From 02a7691028de1b87805c08a5dd71dfdfbae50e45 Mon Sep 17 00:00:00 2001 From: wxyu Date: Tue, 8 Oct 2019 14:48:11 +0800 Subject: [PATCH] MS-611 Add resources validity check in ResourceMgr Former-commit-id: 534264d0ab113ac14f53d53b96060bda5195e022 --- cpp/src/scheduler/ResourceMgr.cpp | 2 ++ cpp/unittest/db/utils.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/cpp/src/scheduler/ResourceMgr.cpp b/cpp/src/scheduler/ResourceMgr.cpp index 41c4ddbc..3ea8a56e 100644 --- a/cpp/src/scheduler/ResourceMgr.cpp +++ b/cpp/src/scheduler/ResourceMgr.cpp @@ -105,6 +105,8 @@ void ResourceMgr::Clear() { std::lock_guard lck(resources_mutex_); disk_resources_.clear(); + cpu_resources_.clear(); + gpu_resources_.clear(); resources_.clear(); } diff --git a/cpp/unittest/db/utils.cpp b/cpp/unittest/db/utils.cpp index 61c75a09..c5874be6 100644 --- a/cpp/unittest/db/utils.cpp +++ b/cpp/unittest/db/utils.cpp @@ -123,6 +123,7 @@ DBTest::TearDown() { ms::scheduler::JobMgrInst::GetInstance()->Stop(); ms::scheduler::SchedInst::GetInstance()->Stop(); ms::scheduler::ResMgrInst::GetInstance()->Stop(); + ms::scheduler::ResMgrInst::GetInstance()->Clear(); BaseTest::TearDown(); -- GitLab