[MP][Hotfix] add default implementation for report_status#2723
[MP][Hotfix] add default implementation for report_status#2723ApostaC merged 2 commits intoLMCache:devfrom
Conversation
Signed-off-by: ApostaC <yihua98@uchicago.edu>
Signed-off-by: ApostaC <yihua98@uchicago.edu>
Summary of ChangesHello, 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 addresses a dependency issue arising from the recently merged Highlights
🧠 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
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces a valuable hotfix by providing a default implementation for L2AdapterInterface.report_status(), preventing crashes for adapters that haven't implemented it. The new implementation for NixlStoreL2Adapter is comprehensive and well-tested. My review includes a few suggestions to improve code clarity by removing a redundant field from the status report and to strengthen one of the new test assertions. Overall, this is a solid improvement.
| "pinned_object_count": pinned_object_count, | ||
| "pool_size": self._config.pool_size, | ||
| "pool_free_slots": pool_free_slots, | ||
| "event_loop_alive": self._loop_thread.is_alive(), |
| assert isinstance(status["pinned_object_count"], int) | ||
| assert isinstance(status["pool_size"], int) | ||
| assert isinstance(status["pool_free_slots"], int) | ||
| assert isinstance(status["event_loop_alive"], bool) |
| assert status["stored_object_count"] == 0 | ||
| assert status["pinned_object_count"] == 0 | ||
| assert status["pool_size"] == POOL_SIZE | ||
| assert status["pool_free_slots"] > 0 |
There was a problem hiding this comment.
This assertion is correct but can be made stronger. For a newly initialized adapter under this test's configuration, the number of free slots should be equal to the pool size. I suggest changing this to assert status["pool_free_slots"] == status["pool_size"] for a more precise check.
| assert status["pool_free_slots"] > 0 | |
| assert status["pool_free_slots"] == status["pool_size"] |
| assert status["pinned_object_count"] == 0 | ||
| assert status["pool_size"] == POOL_SIZE | ||
| assert status["pool_free_slots"] > 0 | ||
| assert status["event_loop_alive"] is True |
| # Unhealthy after close | ||
| status = adpt.report_status() | ||
| assert status["is_healthy"] is False | ||
| assert status["event_loop_alive"] is False |
* Hotfix: implement report_status for nixl storage Signed-off-by: ApostaC <yihua98@uchicago.edu> Signed-off-by: shaoxiawjc <wjc2800@163.com>
* Hotfix: implement report_status for nixl storage Signed-off-by: ApostaC <yihua98@uchicago.edu> Signed-off-by: Aaron Wu <aaron.wu@dell.com>
* Hotfix: implement report_status for nixl storage Signed-off-by: ApostaC <yihua98@uchicago.edu>
* Hotfix: implement report_status for nixl storage Signed-off-by: ApostaC <yihua98@uchicago.edu>
What this PR does / why we need it:
The recently merged report_status subsystem (PR #2699) requires all L2 adapters to implement
report_status(). This PR:report_status()implementation toNixlStoreL2Adapter, reporting health status, backend type, stored/pinned object counts, and pool utilization.L2AdapterInterface.report_status()from an abstract method to a default implementation that returnsis_healthy: Truewith anextra_warningfield, so future L2 adapters won't crash if they haven't implemented it yet.Special notes for your reviewers:
The default base class implementation includes
"extra_warning": "report_status is not implemented and runs default impl"to signal to developers checking status output that a proper override is needed.If applicable: