-
Notifications
You must be signed in to change notification settings - Fork 331
os.read/write waits until file descriptor is ready. #975
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
os.read/write waits until file descriptor is ready. #975
Conversation
Thanks for this patch.
Yes please |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #975 +/- ##
=====================================
Coverage 56% 56%
=====================================
Files 89 89
Lines 9783 9791 +8
Branches 1824 1826 +2
=====================================
+ Hits 5488 5498 +10
+ Misses 3925 3921 -4
- Partials 370 372 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Ok, I made the same change with According to the manual (for select, poll, epoll):
If someone calls |
I just re-enqueued all jobs as some jobs failed during the previous run. No logs were available so I've no clue. I want to be sure than nothing is broken. |
Ok, it was just a flaky CI, lets move on |
@ethan-vanderheijden thanks for your investigations and for your work. Good job! |
@4383 Thanks for the quick review! Sorry to bug you, but when is the next release of Eventlet scheduled? |
@ethan-vanderheijden I'll generate a new version early next week. I need to do an inventory of the latest changes first. |
@ethan-vanderheijden I'm preparing the next release, you can follow its progress there => #979 |
@ethan-vanderheijden eventlet 0.37.0 is out! https://pypi.org/project/eventlet/0.37.0/ |
Fixes #973
Fixes #634
Currently, calling
os.read(fd, size)
will attempt to read the file descriptor immediately. If there is no data to be read, the thread will block until data is available, causing the program to hang. With this pull request,os.read
will wait until the file descriptor is ready to read before attempting a read. It will not wait if the file descriptor is a regular file (according to select/poll, regular files are always ready to read).My fear is that
os.write
has the same bug:eventlet/eventlet/green/os.py
Lines 57 to 68 in 06ec828
It's not common for a write call to block, but it can happen, and if it does happen, the entire program will hang. Do you want me to investigate and fix this as well?