This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Fix callbacks race in asyncio.SelectorLoop.sock_connect
Type: behavior Stage: resolved
Components: asyncio Versions: Python 3.7, Python 3.6, Python 3.5
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: yselivanov Nosy List: berker.peksag, gvanrossum, koobs, python-dev, vstinner, yselivanov
Priority: normal Keywords: patch

Created on 2016-09-15 21:55 by yselivanov, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit
issue28176_skip_tests.diff berker.peksag, 2016-09-18 12:27 review
Pull Requests
URL Status Linked Edit
PR 552 closed dstufft, 2017-03-31 16:36
Messages (8)
msg276628 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2016-09-15 21:55
Proxy issue for
msg276629 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-15 21:58
New changeset 8550ab528a31 by Yury Selivanov in branch '3.5':
Issue #28176: Fix callbacks race in asyncio.SelectorLoop.sock_connect.

New changeset 3d8ba65a0054 by Yury Selivanov in branch '3.6':
Merge 3.5 (issue #28176)

New changeset 5024e2a82181 by Yury Selivanov in branch 'default':
Merge 3.6 (issue #28176)
msg276736 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-09-16 18:59
The timeout of 3 seconds seem to be too short for some buildbots like "AMD64 FreeBSD CURRENT Non-Debug 3.x".

test.test_asyncio.test_windows_utils (unittest.loader.ModuleSkipped) ... Exception in thread Thread-50:
Traceback (most recent call last):
  File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/", line 916, in _bootstrap_inner
  File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/test/test_asyncio/", line 1819, in run
    sock, addr = self.srv_sock.accept()
  File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/", line 205, in accept
    fd, addr = self._accept()
socket.timeout: timed out

test test_asyncio failed
skipped 'Windows only'

ERROR: test_sock_connect_sock_write_race (test.test_asyncio.test_selector_events.SelectorLoopFunctionalTests)
Traceback (most recent call last):
  File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/test/test_asyncio/", line 1868, in test_sock_connect_sock_write_race
  File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/asyncio/", line 457, in run_until_complete
    return future.result()
  File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/asyncio/", line 292, in result
    raise self._exception
  File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/asyncio/", line 239, in _step
    result = coro.send(None)
  File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/asyncio/", line 397, in wait_for
    raise futures.TimeoutError()
msg276782 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-09-17 11:15
Would increasing timeout to 10.0 be sufficient? Should we wrap the test with @support.reap_threads?
msg276854 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-17 22:06
New changeset 8417873f2eac by Berker Peksag in branch '3.5':
Issue #28176: Increase timeout for test_sock_connect_sock_write_race

New changeset b5a08d5db05b by Berker Peksag in branch '3.6':
Issue #28176: Merge from 3.5

New changeset eb306c20de20 by Berker Peksag in branch 'default':
Issue #28176: Merge from 3.6
msg276886 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-09-18 12:27
For some reason, some tests fail randomly on FreeBSD buildbots. See also issue27784. I'm planning to apply the attached patch.
msg277101 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-21 07:18
New changeset 06efc625578a by Victor Stinner in branch '3.5':
test_asynico: fix test_sock_connect_sock_write_race()
msg277550 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-09-27 21:23
test_sock_connect_sock_write_race failure is being discussed in issue 28283. Closing this again.
Date User Action Args
2022-04-11 14:58:36adminsetgithub: 72363
2017-03-31 16:36:28dstufftsetpull_requests: + pull_request1018
2016-09-27 21:23:11berker.peksagsetstatus: open -> closed
resolution: fixed
messages: + msg277550
2016-09-21 07:18:25python-devsetmessages: + msg277101
2016-09-18 12:27:13berker.peksagsetfiles: + issue28176_skip_tests.diff

nosy: + koobs
messages: + msg276886

keywords: + patch
2016-09-17 22:06:47python-devsetmessages: + msg276854
2016-09-17 11:15:31berker.peksagsetstatus: pending -> open
versions: + Python 3.5, Python 3.7
nosy: + berker.peksag

messages: + msg276782
2016-09-16 18:59:59vstinnersetstatus: closed -> pending

nosy: + vstinner
messages: + msg276736

resolution: fixed -> (no value)
2016-09-16 04:33:02berker.peksagsetstatus: open -> closed
2016-09-15 21:58:38python-devsetnosy: + python-dev
messages: + msg276629
2016-09-15 21:55:37yselivanovsetresolution: fixed
2016-09-15 21:55:29yselivanovcreate