2018-12-28 13:07:03 -05:00
|
|
|
# Welcome to Sidekiq 6.0!
|
|
|
|
|
|
|
|
Sidekiq 6.0 contains some breaking changes which streamline proper operation
|
2019-02-11 16:59:52 -05:00
|
|
|
of Sidekiq. It also drops support for EOL versions of Ruby and Rails.
|
2018-12-28 13:07:03 -05:00
|
|
|
|
|
|
|
## What's New
|
|
|
|
|
|
|
|
This release has major breaking changes. Read and test carefully in production.
|
|
|
|
|
2019-07-24 13:59:00 -04:00
|
|
|
- ActiveJobs can now use `sidekiq_options` directly to configure Sidekiq
|
|
|
|
features/internals like the retry subsystem.
|
|
|
|
```ruby
|
|
|
|
class MyJob < ActiveJob::Base
|
|
|
|
queue_as :myqueue
|
|
|
|
sidekiq_options retry: 10, backtrace: 20
|
|
|
|
def perform(...)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
```
|
2019-02-11 16:59:52 -05:00
|
|
|
- Logging has been redesigned to allow pluggable formatters and several
|
2019-01-04 12:31:56 -05:00
|
|
|
formats ship with Sidekiq:
|
|
|
|
* default - your typical output on macOS
|
2019-03-06 12:17:45 -05:00
|
|
|
* heroku - enabled specifically when running in Heroku
|
|
|
|
* json - a JSON format for search indexing, one hash per line
|
|
|
|
|
2019-01-04 12:31:56 -05:00
|
|
|
Sidekiq will enable the best formatter for the detected environment but
|
2019-03-06 12:17:45 -05:00
|
|
|
you can override it by configuring the log formatter explicitly. See
|
|
|
|
'sidekiq/logger' for implementation details.
|
2019-02-11 16:59:52 -05:00
|
|
|
|
2019-03-06 12:17:45 -05:00
|
|
|
```ruby
|
2018-12-28 13:07:03 -05:00
|
|
|
Sidekiq.configure_server do |config|
|
2019-02-11 16:59:52 -05:00
|
|
|
config.log_formatter = AcmeCorp::PlainLogFormatter.new
|
2019-03-06 12:17:45 -05:00
|
|
|
# config.log_formatter = Sidekiq::Logger::Format::JSON.new
|
2018-12-28 13:07:03 -05:00
|
|
|
end
|
|
|
|
```
|
|
|
|
- **Remove the daemonization, logfile and pidfile command line arguments**.
|
2019-03-06 12:17:45 -05:00
|
|
|
I've [noted for years](https://www.mikeperham.com/2014/09/22/dont-daemonize-your-daemons/)
|
|
|
|
how modern services should be managed with a proper init system.
|
|
|
|
Managing services manually is more error-prone, let your operating system do it for you. See the Deployment wiki page for options.
|
2018-12-28 13:07:03 -05:00
|
|
|
- **Validate proper usage of the `REDIS_PROVIDER` variable.**
|
2019-03-06 12:17:45 -05:00
|
|
|
This variable is meant to hold the name of the environment
|
2018-12-28 13:07:03 -05:00
|
|
|
variable which contains your Redis URL, so that you can switch Redis
|
|
|
|
providers quickly and easily with a single variable change. It is not
|
|
|
|
meant to hold the actual Redis URL itself. If you want to manually set
|
|
|
|
the Redis URL then you may set `REDIS_URL` directly. [#3969]
|
|
|
|
- **Increase default shutdown timeout from 8 seconds to 25 seconds.**
|
2019-03-06 12:17:45 -05:00
|
|
|
Both Heroku and ECS now use 30 second shutdown timeout
|
2018-12-28 13:07:03 -05:00
|
|
|
by default and we want Sidekiq to take advantage of this time. If you
|
|
|
|
have deployment scripts which depend on the old default timeout, use `-t 8` to
|
|
|
|
get the old behavior. [#3968]
|
|
|
|
* **Rails <5** is no longer supported.
|
2019-01-04 12:31:56 -05:00
|
|
|
* **Ruby <2.5** is no longer supported.
|
2019-03-06 12:17:45 -05:00
|
|
|
* **Redis <4** is no longer supported.
|
2018-12-28 13:07:03 -05:00
|
|
|
|
|
|
|
## Upgrade
|
|
|
|
|
|
|
|
As always, please upgrade Sidekiq **one major version at a time**.
|
|
|
|
If you are already running Sidekiq 5.x, then:
|
|
|
|
|
|
|
|
* Upgrade to the latest Sidekiq 5.x.
|
|
|
|
```ruby
|
|
|
|
gem 'sidekiq', '< 6'
|
|
|
|
```
|
|
|
|
* Fix any deprecation warnings you see.
|
|
|
|
* Upgrade to 6.x.
|
|
|
|
```ruby
|
|
|
|
gem 'sidekiq', '< 7'
|
|
|
|
```
|