[issue21447] Intermittent asyncio.open_connection / futures.InvalidStateError

2014-07-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset d7e4efd5e279 by Victor Stinner in branch '3.4': Closes #21886, #21447: Fix a race condition in asyncio when setting the result http://hg.python.org/cpython/rev/d7e4efd5e279 New changeset 50c995bdc00a by Victor Stinner in branch 'default': (Merge

[issue21447] Intermittent asyncio.open_connection / futures.InvalidStateError

2014-06-30 Thread STINNER Victor
STINNER Victor added the comment: This issue contains two sub-issues: - race condition in_write_to_self() = already fixed - race condition with scheduled call to future.set_result(), InvalidStateError = I just opened the issue #21886 to discuss it @Ryder: If you are able to reproduce the

[issue21447] Intermittent asyncio.open_connection / futures.InvalidStateError

2014-06-19 Thread STINNER Victor
STINNER Victor added the comment: I'm unable to reproduce the issue with Python 3.5 (development version). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21447 ___

[issue21447] Intermittent asyncio.open_connection / futures.InvalidStateError

2014-06-06 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- components: +Asyncio ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21447 ___ ___

[issue21447] Intermittent asyncio.open_connection / futures.InvalidStateError

2014-05-07 Thread Andrew Svetlov
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- nosy: +asvetlov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21447 ___ ___

[issue21447] Intermittent asyncio.open_connection / futures.InvalidStateError

2014-05-06 Thread Ryder Lewis
New submission from Ryder Lewis: Intermittently, when using asyncio.wait_for() with asyncio.open_connection() to cancel the open_connection() task after a timeout period, an asyncio.futures.InvalidStateError is raised. It seems to be a race condition, if the open_connection() call succeeds

[issue21447] Intermittent asyncio.open_connection / futures.InvalidStateError

2014-05-06 Thread Ryder Lewis
Ryder Lewis added the comment: Another run raised a different exception, again running ./example.py http://www.yahoo.com/ Timed out with 0.05-second timeout HTTP header HTTP/1.0 301 Redirect HTTP header Date: Tue, 06 May 2014 18:58:53 GMT HTTP header Connection: close HTTP header Via: http/1.1

[issue21447] Intermittent asyncio.open_connection / futures.InvalidStateError

2014-05-06 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- nosy: +giampaolo.rodola, gvanrossum, haypo, pitrou, yselivanov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21447 ___

[issue21447] Intermittent asyncio.open_connection / futures.InvalidStateError

2014-05-06 Thread Guido van Rossum
Guido van Rossum added the comment: The second error is easy to explain and fix: it's a race condition between the OS thread used to call getaddrinfo() and the main thread. The method _write_to_self() in selector_events.py is hopelessly naive. It should probably become something like this:

[issue21447] Intermittent asyncio.open_connection / futures.InvalidStateError

2014-05-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset afe8c4bd3230 by Guido van Rossum in branch '3.4': asyncio: Fix the second half of issue #21447: race in _write_to_self(). http://hg.python.org/cpython/rev/afe8c4bd3230 New changeset c0538334f4df by Guido van Rossum in branch 'default': Merge

[issue21447] Intermittent asyncio.open_connection / futures.InvalidStateError

2014-05-06 Thread Guido van Rossum
Guido van Rossum added the comment: I'm a little closer to understanding the first (more common) traceback. I can repro it by running your demo program in a loop -- it may take a while but occasionally I do get the same InvalidStateError. This appears to be an example of the problem