[PR #804] [MERGED] fix(store): add mutex locks for thread-safe metrics retrieval #1833

Closed
opened 2026-10-29 21:30:42 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/Mooncake/pull/804
Author: @xiaguan
Created: 9/4/2025
Status: ✅ Merged
Merged: 9/4/2025
Merged by: @xiaguan

Base: main ← Head: fix_allocator_lock


📝 Commits (2)

  • 3e116d8 fix(store): add mutex locks for thread-safe metrics retrieval and comparisons
  • 1a01d9f refactor(get_metrics_internal): require caller to hold m_mutex instead of internal locking

📊 Changes

2 files changed (+6 additions, -1 deletions)

View changed files

📝 mooncake-store/include/offset_allocator/offset_allocator.hpp (+1 -1)
📝 mooncake-store/tests/offset_allocator_test.cpp (+5 -0)

📄 Description

fix clang errors like this

/data/code/Mooncake/mooncake-store/tests/offset_allocator_test.cpp:322:26: error: reading variable 'm_allocator' requires holding mutex 'a->m_mutex' [-Werror,-Wthread-safety-analysis]
  322 |             ASSERT_EQ(a->m_allocator->m_usedBins[i],

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/Mooncake/pull/804 **Author:** [@xiaguan](https://github.com/xiaguan) **Created:** 9/4/2025 **Status:** ✅ Merged **Merged:** 9/4/2025 **Merged by:** [@xiaguan](https://github.com/xiaguan) **Base:** `main` ← **Head:** `fix_allocator_lock` --- ### 📝 Commits (2) - [`3e116d8`](https://github.com/kvcache-ai/Mooncake/commit/3e116d801737b28d780da69cb2833399d030b3ec) fix(store): add mutex locks for thread-safe metrics retrieval and comparisons - [`1a01d9f`](https://github.com/kvcache-ai/Mooncake/commit/1a01d9fbe7ab4d66fc44cf9c8ef9f99269df4947) refactor(get_metrics_internal): require caller to hold m_mutex instead of internal locking ### 📊 Changes **2 files changed** (+6 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `mooncake-store/include/offset_allocator/offset_allocator.hpp` (+1 -1) 📝 `mooncake-store/tests/offset_allocator_test.cpp` (+5 -0) </details> ### 📄 Description fix clang errors like this ``` /data/code/Mooncake/mooncake-store/tests/offset_allocator_test.cpp:322:26: error: reading variable 'm_allocator' requires holding mutex 'a->m_mutex' [-Werror,-Wthread-safety-analysis] 322 | ASSERT_EQ(a->m_allocator->m_usedBins[i], ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:30:42 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/Mooncake#1833
No description provided.