You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Connection Receive Timeout Configuration Hint Implementation (#279)
- Removed conversion of connection/timeout errors to NotALeader in BoltResult.php and BoltMessage.php; original exceptions are rethrown after invalidating the connection.
- Updated Session.isConnectionError() to check for BoltConnectException and removed NotALeader from it.
- Replaced catch (Throwable) with catch (BoltConnectException) in BoltConnection.close() and discardUnconsumedResults().
- Added a BoltConnectException handler in the testkit backend AbstractRunner that wraps connection/timeout errors in Neo4jException when building DriverErrorResponse.
// Graceful cleanup: GOODBYE/DISCARD may fail if connection already broken.
320
+
// Only catch network/connection failures - if connection is broken we can't send anyway.
321
+
// Other exceptions (Neo4jException, TypeError, etc.) should propagate.
318
322
try {
319
323
if ($this->isOpen()) {
320
324
if ($this->isStreaming()) {
@@ -326,10 +330,29 @@ public function close(): void
326
330
327
331
unset($this->boltProtocol); // has to be set to null as the sockets don't recover nicely contrary to what the underlying code might lead you to believe;
328
332
}
329
-
} catch (Throwable) {
333
+
} catch (BoltConnectException$e) {
334
+
$this->logger?->log(LogLevel::WARNING, 'Failed to close connection gracefully', [
335
+
'exception' => $e->getMessage(),
336
+
]);
330
337
}
331
338
}
332
339
340
+
/**
341
+
* Invalidates the connection without sending GOODBYE message.
342
+
*
343
+
* This method closes the Bolt protocol and socket connection WITHOUT
344
+
* sending a GOODBYE message, which is essential when handling timeout
345
+
* exceptions or when the connection is already broken. Sending GOODBYE
346
+
* on a broken connection can interfere with the server's expected
0 commit comments