fix: handle missing checkpoint token from service#571
Open
ayushiahjolia wants to merge 1 commit into
Open
Conversation
ayushiahjolia
force-pushed
the
fix/checkpoint-token-keep-last
branch
2 times, most recently
from
July 22, 2026 23:51
4467579 to
5281407
Compare
ayushiahjolia
force-pushed
the
fix/checkpoint-token-keep-last
branch
from
July 22, 2026 23:53
5281407 to
f0793df
Compare
ayushiahjolia
force-pushed
the
fix/checkpoint-token-keep-last
branch
from
July 23, 2026 00:11
f0793df to
7e09c90
Compare
ayushiahjolia
force-pushed
the
fix/checkpoint-token-keep-last
branch
from
July 23, 2026 17:31
7e09c90 to
f3f1efb
Compare
ayushiahjolia
force-pushed
the
fix/checkpoint-token-keep-last
branch
from
July 23, 2026 20:22
f3f1efb to
f77354e
Compare
ayushiahjolia
marked this pull request as ready for review
July 23, 2026 21:12
zhongkechen
reviewed
Jul 23, 2026
| queued_op = QueuedOperation(operation_update, completion_event) | ||
|
|
||
| # Enqueue the wrapper object (operation_update can be None for empty checkpoints) | ||
| self._checkpoint_queue.put(queued_op) |
Contributor
There was a problem hiding this comment.
When we call _checkpoint_queue.put here, the condition self._execution_completed.is_set() might have been changed by another thread since previously checked.
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.
Issue #, if available:
#43
#565
Description of changes:
Standardizes how the SDK handles a missing/empty
CheckpointTokenfrom the Durable Functions API, and makes the checkpoint loop treat an absent response token as a first-class terminal signal. Previously the token was defaulted to an empty string and could be forwarded tocheckpoint_durable_execution, where boto3 rejects a zero-length value with aParamValidationError— crashing the background checkpoint thread.Background -
The service omits
CheckpointTokenfrom a checkpoint response in exactly one case: the terminal checkpoint that ends the execution (anEXECUTIONop with actionSUCCEED/FAIL). Every non-terminal checkpoint — including empty/no-op ones — returns a fresh token, and the invocation event always carries a seed token. So an absent token legitimately means "the execution is over"; anywhere else it is an invalid response, and an empty token must never be sent back.CheckpointError→ re-driveNonetoken about to be sent (e.g. malformed seed)CheckpointError/GetExecutionStateError; no boto crashparallel/mapearly completion (min_successful, failure tolerance) with branches still runningEvery token anomaly resolves to a retryable error that re-drives with a fresh token; the one legitimate absent token (execution completion) is handled silently, and an empty token is never transmitted to the service.
Testing - Added unit tests
NOTE: Intentionally diverges from the JS/Java SDKs; they should be updated to match (guard empty-token sends, fail on non-terminal null).
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.