sidekiq 7.0.5 → 7.0.7

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
  SHA256:
3
- metadata.gz: fec40f38a40f555d39f3826d0b2b26dd72d500a8e58a35ff2e85436ad5abb2c7
4
- data.tar.gz: b6b0fde1518951d5715484a046e0732224f819b6c45dba1e18c02e8292b97f55
3
+ metadata.gz: 23b4f6ae3bb1b64fbc6bb359c6d10b52596e3d9c6bae08129907adbaa77f9dd6
4
+ data.tar.gz: '08590b7d942b48cf050f80236d56957c1ab2b26c37bc94ab07606e5b2be5b4bb'
5
5
  SHA512:
6
- metadata.gz: c6e0d60356029b73764a1e57e3e6e570fa8e56758da14f6a16945f502f694d182f71e34b246eed4aaa022b184214f7da8253292deeb3b7540bcf14030b3a1139
7
- data.tar.gz: 3b03e4b1373288faceaee25ac08e73da00f3923bbbfd925b5b02dc0af6ec0c37fb7d23a14b6ec90be268df0441b974e100aa07462586b41648126d3b4020460a
6
+ metadata.gz: 1819631e039de53bc7b1285d6955e89bc8723af0fd6ee64faf3c0d84cd69bc51a6d31ef3f7c6993cd7c937c59993c913c4bba7e3f7a936198081ab2c0af6a499
7
+ data.tar.gz: a08b785013202849bca3fa61b51757ae413efb5dd459606925107843185881b8b62c8255e1aa7b1e9e3ac44bef69dfc6f1f07d93ffed0029906750850d003061
data/Changes.md CHANGED
@@ -2,7 +2,15 @@
2
2
 
