sidekiq 8.1.2 → 8.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d21db4cf06c0b4d0b5fb770162e289403a76ed996d6c99613cf45083f0e671d
4
- data.tar.gz: 07cf848cd5de112f3153ecd0014991cbf2abf9e66bc0847d2b7845ec7a726329
3
+ metadata.gz: 205ebd1ee2e6fdbe27b860b06a03147e96d77a3abc32481eb3bbf51ce01a64a6
4
+ data.tar.gz: 355195d5aadd03117e7eee7bdf144d193a4c9a41d4534b5f05ea6fad847cb7df
5
5
  SHA512:
6
- metadata.gz: 395d346f8b5227480e4d830b3c1f219a35bb0e2527283f9c00a6a4043c1ebe271998874ae53240b6e7dabca89ce8ad939d0a3969da2b33c3e4155fccbebae9ba
7
- data.tar.gz: 20f44288fd8990544569af7f2a87d90d4ce898b2ce760cc95dd2f30c5a0c4ffc90bcc087cbfa22dbc188a904cc2e817756a83b5b3ffd648f75dc0413d3bec3ff
6
+ metadata.gz: a592aa88c757173e70ee511388f15642e2aad1347df15252e972cea12e42ab91a0e8df702c3ff9e0069595bb68dae32a6d53318df390563a9ae7cc0df31852dd
7
+ data.tar.gz: d10b27d602e3c53fe79a85d21a59d0492831c32c8a67e2a344869c42e22e402ad591f82e3835e14c879a81fe8020430450fecd6a324d008bf33c4592dee23ea9
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.1.3
6
+ ----------
7
+
8
+ - Fix edge case leading to duplicate, concurrent execution [#6379]
9
+ If 2 Capsules process jobs from the same queue, long-running
10
+ jobs could run in parallel during process shutdown.
11
+ - [SECURITY] Remove as much YAML usage as possible. [#6950]
12
+ Localization files in `web/locales` are now manually parsed.
13
+ Sidekiq::CLI will now only require YAML if you use a `-C` .yml file.
14
+
5
15
  8.1.2
6
16
  ----------
7
17
 
@@ -51,7 +51,6 @@ module Sidekiq
51
51
  end
52
52
 
53
53
  def stop
54
- fetcher&.bulk_requeue([])
55
54
  end
56
55
 
57
56
  # Sidekiq checks queues in three modes:
data/lib/sidekiq/cli.rb CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  $stdout.sync = true
4
4
 
5
- require "yaml"
6
5
  require "optparse"
7
6
  require "erb"
8
7
  require "fileutils"
@@ -409,6 +408,7 @@ module Sidekiq # :nodoc:
409
408
  def parse_config(path)
410
409
  erb = ERB.new(File.read(path), trim_mode: "-")
411
410
  erb.filename = File.expand_path(path)
411
+ require "yaml"
412
412
  opts = YAML.safe_load(erb.result, permitted_classes: [Symbol], aliases: true) || {}
413
413
 
414
414
  if opts.respond_to? :deep_symbolize_keys!
@@ -255,7 +255,7 @@ module Sidekiq
255
255
  # Register a proc to handle any error which occurs within the Sidekiq process.
256
256
  #
257
257
  # Sidekiq.configure_server do |config|
258
- # config.error_handlers << proc {|ex,ctx_hash| MyErrorService.notify(ex, ctx_hash) }
258
+ # config.error_handlers << proc {|ex,ctx_hash,config| MyErrorService.notify(ex, ctx_hash) }
259
259
  # end
260
260
  #
261
261
  # The default error handler logs errors to @logger.
@@ -117,9 +117,7 @@ module Sidekiq
117
117
  private
118
118
 
119
119
  def wait
120
- @sleeper.pop(timeout: random_poll_interval)
121
- rescue Timeout::Error
122
- # TODO move to exception: false
120
+ @sleeper.pop(timeout: random_poll_interval, exception: false)
123
121
  rescue => ex
124
122
  # if poll_interval_average hasn't been calculated yet, we can
125
123
  # raise an error trying to reach Redis.
@@ -225,8 +223,7 @@ module Sidekiq
225
223
  total += INITIAL_WAIT unless @config[:poll_interval_average]
226
224
  total += (5 * rand)
227
225
 
228
- @sleeper.pop(timeout: total)
229
- rescue Timeout::Error
226
+ @sleeper.pop(timeout: total, exception: false)
230
227
  ensure
231
228
  # periodically clean out the `processes` set in Redis which can collect
232
229
  # references to dead processes over time. The process count affects how
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sidekiq
4
- VERSION = "8.1.2"
4
+ VERSION = "8.1.3"
5
5
  MAJOR = 8
6
6
 
7
7
  def self.gem_version
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "uri"
4
- require "yaml"
5
4
  require "cgi/escape"
6
5
 
7
6
  module Sidekiq
@@ -73,12 +72,42 @@ module Sidekiq
73
72
  # so extensions can be localized
74
73
  @@strings[lang] ||= config.locales.each_with_object({}) do |path, global|
75
74
  find_locale_files(lang).each do |file|
76
- strs = YAML.safe_load_file(file)
75
+ strs = parse_yaml_new(file)
77
76
  global.merge!(strs[lang])
78
77
  end
79
78
  end
80
79
  end
81
80
 
81
+ def parse_yaml_old(path)
82
+ require "yaml"
83
+ YAML.safe_load_file(path)
84
+ end
85
+
86
+ def parse_yaml_new(path)
87
+ locale = nil
88
+ map = {}
89
+ IO.readlines(path, chomp: true).each do |line|
90
+ case line
91
+ when /\A\s*\#.*/
92
+ # line comment
93
+ when !locale && /\A([a-zA-Z\-_]+):/
94
+ locale = $1
95
+ map[locale] = {}
96
+ when /\A\s+(\w+):\s+(.+)\z/
97
+ # A few values have double quotes to include special characters in YAML.
98
+ # Strip them off manually as our greedy match will include them.
99
+ key = $1
100
+ s = $2
101
+ s = s[1..] if s[0] == "\""
102
+ s = s[0..-2] if s[-1] == "\""
103
+ map[locale][key] = s
104
+ else
105
+ raise ArgumentError, "unable to parse #{path}: #{line}"
106
+ end
107
+ end
108
+ map
109
+ end
110
+
82
111
  def to_json(x)
83
112
  Sidekiq.dump_json(x)
84
113
  end
@@ -534,6 +534,8 @@ input[type="checkbox"] { accent-color: var(--color-primary); }
534
534
 
535
535
  .pagination a { text-decoration: none; }
536
536
 
537
+ .pagination .active a { color: var(--color-primary); font-weight: 700; }
538
+
537
539
  .pagination .disabled { opacity: 0.3; }
538
540
 
539
541
  div:has(.pagination.pull-right) { margin-left: auto; }
data/web/locales/ar.yml CHANGED
@@ -74,7 +74,7 @@ ar:
74
74
  Stop: إيقاف
75
75
  StopAll: إيقاف الكل
76
76
  StopPolling: إيقاف الاستعلامات
77
- TextDirection: 'rtl'
77
+ TextDirection: rtl
78
78
  Thread: نيسب
79
79
  Threads: نياسب
80
80
  ThreeMonths: ثلاثة أشهر
data/web/locales/fa.yml CHANGED
@@ -69,7 +69,7 @@ fa:
69
69
  Stop: توقف
70
70
  StopAll: توقف همه
71
71
  StopPolling: Stop Polling
72
- TextDirection: 'rtl'
72
+ TextDirection: rtl
73
73
  Thread: رشته
74
74
  Threads: رشته ها
75
75
  ThreeMonths: ۳ ماه
data/web/locales/gd.yml CHANGED
@@ -1,4 +1,4 @@
1
- # elements like %{queue} are variables and should not be translated
1
+ # elements like %{queue} are variables and should not be translated
2
2
  gd:
3
3
  LanguageName: Gaeilge
4
4
  Actions: Gnìomhan
data/web/locales/he.yml CHANGED
@@ -69,7 +69,7 @@ he:
69
69
  Stop: עצור
70
70
  StopAll: עצור הכל
71
71
  StopPolling: עצור תשאול
72
- TextDirection: 'rtl'
72
+ TextDirection: rtl
73
73
  Thread: חוט
74
74
  Threads: חוטים
75
75
  ThreeMonths: 3 חדשים
@@ -1,4 +1,4 @@
1
- "pt-BR":
1
+ pt-BR:
2
2
  LanguageName: Português (Brasil)
3
3
  Actions: Ações
4
4
  AddToQueue: Adicionar à fila
data/web/locales/ur.yml CHANGED
@@ -69,7 +69,7 @@ ur:
69
69
  Stop: بند کرو
70
70
  StopAll: ﺗﻤﺎﻡ ﺑﻨﺪ کﺭﻭ
71
71
  StopPolling: ﺑﺮاﮦ ﺭاﺳﺖ روکيے
72
- TextDirection: 'rtl'
72
+ TextDirection: rtl
73
73
  Thread: موضوع
74
74
  Threads: موضوع
75
75
  ThreeMonths: تین ماہ
@@ -10,7 +10,7 @@
10
10
  <a href="<%= url %>?<%= qparams(page: @current_page - 1) %>"><%= @current_page - 1 %></a>
11
11
  </li>
12
12
  <% end %>
13
- <li class="disabled">
13
+ <li class="active">
14
14
  <a href="<%= url %>?<%= qparams(page: @current_page) %>"><%= @current_page %></a>
15
15
  </li>
16
16
  <% if @total_size > @current_page * @count %>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.1.2
4
+ version: 8.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Perham