Skip to content

bpo-34323: Enhance IocpProactor.close() log#11555

Merged
vstinner merged 2 commits intopython:masterfrom
vstinner:proactor_close_log
Jan 15, 2019
Merged

bpo-34323: Enhance IocpProactor.close() log#11555
vstinner merged 2 commits intopython:masterfrom
vstinner:proactor_close_log

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Jan 14, 2019

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

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.
@vstinner
Copy link
Member Author

I tested manually with repro.py attached with https://bugs.python.org/issue34323: the log is gone with this PR.

logger.debug('taking long time to close proactor')
if next_msg <= time.monotonic():
logger.debug('IocpProactor.close(): '
'loop is still running since %.1f sec',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd phrase it differently: "loop is running after closing for %.1f seconds"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@vstinner vstinner merged commit b1e4573 into python:master Jan 15, 2019
@miss-islington
Copy link
Contributor

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@vstinner vstinner deleted the proactor_close_log branch January 15, 2019 10:48
@miss-islington
Copy link
Contributor

Sorry, @vstinner, I could not cleanly backport this to 3.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker b1e45739d832e1e402a563c6727defda92e193b7 3.7

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants