Skip to content

Warn on unawaited workflow futures with failures - #542

Open
sachinsharma3191 wants to merge 2 commits into
temporalio:mainfrom
sachinsharma3191:fix/185-warn-unawaited-futures
Open

Warn on unawaited workflow futures with failures#542
sachinsharma3191 wants to merge 2 commits into
temporalio:mainfrom
sachinsharma3191:fix/185-warn-unawaited-futures

Conversation

@sachinsharma3191

Copy link
Copy Markdown

Summary

When a workflow completes, emit a [TMPRL1103] warning if any futures finished with failures that were never awaited via wait or wait_no_raise. This mirrors the existing [TMPRL1102] warning for unfinished handlers.

Changes

  • Future: Track @awaited flag, set on wait/wait_no_raise; register with workflow instance when block completes with a failure
  • WorkflowInstance: Track futures with failures via @futures_with_failures; warn at workflow completion listing unawaited failure details
  • Context: Delegate track_future_with_failure to the instance

Tests (5 scenarios)

  • Single unawaited failed future emits [TMPRL1103] warning with error class and message
  • Multiple unawaited failed futures listed in a single 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

Fixes #185

Re-raised from #525 with comprehensive test coverage.

sachinsharma 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Warn on unawaited workflow futures with failures

1 participant