Open arnaud-lb opened 9 years ago
socket_read()
uses recv()
, which is documented to return 0
if the peer has performed an orderly shutdown.
When recv() returns 0, PHP returns an empty string.
I think this fix fixes somewhat https://github.com/duoshuo/php-cassandra/issues/36 due to avoiding the infinite loop reported.
It seems your Cassandra version is 2.0.x. php-cassandra supports Cassandra 2.1 or later.
We have this issue too, for example if we restart a cassandra node while php was connected. We use cassandra 2.1.
I've seen multiple PHP processes getting stuck in a loop here when the cassandra node goes down.
Apparently,
socket_read()
returns an empty string when the other side has closed the connection.