sidekiq
sidekiq copied to clipboard
Client middleware completes before the job is pushed to Redis
trafficstars
Ruby version: 3.1.4 Rails version: 7.0.8.1 Sidekiq / Pro / Enterprise version(s): sidekiq-pro (5.5.0)
The client middleware is executed to completion before the job payload is actually pushed to Redis.
- Is there a reason the job isn't pushed to Redis within the client middleware chain? This behavior differs from the server middleware, which executes the job in the innermost layer of the chain.
- Does sidekiq provide any metrics or tracing for the full enqueue action? Our client middleware isn't able to accurately publish metrics on enqueue count and latency because the middleware is all executed before the Redis push.
- Because you can push multiple jobs with one network round trip, via push_bulk. Each job is run through client middleware beforehand.
- Queue metrics are part of Enterprise's historical metrics feature but they are not suited to collection by client middleware, as you've learned.