@@ -410,6 +410,9 @@ def activate(
410410 i = 0
411411 while i < len (self ._current_completion .successful .commands ):
412412 command = self ._current_completion .successful .commands [i ]
413+ print (
414+ f"command: { command } , { command .HasField ("cancel_workflow_execution" )} "
415+ )
413416 if not seen_completion :
414417 seen_completion = (
415418 command .HasField ("complete_workflow_execution" )
@@ -422,13 +425,18 @@ def activate(
422425 continue
423426 i += 1
424427
428+ print (
429+ f"seen_completion: { seen_completion } { self ._in_progress_updates } { self ._in_progress_signals } "
430+ )
431+
425432 if seen_completion :
426433 self ._warn_if_unfinished_handlers ()
427434 return self ._current_completion
428435
429436 def _apply (
430437 self , job : temporalio .bridge .proto .workflow_activation .WorkflowActivationJob
431438 ) -> None :
439+ print (f"applying job: { job } " )
432440 if job .HasField ("cancel_workflow" ):
433441 self ._apply_cancel_workflow (job .cancel_workflow )
434442 elif job .HasField ("do_update" ):
@@ -467,11 +475,15 @@ def _apply(
467475 self ._apply_update_random_seed (job .update_random_seed )
468476 else :
469477 raise RuntimeError (f"Unrecognized job: { job .WhichOneof ('variant' )} " )
478+ print (
479+ f"after applying job: { self ._in_progress_updates } { self ._in_progress_signals } "
480+ )
470481
471482 def _apply_cancel_workflow (
472483 self , job : temporalio .bridge .proto .workflow_activation .CancelWorkflow
473484 ) -> None :
474485 self ._cancel_requested = True
486+ print ("cancel_requested" )
475487 # TODO(cretz): Details or cancel message or whatever?
476488 if self ._primary_task :
477489 # The primary task may not have started yet and we want to give the
@@ -1627,6 +1639,7 @@ def warnable(handler_executions: Iterable[HandlerExecution]):
16271639
16281640 warnable_updates = warnable (self ._in_progress_updates .values ())
16291641 if warnable_updates :
1642+ print (">>>>>> Issuing update warning" )
16301643 warnings .warn (
16311644 temporalio .workflow .UnfinishedUpdateHandlersWarning (
16321645 _make_unfinished_update_handler_message (warnable_updates )
@@ -1635,6 +1648,7 @@ def warnable(handler_executions: Iterable[HandlerExecution]):
16351648
16361649 warnable_signals = warnable (self ._in_progress_signals .values ())
16371650 if warnable_signals :
1651+ print (">>>>>> Issuing signal warning" )
16381652 warnings .warn (
16391653 temporalio .workflow .UnfinishedSignalHandlersWarning (
16401654 _make_unfinished_signal_handler_message (warnable_signals )
@@ -1808,6 +1822,7 @@ async def _run_top_level_workflow_function(self, coro: Awaitable[None]) -> None:
18081822 err
18091823 ):
18101824 self ._add_command ().cancel_workflow_execution .SetInParent ()
1825+ print (">>>>>>>> added command" )
18111826 elif self ._is_workflow_failure_exception (err ):
18121827 # All other failure errors fail the workflow
18131828 self ._set_workflow_failure (err )
0 commit comments