diff --git a/CHANGELOG.md b/CHANGELOG.md index ea46080777bbab5e820039d990a05f5f1fdab9f5..3105530a4bc85b423b158125f51b6fafb90883b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ Please mark all change in change log and use the issue from GitHub - \#2637 Suit the range of HNSW parameters - \#2642 Create index failed and server crashed - \#2649 Search parameter of annoy has conflict with document +- \#2692 Milvus hangs during multi-thread concurrent search ## Feature diff --git a/core/src/server/delivery/request/BaseRequest.cpp b/core/src/server/delivery/request/BaseRequest.cpp index 65ebc05502736ad8aecf741f2348a8678e54d53e..bac0015763a56baf8cb1bb52701dd5e6d7a453ff 100644 --- a/core/src/server/delivery/request/BaseRequest.cpp +++ b/core/src/server/delivery/request/BaseRequest.cpp @@ -127,6 +127,7 @@ BaseRequest::OnPostExecute() { void BaseRequest::Done() { + std::unique_lock lock(finish_mtx_); done_ = true; finish_cond_.notify_all(); } diff --git a/core/src/server/delivery/request/BaseRequest.h b/core/src/server/delivery/request/BaseRequest.h index 7def31950e80ca01274ca0a64d1efb0de66318f9..5ed4002800a0db24b227509b8b01f3952e00c971 100644 --- a/core/src/server/delivery/request/BaseRequest.h +++ b/core/src/server/delivery/request/BaseRequest.h @@ -211,15 +211,16 @@ class BaseRequest { protected: const std::shared_ptr context_; - mutable std::mutex finish_mtx_; - std::condition_variable finish_cond_; - RequestType type_; std::string request_group_; bool async_; - bool done_; Status status_; + private: + mutable std::mutex finish_mtx_; + std::condition_variable finish_cond_; + bool done_; + public: const std::shared_ptr& Context() const {