GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||
GeezerVison is showing github.com — GH-65046: Fix docs about logging in `asyncio` by kumaraditya303 · Pull Request #97559 · python/cpython Conversation
|
|
|
||
|
|
||
| Network logging can block the event loop, it is recommended to use | ||
| a separate thread for handling logs or use non blocking io. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think it should be spelled non-blocking I/O, but the bigger issue is that it’s not immediately clear what one should use: after all, we are in the async I/O docs! Is there a section in the os module or another part of the stdlib that explains how to do non-asyncio non-blocking I/O?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
One nit, I don't think a comma is quite right here. I'll apply my suggestion and merge your PR.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks @kumaraditya303 for the PR, and @gvanrossum for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry @kumaraditya303 and @gvanrossum, I had trouble checking out the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-97581 is a backport of this pull request to the 3.10 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Explain that logging should not use network I/O. (cherry picked from commit d68c37c) Co-authored-by: Kumar Aditya <[email protected]>
|
No reaction to my remark about the vagueness of the new recommendation? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I apologize, I was in "get things merged" mode and missed that. That said, I doubt we have something more specific than "use threads or write to disk" -- and while writing to disk is technically not perfect, it's generally considered good enough for asyncio (we've been told that there are async APIs for writing to disk on some platforms, and IIRC there are 3rd party packages that wrap them, but the benefits are at best marginal, and the code isn't portable. Also, I think the warning is about configuring a logger that uses network I/O rather than about how user code should do their own logging. The point is that asyncio itself sometimes calls the logging module and the user should avoid messing that up by accidentally configuring a network-using logger. User code can just use the run_in_executor API to do the logging from a thread, but we don't want to do that for asyncio's own logging. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @kumaraditya303 for the PR, and @gvanrossum for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-97582 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Explain that logging should not use network I/O. (cherry picked from commit d68c37c) Co-authored-by: Kumar Aditya <[email protected]>
Explain that logging should not use network I/O. (cherry picked from commit d68c37c) Co-authored-by: Kumar Aditya <[email protected]>
Explain that logging should not use network I/O. (cherry picked from commit d68c37c) Co-authored-by: Kumar Aditya <[email protected]>
Explain that logging should not use network I/O. (cherry picked from commit d68c37c) Co-authored-by: Kumar Aditya <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
asyncio docs should call out that network logging is a no-no
There was an error while loading. Please reload this page.