A duplicate start() takes the holder's handle from DBOS - #319
Merged
czpython merged 1 commit intoAug 24, 2026
Merged
Conversation
The dedup collision arm caught DBOSQueueDeduplicatedError, looked the holder up through private API, and recursed when the holder reached terminal between the rejection and the lookup. DBOS 2.30's return-existing duplication policy does all three natively: on a held slot the enqueue returns the holder's handle, with the terminal race retried inside DBOS.
czpython
deleted the
commonzenpython/eng-875-start-hands-back-the-live-run-via-return-existing
branch
August 24, 2026 10:26
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.
Workflow.start()claims a subject's run slot with DBOS queue deduplication. The collision arm hand-rolled what DBOS 2.30 now does natively: it caughtDBOSQueueDeduplicatedError, looked the holder up through private API (_get_dbos_instance()._sys_db.get_deduplicated_workflow), and recursed intostart()when the holder reached terminal between the rejection and the lookup.With
duplication_policy="return-existing"on the enqueue, a held slot returns the holder's handle instead of raising, and DBOS retries the terminal race internally (_core.py, theinit_workflowloop). A fresh enqueue ishandle.workflow_id == workflow_id— the minted id — and keeps its row creation and SCHEDULED event; a duplicate returns the holder's id bare, same as before.Net: the private
_sys_dbreach, the exception import, and the recursion are gone; behavior is unchanged and the existing dedup tests (test_duplicate_start_returns_the_live_run,test_duplicate_start_shares_the_run_across_accounts,test_failed_enqueue_claims_no_slot) pin it end to end.