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

asyncio: sendfile tests ignore SO_SNDBUF on Windows #77864

Closed
vstinner opened this issue May 29, 2018 · 2 comments
Closed

asyncio: sendfile tests ignore SO_SNDBUF on Windows #77864

vstinner opened this issue May 29, 2018 · 2 comments
Labels
3.8 only security fixes OS-windows tests Tests in the Lib/test dir topic-asyncio type-feature A feature request or enhancement

Comments

@vstinner
Copy link
Member

BPO 33683
Nosy @pfmoore, @vstinner, @tjguk, @asvetlov, @zware, @1st1, @zooba

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-09-19.23:56:26.388>
created_at = <Date 2018-05-29.14:07:11.010>
labels = ['3.8', 'type-feature', 'tests', 'OS-windows', 'expert-asyncio']
title = 'asyncio: sendfile tests ignore SO_SNDBUF on Windows'
updated_at = <Date 2018-09-19.23:56:26.387>
user = 'https://github.com/vstinner'

bugs.python.org fields:

activity = <Date 2018-09-19.23:56:26.387>
actor = 'vstinner'
assignee = 'none'
closed = True
closed_date = <Date 2018-09-19.23:56:26.388>
closer = 'vstinner'
components = ['Tests', 'Windows', 'asyncio']
creation = <Date 2018-05-29.14:07:11.010>
creator = 'vstinner'
dependencies = []
files = []
hgrepos = []
issue_num = 33683
keywords = []
message_count = 2.0
messages = ['318031', '318034']
nosy_count = 7.0
nosy_names = ['paul.moore', 'vstinner', 'tim.golden', 'asvetlov', 'zach.ware', 'yselivanov', 'steve.dower']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue33683'
versions = ['Python 3.8']

@vstinner
Copy link
Member Author

Follow-up of bpo-33353: On my PR 7200, test_sendfile_close_peer_in_the_middle_of_receiving() failed on Windows (AppVeyor) :-(

For the SelectorEventLoop, it seems like sock.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 1024) doesn't work as intented: sock.send(<16384 bytes>) returns 16384, as the 1024 limit is not taken in account :-(

Same issue for the ProactorEventLoop...

I'm not sure if it's a bug in asyncio, a bug (limitation) of Windows which ignores SO_SNDBUF, or something else...

@vstinner vstinner added 3.8 only security fixes tests Tests in the Lib/test dir OS-windows topic-asyncio type-feature A feature request or enhancement labels May 29, 2018
@vstinner
Copy link
Member Author

The failure was:

FAIL: test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_events.ProactorEventLoopTests)
----------------------------------------------------------------------

Traceback (most recent call last):
  File "C:\projects\cpython\lib\test\test_asyncio\test_events.py", line 2506, in test_sendfile_close_peer_in_the_middle_of_receiving
    self.file.tell())
AssertionError: False is not true : 65536

--

In bpo-33353, I worked around the bug in my commit 9551f77 by using a buffer of 128 KiB instead of 64 KiB.

@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.8 only security fixes OS-windows tests Tests in the Lib/test dir topic-asyncio type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant