Skip to content

Commit

Permalink
Logging stack traces for unexpected exceptions in cluster manager thr…
Browse files Browse the repository at this point in the history
…ead.
  • Loading branch information
mederly authored and dejavix committed Sep 14, 2016
1 parent 3bb0acd commit 3d9b7f1
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -140,23 +140,23 @@ public void run() {
checkClusterConfiguration(result); // if error, the scheduler will be stopped
nodeRegistrar.updateNodeObject(result); // however, we want to update repo even in that case
} catch (Throwable t) {
LoggingUtils.logException(LOGGER, "Unexpected exception while checking cluster configuration; continuing execution.", t);
LoggingUtils.logUnexpectedException(LOGGER, "Unexpected exception while checking cluster configuration; continuing execution.", t);
}

try {
checkWaitingTasks(result);
} catch (Throwable t) {
LoggingUtils.logException(LOGGER, "Unexpected exception while checking waiting tasks; continuing execution.", t);
LoggingUtils.logUnexpectedException(LOGGER, "Unexpected exception while checking waiting tasks; continuing execution.", t);
}

try {
checkStalledTasks(result);
} catch (Throwable t) {
LoggingUtils.logException(LOGGER, "Unexpected exception while checking stalled tasks; continuing execution.", t);
LoggingUtils.logUnexpectedException(LOGGER, "Unexpected exception while checking stalled tasks; continuing execution.", t);
}

} catch(Throwable t) {
LoggingUtils.logException(LOGGER, "Unexpected exception in ClusterManager thread; continuing execution.", t);
LoggingUtils.logUnexpectedException(LOGGER, "Unexpected exception in ClusterManager thread; continuing execution.", t);
}

LOGGER.trace("ClusterManager thread sleeping for " + delay + " msec");
Expand Down Expand Up @@ -187,7 +187,7 @@ public void stopClusterManagerThread(long waitTime, OperationResult parentResult
try {
clusterManagerThread.join(waitTime);
} catch (InterruptedException e) {
LoggingUtils.logException(LOGGER, "Waiting for ClusterManagerThread shutdown was interrupted", e);
LoggingUtils.logUnexpectedException(LOGGER, "Waiting for ClusterManagerThread shutdown was interrupted", e);
}
if (clusterManagerThread.isAlive()) {
result.recordWarning("ClusterManagerThread shutdown requested but after " + waitTime + " ms it is still running.");
Expand Down

0 comments on commit 3d9b7f1

Please sign in to comment.