Repository navigation
fix(sdk): report invalid suspension without pending operations - #785
Conversation
Preserve invalid-suspension retry classification in the handler-thread invocation finalizer and retain checkpoint continuation accounting. Verify invalid suspension and checkpoint token revocation finalize plugins once on the handler thread.
|
Validated commit
Both local runs include 522 SDK integration tests. The default-disabled cloud tests were run separately against real Lambda; all 105 executed cloud cases passed. Java 21 Lambda was tested using a JDK 25 client. All 110 deployed Lambda code hashes were verified against the tested build. CloudWatch scans covered 110 log groups / 929 records, with zero checkpoint-invariant or invalid-suspension errors. Two additional targeted checks of actual last-thread suspension also passed: revoked checkpoint tokens preserve No new regression was detected in these runs. All temporary AWS test resources were removed. |
zhongkechen
left a comment
There was a problem hiding this comment.
Approved the conflict resolution and regression validation at 1ae5075f85de10c4069268633d5dc9054fbd9900. Main's handler-thread lifecycle finalization and continuation accounting are preserved, along with the PR's retryable invalid-suspension behavior and revoked-token PENDING behavior. Full local Java 17/25 tests and cloud Java 17/21/25 integration tests passed; detailed results are recorded in the test-results comment.
|
Thank you for the thorough validation and review! I appreciate your time and feedback. |
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue Link, if available
Fixes #753
Related: #752, #370, #736, #706
Description
Problem
When a durable execution suspends without any pending operations,
ExecutionManager.preSuspendCheck()previously logged a warning but allowed the SDK to returnPENDING. The service subsequently rejected the output with:InvalidParameterValueException: Cannot return PENDING status with no pending operationsThis obscured the underlying cause and made it difficult to identify which operations suspended threads were waiting for.
LocalDurableTestRunneralso failed to surface this invalid state.Solution
IllegalDurableOperationExceptioncontaining the names and IDs of awaited operations.DurableExecutorinvocation boundary.InvocationStatus.RETRYINGwhen an invalid suspension is detected.PENDINGbehavior when the service withholds the checkpoint token.LocalDurableTestRunnersurface invalid suspension errors instead of silently returningPENDING.Demo/Screenshots
Not applicable. The change is covered by automated unit and integration tests.
Example error message:
Invalid suspension. No operation is pending. Suspended threads were waiting for: [branch-2 (id=0-1)]Testing
Unit Tests
Have unit tests been written for these changes?
Yes.
DurableExecutionTest: Verifies retryable invalid-suspension exceptions, awaited-operation details, plugin notifications, and graceful handling of revoked checkpoint tokens.LocalDurableTestRunnerTest: Verifies that the local test runner surfaces invalid suspension errors.Integration Tests
Have integration tests been written for these changes?
Yes.
ParallelIntegrationTest: Reproduces awaiting a skipped parallel branch and verifies that the retryable exception identifies the branch.PluginIntegrationTest: Preserves the suspension plugin test by providing a valid pending operation.Validation performed:
mvn test— passed across all Maven reactor modules, with zero failures or errors.git diff --check— passed with no whitespace errors.