Named the thread pool for gremlin server sessions. CTR
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/aa447eb0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/aa447eb0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/aa447eb0 Branch: refs/heads/TINKERPOP-1308 Commit: aa447eb0390625d561e018315d8719c666ad2d31 Parents: 3feb752 Author: Stephen Mallette <sp...@genoprime.com> Authored: Mon May 23 08:14:24 2016 -0400 Committer: Stephen Mallette <sp...@genoprime.com> Committed: Mon May 23 08:14:24 2016 -0400 ---------------------------------------------------------------------- CHANGELOG.asciidoc | 1 + .../apache/tinkerpop/gremlin/server/op/session/Session.java | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/aa447eb0/CHANGELOG.asciidoc ---------------------------------------------------------------------- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 1e33187..5bf3ada 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/incubator-tinkerpop/master/docs/ TinkerPop 3.1.3 (NOT OFFICIALLY RELEASED YET) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +* Named the thread pool used by Gremlin Server sessions: "gremlin-server-session-$n". * Fixed a bug in `BulkSet.equals()` which made itself apparent when using `store()` and `aggregate()` with labeled `cap()`. * Ensured that all asserts of vertex and edge counts were being applied properly in the test suite. * Fixed bug in `gremlin-driver` where certain channel-level errors would not allow the driver to reconnect. http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/aa447eb0/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/Session.java ---------------------------------------------------------------------- diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/Session.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/Session.java index 01e7bbd..0ed2041 100644 --- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/Session.java +++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/Session.java @@ -23,6 +23,7 @@ import org.apache.tinkerpop.gremlin.server.Context; import org.apache.tinkerpop.gremlin.server.GraphManager; import org.apache.tinkerpop.gremlin.server.Settings; import org.apache.tinkerpop.gremlin.server.util.LifeCycleHook; +import org.apache.tinkerpop.gremlin.server.util.ThreadFactoryUtil; import org.apache.tinkerpop.gremlin.structure.Graph; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -35,6 +36,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; @@ -59,11 +61,13 @@ public class Session { */ private final GremlinExecutor gremlinExecutor; + private final ThreadFactory threadFactoryWorker = ThreadFactoryUtil.create("session-%d"); + /** * By binding the session to run ScriptEngine evaluations in a specific thread, each request will respect * the ThreadLocal nature of Graph implementations. */ - private final ExecutorService executor = Executors.newSingleThreadExecutor(); + private final ExecutorService executor = Executors.newSingleThreadExecutor(threadFactoryWorker); private final ConcurrentHashMap<String, Session> sessions;