sidekiq 5.2.10 → 6.0.0.pre1

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.

Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.standard.yml +20 -0
  3. data/.travis.yml +5 -2
  4. data/6.0-Upgrade.md +58 -0
  5. data/Changes.md +21 -16
  6. data/Gemfile +15 -10
  7. data/Rakefile +5 -4
  8. data/bin/sidekiqctl +1 -10
  9. data/lib/generators/sidekiq/worker_generator.rb +12 -14
  10. data/lib/sidekiq/api.rb +133 -148
  11. data/lib/sidekiq/cli.rb +95 -147
  12. data/lib/sidekiq/client.rb +44 -45
  13. data/lib/sidekiq/ctl.rb +35 -109
  14. data/lib/sidekiq/delay.rb +5 -6
  15. data/lib/sidekiq/exception_handler.rb +10 -12
  16. data/lib/sidekiq/extensions/action_mailer.rb +10 -20
  17. data/lib/sidekiq/extensions/active_record.rb +9 -7
  18. data/lib/sidekiq/extensions/class_methods.rb +9 -7
  19. data/lib/sidekiq/extensions/generic_proxy.rb +4 -4
  20. data/lib/sidekiq/fetch.rb +5 -6
  21. data/lib/sidekiq/job_logger.rb +37 -7
  22. data/lib/sidekiq/job_retry.rb +45 -58
  23. data/lib/sidekiq/launcher.rb +59 -48
  24. data/lib/sidekiq/logger.rb +69 -0
  25. data/lib/sidekiq/manager.rb +6 -8
  26. data/lib/sidekiq/middleware/chain.rb +2 -1
  27. data/lib/sidekiq/middleware/i18n.rb +5 -7
  28. data/lib/sidekiq/paginator.rb +11 -12
  29. data/lib/sidekiq/processor.rb +42 -45
  30. data/lib/sidekiq/rails.rb +2 -26
  31. data/lib/sidekiq/redis_connection.rb +31 -37
  32. data/lib/sidekiq/scheduled.rb +17 -19
  33. data/lib/sidekiq/testing/inline.rb +2 -1
  34. data/lib/sidekiq/testing.rb +22 -23
  35. data/lib/sidekiq/util.rb +18 -15
  36. data/lib/sidekiq/version.rb +2 -1
  37. data/lib/sidekiq/web/action.rb +15 -11
  38. data/lib/sidekiq/web/application.rb +59 -59
  39. data/lib/sidekiq/web/helpers.rb +66 -67
  40. data/lib/sidekiq/web/router.rb +17 -14
  41. data/lib/sidekiq/web.rb +36 -44
  42. data/lib/sidekiq/worker.rb +12 -13
  43. data/lib/sidekiq.rb +53 -42
  44. data/sidekiq.gemspec +7 -7
  45. metadata +20 -32
  46. data/lib/sidekiq/core_ext.rb +0 -1
  47. data/lib/sidekiq/logging.rb +0 -122
  48. data/lib/sidekiq/middleware/server/active_record.rb +0 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 22b205223a123bbe3a8812f1e2804be148afb5fe91c201ecb9a073eb4a188a06
4
- data.tar.gz: '08ab2999267df91afb8f62b9a6b00810299791cad99763d5b16f70bda946410a'
3
+ metadata.gz: 66e4721768942652832cd78e2ff64152e0bfe87e43a591d10c456999988838b4
4
+ data.tar.gz: 3186e6bec7a002151d7d6fb4baf83f6072aa3823434d96dbfac8ed52c3ea9ea9
5
5
  SHA512:
