diff --git a/Changes.md b/Changes.md index 95389987..be2fe759 100644 --- a/Changes.md +++ b/Changes.md @@ -3,6 +3,8 @@ 4.1.2 ----------- +- **IMPORTANT** Fix memory leak with worker data in Redis. +- Freeze all string literals with Ruby 2.3. [#2741] - Client middleware can now stop bulk job push. [#2887] 4.1.1 diff --git a/lib/sidekiq/launcher.rb b/lib/sidekiq/launcher.rb index e9a6477e..07eaf599 100644 --- a/lib/sidekiq/launcher.rb +++ b/lib/sidekiq/launcher.rb @@ -89,6 +89,7 @@ module Sidekiq Processor::WORKER_STATE.each_pair do |tid, hash| conn.hset(workers_key, tid, Sidekiq.dump_json(hash)) end + conn.expire(workers_key, 60) end end fails = procd = 0 diff --git a/lib/sidekiq/version.rb b/lib/sidekiq/version.rb index c39f9b6f..45952a5f 100644 --- a/lib/sidekiq/version.rb +++ b/lib/sidekiq/version.rb @@ -1,4 +1,4 @@ # frozen_string_literal: true module Sidekiq - VERSION = "4.1.1" + VERSION = "4.1.2" end diff --git a/test/test_launcher.rb b/test/test_launcher.rb index 03e786f6..bd86bd21 100644 --- a/test/test_launcher.rb +++ b/test/test_launcher.rb @@ -56,6 +56,10 @@ class TestLauncher < Sidekiq::Test @launcher.heartbeat('identity', heartbeat_data, Sidekiq.dump_json(heartbeat_data)) end + #after do + #puts system('redis-cli -n 15 keys "*" | while read LINE ; do TTL=`redis-cli -n 15 ttl "$LINE"`; if [ "$TTL" -eq -1 ]; then echo "$LINE"; fi; done;') + #end + it 'indicates stopping status in proctitle' do assert_equal "sidekiq #{Sidekiq::VERSION} myapp [1 of 3 busy] stopping", $0 end