Repository navigation
fix(python): measure Unix socket paths in filesystem bytes - #3007
Merged
inureyes merged 2 commits intoNov 14, 2026
Merged
Conversation
The early check on the managed server's Unix socket path compared `len(path)`, a character count, with the 100-byte limit. A path with non-ASCII characters could exceed the limit and still pass, leaving the failure to the child's bind; the error message also printed the character count as bytes. Measure `len(os.fsencode(path))` and report that length. The limit itself is unchanged.
Closed
2 tasks done
Member
|
Thanks for catching this. Reviewed against #3006: the length check now counts I merged current |
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.
Summary
The Python client's early check on the Unix socket path length counted characters where the limit is in bytes, so a non-ASCII path over 100 bytes was accepted and left to fail at bind time. The check now measures
len(os.fsencode(path))and reports that number.Related issues
Closes #3006.
Type of change
fix— bug fixCause
The Unix-socket branch of
ManagedServer.__init__(python/src/mlxcel/_server.py) comparedlen(path)with_MAX_SOCKET_PATH. A path of 35 Hangul characters under/tmpis 63 characters and 133 bytes: it passed the check, and a bind to it fails withAF_UNIX path too long.Change
len(os.fsencode(path)), and the error message prints it. The 100-byte limit itself is unchanged.python/tests/test_lifecycle.py:test_unicode_socket_path_rejected_before_start(101 and 133 bytes, each throughManagedServer,LLMandAsyncLLM;start()is patched to fail the test if it is reached) andtest_socket_path_at_byte_limit_serves_requests(an ASCII and a Hangul path of exactly 100 bytes, each serving one request over the socket through the suite's fake server).Before / after
Linux aarch64, Python 3.12.3, paths in a temporary directory.
mainAF_UNIX path too longMlxcelServerError: Unix socket path is too long (133 > 100 bytes)-m "not e2e"), openai 3.49.0 / httpx 0.28.1Test plan
Run on this PR's source (one commit on
955335a38, treee78a8bba8f5e).python -m pytest -m "not e2e"inpython/: 59 passed, 2 deselected, with the declared lower bounds and with current releasesmain: 6 failed, 2 passedruff check python,ruff format --check python,mypy python/src: passNotes for reviewers
Checklist
docs/: not needed// Used by: ...comments: not applicable (Python).envfiles committed