From 5fd23581ab5f324c4be270a7daa071abef9fdc7c Mon Sep 17 00:00:00 2001 From: Cyber-SiKu Date: Fri, 10 Nov 2023 10:48:03 +0800 Subject: [PATCH] [fix]curvefs/client: diskcache may deadlock Signed-off-by: Cyber-SiKu --- curvefs/src/client/s3/disk_cache_manager.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/curvefs/src/client/s3/disk_cache_manager.cpp b/curvefs/src/client/s3/disk_cache_manager.cpp index 1bc2ac2473..235989ca87 100644 --- a/curvefs/src/client/s3/disk_cache_manager.cpp +++ b/curvefs/src/client/s3/disk_cache_manager.cpp @@ -427,6 +427,10 @@ void DiskCacheManager::TrimCache() { InitQosParam(); if (!IsDiskCacheSafe(kRatioLevel)) { while (!IsDiskCacheSafe(FLAGS_diskTrimRatio)) { + if (!isRunning_) { + LOG(INFO) << "trim thread end."; + return; + } UpdateDiskFsUsedRatio(); if (!cachedObjName_->GetBack(&cacheKey)) { VLOG_EVERY_N(9, 1000) << "obj is empty";