-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Limit SSL_ERROR_WANT_READ retries to 1 sec #957
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
Conversation
retry with 1ms delays to prevent CPU hoggin
@qt1, thanks for the pull request. Can I ask two questions before reviewing?
Thanks! |
Hi, I did see the SSL_ERROR_SYSCALL and also added the retry independently. The time limit and count limit are good practice to reduce risk. I am writing a small extension to an existing application and an application stuck situation - even if rare - would be unacceptable. I can run some more tests, maybe monitor the actual number of retries, and also look at the server side, and report here in a couple of days. Regards |
@qt1, thanks for the reply.
Yes, that would be very helpful. Thanks a lot! |
Looking at the server logs, it dose not look very good.. The retry (even with 1ms delay) seems to do cause multiple connection, sometimes with error indication and sometimes just double entry. The data is actually uploaded as needed but the communication seems wrong.
Regards |
Well, after running the app and the server for a few more days, it seems to be working. There are occasional "client closed connection while waiting for request" but otherwise it works. I think that for the moment this is as good as it gets. Not perfect - but works. I feel that the protection against getting stuck is important (application stuck means a user loosing work - not acceptable). So my recommendation is to merge the PR for now. Regards |
@qt1, thanks for the excellent research. I just merged it. Thanks for the fine contribution! |
retry with 1ms delays to prevent CPU hoggin
There is an unlimited loop in case open_ssl returns SSL_ERROR_WANT_READ or SSL_ERROR_SYSCALL
Currently the loop is unlimited and can potencially cause the main program to stuck.
Also, the retry loop can hog unlimited CPU.