Skip to content

Commit

Permalink
JENKINS-14288: thinBackup doesn't put back the current shutdown flag …
Browse files Browse the repository at this point in the history
…after backing up

git-svn-id: https://svn.jenkins-ci.org/trunk/hudson/plugins/thinBackup@40678 71c3de6d-444a-0410-be80-ed276b4c234a
  • Loading branch information
tofuatjava committed Jul 25, 2012
1 parent 11996d4 commit e125d99
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Expand Up @@ -71,6 +71,8 @@ protected void execute(final TaskListener arg0) {

protected void backupNow(final BackupType type) {
final Hudson hudson = Hudson.getInstance();
final boolean inQuietModeBeforeBackup = hudson.isQuietingDown();

String backupPath = null;
try {
backupPath = plugin.getExpandedBackupPath();
Expand All @@ -93,7 +95,10 @@ protected void backupNow(final BackupType type) {
backupPath);
LOGGER.log(Level.SEVERE, msg, e);
} finally {
hudson.doCancelQuietDown();
if (!inQuietModeBeforeBackup)
hudson.doCancelQuietDown();
else
LOGGER.info("Backup process finsihed, but still in quiet mode as before. The quiet mode needs to be cancled manually, because it is not sure who is putting jenkins/hudson into quiet mode.");
}
}

Expand Down
Expand Up @@ -116,7 +116,7 @@ public static void waitUntilIdleAndSwitchToQuietMode(int timeout, TimeUnit unit)
}

if (!hudson.isQuietingDown() && starttime + unit.toMillis(timeout) < System.currentTimeMillis()) {
LOGGER.info("Timeout reached! Force quiet mode for jenkins now and wait unilt all executors are idle.");
LOGGER.info("Force quiet mode for jenkins now and wait unilt all executors are idle.");
hudson.doQuietDown();
}
} while (running);
Expand Down

0 comments on commit e125d99

Please sign in to comment.