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

Oversized batches of retried tasks #84

Open
javaccar opened this issue Nov 9, 2023 · 1 comment
Open

Oversized batches of retried tasks #84

javaccar opened this issue Nov 9, 2023 · 1 comment

Comments

@javaccar
Copy link

javaccar commented Nov 9, 2023

Retrying tasks with countdowns can cause these tasks to pile up in the _pending queue. For argument's sake, let's say there are 10k such tasks (all with the same ETA) in a _pending queue but flush_every is only 10. When the ETA is reached and 10 messages are received from the broker, then the list of SimpleRequest objects passed to the task will be of length 10010. I understand that flush_every=10 is not a promise that the batch size won't be something larger like 10010, but without enforcing some kind of maximum on the batch size, it becomes difficult to reason about how long a batch is expected to take, which is important when setting SQS visibility timeouts for example.

@clokep
Copy link
Owner

clokep commented Nov 15, 2023

That seems like a bug -- we should probably schedule only an additional flush_every or something like that which have become available due to ETAs. (Taking care to then flush the entire queue which is ready.)

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