Sidekiq Changes | Sidekiq Pro Changes | Sidekiq Enterprise Changes
Please see sidekiq.org for more details and how to buy.
- Handle ISO8601 dates as enqueued_at values [#5937]
- Add Korean locale [#3951, @yesh4gvm]
- Empty batch job now uses the configured default queue [#5914]
- Handle Oj-created
enqueued_at
String values in the reliable scheduler [#4768]
- Fix empty batch support [#5903]
- SEMANTIC CHANGE: Empty batches now automatically create an empty job. This ensures callbacks are fired even if no jobs are created. The behavior of empty batches has always been documented as undefined so this is not considered a breaking change.
- Add
complete_at
,success_at
anddeath_at
timestamps toS::Batch::Status
, which track when that batch callback was triggered. [#5818] - Refactor all
*_at
Batch APIs to consistently returnTime
objects [#5837]
- Increase fetch timeout to minimize ReadTimeoutError [#5874]
- Add Hindi locale [gaurish]
- Dead JIDs on the Batch page are now linked so you can quickly jump to them in Dead
- Fix unnecessary Redis pool creation [#5830]
- Fix network logic which could have resulted in pause/unpause not working [#5834]
- Fix redis-client API usage which could result in stuck Redis connections [#5823]
- Add Farsi translations
- Fix death callback firing multiple times per batch [#5740]
- Fix random fetching with super_fetch [#5726]
- Fix config issue with reliable_push [#5698]
- Fixes for the
pending
fix [#5689]
- Adjust statsd middleware to not hold an open connection while executing a job [#5684]
- Clamp Batch
pending
to 0 [#5659] - Drop Batch pub/sub feature [#5645]
- Fix eager connection to Redis when activating reliable_push [#5606]
- Componentize and capsulize Pro functionality for Sidekiq 7.
- Add DE locale
- Fix typo in
pending
fix [#5689]
- Clamp Batch
pending
to 0 [#5659]
- Lock Sidekiq Pro 5.x to Sidekiq 6.x.
- Update IT localization
- Fix batch "pending == -1" race condition [#5524]
- Remove Redis 4.8.0 deprecation warnings
- Fix overly aggressive orphan check with large Sidekiq clusters [#5435]
- Unbreak queue pausing [#5382]
- DEPRECATION: remove support for statsd-ruby via
Sidekiq::Pro.statsd
. dogstatsd-ruby will be the only supported statsd library in 6.0. [#5212] - Add
Sidekiq.via
API for targeting shards [#5269]
SHARD1 = ConnectionPool.new { Redis.new(db: 0) }
SHARD2 = ConnectionPool.new { Redis.new(db: 1) }
Sidekiq.via(SHARD2) do
Sidekiq::Queue.all.sum(&:size)
end
- Excise "worker" terminology from codebase [#4955]
- Ensure batch callback metrics are always fired [#5217]
- Added
error_type
tag forjob.failures
metrics [#5211] - Internal refactoring for Sidekiq 6.5.
- Requires Sidekiq 6.5.
- Ensure sidekiq-pro/web pulls in sharding support [#5153]
- Fix pipeline/multi deprecation in redis-rb 4.6.
- Fix namespace issue with dogstatsd-ruby in Ruby 3+ [#5094]
- Fix thread-safety issue with Sidekiq::Pro::Config
- Allow job-specific options in Statsd metrics [#5037]
# add to your initializer
Sidekiq::Middleware::Server::Statsd.options = ->(klass, job, q) do
{tags: ["worker:#{klass}", "queue:#{q}"]}.tap do |h|
h[:tags] << "tenant:#{job['tenant_id']}" if job["tenant_id"]
end
end
- Initialize paused queue set before allowing jobs to be fetched [#4975]
- Reduce superfluous logging of Redis errors [#4969]
- Display dead JIDs on Batch details page [#4926]
- Include poison pill info in super_fetch's orphan handler [#4859]
- Use Sidekiq::Batch::Immutable error so race conditions can easily be caught [#4845]
- Fix sharded UI not using middleware in Sidekiq 6.2 [#4843]
- Compatibility with dogstatsd-ruby 4.x and 5.x [#4863]
- Propagate death callbacks to parent batches [#4774]
- Allow customization of Batch linger to quickly reclaim memory in Redis [#4772]
- Fix disappearing processes in Busy due to super_fetch initialization when used in
tandem with
SIDEKIQ_PRELOAD_APP=1
insidekiqswarm
. [#4733]
- The Sidekiq Pro and Enterprise gem servers now
bundle install
much faster with Bundler 2.2+ [#4158] - Fix issue with reliable push and multiple shards [#4669]
- Fix Pro memory leak due to fetch refactoring in Sidekiq 6.1 [#4652]
- Gracefully handle poison pill jobs [#4633]
- Remove support for multi-shard batches [#4642]
- Rename
Sidekiq::Rack::BatchStatus
toSidekiq::Pro::BatchStatus
[#4655]
- Fix broken basic fetcher [#4616]
- Remove old Statsd metrics with
WorkerName
in the name [#4377]
job.WorkerName.count -> job.count with tag worker:WorkerName
job.WorkerName.perform -> job.perform with tag worker:WorkerName
job.WorkerName.failure -> job.failure with tag worker:WorkerName
- Remove
concurrent-ruby
gem dependency [#4586] - Update
constantize
for batch callbacks. [#4469] - Add queue tag to
jobs.recovered.fetch
metric [#4594] - Refactor Pro's fetch infrastructure [#4602]
- Rejigger batch failures UI to add direct links to retries and scheduled jobs [#4209]
- Delete batch data with
UNLINK
[#4155] - Fix bug where a scheduled job can lose its scheduled time when using reliable push [#4267]
- Sidekiq::JobSet#scan and #find_job APIs have been promoted to Sidekiq OSS. [#4259]
- There is no significant migration from Sidekiq Pro 4.0 to 5.0 but make sure you read the update notes for Sidekiq 6.0.
- Removed various deprecated APIs and associated warnings.
- BREAKING CHANGE Remove the
Sidekiq::Batch::Status#dead_jobs
API in favor ofSidekiq::Batch::Status#dead_jids
. [#4217] - Update Sidekiq Pro codebase to use StandardRB formatting
- Fix lingering "b-XXX-died" elements in Redis which could cause excessive memory usage. [#4217]
- Add ES translations, see issues #3949 and #3951 to add your own language.
- Increase super_fetch retriever thread count from 1 to 2 to make it less sensitive to Redis latency.
- Better handling of invalid job JSON by reliable scheduler [#4053]
- Added ZH, PT, JA and RU translations.
- Update Sidekiq::Client patches to work with new Module#prepend mechanism in Sidekiq 5.2.0. [#3930]
- Add at_exit handler to push any saved jobs in
reliable_push
when exiting. [#3823] - Implement batch death callback. This is fired the first time a job within a batch dies. [#3841]
batch = Sidekiq::Batch.new
batch.on(:death, ...)
- Remove super_fetch edge case leading to an unnecessary
sleep(1)
call and resulting latency [#3790] - Fix possible bad statsd metric call on super_fetch startup
- Remove superfluous
freeze
calls on Strings [#3759]
- Fix incompatibility with the statsd-ruby gem [#3740]
- Add tags to Statsd metrics when using Datadog [#3744]
- See the Sidekiq Pro 4.0 release notes.
- Deprecate timed_fetch. Switch to super_fetch:
config.super_fetch!
- Refactor batch job success/failure to gracefully handle several edge cases with regard to Sidekiq::Shutdown. This should greatly reduce the chances of seeing the long-standing "negative pending count" problem. [#3710]
- Add support for Datadog::Statsd, it is the recommended Statsd client. [#3699]
Sidekiq::Pro.dogstatsd = ->{ Datadog::Statsd.new("metrics.example.com", 8125) }
- Size the statsd connection pool based on Sidekiq's concurrency [#3700]
This release overhauls the Statsd metrics support and adds more metrics for tracking Pro feature usage. In your initializer:
Sidekiq::Pro.statsd = ->{ ::Statsd.new("127.0.0.1", 8125) }
Sidekiq Pro will emit more metrics to Statsd:
jobs.expired - when a job is expired
jobs.recovered.push - when a job is recovered by reliable_push after network outage
jobs.recovered.fetch - when a job is recovered by super_fetch after process crash
batch.created - when a batch is created
batch.complete - when a batch is completed
batch.success - when a batch is successful
Sidekiq Pro's existing Statsd middleware has been rewritten to leverage the new API. Everything should be backwards compatible with one deprecation notice.
- Fix case in SuperFetch where Redis downtime can lead to processor thread death [#3684]
- Fix case where TimedFetch might not recover some pending jobs
- Fix edge case in Batch::Status#poll leading to premature completion [#3640]
- Adjust scan API to check 100 elements at a time, to minimize network round trips when scanning large sets.
- Restore error check for super_fetch's job ack [#3601]
- Trim error messages saved in Batch's failure hash, preventing huge messages from bloating Redis. [#3570]
- Fix
Status#completed?
when run against a Batch that had succeeded and was deleted. [#3519]
- Work with Sidekiq 5.0.2+
- Improve performance of super_fetch with weighted queues [#3489]
- Add queue pause/unpause endpoints for scripting via curl [#3445]
- Change how super_fetch names private queues to avoid hostname/queue clashes. [#3443]
- Re-implement
Sidekiq::Queue#delete_job
to avoid O(n) runtime [#3408] - Batch page displays Pending JIDs if less than 10 [#3130]
- Batch page has a Search button to find associated Retries [#3130]
- Make Batch UI progress bar more friendly to the colorblind [#3387]
- Fix potential job loss with reliable scheduler when lots of jobs are scheduled at precisely the same time. Thanks to raivil for his hard work in reproducing the bug. [#3371]
- Optimize super_fetch shutdown to restart jobs quicker [#3249]
- Limit reliable scheduler to enqueue up to 100 jobs per call, minimizing Redis latency [#3332]
- Fix bug in super_fetch logic for queues with
_
in the name [#3339]
- Add
Batch::Status#invalidated?
API which returns true if any/all JIDs were invalidated within the batch. [#3326]
- Allow super_fetch's orphan job check to happen as often as every hour [#3273]
- Officially deprecate reliable_fetch algorithm, I now recommend you use
super_fetch
instead:
Sidekiq.configure_server do |config|
config.super_fetch!
end
Also note that Sidekiq's -i/--index
option is no longer used/relevant with super_fetch.
- Don't display "Delete/Retry All" buttons when filtering in Web UI [#3243]
- Reimplement Sidekiq::JobSet#find_job with ZSCAN [#3197]
- Introducing the newest reliable fetching algorithm:
super_fetch
! This algorithm will replace reliable_fetch in Pro 4.0. super_fetch is bullet-proof across all environments, no longer requiring stable hostnames or an index to be set per-process. [#3077]
Sidekiq.configure_server do |config|
config.super_fetch!
end
Thank you to @jonhyman for code review and the Sidekiq Pro customers that beta tested super_fetch.
- Update Web UI extension to work with Sidekiq 4.2.0's new Web UI. [#3075]
- Minimize batch memory usage after success [#3083]
- Extract batch's 24 hr linger expiry to a LINGER constant so it can be tuned. [#3011]
- If environment is unset, treat it as development so reliable_fetch works as before 3.2.2.
- Don't delete batches immediately upon success but set a 24 hr expiry, this allows Sidekiq::Batch::Status#poll to work, even after batch success. [#3011]
- New
Sidekiq::PendingSet#destroy(jid)
API to remove poison pill jobs [#3015]
- A default value for -i is only set in development now, staging or other environments must set an index if you wish to use reliable_fetch. [#2971]
- Fix nil dereference when checking for jobs over timeout in timed_fetch
- timed_fetch now works with namespaces. [ryansch]
- Fixed detection of missing batches,
NoSuchBatch
should be raised properly now ifSidekiq::Batch.new(bid)
is called on a batch no longer in Redis. - Remove support for Pro 1.x format batches. This version will no longer seamlessly process batches created with Sidekiq Pro 1.x. As always, upgrade one major version at a time to ensure a smooth transition.
- Fix edge case where a parent batch could expire before a child batch was finished processing, leading to missing batches [#2889]
- Fix edge case where a parent batch could expire before a child batch was finished processing, leading to missing batches [#2889]
- New container-friendly fetch algorithm:
timed_fetch
. See the wiki documentation for trade offs between the two reliability options. You should use this if you are on Heroku, Docker, Amazon ECS or EBS or another container-based system.
- Fix race condition on reliable fetch shutdown
- Statsd metrics now account for ActiveJob class names
- Allow reliable fetch internals to be overridden [jonhyman]
- Queue pausing no longer requires reliable fetch. [#2786]
- Convert Lua-based
Sidekiq::Queue#delete_by_class
to Ruby-based, to avoid O(N^2) performance and possible Redis failure. [#2806]
- Make job registration with batch part of the atomic push so batch metadata can't get out of sync with the job data. [#2714]
- Remove a number of Redis version checks since we can assume 2.8+ now.
- Fix expiring jobs client middleware not loaded on server
- See the Pro 3.0 release notes.
- Don't enable strict priority if using weighted queueing like
-q a,1 -q b,1
- Safer JSON mangling in Lua [#2639]
- Lock Sidekiq Pro 2.x to Sidekiq 3.x.
- Make ShardSet lazier so Redis can first be initialized at startup. [#2603]
- Explicit support for sharding batches. You list your Redis shards and Sidekiq Pro will randomly spread batches across the shards. The BID will indicate which shard contains the batch data. Jobs within a batch may be spread across all shards too. [#2548, jonhyman]
- Officially deprecate Sidekiq::Notifications code. Notifications have been undocumented for months now. [#2575]
- Fix reliable scheduler mangling large numeric arguments. Lua's CJSON library cannot accurately encode numbers larger than 14 digits! [#2478]
- Optimize delete of enormous batches (100,000s of jobs) [#2458]
- CSRF protection in Sidekiq 3.4.2 broke job filtering in the Web UI [#2442]
- Sidekiq Pro 1.x is now limited to Sidekiq < 3.5.0.
- Atomic scheduler now sets
enqueued_at
[#2414] - Batches now account for jobs which are stopped by client middleware [#2406]
- Ignore redundant calls to
Sidekiq::Client.reliable_push!
[#2408]
- Reliable push now supports sharding [#2409]
- Reliable push now only catches Redis exceptions [#2307]
- Display Batch callback data on the Batch details page. [#2347]
- Fix incompatibility with Pro Web and Rack middleware. [#2344] Thank you to Jason Clark for the tip on how to fix it.
- Multiple Web UIs can now run in the same process. [#2267] If you have multiple Redis shards, you can mount UIs for all in the same process:
POOL1 = ConnectionPool.new { Redis.new(:url => "redis://localhost:6379/0") }
POOL2 = ConnectionPool.new { Redis.new(:url => "redis://localhost:6378/0") }
mount Sidekiq::Pro::Web => '/sidekiq' # default
mount Sidekiq::Pro::Web.with(redis_pool: POOL1), at: '/sidekiq1', as: 'sidekiq1' # shard1
mount Sidekiq::Pro::Web.with(redis_pool: POOL2), at: '/sidekiq2', as: 'sidekiq2' # shard2
- SECURITY Fix batch XSS in error data. Thanks to moneybird.com for reporting the issue.
- Add
batch.callback_queue
so batch callbacks can use a higher priority queue than jobs. [#2200] - Gracefully recover if someone runs
SCRIPT FLUSH
on Redis. [#2240] - Ignore errors when attempting
bulk_requeue
, allowing clean shutdown
- See the Upgrade Notes for detailed notes.
- As of 1/1/2015, Sidekiq Pro is hosted on a new dedicated server. Happy new year and let's hope for 100% uptime!
- Fix bug in reliable_fetch where jobs could be duplicated if a Sidekiq process crashed and you were using weighted queues. [#2120]
- SECURITY Fix XSS in batch description, thanks to intercom.io for reporting the issue. If you don't use batch descriptions, you don't need the fix.
- Add new expiring jobs feature [#1982]
- Show batch expiration on Batch details page [#1981]
- Add '$' batch success token to the pubsub support. [#1953]
- Fix race condition where Batches can complete before they have been fully defined or only half-defined. Requires Sidekiq 3.2.3. [#1919]
- Quick release to verify #1919
- Fix job filtering within the Dead tab.
- Add APIs and wiki documentation for invalidating jobs within a batch.
- Awesome ANSI art startup banner!
- Batch callbacks should use the same queue as the associated jobs.
- DEPRECATION Use
Batch#on(:complete)
instead ofBatch#notify
. The specific Campfire, HipChat, email and other notification schemes will be removed in 2.0.0. - Remove batch from UI when successful. [#1745]
- Convert batch callbacks to be asynchronous jobs for error handling [#1744]
- Fix for paused queues being processed for a few seconds when starting a new Sidekiq process.
- Add a 5 sec delay when starting reliable fetch on Heroku to minimize any duplicate job processing with another process shutting down.
- Add ability to pause reliable queues via API.
q = Sidekiq::Queue.new("critical")
q.pause!
q.paused? # => true
q.unpause!
Sidekiq polls Redis every 10 seconds for paused queues so pausing will take a few seconds to take effect.
- Compatible with Sidekiq 3.
- Due to a breaking API change in Sidekiq 3.0, this version is limited to Sidekiq 2.x.
- Fix issue on Heroku where reliable fetch could orphan jobs [#1573]
- Reverse sorting of Batches in Web UI [#1098]
- Refactoring for Sidekiq 3.0, Pro now requires Sidekiq 2.17.5
- Tolerate expired Batches in the web UI.
- Fix 100% CPU usage when using weighted queues and reliable fetch.
- Add batch progress bar to batch detail page. [#1398]
- Fix race condition in initializing Lua scripts
- Default batch expiration has been extended to 3 days, from 1 day previously.
- Batches now sort in the Web UI according to expiry time, not creation time.
- Add user-configurable batch expiry. If your batches might take longer than 72 hours to process, you can extend the expiration date.
b = Sidekiq::Batch.new
b.expires_in 5.days
...
- Lazy load Lua scripts so a Redis connection is not required on bootup.
- Fix a gemspec packaging issue which broke the Batch UI.
Thanks to @jonhyman for his contributions to this Sidekiq Pro release.
This release includes new functionality based on the SCAN command newly added to Redis 2.8. Pro still works with Redis 2.4 but some functionality will be unavailable.
- Job Filtering in the Web UI! You can now filter retries and scheduled jobs in the Web UI so you only see the jobs relevant to your needs. Queues cannot be filtered; Redis does not provide the same SCAN operation on the LIST type. Redis 2.8
- SCAN support in the Sidekiq::SortedSet API. Here's an example that finds all jobs which contain the substring "Warehouse::OrderShip" and deletes all matching retries. If the set is large, this API will be MUCH faster than standard iteration using each. Redis 2.8
Sidekiq::RetrySet.new.scan("Warehouse::OrderShip") do |job|
job.delete
end
- Sidekiq::Batch#jobs now returns the set of JIDs added to the batch.
- Sidekiq::Batch#jids returns the complete set of JIDs associated with the batch.
- Sidekiq::Batch#remove_jobs(jid, jid, ...) removes JIDs from the set, allowing early termination of jobs if they become irrelevant according to application logic.
- Sidekiq::Batch#include?(jid) allows jobs to check if they are still relevant to a Batch and exit early if not.
- Sidekiq::SortedSet#find_job(jid) now uses server-side Lua if possible Redis 2.6 [jonhyman]
- The statsd integration now sets global job counts:
jobs.count
jobs.success
jobs.failure
- Change shutdown logic to push leftover jobs in the private queue back into the public queue when shutting down with Reliable Fetch. This allows the safe decommission of a Sidekiq Pro process when autoscaling. [jonhyman]
- Add support for weighted random fetching with Reliable Fetch [jonhyman]
- Pro now requires Sidekiq 2.17.0
- Convert Batch UI to use Sidekiq 2.16's support for extension localization.
- Update reliable_push to work with Sidekiq::Client refactoring in 2.16
- Pro now requires Sidekiq 2.16.0
- Convert Batch UI to Bootstrap 3
- Pro now requires Sidekiq 2.15.0
- Add Sidekiq::Batch::Status#delete [#1205]
- Pro now requires Sidekiq 2.14.0
- Fix bad exception handling in batch callbacks [#1134]
- Convert Batch UI to ERB
- Problem with reliable fetch which could lead to lost jobs when Sidekiq is shut down normally. Thanks to MikaelAmborn for the report. [#1109]
- Forgot to push paging code necessary for
delete_job
performance.
- LEAK Fix batch key which didn't expire in Redis. Keys match /b-[a-f0-9]{16}-pending/, e.g. "b-4f55163ddba10aa0-pending" [#1057]
- Reliable fetch now supports multiple queues, using the algorithm spec'd by @jackrg [#1102]
- Fix issue with reliable_push where it didn't return the JID for a pushed job when sending previously cached jobs to Redis.
- Add fast Sidekiq::Queue#delete_job(jid) API which leverages Lua so job lookup is 100% server-side. Benchmark vs Sidekiq's Job#delete API. Redis 2.6
Sidekiq Pro API
0.030000 0.020000 0.050000 ( 1.640659)
Sidekiq API
17.250000 2.220000 19.470000 ( 22.193300)
- Add fast Sidekiq::Queue#delete_by_class(klass) API to remove all jobs of a given type. Uses server-side Lua for performance. Redis 2.6
- New
sidekiq/pro/reliable_push
which makes Sidekiq::Client resiliant to Redis network failures. [#793] - Move
sidekiq/reliable_fetch
tosidekiq/pro/reliable_fetch
- Sidekiq Pro changelog moved to mperham/sidekiq for public visibility.
- Add new Rack endpoint for easy polling of batch status via JavaScript. See
sidekiq/rack/batch_status
- Fix bad /batches path in Web UI
- Fix Sinatra conflict with sidekiq-failures
- Fix issue with lifecycle notifications not firing.
- Update due to Sidekiq API changes.
- Rearchitect Sidekiq's Fetch code to support different fetch strategies. Add a ReliableFetch strategy which works with Redis' RPOPLPUSH to ensure we don't lose messages, even when the Sidekiq process crashes unexpectedly. [sidekiq#607]
- Reimplement existing notifications using batch on_complete events.
- Rejigger batch callback notifications.
- Add new Batch 'callback' notification support, for in-process notification.
- Symbolize option keys passed to Pony [sidekiq#603]
- Batch no longer requires the Web UI since Web UI usage is optional. You must require is manually in your Web process:
require 'sidekiq/web'
require 'sidekiq/batch/web'
mount Sidekiq::Web => '/sidekiq'
- Worker instances can access the associated jid and bid via simple accessors.
- Batches can now be modified while being processed so, e.g. a batch job can add additional jobs to its own batch.
def perform(...)
batch = Sidekiq::Batch.new(bid) # instantiate batch associated with this job
batch.jobs do
SomeWorker.perform_async # add another job
end
end
- Save error backtraces in batch's failure info for display in Web UI.
- Clean up email notification a bit.
- Add optional batch description
- Mutable batches. Batches can now be modified to add additional jobs at runtime. Example would be a batch job which needs to create more jobs based on the data it is processing.
batch = Sidekiq::Batch.new(bid)
batch.jobs do
# define more jobs here
end
- Fix issues with symbols vs strings in option hashes
- Webhook notification support
- Redis pubsub
- Email polish
- Batches
- Notifications
- Statsd middleware