Skip to content

fix: [AAP-24814] prevent request enqueuing when parent deleted#933

Merged
jshimkus-rh merged 10 commits intoansible:mainfrom
jshimkus-rh:aap-24814
Jun 13, 2024
Merged

fix: [AAP-24814] prevent request enqueuing when parent deleted#933
jshimkus-rh merged 10 commits intoansible:mainfrom
jshimkus-rh:aap-24814

Conversation

@jshimkus-rh
Copy link
Contributor

No description provided.

@jshimkus-rh jshimkus-rh requested a review from a team as a code owner June 10, 2024 17:37
@jshimkus-rh
Copy link
Contributor Author

Tests to come.

@Alex-Izquierdo
Copy link
Collaborator

Hi @jshimkus-rh What I noticed is that once the activation is deleted I saw in every loop of the monitor the message:

May 30 14:10:44 ip-10-0-2-14.ec2.internal automation-eda-controller-worker-1[4947]: 2024-05-30 14:10:44,224 aap_eda.tasks.orchestrator INFO     Dispatching request auto_start for activation 77
May 30 14:10:44 ip-10-0-2-14.ec2.internal automation-eda-controller-worker-1[4947]: 2024-05-30 14:10:44,225 aap_eda.tasks.orchestrator WARNING  activation 77 no longer exists, request auto_start can not be dispatched.

It seems that the problem is after run _queue_auto_start

I think there is a bug in this PR, because in _queue_auto_start we couldn't add the request if the activation was deleted, but later we removed that constraint (the activation is a foreign key, but the process_parent_id don't), so we put in the queue the request even if the activation doesn't exist.

I'm afraid that just cancelling the job could not be enough. What do you think about handling the issue in _queue_auto_start and check for the existence of the process_parent before add it to the queue?

@jshimkus-rh
Copy link
Contributor Author

It seems that the problem is after run _queue_auto_start

Right. And cancelling that before it gets a chance to run prevents the problem.
Certainly there's no need to let a job run just to have it fail.

Ultimately, as pointed out in that PR, it's the requests_queue push that's the culprit.

@jshimkus-rh jshimkus-rh changed the title fix: [AAP-24814] cancel auto-restart when deleting activation fix: [AAP-24814] prevent auto-start looping when activation deleted Jun 10, 2024
Alex-Izquierdo
Alex-Izquierdo previously approved these changes Jun 11, 2024
@jshimkus-rh jshimkus-rh changed the title fix: [AAP-24814] prevent auto-start looping when activation deleted fix: [AAP-24814] prevent request enqueuing when parent deleted Jun 11, 2024
Alex-Izquierdo
Alex-Izquierdo previously approved these changes Jun 11, 2024
@Alex-Izquierdo Alex-Izquierdo requested a review from a team June 12, 2024 12:42
@jshimkus-rh jshimkus-rh merged commit b3e7d45 into ansible:main Jun 13, 2024
@jshimkus-rh jshimkus-rh deleted the aap-24814 branch June 13, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants