bpo-34323: Enhance IocpProactor.close() log#11555
Merged
vstinner merged 2 commits intopython:masterfrom Jan 15, 2019
vstinner:proactor_close_log
Merged
bpo-34323: Enhance IocpProactor.close() log#11555vstinner merged 2 commits intopython:masterfrom vstinner:proactor_close_log
vstinner merged 2 commits intopython:masterfrom
vstinner:proactor_close_log
Conversation
IocpProactor.close() now uses time to decide when to log: wait 1 second before the first log, then log every second. Log also the number of seconds since close() was called.
Member
Author
|
I tested manually with repro.py attached with https://bugs.python.org/issue34323: the log is gone with this PR. |
1st1
reviewed
Jan 14, 2019
Lib/asyncio/windows_events.py
Outdated
| logger.debug('taking long time to close proactor') | ||
| if next_msg <= time.monotonic(): | ||
| logger.debug('IocpProactor.close(): ' | ||
| 'loop is still running since %.1f sec', |
Member
There was a problem hiding this comment.
I'd phrase it differently: "loop is running after closing for %.1f seconds"
Member
Author
There was a problem hiding this comment.
Done. I chose to keep 'IocpProactor.close(): ' because it's the relationship between ProactorEventLoop and IocpProactor is non-obvious (usually, IocpProactor is hidden and quiet).
Contributor
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7. |
Contributor
|
Sorry, @vstinner, I could not cleanly backport this to |
vstinner
added a commit
that referenced
this pull request
Jan 15, 2019
* IocpProactor: prevent modification if closed (GH-11494) * _wait_for_handle(), _register() and _unregister() methods of IocpProactor now raise an exception if closed * Add "closed" to IocpProactor.__repr__() * Simplify IocpProactor.close() (cherry picked from commit 9b07681) * bpo-34323: Enhance IocpProactor.close() log (GH-11555) IocpProactor.close() now uses time to decide when to log: wait 1 second before the first log, then log every second. Log also the number of seconds since close() was called. (cherry picked from commit b1e4573) * bpo-34323: Enhance IocpProactor.close() log again (GH-11563) Add repr(self) to the log to display the number of pending overlapped in the log. (cherry picked from commit b91140f)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
IocpProactor.close() now uses time to decide when to log: wait 1
second before the first log, then log every second. Log also the
number of seconds since close() is running.
https://bugs.python.org/issue34323