sidekiq 4.2.3 → 4.2.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sidekiq might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f5611a44077288f2a7a7c1e46d4fdf39aa05be0f
4
- data.tar.gz: 7c406cd5d25b49faa1af246dd12a6f3e8ccc827a
3
+ metadata.gz: 581035f739e6ecf4fdd07d42b7ff78b1012f3ad2
4
+ data.tar.gz: 26c02597dab733a1fdf7d948a7a274029033ae21
5
5
  SHA512:
6
- metadata.gz: eec6ef8ffffbb53e2717a82fd85de7d089b2accc799905ba8a277a4a2fe8a4ba18382eef0e5a7939deb94b4070a96f785b9513c7ffecc61499f8fb79de083dd6
7
- data.tar.gz: 2fc1f05e9c47a36e5451665b76acfda798f5787fee4bd833f65d955a434ad375cb2c7517b1ee4500e87e9854ad957fa38ec56fe606b9bf9d7802140ac9fca34d
6
+ metadata.gz: ace3433e3bc81e986d56177f392a54f24e9a6f5cd1a050107d5273271cc61df5b022dfae32f99fb0cd74b71d5c9470daebca8073a5106bbe605f71d788196500
7
+ data.tar.gz: abca98c2d32c438dfc4f60e8dabcea79cc0f28c616d62942a02f768bb0353199abd139aacdc12db546ee19e66b95fb0a36644104dd47c663f034f02882bffd24
data/Changes.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Sidekiq Changes
2
2
 
3
+ 4.2.4
4
+ -----------
5
+
6
+ - Log errors coming from the Rails 5 reloader. [#3212, eugeneius]
7
+ - Clone job data so middleware changes don't appear in Busy tab
8
+
3
9
  4.2.3
4
10
  -----------
5
11
 
@@ -119,9 +119,9 @@ module Sidekiq
119
119
  jobstr = work.job
120
120
  queue = work.queue_name
121
121
 
122
- @reloader.call do
123
- ack = false
124
- begin
122
+ ack = false
123
+ begin
124
+ @reloader.call do
125
125
  job = Sidekiq.load_json(jobstr)
126
126
  klass = job['class'.freeze].constantize
127
127
  worker = klass.new
@@ -137,17 +137,17 @@ module Sidekiq
137
137
  end
138
138
  end
139
139
  ack = true
140
- rescue Sidekiq::Shutdown
141
- # Had to force kill this job because it didn't finish
142
- # within the timeout. Don't acknowledge the work since
143
- # we didn't properly finish it.
144
- ack = false
145
- rescue Exception => ex
146
- handle_exception(ex, { :context => "Job raised exception", :job => job, :jobstr => jobstr })
147
- raise
148
- ensure
149
- work.acknowledge if ack
150
140
  end
141
+ rescue Sidekiq::Shutdown
142
+ # Had to force kill this job because it didn't finish
143
+ # within the timeout. Don't acknowledge the work since
144
+ # we didn't properly finish it.
145
+ ack = false
146
+ rescue Exception => ex
147
+ handle_exception(ex, { :context => "Job raised exception", :job => job, :jobstr => jobstr })
148
+ raise
149
+ ensure
150
+ work.acknowledge if ack
151
151
  end
152
152
  end
153
153
 
@@ -165,7 +165,7 @@ module Sidekiq
165
165
 
166
166
  def stats(worker, job, queue)
167
167
  tid = thread_identity
168
- WORKER_STATE[tid] = {:queue => queue, :payload => job, :run_at => Time.now.to_i }
168
+ WORKER_STATE[tid] = {:queue => queue, :payload => cloned(job), :run_at => Time.now.to_i }
169
169
 
170
170
  begin
171
171
  yield
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Sidekiq
3
- VERSION = "4.2.3"
3
+ VERSION = "4.2.4"
4
4
  end
@@ -65,6 +65,40 @@ class TestProcessor < Sidekiq::Test
65
65
  assert_equal [['myarg']], msg['args']
66
66
  end
67
67
 
68
+ describe 'exception handling' do
69
+ let(:errors) { [] }
70
+ let(:error_handler) { proc { |ex, _| errors << ex } }
71
+
72
+ before do
73
+ Sidekiq.error_handlers << error_handler
74
+ end
75
+
76
+ after do
77
+ Sidekiq.error_handlers.pop
78
+ end
79
+
80
+ it 'handles exceptions raised by the job' do
81
+ msg = Sidekiq.dump_json({ 'class' => MockWorker.to_s, 'args' => ['boom'] })
82
+ begin
83
+ @processor.process(work(msg))
84
+ rescue TestException
85
+ end
86
+ assert_equal 1, errors.count
87
+ assert_instance_of TestException, errors.first
88
+ end
89
+
90
+ it 'handles exceptions raised by the reloader' do
91
+ msg = Sidekiq.dump_json({ 'class' => MockWorker.to_s, 'args' => ['myarg'] })
92
+ @processor.instance_variable_set(:'@reloader', proc { raise TEST_EXCEPTION })
93
+ begin
94
+ @processor.process(work(msg))
95
+ rescue TestException
96
+ end
97
+ assert_equal 1, errors.count
98
+ assert_instance_of TestException, errors.first
99
+ end
100
+ end
101
+
68
102
  describe 'acknowledgement' do
69
103
  class ExceptionRaisingMiddleware
70
104
  def initialize(raise_before_yield, raise_after_yield, skip)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.3
4
+ version: 4.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Perham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-18 00:00:00.000000000 Z
11
+ date: 2016-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis