mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-30 07:25:37 +08:00
Merge branch 'branch-0.5.0' into 'branch-0.5.0'
MS-611 Add resources validity check in ResourceMgr See merge request megasearch/milvus!663 Former-commit-id: 23765cd27ce07bd0f74373800ffb9e91c9293a67
This commit is contained in:
commit
bfb09cb4fa
@ -66,12 +66,10 @@ JobMgr::worker_function() {
|
||||
}
|
||||
|
||||
auto tasks = build_task(job);
|
||||
auto disk_list = res_mgr_->GetDiskResources();
|
||||
if (!disk_list.empty()) {
|
||||
if (auto disk = disk_list[0].lock()) {
|
||||
for (auto& task : tasks) {
|
||||
disk->task_table().Put(task);
|
||||
}
|
||||
// disk resources NEVER be empty.
|
||||
if (auto disk = res_mgr_->GetDiskResources()[0].lock()) {
|
||||
for (auto& task : tasks) {
|
||||
disk->task_table().Put(task);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,6 +104,10 @@ ResourceMgr::Connect(const std::string& name1, const std::string& name2, Connect
|
||||
void
|
||||
ResourceMgr::Clear() {
|
||||
std::lock_guard<std::mutex> lck(resources_mutex_);
|
||||
if (running_) {
|
||||
ENGINE_LOG_ERROR << "ResourceMgr is running, cannot clear.";
|
||||
return;
|
||||
}
|
||||
disk_resources_.clear();
|
||||
cpu_resources_.clear();
|
||||
gpu_resources_.clear();
|
||||
|
||||
@ -34,6 +34,7 @@ static constexpr size_t PARALLEL_REDUCE_BATCH = 1000;
|
||||
|
||||
std::mutex XSearchTask::merge_mutex_;
|
||||
|
||||
// TODO(wxyu): remove unused code
|
||||
// bool
|
||||
// NeedParallelReduce(uint64_t nq, uint64_t topk) {
|
||||
// server::ServerConfig &config = server::ServerConfig::GetInstance();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user