Skip to content

Commit 97688cc

Browse files
authored
Unfinished handlers: add rule to warning message; test CAN, dynamic, and late-registered handlers (#612)
1 parent 73a1673 commit 97688cc

File tree

2 files changed

+184
-89
lines changed

2 files changed

+184
-89
lines changed

temporalio/worker/_workflow_instance.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -2778,7 +2778,7 @@ def _make_unfinished_update_handler_message(
27782778
handler_executions: List[HandlerExecution],
27792779
) -> str:
27802780
message = """
2781-
Workflow finished while update handlers are still running. This may have interrupted work that the
2781+
[TMPRL1102] Workflow finished while update handlers are still running. This may have interrupted work that the
27822782
update handler was doing, and the client that sent the update will receive a 'workflow execution
27832783
already completed' RPCError instead of the update result. You can wait for all update and signal
27842784
handlers to complete by using `await workflow.wait_condition(lambda:
@@ -2797,12 +2797,12 @@ def _make_unfinished_signal_handler_message(
27972797
handler_executions: List[HandlerExecution],
27982798
) -> str:
27992799
message = """
2800-
Workflow finished while signal handlers are still running. This may have interrupted work that the
2800+
[TMPRL1102] Workflow finished while signal handlers are still running. This may have interrupted work that the
28012801
signal handler was doing. You can wait for all update and signal handlers to complete by using
28022802
`await workflow.wait_condition(lambda: workflow.all_handlers_finished())`. Alternatively, if both
28032803
you and the clients sending the signal are okay with interrupting running handlers when the workflow
2804-
finishes, and causing clients to receive errors, then you can disable this warning via the signal
2805-
handler decorator: `@workflow.signal(unfinished_policy=workflow.HandlerUnfinishedPolicy.ABANDON)`.
2804+
finishes, then you can disable this warning via the signal handler decorator:
2805+
`@workflow.signal(unfinished_policy=workflow.HandlerUnfinishedPolicy.ABANDON)`.
28062806
""".replace("\n", " ").strip()
28072807
names = collections.Counter(ex.name for ex in handler_executions)
28082808
return (

0 commit comments

Comments
 (0)