Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
zhztheplayer committed Jun 28, 2024
1 parent f1864dc commit 3fd00eb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cpp/velox/memory/VeloxMemoryManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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. ";
}
Expand All @@ -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

0 comments on commit 3fd00eb

Please sign in to comment.