From aa549f0fba9179170706d12f778c94a1c9afe78c Mon Sep 17 00:00:00 2001 From: groot Date: Thu, 2 Jul 2020 19:03:24 +0800 Subject: [PATCH] * #2642 Create index failed caused by server crashed. Signed-off-by: yhmo * changelog Signed-off-by: yhmo * changelog Signed-off-by: yhmo * typo Signed-off-by: yhmo * #2692 Milvus hangs during multi-thread concurrent search Signed-off-by: yhmo --- CHANGELOG.md | 1 + core/src/server/delivery/request/BaseRequest.cpp | 1 + core/src/server/delivery/request/BaseRequest.h | 9 +++++---- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ae526015c37..68a4bfa0d6ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ Please mark all changes in change log and use the issue from GitHub - \#2642 Create index failed and server crashed - \#2649 Search parameter of annoy has conflict with document - \#2690 Remove body parser in show-partitions endpoints +- \#2692 Milvus hangs during multi-thread concurrent search ## Feature - \#2319 Redo metadata to support MVCC diff --git a/core/src/server/delivery/request/BaseRequest.cpp b/core/src/server/delivery/request/BaseRequest.cpp index d915a0400610..5edcbfdb32eb 100644 --- a/core/src/server/delivery/request/BaseRequest.cpp +++ b/core/src/server/delivery/request/BaseRequest.cpp @@ -129,6 +129,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 d625d268a36c..6ace7f1dde90 100644 --- a/core/src/server/delivery/request/BaseRequest.h +++ b/core/src/server/delivery/request/BaseRequest.h @@ -215,15 +215,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 {