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

Canceling a job can give wrong error message for related project sync #12822

Closed
4 of 9 tasks
AlanCoding opened this issue Sep 2, 2022 · 1 comment
Closed
4 of 9 tasks

Comments

@AlanCoding
Copy link
Member

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that AWX is open source software provided for free and that I might not receive a timely response.

Bug Summary

The propagation of the cancellation signals is not working 100% as intended.

If you launch a job on a cluster that needs to run a project sync in advance to sync the source tree, and you cancel the job in the right time window, the project update will give an error status with the message:

Task was canceled due to receiving a shutdown signal.

We don't want this, we want a plain "canceled" status instead (or in the absence of that, an appropriate message).

AWX version

devel

Select the relevant components

  • UI
  • API
  • Docs
  • Collection
  • CLI
  • Other

Installation method

docker development environment

Modifications

no

Ansible version

N/A

Operating system

N/A

Web browser

Chrome

Steps to reproduce

Launch a job on a cluster, so that it's likely that it will trigger a project sync before-hand to update the source tree on the node it runs on.

Quickly cancel the job.

Expected results

Job will get canceled status.

Actual results

Job gets this status

Screenshot from 2022-09-02 14-53-13

This is because the project update error followed through the fail chain. Click on the project link in that page:

Screenshot from 2022-09-02 14-53-31

So that's the bug there.

Additional information

This was triggered indirectly via a workflow as well.

>>> job = Job.objects.get(pk=4635)
>>> job.cancel_flag
True
>>> job.project_update
<ProjectUpdate: 2022-09-02 18:39:18.450958+00:00-4636-failed>
>>> job.project_update.cancel_flag
False

Is the data determined from the scenario given above. The bug is that the project update should probably have had the cancel_flag flipped.

this is probably fallout from #12435

@AlanCoding
Copy link
Member Author

I was wrong, and it turns out this bug only happened when running with the branch #11745

I've pushed a fix, and will close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant