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

Atomic length method #2

Open
JOT85 opened this issue Jun 29, 2023 · 0 comments · Fixed by #4
Open

Atomic length method #2

JOT85 opened this issue Jun 29, 2023 · 0 comments · Fixed by #4

Comments

@JOT85
Copy link
Member

JOT85 commented Jun 29, 2023

Currently there are methods to get the length of the queue, and the number of jobs being processed. It's not currently possible to simultaneously get both of these.

In the autoscaler, we get one and then the other. This may not be an accurate total, since items could move in between calls, though realistically it's more than accurate enough. It does mean there are multiple backwards and forwards to the redis server, instead of a single pipeline though.

This becomes more of a problem when you're trying to shut down a queue when it's empty, since you can't really be 100% sure that it definitely is empty, it opens the door for a very occasional failure.

We should implement a length method that returns both these lengths atomically.

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

Successfully merging a pull request may close this issue.

1 participant