mirror of https://github.com/milvus-io/milvus.git
Fix milvus crash when exiting (#3333)
* Fix server crash when exiting Signed-off-by: yinghao.zou <yinghao.zou@zilliz.com> * Simplify web server Signed-off-by: yinghao.zou <yinghao.zou@zilliz.com>pull/3343/head
parent
05a602fecc
commit
81791fc803
|
@ -240,8 +240,8 @@ endif ()
|
|||
if (DEFINED ENV{MILVUS_OATPP_URL})
|
||||
set(OATPP_SOURCE_URL "$ENV{MILVUS_OATPP_URL}")
|
||||
else ()
|
||||
set(OATPP_SOURCE_URL "https://github.com/oatpp/oatpp/archive/${OATPP_VERSION}.tar.gz")
|
||||
# set(OATPP_SOURCE_URL "https://github.com/BossZou/oatpp/archive/${OATPP_VERSION}.zip")
|
||||
set(OATPP_SOURCE_URL "https://github.com/oatpp/oatpp/archive/${OATPP_VERSION}.tar.gz")
|
||||
# set(OATPP_SOURCE_URL "https://github.com/BossZou/oatpp/archive/${OATPP_VERSION}.zip")
|
||||
endif ()
|
||||
|
||||
if (DEFINED ENV{MILVUS_AWS_URL})
|
||||
|
|
|
@ -102,6 +102,7 @@ StopSchedulerService() {
|
|||
JobMgrInst::GetInstance()->Stop();
|
||||
SchedInst::GetInstance()->Stop();
|
||||
ResMgrInst::GetInstance()->Stop();
|
||||
OptimizerInst::GetInstance()->Stop();
|
||||
}
|
||||
|
||||
} // namespace scheduler
|
||||
|
|
|
@ -32,5 +32,10 @@ Optimizer::Run(const TaskPtr& task) {
|
|||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
Optimizer::Stop() {
|
||||
pass_list_ = std::vector<PassPtr>();
|
||||
}
|
||||
|
||||
} // namespace scheduler
|
||||
} // namespace milvus
|
||||
|
|
|
@ -38,6 +38,9 @@ class Optimizer {
|
|||
bool
|
||||
Run(const TaskPtr& task);
|
||||
|
||||
void
|
||||
Stop();
|
||||
|
||||
private:
|
||||
std::vector<PassPtr> pass_list_;
|
||||
};
|
||||
|
|
|
@ -65,13 +65,10 @@ WebServer::StartService() {
|
|||
}
|
||||
|
||||
server.stop();
|
||||
OATPP_COMPONENT(std::shared_ptr<oatpp::network::ClientConnectionProvider>, client_provider);
|
||||
client_provider->getConnection();
|
||||
});
|
||||
|
||||
// start synchronously
|
||||
server.run();
|
||||
connection_handler->stop();
|
||||
stop_thread.join();
|
||||
}
|
||||
oatpp::base::Environment::destroy();
|
||||
|
|
Loading…
Reference in New Issue