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

Fix failed actions rescheduling #7630

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package com.redhat.rhn.taskomatic.task;

import com.redhat.rhn.GlobalInstanceHolder;
import com.redhat.rhn.common.hibernate.HibernateFactory;
import com.redhat.rhn.common.localization.LocalizationService;
import com.redhat.rhn.domain.action.Action;
import com.redhat.rhn.domain.action.ActionFactory;
Expand Down Expand Up @@ -121,7 +122,16 @@ public void execute(JobExecutionContext context) {
// COMMITted in the database. Wait for some minutes checking if it appears
int waitedTime = 0;
while (countQueuedServerActions(action) == 0 && waitedTime < ACTION_DATABASE_GRACE_TIME) {
if (action != null) {
HibernateFactory.getSession().flush();
HibernateFactory.getSession().evict(action);
}

action = ActionFactory.lookupById(actionId);

if (log.isDebugEnabled()) {
log.debug("Number of Queued Server Actions for {}: {}", actionId, countQueuedServerActions(action));
}
try {
Thread.sleep(ACTION_DATABASE_POLL_TIME);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix failed actions rescheduling (bsc#1214121)
Loading