neo4j-php-client icon indicating copy to clipboard operation
neo4j-php-client copied to clipboard

Automatic reconnect

Open tomswinkels opened this issue 1 year ago • 2 comments

Sometimes we have long-running jobs and then we get some errors.

fwrite(): Send of 8 bytes failed with errno=32 Broken pipe

Maybe it is better that the client can detect when the connection is broken and do a reconnect.

#2 /code/vendor/stefanak-michal/bolt/src/connection/StreamSocket.php(76): fwrite()
#3 /code/vendor/stefanak-michal/bolt/src/protocol/AProtocol.php(70): Bolt\connection\StreamSocket->write()
#4 /code/vendor/stefanak-michal/bolt/src/protocol/v3/RunMessage.php(20): Bolt\protocol\AProtocol->write()
#5 /code/vendor/laudis/neo4j-php-client/src/Bolt/BoltConnection.php(225): Bolt\protocol\V4_4->run()
#6 /code/vendor/laudis/neo4j-php-client/src/Bolt/BoltUnmanagedTransaction.php(138): Laudis\Neo4j\Bolt\BoltConnection->run()
#7 /code/vendor/laudis/neo4j-php-client/src/Bolt/Session.php(70): Laudis\Neo4j\Bolt\BoltUnmanagedTransaction->runStatement()
#8 /code/vendor/laudis/neo4j-php-client/src/Client.php(110): Laudis\Neo4j\Bolt\Session->runStatements()
#9 /code/vendor/laudis/neo4j-php-client/src/Client.php(80): Laudis\Neo4j\Client->runStatements()
#10 /code/vendor/laudis/neo4j-php-client/src/Client.php(75): Laudis\Neo4j\Client->runStatement()
#11 /code/app/Models/Api5/Guide.php(48): Laudis\Neo4j\Client->run()

tomswinkels avatar Oct 11 '24 12:10 tomswinkels

Hey @tomswinkels. Sorry for the late response. I'd like some more information about what caused this issue. Are you running a single long running query or multiple smaller queries?

exaby73 avatar Oct 16 '24 06:10 exaby73

Hey @exaby73 no problem!

This issue has nothing to do with the runtime of a query.

It's a long-running job that do more than only execute some queries.

When we do before every query again a client connect than the problem will be solved, but we think that it's better that the client check if the connection is active or not.

tomswinkels avatar Oct 16 '24 08:10 tomswinkels