sdk-go icon indicating copy to clipboard operation
sdk-go copied to clipboard

Warn or error when update handlers dangle across CAN or workflow exit

Open drewhoskins-temporal opened this issue 1 year ago • 1 comments

We can recommend the await-all-handlers or drop-all-handlers methods. TBD whether error or warning.

drewhoskins-temporal avatar Jun 04 '24 04:06 drewhoskins-temporal

I've merged the first PR, for Python: https://github.com/temporalio/sdk-python/pull/556

The basic spec that that PR's proposing for other SDKs is

  • Workflow code can wait on a method named similarly to workflow.all_handlers_finished()

  • By default, the worker will emit workflow.UnfinishedUpdateHandlersWarning and workflow.UnfinishedSignalHandlersWarning if any handlers of those types are unfinished when the workflow completes (cancellation, failure, success). See PR for wording of message.

  • These warnings are controlled by a policy whose default value is workflow.HandlerUnfinishedPolicy.WARN_AND_ABANDON

  • Users can silence the warning on a per-handler basis by setting unfinished_policy to workflow.HandlerUnfinishedPolicy.ABANDON

  • Tests should verify the above for worker-side workflow exit via cancellation, failure, and success

dandavison avatar Jun 28 '24 12:06 dandavison