From 7c3d6bdbc41e1f00e1c2cc67e406d3625576ff52 Mon Sep 17 00:00:00 2001 From: kun yu Date: Mon, 29 Jul 2019 18:50:41 +0800 Subject: [PATCH] fix search error handle bug Former-commit-id: 8e671f56a9a729d24bb827bae2cbf7c760963a9f --- cpp/src/server/grpc_impl/RequestHandler.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cpp/src/server/grpc_impl/RequestHandler.cpp b/cpp/src/server/grpc_impl/RequestHandler.cpp index 43252179..8aba5351 100644 --- a/cpp/src/server/grpc_impl/RequestHandler.cpp +++ b/cpp/src/server/grpc_impl/RequestHandler.cpp @@ -73,8 +73,14 @@ RequestHandler::SearchVector(::grpc::ServerContext* context, const ::milvus::grp RequestHandler::SearchVectorInFiles(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInFilesInfos* request, ::grpc::ServerWriter<::milvus::grpc::TopKQueryResult>* writer) { std::vector file_id_array; BaseTaskPtr task_ptr = SearchVectorTask::Create(request->search_vector_infos(), file_id_array, *writer); - RequestScheduler::ExecTask(task_ptr, nullptr); - return ::grpc::Status::OK; + ::milvus::grpc::Status grpc_status; + RequestScheduler::ExecTask(task_ptr, &grpc_status); + if (grpc_status.error_code() != SERVER_SUCCESS) { + ::grpc::Status status(::grpc::INVALID_ARGUMENT, grpc_status.reason()); + return status; + } else { + return ::grpc::Status::OK; + } } ::grpc::Status -- GitLab