Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client middleware completes before the job is pushed to Redis #6264

Open
eileen-jiang opened this issue Apr 23, 2024 · 1 comment
Open

Client middleware completes before the job is pushed to Redis #6264

eileen-jiang opened this issue Apr 23, 2024 · 1 comment

Comments

@eileen-jiang
Copy link

eileen-jiang commented Apr 23, 2024

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.

  1. 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.
  2. 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.
@mperham
Copy link
Collaborator

mperham commented Apr 23, 2024

  1. Because you can push multiple jobs with one network round trip, via push_bulk. Each job is run through client middleware beforehand.
  2. Queue metrics are part of Enterprise's historical metrics feature but they are not suited to collection by client middleware, as you've learned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants