Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
Bug 1265309 - Operations running longer than 24hours should not be
Browse files Browse the repository at this point in the history
considered as not started

Fix OperationManagerBean cleanup logic for IN_PROGRESS operations. The main
change is, that we'll timeout only operation histories that have been
started (this should mean agent received operation request) but did not
finish on time (either because they just timed out or agent died in the
middle of operation execution). Then we'll mark operations as not-started
only if they were not started within 24hours since they were created.
  • Loading branch information
Libor Zoubek committed Sep 22, 2015
1 parent 6e881b4 commit 1254b9f
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -1628,8 +1628,9 @@ public void checkForTimedOutOperations(Subject subject) {
// In either case, we can't wait forever, so we'll mark them as failed with an appropriate error message.
long duration = history.getDuration();
long createdTime = history.getCreatedTime();
boolean timedOut = (duration > timeout);
boolean neverStarted = ((System.currentTimeMillis() - createdTime) > (1000 * 60 * 60 * 24));
boolean started = history.getStartedTime() > 0;
boolean timedOut = (duration > timeout) && started;
boolean neverStarted = !started && ((System.currentTimeMillis() - createdTime) > (1000 * 60 * 60 * 24));
if (timedOut || neverStarted) {
if (timedOut) {
// the operation started, but the agent never told us how it finished prior to exceeding the timeout
Expand Down

0 comments on commit 1254b9f

Please sign in to comment.