server : add custom socket options to disable SO_REUSEPORT#21056
Merged
pwilkin merged 4 commits intoggml-org:masterfrom Mar 28, 2026
Merged
Conversation
Signed-off-by: Adrien Gallouët <angt@huggingface.co>
$ strace -e trace=setsockopt,bind build/bin/llama-server -lv 2 --reuse-port
setsockopt(3, SOL_TCP, TCP_NODELAY, [1], 4) = 0
setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(3, SOL_SOCKET, SO_REUSEPORT, [1], 4) = 0
bind(3, {sa_family=AF_INET, sin_port=htons(8080), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
$ strace -e trace=setsockopt,bind build/bin/llama-server -lv 2
setsockopt(3, SOL_TCP, TCP_NODELAY, [1], 4) = 0
setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(3, {sa_family=AF_INET, sin_port=htons(8080), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
Signed-off-by: Adrien Gallouët <angt@huggingface.co>
Member
Author
|
with without: |
Contributor
|
I'm going to test this to a custom C++ script too, because I keep getting silently screwed by an old process still running. Super useful for dev! |
Contributor
|
Remember to launch llama-gen-docs to update doc :) |
ServeurpersoCom
approved these changes
Mar 27, 2026
Signed-off-by: Adrien Gallouët <angt@huggingface.co>
ggerganov
approved these changes
Mar 27, 2026
ngxson
approved these changes
Mar 27, 2026
Member
Author
|
Damn windows 😅 |
Signed-off-by: Adrien Gallouët <angt@huggingface.co>
Green-Sky
approved these changes
Mar 27, 2026
Collaborator
Green-Sky
left a comment
There was a problem hiding this comment.
Why is this a thing again.
Member
Author
|
Last error is not related: |
taronaeo
approved these changes
Mar 27, 2026
Member
|
Seems to consistently fail on this test now: |
Contributor
|
Oops, either we add the option to the test script (backward compatibility) or we find the real cause: (a process that's remain?) |
Member
Author
|
Yes adding |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
cpp-httplib uses
SO_REUSEPORTby default, see #20963Additional information
yhirose/cpp-httplib#2409
yhirose/cpp-httplib#2411
Requirements