Use plain old exception if security init fails

When security initialization fails during startup today we throw an
Error. This triggers the uncaught exception handler immediately killing
the node. While the node is going to die either way, we should not be
triggering the killer and in general we should avoid using Throwables
that extend Error.

Relates elastic/x-pack-elasticsearch#2035

Original commit: elastic/x-pack-elasticsearch@546f7f9002
This commit is contained in:
Jason Tedor 2017-07-21 00:26:22 +09:00 committed by GitHub
parent eb5631b981
commit 5ecbbbd46d
1 changed files with 2 additions and 2 deletions

View File

@ -281,8 +281,8 @@ public class XPackPlugin extends Plugin implements ScriptPlugin, ActionPlugin, I
try {
components.addAll(security.createComponents(internalClient, threadPool, clusterService, resourceWatcherService,
extensionsService.getExtensions()));
} catch (Exception e) {
throw new Error("security initialization failed", e);
} catch (final Exception e) {
throw new IllegalStateException("security initialization failed", e);
}
components.addAll(monitoring.createComponents(internalClient, threadPool, clusterService, licenseService, sslService));