sidekiq 7.3.5 → 7.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ada259b22664fbbb740c3d28fa06578cb6fc00a42590ea459a1f2395f8e38a92
4
- data.tar.gz: 0636466a99e8a0df4d955b0928d76b504df74bba4e3ab13a2d08237ccd57b162
3
+ metadata.gz: 6c9bd0a03b27535a34a0525397e84c429a9332e6754dba43c088558ab8f362e9
4
+ data.tar.gz: '08fee2db2d83996d1df6f78e7eb9a226cb98d951cba336dd422771f9127cf95a'
5
5
  SHA512:
6
- metadata.gz: 209f76b8ceebdb2cac83d22aab78873dad373a9ba488e7d320972e8ced4d3ac71454ef6669db321727ce3e4a85fdc5744005ff64d1a0f4cd48d9a4231bddf384
7
- data.tar.gz: df094fd4baa169249e92309814d67d0fb5a53b5da4990c0510f5ae1d96e07541356a3014f75b8b79a97f0a91b03b92b576331422c54f36bb2c4943f2f0f87b08
6
+ metadata.gz: f4876eb7594d0c87e4dba08a752dbcb65bbf45ae8213fb9b9ee6a1e12d7a48750c161ffe632f3b13eacfed73de3c3c73a9dc06a2548ddf7e5f6dde0f7de161bd
7
+ data.tar.gz: a0f485adef4ba6751114daf0d2c1d509966d530bc620e00ebf17a9c244f1eb0821ae5e8214d88d3652106d932cae7acfd2b66874647acc8c33fe6ec2e3b9d691
data/Changes.md CHANGED
@@ -2,6 +2,12 @@
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.3.6
6
+ ----------
7
+
8
+ - Forward compatibility fixes for Ruby 3.4
9
+ - Filtering in the Web UI now works via GET so you can bookmark a filtered view. [#6497]
10
+
5
11
  7.3.5
6
12
  ----------
7
13
 
data/bin/sidekiqload CHANGED
@@ -50,7 +50,7 @@ if ENV["AJ"]
50
50
  ActiveJob::Base.logger.level = Logger::WARN
51
51
 
52
52
  class LoadJob < ActiveJob::Base
53
- def perform(idx, ts = nil)
53
+ def perform(string, idx, hash, ts = nil)
54
54
  puts(Time.now.to_f - ts) if !ts.nil?
55
55
  end
56
56
  end
@@ -58,12 +58,21 @@ end
58
58
 
59
59
  class LoadWorker
60
60
  include Sidekiq::Job
61
+ $count = 0
62
+ $lock = Mutex.new
63
+
61
64
  sidekiq_options retry: 1
62
65
  sidekiq_retry_in do |x|
63
66
  1
64
67
  end
65
68
 
66
- def perform(idx, ts = nil)
69
+ def perform(string, idx, hash, ts = nil)
70
+ $lock.synchronize do
71
+ $count += 1
72
+ if $count % 100_000 == 0
73
+ logger.warn("#{Time.now} Done #{$count}")
74
+ end
75
+ end
67
76
  puts(Time.now.to_f - ts) if !ts.nil?
68
77
  # raise idx.to_s if idx % 100 == 1
69
78
  end
@@ -133,13 +142,13 @@ class Loader
133
142
  start = Time.now
134
143
  if ENV["AJ"]
135
144
  @iter.times do
136
- @count.times do |idx|
137
- LoadJob.perform_later(idx)
138
- end
145
+ ActiveJob.perform_all_later(@count.times.map do |idx|
146
+ LoadJob.new("mike", idx, {mike: "bob"})
147
+ end)
139
148
  end
140
149
  else
141
150
  @iter.times do
142
- arr = Array.new(@count) { |idx| [idx] }
151
+ arr = Array.new(@count) { |idx| ["string", idx, {"mike" => "bob"}] }
143
152
  Sidekiq::Client.push_bulk("class" => LoadWorker, "args" => arr)
144
153
  end
145
154
  end
@@ -163,13 +172,13 @@ class Loader
163
172
  Sidekiq.logger.error("Now here's the latency for three jobs")
164
173
 
165
174
  if ENV["AJ"]
166
- LoadJob.perform_later(1, Time.now.to_f)
167
- LoadJob.perform_later(2, Time.now.to_f)
168
- LoadJob.perform_later(3, Time.now.to_f)
175
+ LoadJob.perform_later("", 1, {}, Time.now.to_f)
176
+ LoadJob.perform_later("", 2, {}, Time.now.to_f)
177
+ LoadJob.perform_later("", 3, {}, Time.now.to_f)
169
178
  else
170
- LoadWorker.perform_async(1, Time.now.to_f)
171
- LoadWorker.perform_async(2, Time.now.to_f)
172
- LoadWorker.perform_async(3, Time.now.to_f)
179
+ LoadWorker.perform_async("", 1, {}, Time.now.to_f)
180
+ LoadWorker.perform_async("", 2, {}, Time.now.to_f)
181
+ LoadWorker.perform_async("", 3, {}, Time.now.to_f)
173
182
  end
174
183
 
175
184
  sleep 0.1
@@ -16,7 +16,7 @@ end
16
16
  module ActiveJob
17
17
  module QueueAdapters
18
18
  # Explicitly remove the implementation existing in older rails'.
19
- remove_const(:SidekiqAdapter) if defined?("::#{name}::SidekiqAdapter")
19
+ remove_const(:SidekiqAdapter) if const_defined?(:SidekiqAdapter)
20
20
 
21
21
  # Sidekiq adapter for Active Job
22
22
  #
data/lib/sidekiq/cli.rb CHANGED
@@ -101,7 +101,7 @@ module Sidekiq # :nodoc:
101
101
  # Touch middleware so it isn't lazy loaded by multiple threads, #3043
102
102
  @config.server_middleware
103
103
 
104
- ::Process.warmup if warmup && ::Process.respond_to?(:warmup)
104
+ ::Process.warmup if warmup && ::Process.respond_to?(:warmup) && ENV["RUBY_DISABLE_WARMUP"] != "1"
105
105
 
106
106
  # Before this point, the process is initializing with just the main thread.
107
107
  # Starting here the process will now have multiple threads running.
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sidekiq
4
- VERSION = "7.3.5"
4
+ VERSION = "7.3.6"
5
5
  MAJOR = 7
6
6
 
7
7
  def self.gem_version
@@ -67,11 +67,15 @@ module Sidekiq
67
67
  end
68
68
 
69
69
  get "/metrics" do
70
+ x = params[:substr]
71
+ class_filter = (x.nil? || x == "") ? nil : Regexp.new(Regexp.escape(x), Regexp::IGNORECASE)
72
+
70
73
  q = Sidekiq::Metrics::Query.new
71
74
  @period = h((params[:period] || "")[0..1])
72
75
  @periods = METRICS_PERIODS
73
76
  minutes = @periods.fetch(@period, @periods.values.first)
74
- @query_result = q.top_jobs(minutes: minutes)
77
+ @query_result = q.top_jobs(minutes: minutes, class_filter: class_filter)
78
+
75
79
  erb(:metrics)
76
80
  end
77
81
 
@@ -153,9 +157,15 @@ module Sidekiq
153
157
  end
154
158
 
155
159
  get "/morgue" do
156
- @count = (params["count"] || 25).to_i
157
- (@current_page, @total_size, @dead) = page("dead", params["page"], @count, reverse: true)
158
- @dead = @dead.map { |msg, score| Sidekiq::SortedEntry.new(nil, score, msg) }
160
+ x = params[:substr]
161
+
162
+ if x && x != ""
163
+ @dead = search(Sidekiq::DeadSet.new, x)
164
+ else
165
+ @count = (params["count"] || 25).to_i
166
+ (@current_page, @total_size, @dead) = page("dead", params["page"], @count, reverse: true)
167
+ @dead = @dead.map { |msg, score| Sidekiq::SortedEntry.new(nil, score, msg) }
168
+ end
159
169
 
160
170
  erb(:morgue)
161
171
  end
@@ -207,9 +217,15 @@ module Sidekiq
207
217
  end
208
218
 
209
219
  get "/retries" do
210
- @count = (params["count"] || 25).to_i
211
- (@current_page, @total_size, @retries) = page("retry", params["page"], @count)
212
- @retries = @retries.map { |msg, score| Sidekiq::SortedEntry.new(nil, score, msg) }
220
+ x = params[:substr]
221
+
222
+ if x && x != ""
223
+ @retries = search(Sidekiq::RetrySet.new, x)
224
+ else
225
+ @count = (params["count"] || 25).to_i
226
+ (@current_page, @total_size, @retries) = page("retry", params["page"], @count)
227
+ @retries = @retries.map { |msg, score| Sidekiq::SortedEntry.new(nil, score, msg) }
228
+ end
213
229
 
214
230
  erb(:retries)
215
231
  end
@@ -262,9 +278,15 @@ module Sidekiq
262
278
  end
263
279
 
264
280
  get "/scheduled" do
265
- @count = (params["count"] || 25).to_i
266
- (@current_page, @total_size, @scheduled) = page("schedule", params["page"], @count)
267
- @scheduled = @scheduled.map { |msg, score| Sidekiq::SortedEntry.new(nil, score, msg) }
281
+ x = params[:substr]
282
+
283
+ if x && x != ""
284
+ @scheduled = search(Sidekiq::ScheduledSet.new, x)
285
+ else
286
+ @count = (params["count"] || 25).to_i
287
+ (@current_page, @total_size, @scheduled) = page("schedule", params["page"], @count)
288
+ @scheduled = @scheduled.map { |msg, score| Sidekiq::SortedEntry.new(nil, score, msg) }
289
+ end
268
290
 
269
291
  erb(:scheduled)
270
292
  end
@@ -328,46 +350,6 @@ module Sidekiq
328
350
  json Sidekiq::Stats.new.queues
329
351
  end
330
352
 
331
- ########
332
- # Filtering
333
-
334
- route :get, :post, "/filter/metrics" do
335
- x = params[:substr]
336
- return redirect "#{root_path}metrics" unless x && x != ""
337
-
338
- q = Sidekiq::Metrics::Query.new
339
- @period = h((params[:period] || "")[0..1])
340
- @periods = METRICS_PERIODS
341
- minutes = @periods.fetch(@period, @periods.values.first)
342
- @query_result = q.top_jobs(minutes: minutes, class_filter: Regexp.new(Regexp.escape(x), Regexp::IGNORECASE))
343
-
344
- erb :metrics
345
- end
346
-
347
- route :get, :post, "/filter/retries" do
348
- x = params[:substr]
349
- return redirect "#{root_path}retries" unless x && x != ""
350
-
351
- @retries = search(Sidekiq::RetrySet.new, params[:substr])
352
- erb :retries
353
- end
354
-
355
- route :get, :post, "/filter/scheduled" do
356
- x = params[:substr]
357
- return redirect "#{root_path}scheduled" unless x && x != ""
358
-
359
- @scheduled = search(Sidekiq::ScheduledSet.new, params[:substr])
360
- erb :scheduled
361
- end
362
-
363
- route :get, :post, "/filter/dead" do
364
- x = params[:substr]
365
- return redirect "#{root_path}morgue" unless x && x != ""
366
-
367
- @dead = search(Sidekiq::DeadSet.new, params[:substr])
368
- erb :morgue
369
- end
370
-
371
353
  post "/change_locale" do
372
354
  locale = params["locale"]
373
355
 
@@ -1,6 +1,5 @@
1
1
  <div>
2
- <form method="post" class="form-inline" action='<%= root_path %>filter/<%= which %>'>
3
- <%= csrf_tag %>
2
+ <form method="get" class="form-inline" action='<%= root_path %><%= which %>'>
4
3
  <label for="substr"><%= t('Filter') %></label>
5
4
  <input class="search form-control" type="search" name="substr" value="<%= h params[:substr] %>" placeholder="<%= t('AnyJobContent') %>"/>
6
5
  </form>
@@ -9,8 +9,7 @@
9
9
  </div>
10
10
 
11
11
  <div>
12
- <form id="metrics-form" class="form-inline" action="<%= root_path %>filter/metrics" method="post">
13
- <%= csrf_tag %>
12
+ <form id="metrics-form" class="form-inline" action="<%= root_path %>metrics" method="get">
14
13
  <label for="substr"><%= t('Filter') %></label>
15
14
  <input id="class-filter" class="form-control" type="text" name="substr" placeholder="<%= t('Name') %>" value="<%= h params[:substr] %>">
16
15
  <select id="period-selector" class="form-control" name="period">
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.3.5
4
+ version: 7.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Perham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-04 00:00:00.000000000 Z
11
+ date: 2024-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis-client