Skip to content

[MP] Health Check#2645

Merged
ApostaC merged 5 commits intoLMCache:devfrom
Oasis-Git:health
Feb 28, 2026
Merged

[MP] Health Check#2645
ApostaC merged 5 commits intoLMCache:devfrom
Oasis-Git:health

Conversation

@Oasis-Git
Copy link
Copy Markdown
Member

What this PR does / why we need it:
Refactor the http server and provide health check via http server
Special notes for your reviewers:

If applicable:

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

Signed-off-by: Oasis-Git <ayw.sirius19@gmail.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on enhancing the robustness and maintainability of the LMCache system by introducing a dedicated health check mechanism for the HTTP server. It refactors the HTTP server to remove outdated or unused KV cache management functionalities, simplifying its codebase and clarifying its purpose. The core memory checking logic has been updated to provide explicit success/failure indicators, which are now leveraged by the new health check endpoint.

Highlights

  • Health Check Endpoint: A new /api/healthcheck endpoint has been introduced to the HTTP server, providing a mechanism to verify the operational status of the cache engine and its memory consistency.
  • HTTP Server Refactoring: The HTTP server has undergone significant refactoring, removing all KV cache-related endpoints and their associated helper functions, streamlining the server's responsibilities.
  • Memory Check Return Type: The memcheck methods across L1Manager, MemoryManager, and StorageManager have been updated to return a boolean value, indicating the success or failure of the memory consistency check.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • lmcache/v1/distributed/l1_manager.py
    • Updated memcheck method signature to return a boolean.
    • Modified memcheck to capture and return the result of the underlying memory manager's check.
  • lmcache/v1/distributed/memory_manager.py
    • Changed memcheck method to return the boolean result from the allocator's memory check.
  • lmcache/v1/distributed/storage_manager.py
    • Updated memcheck method signature to return a boolean.
    • Expanded docstring for memcheck to specify the boolean return value.
    • Modified memcheck to return the boolean result from the L1 manager's memory check.
  • lmcache/v1/multiprocess/http_server.py
    • Removed numerous imports related to KV cache operations, serialization, and request models.
    • Deleted all KV cache management endpoints, including those for retrieving hashes, KV cache data, metadata, and setting/downloading KV cache entries.
    • Removed helper functions for tensor serialization, hash encoding, and key searching.
    • Added a new /api/healthcheck endpoint that verifies engine initialization and performs a memory check via storage_manager.memcheck().
    • Simplified the root (/) endpoint to return a basic status.
    • Removed redundant comments and descriptions from the run_http_server function.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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 introduces a health check endpoint /api/healthcheck to the HTTP server and refactors it by removing several endpoints related to direct KV cache manipulation. To support the health check, the memcheck methods across l1_manager, memory_manager, and storage_manager have been updated to return a boolean status. The changes are logical and well-contained. I have one suggestion to add a missing type hint for better code clarity and maintainability.

@@ -160,4 +160,4 @@ def close(self) -> None:

# Debugging APIs
def memcheck(self):
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.

medium

This method is missing a return type hint. For consistency with the other memcheck methods updated in this PR and to adhere to best practices for type safety, please add the -> bool return type hint. The MemoryAllocatorInterface that self._allocator implements already specifies this return type.

Suggested change
def memcheck(self):
def memcheck(self) -> bool:

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!

Signed-off-by: Oasis-Git <ayw.sirius19@gmail.com>
Copy link
Copy Markdown
Contributor

@royyhuang royyhuang left a comment

Choose a reason for hiding this comment

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

LGTM.

@Oasis-Git Oasis-Git added the full Run comprehensive tests on this PR label Feb 27, 2026
Signed-off-by: Oasis-Git <ayw.sirius19@gmail.com>
Signed-off-by: Oasis-Git <ayw.sirius19@gmail.com>
@ApostaC
Copy link
Copy Markdown
Contributor

ApostaC commented Feb 28, 2026

Force merging this because it won't impact mp comprehensive test

@ApostaC ApostaC merged commit 006c7d6 into LMCache:dev Feb 28, 2026
22 of 24 checks passed
sammshen pushed a commit to sammshen/LMCache that referenced this pull request Mar 1, 2026
Signed-off-by: Oasis-Git <ayw.sirius19@gmail.com>
hlin99 pushed a commit to hlin99/LMCache that referenced this pull request Mar 2, 2026
Signed-off-by: Oasis-Git <ayw.sirius19@gmail.com>
oferki pushed a commit to oferki/LMCache that referenced this pull request Mar 3, 2026
Signed-off-by: Oasis-Git <ayw.sirius19@gmail.com>
Signed-off-by: Ofer Kiselov Nahman <ofer.kiselovnahman@weka.io>
oferki pushed a commit to oferki/LMCache that referenced this pull request Mar 3, 2026
Signed-off-by: Oasis-Git <ayw.sirius19@gmail.com>
mauryaavinash95 pushed a commit to mauryaavinash95/LMCache that referenced this pull request Mar 7, 2026
Signed-off-by: Oasis-Git <ayw.sirius19@gmail.com>
shaoxiawjc pushed a commit to shaoxiawjc/LMCache that referenced this pull request Mar 11, 2026
Signed-off-by: Oasis-Git <ayw.sirius19@gmail.com>
Signed-off-by: shaoxiawjc <wjc2800@163.com>
realAaronWu pushed a commit to realAaronWu/LMCache that referenced this pull request Mar 20, 2026
Signed-off-by: Oasis-Git <ayw.sirius19@gmail.com>
Signed-off-by: Aaron Wu <aaron.wu@dell.com>
jooho-XCENA pushed a commit to xcena-dev/LMCache that referenced this pull request Apr 2, 2026
Signed-off-by: Oasis-Git <ayw.sirius19@gmail.com>
jooho-XCENA pushed a commit to xcena-dev/LMCache that referenced this pull request Apr 2, 2026
Signed-off-by: Oasis-Git <ayw.sirius19@gmail.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