Skip to content

gh-80184: Set getattr(socket, "SOMAXCONN", 5) as the default queue size for TCPServer #134249

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

Merged
merged 7 commits into from
May 19, 2025

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.

@bedevere-app
Copy link

bedevere-app bot commented May 19, 2025

Most changes to Python 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
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

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant