Conversation
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.
Cause: runWorkerBatch selects the oldest pending job each step. When generateReport throws (e.g. job.rows is not an array, as in job-101 from incident 6f1192b4206f4cf5ace82c733d24537f), the catch block recorded job.lastError but left job.status as "pending". That same malformed job was reselected on every subsequent step, consuming the whole bounded batch and starving healthy jobs queued behind it (job-102, job-103 never got attempted).
Fix: in app/worker.mjs's catch block, set job.status = "failed" alongside job.lastError, so a permanently malformed job is recorded as failed and not reselected by the pending-job filter. Healthy jobs behind it can then be attempted and completed within the same bounded batch.
Regression test: app/test/worker.regression.test.mjs reproduces the exact incident shape (job-101 with rows: null followed by two healthy jobs) and asserts the required behavior: the bad job fails once and is marked "failed", and both healthy jobs are attempted and completed with correct CSV output within the batch. This test fails on the original source (the malformed job is retried 4 times, both healthy jobs remain pending/unattempted) and passes after the fix.
Sentry incident: event. This is the deliberately faulty on-call example app.
Tested against commit
04b1e334a737824d719341f674d7048afa69401c. The same regression command failed before the fix and passed afterward: