Repository: incubator-sentry Updated Branches: refs/heads/master 23134c631 -> 47dec01df
SENTRY-276: SentryService tests are currently timing out (Jarek Jarcec Cecho via Sravya Tirukkovalur) Project: http://git-wip-us.apache.org/repos/asf/incubator-sentry/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-sentry/commit/47dec01d Tree: http://git-wip-us.apache.org/repos/asf/incubator-sentry/tree/47dec01d Diff: http://git-wip-us.apache.org/repos/asf/incubator-sentry/diff/47dec01d Branch: refs/heads/master Commit: 47dec01df2b57db165e49f03e2002023c5a2a104 Parents: 23134c6 Author: Sravya Tirukkovalur <[email protected]> Authored: Sun Jun 8 12:36:31 2014 -0700 Committer: Sravya Tirukkovalur <[email protected]> Committed: Sun Jun 8 12:38:57 2014 -0700 ---------------------------------------------------------------------- .../apache/sentry/service/thrift/SentryService.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/47dec01d/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryService.java ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryService.java b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryService.java index e4111fb..f9928df 100644 --- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryService.java +++ b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryService.java @@ -82,6 +82,7 @@ public class SentryService implements Callable { private final String[] principalParts; private final String keytab; private final ExecutorService serviceExecutor; + private Future future; private TServer thriftServer; private Status status; @@ -241,12 +242,7 @@ public class SentryService implements Callable { } LOGGER.info("Attempting to start..."); status = Status.STARTED; - Future future = serviceExecutor.submit(this); - try{ - future.get(); - }finally{ - serviceExecutor.shutdown(); - } + future = serviceExecutor.submit(this); } public synchronized void stop() { @@ -330,6 +326,14 @@ public class SentryService implements Callable { } } }); + + // Let's wait on the service to stop + try { + LOGGER.info("Waiting on future.get()"); + server.future.get(); + } finally { + server.serviceExecutor.shutdown(); + } } }