6
- metadata.gz: ad90b8ed3b060ce4521326a0dd4173550ee6bf64b0674fc08fbf37770aaec5ca0ea82738ed1730ccfcff4e0b616afcc47789ca8610cdd41a20abc0ef7d734891
7
- data.tar.gz: 2ed367f9801d28616a1b56b0b209cfe797c2b5a137d2e67cfb8c6864c8d5ed8f58992924ddce654f1fec53b84a5f18abdf88d4df45373b98f46786d511bac3f2
6
+ metadata.gz: c97aaa9b382b95c01c42019bdc12bc80f3805bbe9fa28921c0d5bd0b1383affd5e081464c75004dd07b780cc60d865cfea03ea1585a52ce3d9f89a06b5801353
7
+ data.tar.gz: f9de3b4b488af11c085cd8c1f577e98f661e446ce0074f7da63fa36ba559892bd53e29abcb2c09215c82c866c98e8d7afeb6d42563aa516be587dfe66b37e265
data/.standard.yml ADDED
@@ -0,0 +1,20 @@
1
+ ruby_version: 2.5.0
2
+ fix: false
3
+ parallel: true
4
+ ignore:
5
+ - test/**/*
6
+ - examples/**/*
7
+ - myapp/**/*
8
+ - 'lib/sidekiq.rb':
9
+ - Lint/InheritException
10
+ - 'lib/sidekiq/extensions/**/*':
11
+ - Style/MethodMissingSuper
12
+ - Style/MissingRespondToMissing
13
+ - 'lib/**/*':
14
+ - Naming/AsciiIdentifiers
15
+ - Lint/RescueException
16
+ - Security/YAMLLoad
17
+ - Naming/AccessorMethodName
18
+ - Naming/MethodName
19
+ - Style/GlobalVars
20
+ - Style/Alias
data/.travis.yml CHANGED
@@ -3,9 +3,12 @@ sudo: false
3
3
  cache: bundler
4
4
  services:
5
5
  - redis-server
6
+ bundler_args: --without development load_test
6
7
  rvm:
7
- - 2.3.7
8
- - 2.4.4
9
8
  - 2.5.1
10
9
  - 2.6.0
11
10
  - jruby-9.2.6.0
