You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c8f334a
Browse filesBrowse the repository at this point in the historyBrowse files
[Fix#1749] Publish onWorkflowCancelled before cancelling pending futures (#1751)
* [Fix#1749] Publish onWorkflowCancelled before cancelling pending futures
Cancelling the futures registered through addCancelable (e.g. by a
listen task) completes the execution pipeline synchronously, which runs
cleanUp and clears the instance metadata. cancel()/cancelFuture() used
to do that before publishing the status change and onWorkflowCancelled,
so listeners could not find their per-instance metadata when the
cancelled event arrived.
internalCancel() now returns the futures to cancel, and they are
cancelled only after the cancelled status change and
onWorkflowCancelled have been published.
Signed-off-by: Eric Deandrea <eric@ericdeandrea.dev>
* [Fix#1749] Keep cancellation final and clean up after it is published
Address review feedback on the cancellation ordering:
- status(WorkflowStatus) now checks and sets the status under
statusLock and ignores changes once the instance is CANCELLED, so a
listen task receiving an event while the cancellation is being
published can no longer move the instance back to WAITING and let it
complete normally.
- The execution pipeline waits for the cancellation to be published
before running cleanUp, so instance metadata is still available to
onWorkflowCancelled listeners even when the pipeline ends on its own
(an event completes the listen task, or a wait elapses) while an
asynchronous status change listener is still pending.
Adds regressions that hold the CANCELLED status change pending and
deliver a late event or let the pipeline finish in the meantime.
Signed-off-by: Eric Deandrea <eric@ericdeandrea.dev>
* [Fix#1749] Fail terminal transitions of a cancelled instance
status(WorkflowStatus) ignored every change once the instance was
CANCELLED by returning a normally completed future, but publishEvents()
and handleException() ignore that value. If the cancellation happened
while the last task's onTaskCompleted/onTaskFailed listener was still
pending, releasing it published onWorkflowCompleted (and completed
start() normally) or onWorkflowFailed for a cancelled instance.
A rejected COMPLETED or FAULTED transition now fails with a
CancellationException, so the pipeline ends as cancelled without
publishing completion or failure events. Late non-terminal changes
(e.g. WAITING from a listen task) are still ignored.
Signed-off-by: Eric Deandrea <eric@ericdeandrea.dev>
* [Fix#1749] Alternative approach
Signed-off-by: Francisco Javier Tirado Sarti <ftirados@ibm.com>
---------
Signed-off-by: Eric Deandrea <eric@ericdeandrea.dev>
Signed-off-by: Francisco Javier Tirado Sarti <ftirados@ibm.com>
Co-authored-by: Francisco Javier Tirado Sarti <ftirados@ibm.com>
0 commit comments