You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2015/07/27 22:21:18 UTC
[1/2] incubator-tinkerpop git commit: Gremlin Server was not failing
nicely on port conflicts.
Repository: incubator-tinkerpop
Updated Branches:
refs/heads/master 0daa69bb9 -> 2f05fdcf5
Gremlin Server was not failing nicely on port conflicts.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/bcdd45be
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/bcdd45be
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/bcdd45be
Branch: refs/heads/master
Commit: bcdd45be55eeacbe9c8b5740c67e4de28ffc5a1c
Parents: 4cb2463
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jul 27 16:07:28 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 27 16:07:28 2015 -0400
----------------------------------------------------------------------
.../tinkerpop/gremlin/server/GremlinServer.java | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bcdd45be/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GremlinServer.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GremlinServer.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GremlinServer.java
index 2eff2be..3248ce0 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GremlinServer.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GremlinServer.java
@@ -117,7 +117,7 @@ public class GremlinServer {
}
serverStarted = new CompletableFuture<>();
- final CompletableFuture<ServerGremlinExecutor<EventLoopGroup>> serverReadyFuture = serverStarted = new CompletableFuture<>();
+ final CompletableFuture<ServerGremlinExecutor<EventLoopGroup>> serverReadyFuture = serverStarted;
try {
final ServerBootstrap b = new ServerBootstrap();
@@ -200,7 +200,12 @@ public class GremlinServer {
serverStopped = new CompletableFuture<>();
final CountDownLatch servicesLeftToShutdown = new CountDownLatch(3);
- ch.close().addListener(f -> servicesLeftToShutdown.countDown());
+ // it's possible that a channel might not be initialized in the first place if bind() fails because
+ // of port conflict. in that case, there's no need to wait for the channel to close.
+ if (null == ch)
+ servicesLeftToShutdown.countDown();
+ else
+ ch.close().addListener(f -> servicesLeftToShutdown.countDown());
logger.info("Shutting down thread pools.");
@@ -242,7 +247,7 @@ public class GremlinServer {
try {
servicesLeftToShutdown.await(30000, TimeUnit.MILLISECONDS);
} catch (InterruptedException ie) {
- logger.warn("Timeout waiting for bossy/worker thread pools to shutdown - continuing with shutdown process.");
+ logger.warn("Timeout waiting for boss/worker thread pools to shutdown - continuing with shutdown process.");
}
serverGremlinExecutor.getGraphManager().getGraphs().forEach((k, v) -> {
@@ -282,7 +287,12 @@ public class GremlinServer {
logger.info("Configuring Gremlin Server from {}", file);
settings.optionalMetrics().ifPresent(GremlinServer::configureMetrics);
- new GremlinServer(settings).start();
+ final GremlinServer server = new GremlinServer(settings);
+ server.start().exceptionally(t -> {
+ logger.error("Gremlin Server was unable to start and will now begin shutdown: {}", t.getMessage());
+ server.stop().join();
+ return null;
+ }).join();
}
public static String getHeader() {
[2/2] incubator-tinkerpop git commit: Merge remote-tracking branch
'origin/tp30'
Posted by sp...@apache.org.
Merge remote-tracking branch 'origin/tp30'
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/2f05fdcf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/2f05fdcf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/2f05fdcf
Branch: refs/heads/master
Commit: 2f05fdcf5a1860fcad7db8a05bcc05eadb90c3f3
Parents: 0daa69b bcdd45b
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Jul 27 16:21:04 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Jul 27 16:21:04 2015 -0400
----------------------------------------------------------------------
.../tinkerpop/gremlin/server/GremlinServer.java | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------