11
+
12
+ script:
13
+ - bundle exec rake test
14
+ - bundle exec rake standard
data/6.0-Upgrade.md ADDED
@@ -0,0 +1,58 @@
1
+ # Welcome to Sidekiq 6.0!
2
+
3
+ Sidekiq 6.0 contains some breaking changes which streamline proper operation
4
+ of Sidekiq. It also drops support for EOL versions of Ruby and Rails.
5
+
6
+ ## What's New
7
+
8
+ This release has major breaking changes. Read and test carefully in production.
9
+
10
+ - Logging has been redesigned to allow pluggable formatters and several
11
+ formats ship with Sidekiq:
12
+ * default - your typical output on macOS
13
+ * heroku - enabled specifically when running in Heroku
14
+ * json - a JSON format for search indexing, one hash per line
15
+
16
+ Sidekiq will enable the best formatter for the detected environment but
17
+ you can override it by configuring the log formatter explicitly. See
18
+ 'sidekiq/logger' for implementation details.
19
+
20
+ ```ruby
21
+ Sidekiq.configure_server do |config|
22
+ config.log_formatter = AcmeCorp::PlainLogFormatter.new
23
+ # config.log_formatter = Sidekiq::Logger::Format::JSON.new
24
+ end
25
+ ```
26
+ - **Remove the daemonization, logfile and pidfile command line arguments**.
27
+ I've [noted for years](https://www.mikeperham.com/2014/09/22/dont-daemonize-your-daemons/)
28
+ how modern services should be managed with a proper init system.
29
+ Managing services manually is more error-prone, let your operating system do it for you. See the Deployment wiki page for options.
30
+ - **Validate proper usage of the `REDIS_PROVIDER` variable.**
31
+ This variable is meant to hold the name of the environment
32
+ variable which contains your Redis URL, so that you can switch Redis
33
+ providers quickly and easily with a single variable change. It is not
34
+ meant to hold the actual Redis URL itself. If you want to manually set
35
+ the Redis URL then you may set `REDIS_URL` directly. [#3969]
36
+ - **Increase default shutdown timeout from 8 seconds to 25 seconds.**
37
+ Both Heroku and ECS now use 30 second shutdown timeout
38
+ by default and we want Sidekiq to take advantage of this time. If you
39
+ have deployment scripts which depend on the old default timeout, use `-t 8` to
40
+ get the old behavior. [#3968]
41
+ * **Rails <5** is no longer supported.
42
+ * **Ruby <2.5** is no longer supported.
43
+ * **Redis <4** is no longer supported.
44
+
45
+ ## Upgrade
46
+
47
+ As always, please upgrade Sidekiq **one major version at a time**.
48
+ If you are already running Sidekiq 5.x, then:
49
+
50
+ * Upgrade to the latest Sidekiq 5.x.
51
+ ```ruby
52
+ gem 'sidekiq', '< 6'
53
+ ```
54
+ * Fix any deprecation warnings you see.
55
+ * Upgrade to 6.x.
56
+ ```ruby
57
+ gem 'sidekiq', '< 7'
58
+ ```
data/Changes.md CHANGED
@@ -2,24 +2,29 @@
2
2
 
3
3
  [Sidekiq Changes](https://github.com/mperham/sidekiq/blob/master/Changes.md) | [Sidekiq Pro Changes](https://github.com/mperham/sidekiq/blob/master/Pro-Changes.md) | [Sidekiq Enterprise Changes](https://github.com/mperham/sidekiq/blob/master/Ent-Changes.md)
4
4
 
5
- 5.2.10
5
+ 6.0
6
6
  ---------
7
7
 
8
- - Backport fix for CVE-2022-23837.
9
- - Migrate to `exists?` for redis-rb.
10
- - Lock redis-rb to <4.6 to avoid deprecations.
11
-
12
- 5.2.9
13
- ---------
14
-
15
- - Release Rack lock due to a cascade of CVEs. [#4566]
16
- Pro-tip: don't lock Rack.
17
-
18
- 5.2.8
19
- ---------
20
-
21
- - Lock to Rack 2.0.x to prevent future incompatibilities
22
- - Fix invalid reference in `sidekiqctl`
8
+ This release has major breaking changes. Read and test carefully in production.
9
+
10
+ - **BREAKING CHANGE** Validate proper usage of the `REDIS_PROVIDER`
11
+ variable. This variable is meant to hold the name of the environment
12
+ variable which contains your Redis URL, so that you can switch Redis
13
+ providers quickly and easily with a single variable change. It is not
14
+ meant to hold the actual Redis URL itself. If you want to manually set
15
+ the Redis URL (not recommended as it implies you have no failover),
16
+ then you may set `REDIS_URL` directly. [#3969]
17
+ - **BREAKING CHANGE** Increase default shutdown timeout from 8 seconds
18
+ to 25 seconds. Both Heroku and ECS now use 30 second shutdown timeout
19
+ by default and we want Sidekiq to take advantage of this time. If you
20
+ have deployment scripts which depend on the old default timeout, use `-t 8` to
21
+ get the old behavior. [#3968]
22
+ - **BREAKING CHANGE** Remove the daemonization, logfile and pidfile
23
+ arguments to Sidekiq. Use a proper process supervisor (e.g. systemd or
24
+ foreman) to manage Sidekiq. See the Deployment wiki page for links to
25
+ more resources.
26
+ - Integrate the StandardRB code formatter to ensure consistent code
27
+ styling. [#4114, gearnode]
23
28
 
24
29
  5.2.7
25
30
  ---------
data/Gemfile CHANGED
@@ -1,19 +1,24 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'rake'
6
- gem 'redis-namespace'
7
- gem 'rails', '~> 5.2'
8
- gem 'sqlite3', platforms: :ruby
9
- gem 'activerecord-jdbcsqlite3-adapter', platforms: :jruby
5
+ gem "rake"
6
+ gem "redis-namespace"
7
+ gem "rails"
8
+ gem "sqlite3", platforms: :ruby
9
+ gem "activerecord-jdbcsqlite3-adapter", platforms: :jruby
10
10
 
11
11
  group :test do
12
- gem 'minitest'
13
- gem 'simplecov'
12
+ gem "minitest"
13
+ gem "simplecov"
14
+ end
15
+
16
+ group :development, :test do
17
+ gem "pry-byebug", platforms: :mri
18
+ gem "standard"
14
19
  end
15
20
 
16
21
  group :load_test do
17
- gem 'hiredis'
18
- gem 'toxiproxy'
22
+ gem "hiredis"
23
+ gem "toxiproxy"
19
24
  end
data/Rakefile CHANGED
@@ -1,9 +1,10 @@
1
- require 'bundler/gem_tasks'
2
- require 'rake/testtask'
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+ require "standard/rake"
3
4
 
4
5
  Rake::TestTask.new(:test) do |test|
5
6
  test.warning = true
6
- test.pattern = 'test/**/test_*.rb'
7
+ test.pattern = "test/**/test_*.rb"
7
8
  end
8
9
 
9
- task default: :test
10
+ task default: [:standard, :test]
data/bin/sidekiqctl CHANGED
@@ -7,14 +7,5 @@ require 'sidekiq/ctl'
7
7
  if ARGV[0] == 'status'
8
8
  Sidekiq::Ctl::Status.new.display(ARGV[1])
9
9
  else
10
- if ARGV.length < 2
11
- Sidekiq::Ctl.print_usage
12
- else
13
- stage = ARGV[0]
14
- pidfile = ARGV[1]
15
- timeout = ARGV[2].to_i
16
- timeout = Sidekiq::Ctl::DEFAULT_KILL_TIMEOUT if timeout == 0
17
-
18
- Sidekiq::Ctl.new(stage, pidfile, timeout)
19
- end
10
+ Sidekiq::Ctl.print_usage
20
11
  end
@@ -1,18 +1,18 @@
1
- require 'rails/generators/named_base'
1
+ require "rails/generators/named_base"
2
2
 
3
3
  module Sidekiq
4
4
  module Generators # :nodoc:
5
5
  class WorkerGenerator < ::Rails::Generators::NamedBase # :nodoc:
6
- desc 'This generator creates a Sidekiq Worker in app/workers and a corresponding test'
6
+ desc "This generator creates a Sidekiq Worker in app/workers and a corresponding test"
7
7
 
8
- check_class_collision suffix: 'Worker'
8
+ check_class_collision suffix: "Worker"
9
9
 
10
10
  def self.default_generator_root
11
11
  File.dirname(__FILE__)
12
12
  end
13
13
 
14
14
  def create_worker_file
15
- template 'worker.rb.erb', File.join('app/workers', class_path, "#{file_name}_worker.rb")
15
+ template "worker.rb.erb", File.join("app/workers", class_path, "#{file_name}_worker.rb")
16
16
  end
17
17
 
18
18
  def create_test_file
@@ -27,23 +27,21 @@ module Sidekiq
27
27
 
28
28
  def create_worker_spec
29
29
  template_file = File.join(
30
- 'spec/workers',
31
- class_path,
32
- "#{file_name}_worker_spec.rb"
30
+ "spec/workers",
31
+ class_path,
32
+ "#{file_name}_worker_spec.rb"
33
33
  )
34
- template 'worker_spec.rb.erb', template_file
34
+ template "worker_spec.rb.erb", template_file
35
35
  end
36
36
 
37
37
  def create_worker_test
38
38
  template_file = File.join(
39
- 'test/workers',
40
- class_path,
41
- "#{file_name}_worker_test.rb"
39
+ "test/workers",
40
+ class_path,
41
+ "#{file_name}_worker_test.rb"
42
42
  )
43
- template 'worker_test.rb.erb', template_file
43
+ template "worker_test.rb.erb", template_file
44
44
  end
45
-
46
-
47
45
  end
48
46
  end
49
47
  end