From 41a0eeb37ea5b8c02c24d9f6e431e4fc838dbed7 Mon Sep 17 00:00:00 2001 From: Hongze Zhang Date: Mon, 16 Dec 2024 14:32:40 +0800 Subject: [PATCH 1/2] [VL] Fix crash when there are unreleased memory pools during termintating Velox task --- cpp/velox/memory/VeloxMemoryManager.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpp/velox/memory/VeloxMemoryManager.cc b/cpp/velox/memory/VeloxMemoryManager.cc index 101a9db4a889..718c641c8d6d 100644 --- a/cpp/velox/memory/VeloxMemoryManager.cc +++ b/cpp/velox/memory/VeloxMemoryManager.cc @@ -336,7 +336,8 @@ bool VeloxMemoryManager::tryDestructSafe() { // Velox memory manager considered safe to destruct when no alive pools. if (veloxMemoryManager_) { if (veloxMemoryManager_->numPools() > 3) { - GLUTEN_CHECK(false, "Unreachable code"); + LOG(WARNING) << "Failed to destruct VeloxMemoryManager because there are " << veloxMemoryManager_->numPools() + << " outstanding memory pools."; return false; } if (veloxMemoryManager_->numPools() == 3) { From ff187535f08648f7f9b0761226f007b21c6fa1be Mon Sep 17 00:00:00 2001 From: Hongze Zhang Date: Mon, 16 Dec 2024 14:36:19 +0800 Subject: [PATCH 2/2] fixup --- cpp/velox/memory/VeloxMemoryManager.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/velox/memory/VeloxMemoryManager.cc b/cpp/velox/memory/VeloxMemoryManager.cc index 718c641c8d6d..597ce1c9da37 100644 --- a/cpp/velox/memory/VeloxMemoryManager.cc +++ b/cpp/velox/memory/VeloxMemoryManager.cc @@ -336,8 +336,8 @@ bool VeloxMemoryManager::tryDestructSafe() { // Velox memory manager considered safe to destruct when no alive pools. if (veloxMemoryManager_) { if (veloxMemoryManager_->numPools() > 3) { - LOG(WARNING) << "Failed to destruct VeloxMemoryManager because there are " << veloxMemoryManager_->numPools() - << " outstanding memory pools."; + VLOG(2) << "Attempt to destruct VeloxMemoryManager failed because there are " << veloxMemoryManager_->numPools() + << " outstanding memory pools."; return false; } if (veloxMemoryManager_->numPools() == 3) {