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

Implement loop.sock_sendfile method #76591

Closed
asvetlov opened this issue Dec 22, 2017 · 7 comments
Closed

Implement loop.sock_sendfile method #76591

asvetlov opened this issue Dec 22, 2017 · 7 comments
Labels
3.7 (EOL) end of life stdlib Python modules in the Lib dir topic-asyncio

Comments

@asvetlov
Copy link
Contributor

BPO 32410
Nosy @giampaolo, @ned-deily, @asvetlov, @1st1
PRs
  • bpo-32410: Implement loop.sock_sendfile() #4976
  • bpo-32410: Make SendfileNotAvailableError public #5243
  • bpo-32410: Improve sock_sendfile tests #5294
  • bpo-32410: Avoid blocking on file IO in sendfile fallback code #7172
  • [3.7] bpo-32410: Avoid blocking on file IO in sendfile fallback code (GH-7172) #7182
  • 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 = None
    closed_at = <Date 2018-01-24.19:42:42.123>
    created_at = <Date 2017-12-22.13:07:13.056>
    labels = ['3.7', 'library', 'expert-asyncio']
    title = 'Implement loop.sock_sendfile method'
    updated_at = <Date 2018-05-29.01:42:47.417>
    user = 'https://github.com/asvetlov'

    bugs.python.org fields:

    activity = <Date 2018-05-29.01:42:47.417>
    actor = 'ned.deily'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-01-24.19:42:42.123>
    closer = 'asvetlov'
    components = ['Library (Lib)', 'asyncio']
    creation = <Date 2017-12-22.13:07:13.056>
    creator = 'asvetlov'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32410
    keywords = ['patch']
    message_count = 7.0
    messages = ['308932', '310098', '310279', '310521', '310624', '317936', '317973']
    nosy_count = 4.0
    nosy_names = ['giampaolo.rodola', 'ned.deily', 'asvetlov', 'yselivanov']
    pr_nums = ['4976', '5243', '5294', '7172', '7182']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue32410'
    versions = ['Python 3.7']

    @asvetlov
    Copy link
    Contributor Author

    The method should be low-level coroutine, implemented on loops with native sendfile support only (UnixEventLoop).

    The signature should be close to socket.sendfile() method

    Next step is implementing loop.sendfile(transport, ...) with fallback to sending by chunks if sendfile is not supported.

    @asvetlov asvetlov added 3.7 (EOL) end of life stdlib Python modules in the Lib dir topic-asyncio labels Dec 22, 2017
    @asvetlov
    Copy link
    Contributor Author

    New changeset 6b5a279 by Andrew Svetlov in branch 'master':
    bpo-32410: Implement loop.sock_sendfile() (bpo-4976)
    6b5a279

    @asvetlov
    Copy link
    Contributor Author

    New changeset 7464e87 by Andrew Svetlov in branch 'master':
    bpo-32410: Make SendfileNotAvailableError exception public (bpo-5243)
    7464e87

    @1st1
    Copy link
    Member

    1st1 commented Jan 23, 2018

    Andrew, test_cancel2 test fails 1 out of 10 times on my machine (log below). Could you please take a look?

    Also, can you rename sendfile tests to 'test_sock_sendfile_*'?

    {pydev} ~/d/p/cpython (master %) » ./python.exe -m test test_asyncio -v -m test_cancel2
    == CPython 3.7.0a4+ (heads/master:9d411c119f, Jan 23 2018, 15:12:10) [Clang 9.0.0 (clang-900.0.39.2)]
    == Darwin-17.3.0-x86_64-i386-64bit little-endian
    == cwd: /Users/yury/dev/pydev/cpython/build/test_python_65406
    == CPU count: 8
    == encodings: locale=UTF-8, FS=utf-8
    Run tests sequentially
    0:00:00 load avg: 1.80 [1/1] test_asyncio
    test_cancel2 (test.test_asyncio.test_unix_events.SelectorEventLoopUnixSockSendfileTests) ... ERROR

    ======================================================================
    ERROR: test_cancel2 (test.test_asyncio.test_unix_events.SelectorEventLoopUnixSockSendfileTests)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/Users/yury/dev/pydev/cpython/Lib/test/test_asyncio/test_unix_events.py", line 487, in cleanup
        proto.transport.close()
    AttributeError: 'NoneType' object has no attribute 'close'

    Ran 1 test in 0.010s

    FAILED (errors=1)
    Task was destroyed but it is pending!
    task: <Task pending coro=<BaseSelectorEventLoop._accept_connection2() done, defined at /Users/yury/dev/pydev/cpython/Lib/asyncio/selector_events.py:200> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x10731c2e8>()]>>
    test test_asyncio failed
    test_asyncio failed

    @1st1 1st1 reopened this Jan 23, 2018
    @asvetlov
    Copy link
    Contributor Author

    New changeset 0a5e71b by Andrew Svetlov in branch 'master':
    bpo-32410: Improve sock_sendfile tests (bpo-5294)
    0a5e71b

    @1st1
    Copy link
    Member

    1st1 commented May 28, 2018

    New changeset 7165754 by Yury Selivanov in branch 'master':
    bpo-32410: Avoid blocking on file IO in sendfile fallback code (GH-7172)
    7165754

    @ned-deily
    Copy link
    Member

    New changeset 420092e by Ned Deily (Miss Islington (bot)) in branch '3.7':
    bpo-32410: Avoid blocking on file IO in sendfile fallback code (GH-7172) (bpo-7182)
    420092e

    @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 stdlib Python modules in the Lib dir topic-asyncio
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants