Repository navigation
fix(batch): stop a wait before a back-off that ends on its --timeout - #76
Merged
Merged
Conversation
waitForJob slept whenever the next back-off ended at or before the deadline, so a back-off ending exactly on it slept the whole way and then read the job with no time left. Whether that happened depended on whether a millisecond passed between reads, which made "a wait never sleeps or retries past its --timeout" fail now and then. The wait now stops when the back-off would reach the deadline, as the retry inside each read already does.
2 tasks
StefanoGuerrini
self-requested a review
October 30, 2026 11:11
StefanoGuerrini
approved these changes
Oct 30, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
zenrows batch waitno longer sleeps through a back-off that ends exactly on--timeout.waitForJobstopped only when the next back-off ended after the deadline. A back-off ending on it was slept in full, and the job was then read with no time left.Why
Whether that edge case happened depended on whether a millisecond passed between reads. So the test "a wait never sleeps or retries past its --timeout" failed now and then, on
maintoo (sleeps: 2000,3000).How it is checked
sleeps: 2000,3000; after it, the wait sleeps once.npm run typecheckis clean, andnpm testpasses 495 of 495, five runs in a row.