-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix RuntimeError in _sendfile_cb #3370
Conversation
Could you go further and rewrite the code by using asyncio code is overcomplicated a little to update filepos properly, aiohttp can skip this logic. But you can borrow the cancellation callback and its registration. |
I feel little uncomfortable to do such refactoring since I won't be able to reproduce the issue. |
Codecov Report
@@ Coverage Diff @@
## master #3370 +/- ##
==========================================
- Coverage 97.97% 97.93% -0.04%
==========================================
Files 44 44
Lines 8482 8482
Branches 1378 1378
==========================================
- Hits 8310 8307 -3
- Misses 73 75 +2
- Partials 99 100 +1
Continue to review full report at Codecov.
|
Superseded by #3383 |
What do these changes do?
Under some circumstances, a Runtime Error
RuntimeError: File descriptor 36 is used by transport <ReadUnixTransport closed=False reading=True 0x7f9c51da9d48>
will be raise.This change try to fix it by check if task has been canceled before remove stream writer.
I have never met this issue personally, so I won't be able to write a case to reproduce issue. However this patch has been published in home-assistant/core#12832 (comment) and got positive responses from users who had this issue.
Are there changes in behavior for the user?
Related issue number
fixes #1893
Checklist
CONTRIBUTORS.txt
CHANGES
folder<issue_id>.<type>
for example (588.bugfix)issue_id
change it to the pr id after creating the pr.feature
: Signifying a new feature..bugfix
: Signifying a bug fix..doc
: Signifying a documentation improvement..removal
: Signifying a deprecation or removal of public API..misc
: A ticket has been closed, but it is not of interest to users.