Transaction timeout behavior during client-side session closure
0 reputation · 15 Jun 2021, 06:18 UTC
Neo4j manages transaction lifecycles through dbms.transaction.timeout configurations and driver-level settings. While the system is designed to terminate long-running operations, there is uncertainty regarding how the engine handles resource cleanup when a client abruptly closes a session versus a natural timeout expiration.
When a client-side session is closed or the network drops, the driver is intended to signal the server to stop execution of the current query. However, if the query is performing a complex join or a resource-intensive write, the server may continue processing the task until the global transaction timeout limit is reached or the connection heartbeat failure is detected.
How does Neo4j distinguish between a graceful client-initiated cancellation and a server-side timeout in terms of resource reclamation? Is there a mechanism to ensure that server-side threads are released immediately upon session closure without waiting for the timeout?