未验证 提交 81791fc8 编写于 作者: B BossZou 提交者: GitHub

Fix milvus crash when exiting (#3333)

* Fix server crash when exiting
Signed-off-by: Nyinghao.zou <yinghao.zou@zilliz.com>

* Simplify web server
Signed-off-by: Nyinghao.zou <yinghao.zou@zilliz.com>
上级 05a602fe
......@@ -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();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册