classification
Title: http.client.HTTPConnection doesn't work without TCP_NODELAY
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: lukasz.langa, miss-islington, rtobar, rtobar2
Priority: normal Keywords: patch

Created on 2021-09-30 08:06 by rtobar2, last changed 2021-10-06 18:30 by lukasz.langa. This issue is now closed.

Files
File name Uploaded Description Edit
http-client.patch rtobar2, 2021-09-30 08:06
Pull Requests
URL Status Linked Edit
PR 28646 merged rtobar, 2021-09-30 08:21
PR 28770 merged miss-islington, 2021-10-06 17:49
PR 28771 merged miss-islington, 2021-10-06 17:50
Messages (5)
msg402937 - (view) Author: Rodrigo Tobar (rtobar2) * Date: 2021-09-30 08:06
I'm working on trying to run python under SerenityOS.

At the moment, SerenityOS doesn't implement the TCP_NODELAY socket option. This makes the HTTPConnection.connect() method raise an OSError for an operation that is otherwise optional. Additionally, the connection object can be left in an intermediate state: the underlying socket is always created, but depending on what method was invoked (either connect() directly or a higher-level one such as putrequest()) the connection object can be in IDLE or REQ_STARTED state.

I have a patch that works (attached), and I'll be working on submitting a PR now.

Usage of TCP_NODELAY was introduced in 3.5 (#23302), so even though I've been testing against 3.10rc2 for the time being I'm sure it will affect all versions in between.
msg403328 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-10-06 17:49
New changeset 0571b934f5f9198c3461a7b631d7073ac0a5676f by rtobar in branch 'main':
bpo-45328: Avoid failure in OSs without TCP_NODELAY support (GH-28646)
https://github.com/python/cpython/commit/0571b934f5f9198c3461a7b631d7073ac0a5676f
msg403329 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-10-06 18:29
New changeset 4c35a2aa80d7f55573d83651883d8733fac01e31 by Miss Islington (bot) in branch '3.10':
bpo-45328: Avoid failure in OSs without TCP_NODELAY support (GH-28646) (GH-28771)
https://github.com/python/cpython/commit/4c35a2aa80d7f55573d83651883d8733fac01e31
msg403330 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-10-06 18:29
New changeset 92018a08240308c5beef9ccc712bef5c2e582926 by Miss Islington (bot) in branch '3.9':
bpo-45328: Avoid failure in OSs without TCP_NODELAY support (GH-28646) (GH-28770)
https://github.com/python/cpython/commit/92018a08240308c5beef9ccc712bef5c2e582926
msg403331 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2021-10-06 18:30
Thanks, rtobar! ✨ 🍰 ✨
History
Date User Action Args
2021-10-06 18:30:23lukasz.langasetstatus: open -> closed
resolution: fixed
messages: + msg403331

stage: patch review -> resolved
2021-10-06 18:29:45lukasz.langasetmessages: + msg403330
2021-10-06 18:29:33lukasz.langasetmessages: + msg403329
2021-10-06 17:50:24miss-islingtonsetpull_requests: + pull_request27108
2021-10-06 17:49:55miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request27107
2021-10-06 17:49:48lukasz.langasetnosy: + lukasz.langa
messages: + msg403328
2021-10-06 17:18:37lukasz.langasetversions: + Python 3.9, Python 3.11
2021-09-30 08:21:23rtobarsetnosy: + rtobar

pull_requests: + pull_request27014
stage: patch review
2021-09-30 08:06:56rtobar2create