Skip to content

Conversation

sahilds1
Copy link
Contributor

@sahilds1 sahilds1 commented May 19, 2025

@python-cla-bot
Copy link

python-cla-bot bot commented May 19, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app
Copy link

bedevere-app bot commented May 19, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@picnixz
Copy link
Member

picnixz commented May 19, 2025

Thanks for the PR, but we should add a NEWS entry as well as a .. versionchanged:: next in the rst docs of TCPServer.

@picnixz picnixz changed the title gh-80184: Set 0 as the default queue size for TCPServe gh-80184: Set 0 as the default queue size for TCPServer May 19, 2025
@gpshead
Copy link
Member

gpshead commented May 19, 2025

Okay, i this change looks right for what was described in the issue. BUT i've done a little more research to double check the implications. we may not want to use 0 even though that felt right. apparently some platforms treat that as actual 0, effectively disabling connections. posix doesn't seem to require 0 to mean "default". ugh.

In particular Linux - https://bugzilla.kernel.org/show_bug.cgi?id=119141

a better alternative effectively similar to what the intent of 0 was is probably something like:

getattr(socket, "SOMAXCONN", 5) to use socket.SOMAXCONN if defined otherwise our old non-zero default.

@sahilds1 sahilds1 changed the title gh-80184: Set 0 as the default queue size for TCPServer gh-80184: Set getattr(socket, "SOMAXCONN", 5) as the default queue size for TCPServer May 19, 2025
@github-project-automation github-project-automation bot moved this from Todo to In Progress in Sprint 2024 May 19, 2025
@gpshead gpshead removed this from Sprint 2024 May 19, 2025
@gpshead gpshead added the needs backport to 3.14 bugs and security fixes label May 19, 2025
@gpshead gpshead removed the needs backport to 3.14 bugs and security fixes label May 19, 2025
@gpshead gpshead enabled auto-merge (squash) May 19, 2025 19:04
@gpshead gpshead merged commit 92f85ff into python:main May 19, 2025
47 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Sprint 2024 May 19, 2025
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
…eue size for TCPServer (pythonGH-134249)

socketserver.TCPServer default queue size becomes SOMAXCONN instead of 5 when possible.
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
…eue size for TCPServer (pythonGH-134249)

socketserver.TCPServer default queue size becomes SOMAXCONN instead of 5 when possible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants