Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActC events aren't always correct for pipeline builds #18

Open
magnusbaeck opened this issue Jan 7, 2021 · 1 comment
Open

ActC events aren't always correct for pipeline builds #18

magnusbaeck opened this issue Jan 7, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@magnusbaeck
Copy link
Contributor

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.
@magnusbaeck magnusbaeck added the bug Something isn't working label Jan 7, 2021
@magnusbaeck
Copy link
Contributor Author

There's always Run#getQueueId if we're able to navigate to the Run that executes the PlaceholderTask (which should be possible).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant