-
-
Notifications
You must be signed in to change notification settings - Fork 101
batch should not be marked as completed before batch.jobs{} is actually completed #100
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
base: master
Are you sure you want to change the base?
batch should not be marked as completed before batch.jobs{} is actually completed #100
Conversation
|
@nglx Hi, if you have time, could you review my pull request ? |
b61d901 to
1220a43
Compare
|
@lionelchauvin #69 did indeed attempt to solve the issue, but it requires specific configuration - I believe your PR may be duplicating that effort, specifically your duplication code is exactly what I used to demonstrate success. Did you try the config here? Can you post a minimal repro that uses the config value? |
|
@aleksclark Yes I tried the config and it was not working with sidekiq 8 even with
It is not exactly the same code. In your PR you create one job in I can try to add the config batch_push_interval = 0 in this test but I am almost sure it will fail. |
|
As I expected, the test fail (with the code from master) even if I simulate the config: in the condition, |
|
For more context, I detected this bug because I have my own implementation of |
|
Yeah it doesn't work with sidekiq 8, that's specifically called out
Aleks Clark
cell: 775-391-6114
…On Thu, Oct 30, 2025, 1:16 PM Lionel Chauvin ***@***.***> wrote:
*lionelchauvin* left a comment (breamware/sidekiq-batch#100)
<#100 (comment)>
For more context, I detected this bug because I have my own implementation
of Sidekiq::Batch::Status#join. I use it in my specs in order to wait
that all jobs are finished before the checks. I could provide a PR for
Sidekiq::Batch::Status#join but it can't work without this fix.
—
Reply to this email directly, view it on GitHub
<#100 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEUHHHQS43YU3WGQTO3GUT32JIY7AVCNFSM6AAAAACGIG6JOWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTINRZGQYDMNBUHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
1220a43 to
fcebd41
Compare
The current implementation of batches doesn't work properly. In the following example, TestCallback is executed too soon:
I think #69 tried to solve this issue.
In this pull request, an additional redis variable "block_executed" has been added in order to know if the batch.jobs{} is actually executed before execute callbacks.
If batch.jobs{} is completed and the last pending job is completed then callbacks are processed.
If all jobs are completed when batch.jobs{} is completed then callbacks are processed.