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
When a pipeline build that hasn't started executing gets cancelled it seems we can end up in two situations:
Jenkins has figured out which pipeline steps to run and will call QueueListenerImpl.onLeft twice; once for the WorkflowJob (which is the one we're interested in and the one that corresponds to the ActT event we've sent) and once for the ExecutorStepExecution$PlaceholderTask. In the WorkflowJob case the Queue.LeftItem object's outcome attribute contains a WorkUnitContext object that describes the PlaceholderTask, but that also means isCancelled() returns false for WorkflowJob. That's arguably a bug. The onLeft call for the PlaceholderTask correctly returns true for isCancelled() but it's non-trivial to map that Queue.LeftItem to the WorkflowJob's Queue.LeftItem that we need to obtain the id of the ActT event.
Jenkins hasn't had time to figure out which pipeline steps to run before we get to QueueListenerImpl.onLeft, and the Queue.LeftItem object's outcome attribute is null. Then isCancelled() returns true and we're able to send a correct ActC event.
The text was updated successfully, but these errors were encountered:
When a pipeline build that hasn't started executing gets cancelled it seems we can end up in two situations:
The text was updated successfully, but these errors were encountered: