[ 
https://issues.apache.org/jira/browse/TINKERPOP-2832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17715159#comment-17715159
 ] 

Valentyn Kahamlyk commented on TINKERPOP-2832:
----------------------------------------------

Default session timeout is 8 hours, most Gremlin Server configurations also use 
this value.
However, when this time is configured with a much lower value, then the 
following sequence of events is possible:
1. Client starts new session on server
2. Client sets some variables or make some changes in transaction
3. Client looses connection
4. Server removes session as expired
5. Client reconnects and try to continue to work with opened session
6. Server creates new session with same ID

Resulting in an inconsistent state and possible data loss in the transaction.

Proposed solution for 3.5/3.6: after closing the session, have the server keep 
its id for some more time and do not allow creating a session with same ID, 
throw an error when such an attempt is made.

The longer term plan is to re-design the entire session logic as part of 
transaction implementation in TinkerGraph in 3.7 

> Nature of sessions and driver reconnect allow bytecode transactions to appear 
> to remain open
> --------------------------------------------------------------------------------------------
>
>                 Key: TINKERPOP-2832
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2832
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: driver, server
>    Affects Versions: 3.5.4
>            Reporter: Stephen Mallette
>            Priority: Critical
>
> The driver is design to reconnect if it loses its connection to the server. 
> For sessions a close can happen if there is a timeout on the session itself. 
> On the server the session is invalidated, but on the client side, it tries to 
> reconnect using the same session id. Unfortunately this reconnect creates a 
> scenario for bytecode transactions where it can appear as though you're 
> working the same transaction when you are not. 
> Test to demonstrate shown 
> [here|https://github.com/apache/tinkerpop/commit/4528ec33ab56e3c0526ad8b38494674c64754e54]
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to