Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket::read() can get stuck reading 0 bytes in a loop #41

Open
arnaud-lb opened this issue Mar 25, 2015 · 4 comments
Open

Socket::read() can get stuck reading 0 bytes in a loop #41

arnaud-lb opened this issue Mar 25, 2015 · 4 comments

Comments

@arnaud-lb
Copy link

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.

@arnaud-lb
Copy link
Author

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.

arnaud-lb added a commit to arnaud-lb/php-cassandra that referenced this issue Mar 25, 2015
@gonzaloserrano
Copy link

I think this fix fixes somewhat #36 due to avoiding the infinite loop reported.

@shen2
Copy link
Member

shen2 commented Apr 2, 2015

It seems your Cassandra version is 2.0.x.
php-cassandra supports Cassandra 2.1 or later.

@locked
Copy link

locked commented Apr 28, 2015

We have this issue too, for example if we restart a cassandra node while php was connected. We use cassandra 2.1.

arnaud-lb added a commit to arnaud-lb/php-cassandra that referenced this issue May 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants