-
Notifications
You must be signed in to change notification settings - Fork 844
TINKERPOP-3217 Add server option to close Session automatically. #3284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 3.7-dev
Are you sure you want to change the base?
Conversation
...-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/SessionOpProcessor.java
Show resolved
Hide resolved
...er/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinSessionReuseTxIntegrateTest.java
Outdated
Show resolved
Hide resolved
...er/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinSessionReuseTxIntegrateTest.java
Outdated
Show resolved
Hide resolved
| if (destroySessionPostGraphOp) { | ||
| // Destroy the session after a successful rollback due to error. Placed here rather than | ||
| // in a finally block since we don't want to end the session if no commit/rollback succeeded. | ||
| session.manualKill(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is in a catch block that is catching all error types, is it possible for session.manualKill to be called twice if the previous call in the try block threw an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't happen, but even if it does, theres explicit handling in that method for that situation so it's safe to call it more than once.
...er/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinSessionReuseTxIntegrateTest.java
Outdated
Show resolved
Hide resolved
| /** | ||
| * Integration tests for gremlin-driver and bytecode sessions. | ||
| * | ||
| * NOTE: this is effectively a copy of GremlinSessionTxIntegrateTest but the expectation is that the gremlin-driver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to actually verify the connection is reused or the connection state such that it can be reused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are server side metrics and/or logs that can be asserted against when a session is created/destroyed. This is a test that should be added but needs to wait on #3258
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
Outdated
Show resolved
Hide resolved
...er/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinSessionReuseTxIntegrateTest.java
Outdated
Show resolved
Hide resolved
...er/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinSessionReuseTxIntegrateTest.java
Outdated
Show resolved
Hide resolved
The added destroySessionPostGraphOp setting enables re-using the same underlying connection for a different subsequent Session. This should increase performance for cases where many short-lived Transactions are sent to the server.
0d65b6f to
7f7d9b8
Compare
|
VOTE +1 |
1 similar comment
|
VOTE +1 |
|
Thank you, @kenhuuu, nice feature. Will port to our version too. |
The added destroySessionPostGraphOp setting enables re-using the same underlying connection for a different subsequent Session. This should increase performance for cases where many short-lived Transactions are sent to the server.
https://issues.apache.org/jira/browse/TINKERPOP-3217
VOTE +1