-
Notifications
You must be signed in to change notification settings - Fork 180
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
Fix action executor to prevent blocking Taskomatic for actions that are already finished #7416
Fix action executor to prevent blocking Taskomatic for actions that are already finished #7416
Conversation
Suggested tests to cover this Pull Request |
java/code/src/com/redhat/rhn/taskomatic/task/MinionActionExecutor.java
Outdated
Show resolved
Hide resolved
|
||
private boolean allServerActionsFinished(Action action) { | ||
return action != null && | ||
!CollectionUtils.isEmpty(action.getServerActions()) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this mean an action with no server actions does never count as having all server actions finished?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess it makes sense given the countQueuedServerActions(action) == 0
check already. I'm not exactly sure in what scenario an action would be saved and scheduled without server actions and then in a separate transaction server actions get added. It sounds like all kinds of problematic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really know if it is possible to have an action here that has no server actions reaching this point of the code. I agree that it would be very problematic.
I just know that it is not what I'm searching for, maybe it just never happens. My point is that if the action has server actions and they are all finished I should not block the Taskomatic thread waiting for actions to appear as QUEUED in the database.
If this hypothetical case (having action without server actions) eventually happens I just want to keep the behavior exactly like it is today, and that is the reason to check if the list is not empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you OK with that? I can remove this check or even rename the method if you think it is necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think its fine for now. The code suggests that there are cases where the action has no server actions initially. The whole action hand off between tomcat and taskomatic seems just very fragile so i think this needs some proper way in the future.
8a3c426
to
6568212
Compare
…re already finished
6568212
to
7fa35c7
Compare
What does this PR change?
The server actions can be manually cancelled via Web UI, so this PR changes the code to check if all server actions have already finished before putting the Taskomatic thread to sleep. It should prevent blocking the Taskomatic for actions that will never appear in the database.
GUI diff
No difference.
Documentation
No documentation needed: only internal and user invisible changes
DONE
Test coverage
No tests: already covered
DONE
Links
Port of https://github.com/SUSE/spacewalk/pull/22295
Changelogs
Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository
If you don't need a changelog check, please mark this checkbox:
If you uncheck the checkbox after the PR is created, you will need to re-run
changelog_test
(see below)Re-run a test
If you need to re-run a test, please mark the related checkbox, it will be unchecked automatically once it has re-run: