[issue35599] asyncio windows_events.py IocpProactor bug

2019-01-15 Thread STINNER Victor


STINNER Victor  added the comment:

I confirm that it's a duplicate of bpo-34323 that I just fixed ;-)

--
nosy: +vstinner
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> False timeout log message on proactor close

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35599] asyncio windows_events.py IocpProactor bug

2018-12-29 Thread Jeff Robbins


Jeff Robbins  added the comment:

This issue is likely a duplicate of https://bugs.python.org/issue34323
which was reported in Python 3.5.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35599] asyncio windows_events.py IocpProactor bug

2018-12-27 Thread Jeff Robbins


New submission from Jeff Robbins :

The close() method of IocpProactor in windows_events.py has this code in its 
close() method:

while self._cache:
if not self._poll(1):
logger.debug('taking long time to close proactor')

The bug is that self._poll() has *no* return statements in it, and so returns 
None no matter what.  Which makes the "if not" part confusing, at best.  At 
worst, it might reflect a disconnect with the author's intent.

I added a bit more logging and re-ran my test:

while self._cache:
logger.debug('before self._poll(1)')
if not self._poll(1):
logger.debug('taking long time to close proactor')
logger.debug(f'{self._cache}')


logger output:

20:16:30.247 (D)   MainThread  asyncio: before self._poll(1)
20:16:30.248 (D)   MainThread  asyncio: taking long time to 
close proactor
20:16:30.249 (D)   MainThread  asyncio: {}


Obviously 1 millisecond isn't "taking a long time to close proactor".  Also of 
interest, the _cache is now empty.  

I think the intent of the author must have been to check if the call to 
._poll() cleared out any possible pending futures, or waited the full 1 second. 
 Since ._poll() doesn't return any value to differentiate if it waited the full 
wait period or not, the "if" is wrong, and, I think, the intent of the author 
isn't met by this code.

But, separate from speculating on "intent", the debug output of "taking a long 
time to close proactor" seems wrong, and the .close() code seems disassociated 
with the implementation of ._poll() in the same class IocpProactor in 
windows_events.py.

--
components: asyncio
messages: 332632
nosy: asvetlov, je...@livedata.com, yselivanov
priority: normal
severity: normal
status: open
title: asyncio windows_events.py IocpProactor bug
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com