From 3fd00eb6d696dfcdc07a1c8ab03fec4c16c86350 Mon Sep 17 00:00:00 2001 From: Hongze Zhang Date: Fri, 28 Jun 2024 18:37:10 +0800 Subject: [PATCH] fixup --- cpp/velox/memory/VeloxMemoryManager.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cpp/velox/memory/VeloxMemoryManager.cc b/cpp/velox/memory/VeloxMemoryManager.cc index 1c62f148f3ba4..aec9e03b9c6bf 100644 --- a/cpp/velox/memory/VeloxMemoryManager.cc +++ b/cpp/velox/memory/VeloxMemoryManager.cc @@ -310,8 +310,10 @@ bool VeloxMemoryManager::tryDestructSafe() { VeloxMemoryManager::~VeloxMemoryManager() { static const uint32_t kWaitTimeoutMs = FLAGS_gluten_velox_aysnc_timeout_on_task_stopping; // 30s by default uint32_t accumulatedWaitMs = 0UL; + bool destructed = false; for (int32_t tryCount = 0; accumulatedWaitMs < kWaitTimeoutMs; tryCount++) { - if (tryDestructSafe()) { + destructed = tryDestructSafe(); + if (destructed) { if (tryCount > 0) { LOG(INFO) << "All the outstanding memory resources successfully released. "; } @@ -323,6 +325,10 @@ VeloxMemoryManager::~VeloxMemoryManager() { usleep(waitMs * 1000); accumulatedWaitMs += waitMs; } + if (!destructed) { + LOG(ERROR) << "Failed to release Velox memory manager after " << accumulatedWaitMs + << "ms as there are still outstanding memory resources. "; + } } } // namespace gluten