Warn on unawaited workflow futures with failures - #542
Open
sachinsharma3191 wants to merge 2 commits into
Open
Conversation
added 2 commits
August 17, 2026 14:39
When a workflow completes, warn if any futures finished with failures that were never awaited via `wait` or `wait_no_raise`. This follows the same pattern as the existing "warn on unfinished handlers" feature. Changes: - Future: add `@awaited` flag, set when wait/wait_no_raise is called - Future: on block completion with failure, register with the workflow instance via track_future_with_failure - WorkflowInstance: track futures with failures, warn at completion with [TMPRL1103] message listing unawaited failures - Context: delegate track_future_with_failure to the instance Fixes temporalio#185
Five test scenarios covering the [TMPRL1103] warning: - Single unawaited failed future emits warning - Multiple unawaited failed futures listed in one warning - Failed future awaited via wait produces no warning - Failed future awaited via wait_no_raise produces no warning - Successful unawaited future produces no warning
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.
Summary
When a workflow completes, emit a
[TMPRL1103]warning if any futures finished with failures that were never awaited viawaitorwait_no_raise. This mirrors the existing[TMPRL1102]warning for unfinished handlers.Changes
Future: Track@awaitedflag, set onwait/wait_no_raise; register with workflow instance when block completes with a failureWorkflowInstance: Track futures with failures via@futures_with_failures; warn at workflow completion listing unawaited failure detailsContext: Delegatetrack_future_with_failureto the instanceTests (5 scenarios)
[TMPRL1103]warning with error class and messagewaitproduces no warningwait_no_raiseproduces no warningFixes #185
Re-raised from #525 with comprehensive test coverage.