Repository: sentry Updated Branches: refs/heads/master f48da48f4 -> 55d2721c8
Sentry processed stays alive after being killed (Alexander Kolbasov via Vamsee Yarlagadda) Project: http://git-wip-us.apache.org/repos/asf/sentry/repo Commit: http://git-wip-us.apache.org/repos/asf/sentry/commit/55d2721c Tree: http://git-wip-us.apache.org/repos/asf/sentry/tree/55d2721c Diff: http://git-wip-us.apache.org/repos/asf/sentry/diff/55d2721c Branch: refs/heads/master Commit: 55d2721c866f0820f03162d92b0a62768eea2d1b Parents: f48da48 Author: Vamsee Yarlagadda <[email protected]> Authored: Fri Dec 16 10:53:19 2016 -0800 Committer: Vamsee Yarlagadda <[email protected]> Committed: Fri Dec 16 10:53:19 2016 -0800 ---------------------------------------------------------------------- .../org/apache/sentry/service/thrift/SentryService.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sentry/blob/55d2721c/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/SentryService.java ---------------------------------------------------------------------- diff --git a/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/SentryService.java b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/SentryService.java index 5783649..a21f593 100644 --- a/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/SentryService.java +++ b/sentry-service/sentry-service-server/src/main/java/org/apache/sentry/service/thrift/SentryService.java @@ -29,7 +29,6 @@ import java.util.ArrayList; import java.util.EventListener; import java.util.List; import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; @@ -306,12 +305,6 @@ public class SentryService implements Callable { LOGGER.info("Stopped..."); } - // wait for the service thread to finish execution - public synchronized void waitOnFuture() throws ExecutionException, InterruptedException { - LOGGER.info("Waiting on future.get()"); - serviceStatus.get(); - } - private MultiException addMultiException(MultiException exception, Exception e) { MultiException newException = exception; if (newException == null) { @@ -389,13 +382,15 @@ public class SentryService implements Callable { server.stop(); } catch (Throwable t) { LOGGER.error("Error stopping SentryService", t); + System.exit(1); } } }); // Let's wait on the service to stop try { - server.waitOnFuture(); + // Wait for the service thread to finish + server.serviceStatus.get(); } finally { server.serviceExecutor.shutdown(); }