3
3
  [Sidekiq Changes](https://github.com/sidekiq/sidekiq/blob/main/Changes.md) | [Sidekiq Pro Changes](https://github.com/sidekiq/sidekiq/blob/main/Pro-Changes.md) | [Sidekiq Enterprise Changes](https://github.com/sidekiq/sidekiq/blob/main/Ent-Changes.md)
4
4
 
5
- 7.0.5
5
+ 7.0.7
6
+ ----------
7
+
8
+ - Fix redis-client API usage which could result in stuck Redis
9
+ connections [#5823]
10
+ - Fix AS::Duration with `sidekiq_retry_in` [#5806]
11
+ - Restore dumping config options on startup with `-v` [#5822]
12
+
13
+ 7.0.5,7.0.6
6
14
  ----------
7
15
 
8
16
  - More context for debugging json unsafe errors [#5787]
data/lib/sidekiq/fetch.rb CHANGED
@@ -44,7 +44,7 @@ module Sidekiq # :nodoc:
44
44
  return nil
45
45
  end
46
46
 
47
- queue, job = redis { |conn| conn.blocking_call(false, "brpop", *qs, TIMEOUT) }
47
+ queue, job = redis { |conn| conn.blocking_call(TIMEOUT + 1, "brpop", *qs, TIMEOUT) }
48
48
  UnitOfWork.new(queue, job, config) if queue
49
49
  end
50
50
 
@@ -201,6 +201,7 @@ module Sidekiq
201
201
  nil
202
202
  end
203
203
 
204
+ rv = rv.to_i if rv.respond_to?(:to_i)
204
205
  delay = (count**4) + 15
205
206
  if Integer === rv && rv > 0
206
207
  delay = rv
@@ -21,8 +21,7 @@ module Sidekiq
21
21
  mode = Sidekiq::Config::DEFAULTS[:on_complex_arguments]
22
22
 
23
23
  if mode == :raise || mode == :warn
24
- unless json_safe?(args)
25
- unsafe_item = json_unsafe_item(args)
24
+ if (unsafe_item = json_unsafe?(args))
26
25
  msg = <<~EOM
27
26
  Job arguments to #{job_class} must be native JSON types, but #{unsafe_item.inspect} is a #{unsafe_item.class}.
28
27
  See https://github.com/sidekiq/sidekiq/wiki/Best-Practices.
@@ -70,50 +69,37 @@ module Sidekiq
70
69
 
71
70
  private
72
71
 
73
- RECURSIVE_JSON_SAFE = {
74
- Integer => ->(val) { true },
75
- Float => ->(val) { true },
76
- TrueClass => ->(val) { true },
77
- FalseClass => ->(val) { true },
78
- NilClass => ->(val) { true },
79
- String => ->(val) { true },
72
+ RECURSIVE_JSON_UNSAFE = {
73
+ Integer => ->(val) {},
74
+ Float => ->(val) {},
75
+ TrueClass => ->(val) {},
76
+ FalseClass => ->(val) {},
77
+ NilClass => ->(val) {},
78
+ String => ->(val) {},
80
79
  Array => ->(val) {
81
- val.all? { |e| RECURSIVE_JSON_SAFE[e.class].call(e) }
82
- },
83
- Hash => ->(val) {
84
- val.all? { |k, v| String === k && RECURSIVE_JSON_SAFE[v.class].call(v) }
85
- }
86
- }
87
-
88
- RECURSIVE_JSON_SAFE.default = ->(_val) { false }
89
- RECURSIVE_JSON_SAFE.compare_by_identity
90
- private_constant :RECURSIVE_JSON_SAFE
91
-
92
- def json_safe?(item)
93
- RECURSIVE_JSON_SAFE[item.class].call(item)
94
- end
95
-
96
- def json_unsafe_item(item)
97
- case item
98
- when String, Integer, Float, TrueClass, FalseClass, NilClass
99
- nil
100
- when Array
101
- item.each do |e|
102
- unsafe_item = json_unsafe_item(e)
80
+ val.each do |e|
81
+ unsafe_item = RECURSIVE_JSON_UNSAFE[e.class].call(e)
103
82
  return unsafe_item unless unsafe_item.nil?
104
83
  end
105
84
  nil
106
- when Hash
107
- item.each do |k, v|
85
+ },
86
+ Hash => ->(val) {
87
+ val.each do |k, v|
108
88
  return k unless String === k
109
89
 
110
- unsafe_item = json_unsafe_item(v)
90
+ unsafe_item = RECURSIVE_JSON_UNSAFE[v.class].call(v)
111
91
  return unsafe_item unless unsafe_item.nil?
112
92
  end
113
93
  nil
114
- else
115
- item
116
- end
94
+ }
95
+ }
96
+
97
+ RECURSIVE_JSON_UNSAFE.default = ->(val) { val }
98
+ RECURSIVE_JSON_UNSAFE.compare_by_identity
99
+ private_constant :RECURSIVE_JSON_UNSAFE
100
+
101
+ def json_unsafe?(item)
102
+ RECURSIVE_JSON_UNSAFE[item.class].call(item)
117
103
  end
118
104
  end
119
105
  end
@@ -37,6 +37,7 @@ module Sidekiq
37
37
  # and instead have thread call Launcher#heartbeat every N seconds.
38
38
  def run(async_beat: true)
39
39
  Sidekiq.freeze!
40
+ logger.debug { @config.merge!({}) }
40
41
  @thread = safe_thread("heartbeat", &method(:start_heartbeat)) if async_beat
41
42
  @poller.start
42
43
  @managers.each(&:start)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sidekiq
4
- VERSION = "7.0.5"
4
+ VERSION = "7.0.7"
5
5
  MAJOR = 7
6
6
  end
data/web/locales/ja.yml CHANGED
@@ -27,6 +27,7 @@ ja:
27
27
  Extras: エクストラ
28
28
  Failed: 失敗
29
29
  Failures: 失敗
30
+ Failure: 失敗
30
31
  GoBack: ← 戻る
31
32
  History: 履歴
32
33
  Job: ジョブ
@@ -75,6 +76,7 @@ ja:
75
76
  Stop: 停止
76
77
  StopAll: すべて停止
77
78
  StopPolling: ポーリング停止
79
+ Success: 成功
78
80
  Thread: スレッド
79
81
  Threads: スレッド
80
82
  ThreeMonths: 3 ヶ月
@@ -82,7 +84,7 @@ ja:
82
84
  Unpause: 一時停止を解除
83
85
  Metrics: メトリクス
84
86
  NoDataFound: データが見つかりませんでした
85
- ExecutionTime: 合計実行時間
87
+ TotalExecutionTime: 合計実行時間
86
88
  AvgExecutionTime: 平均実行時間
87
89
  Context: コンテキスト
88
90
  Bucket: バケット
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: 7.0.5
4
+ version: 7.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Perham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-15 00:00:00.000000000 Z
11
+ date: 2023-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis-client
@@ -227,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  - !ruby/object:Gem::Version
228
228
  version: '0'
229
229
  requirements: []
230
- rubygems_version: 3.4.6
230
+ rubygems_version: 3.4.7
231
231
  signing_key:
232
232
  specification_version: 4
233
233
  summary: Simple, efficient background processing for Ruby