sidekiq 8.0.9 → 8.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Changes.md +10 -0
- data/lib/sidekiq/api.rb +17 -7
- data/lib/sidekiq/cli.rb +15 -4
- data/lib/sidekiq/config.rb +2 -1
- data/lib/sidekiq/launcher.rb +4 -4
- data/lib/sidekiq/redis_connection.rb +2 -2
- data/lib/sidekiq/scheduled.rb +4 -4
- data/lib/sidekiq/version.rb +1 -1
- data/lib/sidekiq/web/config.rb +1 -1
- data/lib/sidekiq/web/helpers.rb +2 -2
- data/web/assets/javascripts/application.js +1 -1
- data/web/locales/fr.yml +1 -1
- data/web/views/filtering.erb +2 -2
- data/web/views/morgue.erb +1 -1
- data/web/views/retries.erb +1 -1
- data/web/views/scheduled.erb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a831ed9ff5c1a11b447110fa77cbccf00fc44d3e3888fd5b1baa23cce5228ee9
|
|
4
|
+
data.tar.gz: 0b11c1b102a8ff8313992201b519b87e1e9446b84c72f23369e3390f671680f6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f6139796abb98a9bc67bf6498438f52e135b85ea6a360f86b45ddafd4f46d9d5567592940005d93bab5c3700430adfb5be340e08ca4a9e5cbde529d19a9c7dcc
|
|
7
|
+
data.tar.gz: '08ac62d0c45ca1a8216833ecfb07ad8f37ca3d1a1137198f0994af7cf0b107c842741a4f8b62ea8c3f59b42aa209418f65d9bcf6b57127b6ae6e09daf9509907'
|
data/Changes.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
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
|
+
8.0.10
|
|
6
|
+
----------
|
|
7
|
+
|
|
8
|
+
- Add confirm dialog for Delete All buttons in Web UI [#6853]
|
|
9
|
+
- Adjust scheduler to run closer to poll average [#6866]
|
|
10
|
+
- Forward compatibility changes for connection_pool 3.0.0
|
|
11
|
+
- Backwards compatibility fix for <8.0.9 process data in Redis [#6870]
|
|
12
|
+
- Backtrace dump can now be triggered with the INFO signal, since Puma uses the
|
|
13
|
+
same signal [#6857]
|
|
14
|
+
|
|
5
15
|
8.0.9
|
|
6
16
|
----------
|
|
7
17
|
|
data/lib/sidekiq/api.rb
CHANGED
|
@@ -1091,19 +1091,29 @@ module Sidekiq
|
|
|
1091
1091
|
|
|
1092
1092
|
# deprecated, use capsules below
|
|
1093
1093
|
def queues
|
|
1094
|
-
|
|
1094
|
+
# Backwards compatibility with <8.0.8
|
|
1095
|
+
if !self["capsules"]
|
|
1096
|
+
self["queues"]
|
|
1097
|
+
else
|
|
1098
|
+
capsules.values.flat_map { |x| x["weights"].keys }.uniq
|
|
1099
|
+
end
|
|
1095
1100
|
end
|
|
1096
1101
|
|
|
1097
1102
|
# deprecated, use capsules below
|
|
1098
1103
|
def weights
|
|
1099
|
-
|
|
1100
|
-
capsules
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
+
# Backwards compatibility with <8.0.8
|
|
1105
|
+
if !self["capsules"]
|
|
1106
|
+
self["weights"]
|
|
1107
|
+
else
|
|
1108
|
+
hash = {}
|
|
1109
|
+
capsules.values.each do |cap|
|
|
1110
|
+
# Note: will lose data if two capsules are processing the same named queue
|
|
1111
|
+
cap["weights"].each_pair do |queue, weight|
|
|
1112
|
+
hash[queue] = weight
|
|
1113
|
+
end
|
|
1104
1114
|
end
|
|
1115
|
+
hash
|
|
1105
1116
|
end
|
|
1106
|
-
hash
|
|
1107
1117
|
end
|
|
1108
1118
|
|
|
1109
1119
|
def capsules
|
data/lib/sidekiq/cli.rb
CHANGED
|
@@ -49,7 +49,7 @@ module Sidekiq # :nodoc:
|
|
|
49
49
|
logger.info "Booted Rails #{::Rails.version} application in #{environment} environment" if rails_app?
|
|
50
50
|
|
|
51
51
|
self_read, self_write = IO.pipe
|
|
52
|
-
sigs = %w[INT TERM TTIN TSTP]
|
|
52
|
+
sigs = %w[INT TERM INFO TTIN TSTP]
|
|
53
53
|
# USR1 and USR2 don't work on the JVM
|
|
54
54
|
sigs << "USR2" if Sidekiq.pro? && !jruby?
|
|
55
55
|
sigs.each do |sig|
|
|
@@ -201,6 +201,7 @@ module Sidekiq # :nodoc:
|
|
|
201
201
|
cli.logger.info "Received TSTP, no longer accepting new work"
|
|
202
202
|
cli.launcher.quiet
|
|
203
203
|
},
|
|
204
|
+
# deprecated, use INFO
|
|
204
205
|
"TTIN" => ->(cli) {
|
|
205
206
|
Thread.list.each do |thread|
|
|
206
207
|
cli.logger.warn "Thread TID-#{(thread.object_id ^ ::Process.pid).to_s(36)} #{thread.name}"
|
|
@@ -210,14 +211,24 @@ module Sidekiq # :nodoc:
|
|
|
210
211
|
cli.logger.warn "<no backtrace available>"
|
|
211
212
|
end
|
|
212
213
|
end
|
|
214
|
+
},
|
|
215
|
+
"INFO" => ->(cli) {
|
|
216
|
+
Thread.list.each do |thread|
|
|
217
|
+
cli.logger.warn "Thread TID-#{(thread.object_id ^ ::Process.pid).to_s(36)} #{thread.name}"
|
|
218
|
+
if thread.backtrace
|
|
219
|
+
cli.logger.warn thread.backtrace.join("\n")
|
|
220
|
+
else
|
|
221
|
+
cli.logger.warn "<no backtrace available>"
|
|
222
|
+
end
|
|
223
|
+
end
|
|
213
224
|
}
|
|
214
225
|
}
|
|
215
|
-
UNHANDLED_SIGNAL_HANDLER = ->(cli) { cli.logger.info "No signal handler registered, ignoring" }
|
|
216
|
-
SIGNAL_HANDLERS.default = UNHANDLED_SIGNAL_HANDLER
|
|
217
226
|
|
|
218
227
|
def handle_signal(sig)
|
|
219
228
|
logger.debug "Got #{sig} signal"
|
|
220
|
-
SIGNAL_HANDLERS[sig]
|
|
229
|
+
hndlr = SIGNAL_HANDLERS[sig]
|
|
230
|
+
hndlr ? hndlr.call(self) :
|
|
231
|
+
logger.warn("No #{sig} signal handler registered, ignoring")
|
|
221
232
|
end
|
|
222
233
|
|
|
223
234
|
private
|
data/lib/sidekiq/config.rb
CHANGED
|
@@ -36,7 +36,8 @@ module Sidekiq
|
|
|
36
36
|
dead_timeout_in_seconds: 180 * 24 * 60 * 60, # 6 months
|
|
37
37
|
reloader: proc { |&block| block.call },
|
|
38
38
|
backtrace_cleaner: ->(backtrace) { backtrace },
|
|
39
|
-
logged_job_attributes: ["bid", "tags"]
|
|
39
|
+
logged_job_attributes: ["bid", "tags"],
|
|
40
|
+
reap_connections: nil # TODO Enable by default
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
ERROR_HANDLER = ->(ex, ctx, cfg = Sidekiq.default_configuration) {
|
data/lib/sidekiq/launcher.rb
CHANGED
|
@@ -220,11 +220,11 @@ module Sidekiq
|
|
|
220
220
|
# Log a warning if it's a disaster.
|
|
221
221
|
if RTT_READINGS.all? { |x| x > RTT_WARNING_LEVEL }
|
|
222
222
|
logger.warn <<~EOM
|
|
223
|
-
Your Redis network connection
|
|
223
|
+
Your Redis network connection appears to be performing poorly.
|
|
224
224
|
Last RTT readings were #{RTT_READINGS.buffer.inspect}, ideally these should be < 1000.
|
|
225
|
-
Ensure Redis is running in the same AZ or datacenter as Sidekiq
|
|
226
|
-
|
|
227
|
-
|
|
225
|
+
Ensure Redis is running in the same AZ or datacenter as Sidekiq and that
|
|
226
|
+
your Sidekiq process is not CPU-saturated; reduce your concurrency and/or
|
|
227
|
+
see https://github.com/sidekiq/sidekiq/discussions/5039
|
|
228
228
|
EOM
|
|
229
229
|
RTT_READINGS.reset
|
|
230
230
|
end
|
|
@@ -23,7 +23,7 @@ module Sidekiq
|
|
|
23
23
|
|
|
24
24
|
size = symbolized_options.delete(:size) || 5
|
|
25
25
|
pool_timeout = symbolized_options.delete(:pool_timeout) || 1
|
|
26
|
-
|
|
26
|
+
symbolized_options.delete(:pool_name)
|
|
27
27
|
|
|
28
28
|
# Default timeout in redis-client is 1 second, which can be too aggressive
|
|
29
29
|
# if the Sidekiq process is CPU-bound. With 10-15 threads and a thread quantum of 100ms,
|
|
@@ -33,7 +33,7 @@ module Sidekiq
|
|
|
33
33
|
symbolized_options[:timeout] ||= 3
|
|
34
34
|
|
|
35
35
|
redis_config = Sidekiq::RedisClientAdapter.new(symbolized_options)
|
|
36
|
-
ConnectionPool.new(timeout: pool_timeout, size: size
|
|
36
|
+
ConnectionPool.new(timeout: pool_timeout, size: size) do
|
|
37
37
|
redis_config.new_client
|
|
38
38
|
end
|
|
39
39
|
end
|
data/lib/sidekiq/scheduled.rb
CHANGED
|
@@ -115,9 +115,9 @@ module Sidekiq
|
|
|
115
115
|
private
|
|
116
116
|
|
|
117
117
|
def wait
|
|
118
|
-
@sleeper.pop(random_poll_interval)
|
|
118
|
+
@sleeper.pop(timeout: random_poll_interval)
|
|
119
119
|
rescue Timeout::Error
|
|
120
|
-
#
|
|
120
|
+
# TODO move to exception: false
|
|
121
121
|
rescue => ex
|
|
122
122
|
# if poll_interval_average hasn't been calculated yet, we can
|
|
123
123
|
# raise an error trying to reach Redis.
|
|
@@ -155,7 +155,7 @@ module Sidekiq
|
|
|
155
155
|
else
|
|
156
156
|
# With 10+ processes, we should have enough randomness to get decent polling
|
|
157
157
|
# across the entire timespan
|
|
158
|
-
interval * rand
|
|
158
|
+
interval * rand * 2
|
|
159
159
|
end
|
|
160
160
|
end
|
|
161
161
|
|
|
@@ -223,7 +223,7 @@ module Sidekiq
|
|
|
223
223
|
total += INITIAL_WAIT unless @config[:poll_interval_average]
|
|
224
224
|
total += (5 * rand)
|
|
225
225
|
|
|
226
|
-
@sleeper.pop(total)
|
|
226
|
+
@sleeper.pop(timeout: total)
|
|
227
227
|
rescue Timeout::Error
|
|
228
228
|
ensure
|
|
229
229
|
# periodically clean out the `processes` set in Redis which can collect
|
data/lib/sidekiq/version.rb
CHANGED
data/lib/sidekiq/web/config.rb
CHANGED
|
@@ -25,7 +25,7 @@ module Sidekiq
|
|
|
25
25
|
# about data security and wish to self-host, you can change these URLs.
|
|
26
26
|
profile_view_url: "https://profiler.firefox.com/public/%s",
|
|
27
27
|
profile_store_url: "https://api.profiler.firefox.com/compressed-store",
|
|
28
|
-
# Will be false in Sidekiq 9.0.
|
|
28
|
+
# TODO Will be false in Sidekiq 9.0.
|
|
29
29
|
# CSRF is unnecessary if you are using SameSite=(Strict|Lax) cookies.
|
|
30
30
|
csrf: true
|
|
31
31
|
}
|
data/lib/sidekiq/web/helpers.rb
CHANGED
|
@@ -122,8 +122,8 @@ module Sidekiq
|
|
|
122
122
|
resultset
|
|
123
123
|
end
|
|
124
124
|
|
|
125
|
-
def filtering(which)
|
|
126
|
-
erb(:filtering, locals: {which:
|
|
125
|
+
def filtering(which, placeholder_key: "AnyJobContent", label_key: "Filter")
|
|
126
|
+
erb(:filtering, locals: {which:, placeholder_key:, label_key:})
|
|
127
127
|
end
|
|
128
128
|
|
|
129
129
|
def filter_link(jid, within = "retries")
|
|
@@ -190,7 +190,7 @@ function updateProgressBars() {
|
|
|
190
190
|
function handleConfirmDialog (event) {
|
|
191
191
|
const target = event.target
|
|
192
192
|
|
|
193
|
-
if (target.localName !== "input") { return }
|
|
193
|
+
if (target.localName !== "input" && target.localName !== "button" ) { return }
|
|
194
194
|
const confirmMessage = target.dataset.confirm
|
|
195
195
|
|
|
196
196
|
if (confirmMessage === undefined) { return }
|
data/web/locales/fr.yml
CHANGED
|
@@ -8,7 +8,7 @@ fr:
|
|
|
8
8
|
AreYouSureDeleteJob: Êtes-vous certain de vouloir supprimer cette tâche ?
|
|
9
9
|
AreYouSureDeleteQueue: Êtes-vous certain de vouloir supprimer la queue %{queue} ?
|
|
10
10
|
Arguments: Arguments
|
|
11
|
-
|
|
11
|
+
BackToApp: Retour à l'application
|
|
12
12
|
Busy: En cours
|
|
13
13
|
Class: Classe
|
|
14
14
|
Connections: Connexions
|
data/web/views/filtering.erb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div class="filter">
|
|
2
2
|
<form role="search" method="get" class="form-inline" action="<%= root_path %><%= which %>">
|
|
3
|
-
<label for="substr"><%= t(
|
|
4
|
-
<input class="form-control" type="search" name="substr" value="<%= h url_params("substr") %>" placeholder="<%= t(
|
|
3
|
+
<label for="substr"><%= t(label_key) %></label>
|
|
4
|
+
<input class="form-control" type="search" name="substr" value="<%= h url_params("substr") %>" placeholder="<%= t(placeholder_key) %>" autocomplete="off">
|
|
5
5
|
</form>
|
|
6
6
|
</div>
|
data/web/views/morgue.erb
CHANGED
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
<input class="btn btn-primary pull-left flip" type="submit" name="retry" value="<%= t('RetryNow') %>">
|
|
60
60
|
<input class="btn btn-danger pull-left flip" type="submit" name="delete" value="<%= t('Delete') %>">
|
|
61
61
|
<button class="btn btn-primary bulk-action-buttons bulk-lead-button" type="submit" name="action" value="retry_all" formaction="<%= "#{root_path}morgue/all/retry" %>"><%= t('RetryAll') %></button>
|
|
62
|
-
<button class="btn btn-danger bulk-action-buttons" type="submit" name="action" value="delete_all" formaction="<%= "#{root_path}morgue/all/delete" %>"><%= t('DeleteAll') %></button>
|
|
62
|
+
<button class="btn btn-danger bulk-action-buttons" type="submit" name="action" value="delete_all" formaction="<%= "#{root_path}morgue/all/delete" %>" data-confirm="<%= t('AreYouSure') %>"><%= t('DeleteAll') %></button>
|
|
63
63
|
</div>
|
|
64
64
|
</form>
|
|
65
65
|
|
data/web/views/retries.erb
CHANGED
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
<input class="btn btn-danger" type="submit" name="kill" value="<%= t('Kill') %>">
|
|
64
64
|
<!-- Retry all -->
|
|
65
65
|
<button class="btn btn-primary bulk-action-buttons bulk-lead-button" type="submit" name="action" value="retry_all" formaction="<%= "#{root_path}retries/all/retry" %>"><%= t('RetryAll') %></button>
|
|
66
|
-
<button class="btn btn-danger bulk-action-buttons" type="submit" name="action" value="delete_all" formaction="<%= "#{root_path}retries/all/delete" %>"><%= t('DeleteAll') %></button>
|
|
66
|
+
<button class="btn btn-danger bulk-action-buttons" type="submit" name="action" value="delete_all" formaction="<%= "#{root_path}retries/all/delete" %>" data-confirm="<%= t('AreYouSure') %>"><%= t('DeleteAll') %></button>
|
|
67
67
|
<button class="btn btn-danger bulk-action-buttons" type="submit" name="action" value="kill_all" formaction="<%= "#{root_path}retries/all/kill" %>"><%= t('KillAll') %></button>
|
|
68
68
|
</div>
|
|
69
69
|
</form>
|
data/web/views/scheduled.erb
CHANGED
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
<div class="buttons-row">
|
|
55
55
|
<input class="btn btn-danger" type="submit" name="delete" value="<%= t('Delete') %>">
|
|
56
56
|
<input class="btn btn-danger" type="submit" name="add_to_queue" value="<%= t('AddToQueue') %>">
|
|
57
|
-
<button class="btn btn-danger bulk-action-buttons bulk-lead-button" type="submit" name="action" value="delete_all" formaction="<%= "#{root_path}scheduled/all/delete" %>"><%= t('DeleteAll') %></button>
|
|
57
|
+
<button class="btn btn-danger bulk-action-buttons bulk-lead-button" type="submit" name="action" value="delete_all" formaction="<%= "#{root_path}scheduled/all/delete" %>" data-confirm="<%= t('AreYouSure') %>"><%= t('DeleteAll') %></button>
|
|
58
58
|
<button class="btn btn-danger bulk-action-buttons" type="submit" name="action" value="add_all_to_queue" formaction="<%= "#{root_path}scheduled/all/add_to_queue" %>"><%= t('AddAllToQueue') %></button>
|
|
59
59
|
</div>
|
|
60
60
|
</form>
|