Repository navigation
fix(mp/mq): isolate malformed server requests - #4934
Merged
maobaolong merged 5 commits intoNov 4, 2026
Merged
Conversation
0z5a
requested review from
ApostaC,
DongDongJu,
Oasis-Git,
deng451e,
hickeyma,
hlin99 and
sammshen
as code owners
September 4, 2026 00:14
0z5a
added a commit
to 0z5a/LMCache
that referenced
this pull request
Sep 23, 2026
Signed-off-by: 0z5a <[email protected]>
Signed-off-by: 0z5a <[email protected]>
0z5a
added a commit
to 0z5a/LMCache
that referenced
this pull request
Sep 24, 2026
Signed-off-by: 0z5a <[email protected]>
0z5a
force-pushed
the
fix/mp-mq-malformed-request-isolation
branch
from
September 24, 2026 06:40
8618ee8 to
15481ff
Compare
Signed-off-by: 0z5a <[email protected]> Signed-off-by: 0z5a <[email protected]>
Signed-off-by: 0z5a <[email protected]>
0z5a
force-pushed
the
fix/mp-mq-malformed-request-isolation
branch
from
September 24, 2026 07:09
15481ff to
565d287
Compare
1 of 2 tasks
maobaolong
approved these changes
Oct 14, 2026
maobaolong
left a comment
Collaborator
There was a problem hiding this comment.
@0z5a This is a good catch! LGTM.
dev (LMCache#5614) moved per-request handling out of _main_loop into _handle_request(). Keep dev's loop and move the malformed-frame-count guard into _handle_request(), which now logs and returns instead of asserting. submit_request() on dev now returns MessagingFuture | MessagingStream, so the regression test narrows the response like the other dev tests. Signed-off-by: 0z5a <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
maobaolong
enabled auto-merge (squash)
November 4, 2026 03:33
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.
Incremental review: Files changed against
dev.What this PR does / why we need it:
A malformed DEALER peer could terminate the shared MessageQueueServer polling thread before handler-level exception isolation ran:
Both cases left otherwise healthy clients timing out. This change validates the frame count and isolates request-type decoding failures, logs the malformed request, and continues polling.
The regression test sends both malformed header variants, waits deterministically until the server processes each one, and then verifies that a healthy NOOP request still succeeds and the worker thread remains alive.
Special notes for your reviewers:
Test-first reproduction against the previous implementation:
Validation:
uv run pytest -q tests/v1/multiprocess/test_mq.py tests/v1/multiprocess/test_futures.py->39 passed, 14 skipped, 134 warnings in 30.27sCUDA_VISIBLE_DEVICES=""): same suite ->39 passed, 14 skipped, 134 warnings in 47.78suvx ruff check lmcache/v1/multiprocess/mq.py tests/v1/multiprocess/test_mq.py-> passeduvx ruff format --check lmcache/v1/multiprocess/mq.py tests/v1/multiprocess/test_mq.py-> passedgit diff --check-> passedNo GPU benchmark is applicable; this is a MessageQueue control-plane correctness fix.
If applicable:
Final-head reproducible integration log
Validated from an isolated worktree at exact commit
f6e7a04ab6b03366f4fd0cff9d16b90bfb432c9con macOS arm64 / Python 3.12.13 with the locally built LMCache native extensions:The verbose raw pytest log contains 89 lines and has SHA-256
0aeb5d02e23c7c17d000b92e253407c856a0985e48b3916030630baeb60f979a. The command above is the reviewer-runnable reproduction entry point and exercises the same checked-in tests and candidate code. This is a CPU control-plane/integration change, so a GPU notebook would add an indirect wrapper without increasing coverage; GPU/benchmark PRs carry Run-All notebooks separately.