Watcher - catch uncaught exception. (#47680) (#47695)

If a thread pool rejection exception happens, an alternative code
path is chosen to write history and delete the trigger. If an exception
happens during deletion of the trigger an exception may be thrown and not
caught.

This commit catches the exception and provides a meaning error message.

fixes #47008
This commit is contained in:
Jake Landis 2019-10-07 15:45:45 -05:00 committed by GitHub
parent a49a1b6994
commit 74876811c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -436,7 +436,14 @@ public class ExecutionService {
"Error storing watch history record for watch [{}] after thread pool rejection",
triggeredWatch.id()), exc);
}
deleteTrigger(triggeredWatch.id());
try {
deleteTrigger(triggeredWatch.id());
} catch (Exception exc) {
logger.error((Supplier<?>) () ->
new ParameterizedMessage(
"Error deleting entry from .triggered_watches for watch [{}] after thread pool rejection",
triggeredWatch.id()), exc);
}
}));
}
}