Skip to content

Fix hang when using eventlet and ssl #485

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

Merged
merged 1 commit into from
Feb 24, 2016
Merged

Fix hang when using eventlet and ssl #485

merged 1 commit into from
Feb 24, 2016

Conversation

sigmunau
Copy link
Contributor

The eventlet read loop runs select before each recv call. This will
fail because recv() on an ssl socket might read more data than
requested from the underlying socket in order to have enough context
for decryption. These extra bytes would be returned by the next recv
on the ssl socket, but are not known to underlying socket so select
will hang.

It is my understanding that eventlet implements blocking IO by using
poll under the hood and yielding, so the select should not be
necessary at all

@datastax-bot
Copy link

Hi @sigmunau, thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes.

Sincerely,
DataStax Bot.

@datastax-bot
Copy link

Thank you @sigmunau for signing the Contribution License Agreement.

Cheers,
DataStax Bot.

@aholmberg
Copy link
Contributor

Thanks. Will take a look at this for 3.1.
https://datastax-oss.atlassian.net/browse/PYTHON-495

The eventlet read loop runs select before each recv call. This will
fail because recv() on an ssl socket might read more data than
requested from the underlying socket in order to have enough context
for decryption. These extra bytes would be returned by the next recv
on the ssl socket, but are not known to underlying socket so select
will hang.

It is my understanding that eventlet implements blocking IO by using
poll under the hood and yielding, so the select should not be
necessary at all
@sigmunau
Copy link
Contributor Author

Slightly revised the fix to solve issues with timeouts when socket is idle for some time

@aholmberg
Copy link
Contributor

@sigmunau what level of testing have you done with this? I'm finding the tests not working quite right when I run eventlet_nosetests. (disregard -- I found the issue in the tests) 603e87b

@aholmberg aholmberg merged commit 252b52c into datastax:master Feb 24, 2016
@aholmberg
Copy link
Contributor

Thanks for the contribution!

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

Successfully merging this pull request may close these issues.

3 participants