Open nixocio opened 2 years ago
This is kind of a larger problem with AWX API. Our API request/response cycle happens in a transaction, so that is good. The bad news is that it really only protects the resource that we are directly acting upon. i.e. DELETE /api/v2/project_updates/130/
In our request handling, it's "safe" to do all kinds of update/delete to project update 130. It's not "safe" to do things to it's related objects. We should sprinkle in select_for_update()
to grab a lock on the related resources that we intend to modify, before modifying them. The disadvantage is that obtaining these locks could take time. If they take too much time, we might consider backgrounding the operating via a .delay()
call like we do with inventory delete.
This specific case may be more complicated than a simple sleect_for_update()
but it's what comes to mind when I see this sort of problem.
Please confirm the following
Summary
Bulk deletion of jobs leads to internal error
AWX version
devel
Installation method
docker for mac
Modifications
no
Ansible version
No response
Operating system
No response
Web browser
No response
Steps to reproduce
1 - Trigger a miscellaneous of several jobs, like, inventory source sync, workflow, and job templates. 2 - Select all of the jobs on the first page to be deleted. 3 - Delete them
Expected results
All jobs to be deleted.
Actual results
Additional information
It is seem like workflow job that trigger then job template to run was deleted first, but I was not able to conclude that was the reason of the internal server failure.