mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-04 09:52:30 +08:00
fix(db): db destruction bug fix
Former-commit-id: d77e18e428bc43b2cc1316f0d77b6807192f6662
This commit is contained in:
parent
4428d56670
commit
56ffd6bad3
@ -19,7 +19,6 @@ DB::~DB() {}
|
||||
|
||||
void DB::Open(const Options& options, DB** dbptr) {
|
||||
*dbptr = nullptr;
|
||||
/* *dbptr = new DBImpl<FaissExecutionEngine<IVFIndexTrait>>(options); */
|
||||
*dbptr = DBFactory::Build(options);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -176,8 +176,7 @@ Status DBImpl<EngineT>::search(const std::string& group_id, size_t k, size_t nq,
|
||||
|
||||
template<typename EngineT>
|
||||
void DBImpl<EngineT>::start_timer_task(int interval_) {
|
||||
std::thread bg_task(&DBImpl<EngineT>::background_timer_task, this, interval_);
|
||||
bg_task.detach();
|
||||
bg_timer_thread_ = std::thread(&DBImpl<EngineT>::background_timer_task, this, interval_);
|
||||
}
|
||||
|
||||
template<typename EngineT>
|
||||
@ -403,6 +402,7 @@ DBImpl<EngineT>::~DBImpl() {
|
||||
bg_build_index_finish_signal_.wait(lock);
|
||||
}
|
||||
}
|
||||
bg_timer_thread_.join();
|
||||
std::vector<std::string> ids;
|
||||
_pMemMgr->serialize(ids);
|
||||
_env->Stop();
|
||||
|
||||
@ -87,6 +87,8 @@ private:
|
||||
bool bg_build_index_started_;
|
||||
std::condition_variable bg_build_index_finish_signal_;
|
||||
|
||||
std::thread bg_timer_thread_;
|
||||
|
||||
MetaPtr _pMeta;
|
||||
MemManagerPtr _pMemMgr;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user