Repository navigation
fix(sqlite): a pop takes a message from the queue polled only - #1871
Merged
Merged
Conversation
The pop chose ids in the queue polled but marked and returned every row with those ids, in any queue. A message id is unique within a queue, not across queues: a native continuation offered on a worker's own queue and, as a fallback, on the shared queue under the same id was popped from both and run twice. The update now names the queue too.
mp-orkes
marked this pull request as ready for review
November 24, 2026 01:06
mp-orkes
requested review from
bradyyie,
c4lm,
kowser-orkes,
manan164 and
nthmost-orkes
November 24, 2026 01:06
v1r3n
approved these changes
Nov 24, 2026
This was referenced Nov 25, 2026
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.
Why
In the SQLite queue, a message id is unique within one queue. The same id can be in two queues at the same time.
SqliteQueueDAO.popselected the ids from the polled queue, but itsUPDATEmatched on the id only. The pop thus marked and returned the rows with those ids in all queues. A message with the same id in a second queue was taken from that queue too, and the caller got the id two times.What changed
Notes
UPDATEnow names the queue:WHERE queue_name = ? AND message_id IN (...).UPDATE. They do not change.mainputs one id in two queues. The native workflows PR (#1832) does, so this fix must merge before it.🤖 Generated with Claude Code