Skip to content

[fix] add missing request type in blend server#2894

Merged
ApostaC merged 1 commit intoLMCache:devfrom
deng451e:add_rq_type
Mar 28, 2026
Merged

[fix] add missing request type in blend server#2894
ApostaC merged 1 commit intoLMCache:devfrom
deng451e:add_rq_type

Conversation

@deng451e
Copy link
Copy Markdown
Collaborator

What this PR does / why we need it:

Special notes for your reviewers:

If applicable:

  • this PR contains user facing changes - docs added
  • this PR contains unit tests

Signed-off-by: deng451e <838677410@qq.com>
@deng451e deng451e requested review from ApostaC and sammshen March 27, 2026 23:36
Copy link
Copy Markdown
Contributor

@ApostaC ApostaC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ApostaC ApostaC enabled auto-merge (squash) March 27, 2026 23:37
@github-actions github-actions Bot added the full Run comprehensive tests on this PR label Mar 27, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a PING request handler and includes it in the thread pool configuration within the run_cache_server function. Feedback suggests refactoring the handler registration logic into a shared function to address code duplication between different server implementations, which would improve the project's long-term maintainability and architectural soundness.

server, RequestType.CB_RETRIEVE_PRE_COMPUTED_V2, engine.cb_retrieve_pre_computed
)
add_handler_helper(server, RequestType.CB_STORE_FINAL, engine.cb_store_final)
add_handler_helper(server, RequestType.PING, engine.ping)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

While adding the PING handler is correct, its manual addition points to a larger maintainability issue. The run_cache_server function is substantially duplicated between this file and lmcache/v1/multiprocess/server.py, leading to inconsistencies like this missing handler.

To improve the architecture and prevent future bugs, I recommend refactoring the common handler registration logic into a shared function. This function could be called by both run_cache_server implementations to ensure they stay synchronized.

References
  1. The style guide directs reviewers to focus on architectural soundness, modularity, and maintainability. The code duplication between run_cache_server implementations represents a maintainability risk and a potential source of future bugs, which is a 'poor architectural decision' according to the guide's severity calibration. (link)

Copy link
Copy Markdown
Contributor

@sammshen sammshen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ApostaC ApostaC merged commit 1934377 into LMCache:dev Mar 28, 2026
34 checks passed
jooho-XCENA pushed a commit to xcena-dev/LMCache that referenced this pull request Apr 2, 2026
add missing request type in blend server

Signed-off-by: deng451e <838677410@qq.com>
jooho-XCENA pushed a commit to xcena-dev/LMCache that referenced this pull request Apr 2, 2026
add missing request type in blend server

Signed-off-by: deng451e <838677410@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full Run comprehensive tests on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants