Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix callbacks race in asyncio.SelectorLoop.sock_connect #72363

Closed
1st1 opened this issue Sep 15, 2016 · 8 comments
Closed

Fix callbacks race in asyncio.SelectorLoop.sock_connect #72363

1st1 opened this issue Sep 15, 2016 · 8 comments
Assignees
Labels
3.7 (EOL) end of life topic-asyncio type-bug An unexpected behavior, bug, or error

Comments

@1st1
Copy link
Member

1st1 commented Sep 15, 2016

BPO 28176
Nosy @gvanrossum, @vstinner, @berkerpeksag, @1st1, @koobs
PRs
  • [Do Not Merge] Convert Misc/NEWS so that it is managed by towncrier #552
  • Files
  • issue28176_skip_tests.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/1st1'
    closed_at = <Date 2016-09-27.21:23:11.694>
    created_at = <Date 2016-09-15.21:55:29.974>
    labels = ['type-bug', '3.7', 'expert-asyncio']
    title = 'Fix callbacks race in asyncio.SelectorLoop.sock_connect'
    updated_at = <Date 2017-03-31.16:36:28.781>
    user = 'https://github.com/1st1'

    bugs.python.org fields:

    activity = <Date 2017-03-31.16:36:28.781>
    actor = 'dstufft'
    assignee = 'yselivanov'
    closed = True
    closed_date = <Date 2016-09-27.21:23:11.694>
    closer = 'berker.peksag'
    components = ['asyncio']
    creation = <Date 2016-09-15.21:55:29.974>
    creator = 'yselivanov'
    dependencies = []
    files = ['44736']
    hgrepos = []
    issue_num = 28176
    keywords = ['patch']
    message_count = 8.0
    messages = ['276628', '276629', '276736', '276782', '276854', '276886', '277101', '277550']
    nosy_count = 6.0
    nosy_names = ['gvanrossum', 'vstinner', 'python-dev', 'berker.peksag', 'yselivanov', 'koobs']
    pr_nums = ['552']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue28176'
    versions = ['Python 3.5', 'Python 3.6', 'Python 3.7']

    @1st1
    Copy link
    Member Author

    1st1 commented Sep 15, 2016

    Proxy issue for python/asyncio#366

    @1st1 1st1 self-assigned this Sep 15, 2016
    @1st1 1st1 added topic-asyncio type-bug An unexpected behavior, bug, or error labels Sep 15, 2016
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 15, 2016

    New changeset 8550ab528a31 by Yury Selivanov in branch '3.5':
    Issue bpo-28176: Fix callbacks race in asyncio.SelectorLoop.sock_connect.
    https://hg.python.org/cpython/rev/8550ab528a31

    New changeset 3d8ba65a0054 by Yury Selivanov in branch '3.6':
    Merge 3.5 (issue bpo-28176)
    https://hg.python.org/cpython/rev/3d8ba65a0054

    New changeset 5024e2a82181 by Yury Selivanov in branch 'default':
    Merge 3.6 (issue bpo-28176)
    https://hg.python.org/cpython/rev/5024e2a82181

    @vstinner
    Copy link
    Member

    The timeout of 3 seconds seem to be too short for some buildbots like "AMD64 FreeBSD CURRENT Non-Debug 3.x".

    http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Non-Debug%203.x/builds/295/steps/test/logs/stdio

    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/threading.py", line 916, in _bootstrap_inner
        self.run()
      File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/test/test_asyncio/test_selector_events.py", line 1819, in run
        sock, addr = self.srv_sock.accept()
      File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/socket.py", 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/test_selector_events.py", line 1868, in test_sock_connect_sock_write_race
        timeout=TIMEOUT))
      File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/asyncio/base_events.py", line 457, in run_until_complete
        return future.result()
      File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/asyncio/futures.py", line 292, in result
        raise self._exception
      File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/asyncio/tasks.py", line 239, in _step
        result = coro.send(None)
      File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/asyncio/tasks.py", line 397, in wait_for
        raise futures.TimeoutError()
    concurrent.futures._base.TimeoutError

    @vstinner vstinner reopened this Sep 16, 2016
    @berkerpeksag
    Copy link
    Member

    Would increasing timeout to 10.0 be sufficient? Should we wrap the test with @support.reap_threads?

    @berkerpeksag berkerpeksag added the 3.7 (EOL) end of life label Sep 17, 2016
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 17, 2016

    New changeset 8417873f2eac by Berker Peksag in branch '3.5':
    Issue bpo-28176: Increase timeout for test_sock_connect_sock_write_race
    https://hg.python.org/cpython/rev/8417873f2eac

    New changeset b5a08d5db05b by Berker Peksag in branch '3.6':
    Issue bpo-28176: Merge from 3.5
    https://hg.python.org/cpython/rev/b5a08d5db05b

    New changeset eb306c20de20 by Berker Peksag in branch 'default':
    Issue bpo-28176: Merge from 3.6
    https://hg.python.org/cpython/rev/eb306c20de20

    @berkerpeksag
    Copy link
    Member

    For some reason, some tests fail randomly on FreeBSD buildbots. See also bpo-27784. I'm planning to apply the attached patch.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 21, 2016

    New changeset 06efc625578a by Victor Stinner in branch '3.5':
    test_asynico: fix test_sock_connect_sock_write_race()
    https://hg.python.org/cpython/rev/06efc625578a

    @berkerpeksag
    Copy link
    Member

    test_sock_connect_sock_write_race failure is being discussed in bpo-28283. Closing this again.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life topic-asyncio type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants