Skip to content

Commit fa2986a

Browse files
committed
[fix]curvefs/client: diskcache may deadlock
Signed-off-by: Cyber-SiKu <Cyber-SiKu@outlook.com>
1 parent b8dffff commit fa2986a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

curvefs/src/client/s3/disk_cache_manager.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,10 @@ void DiskCacheManager::TrimCache() {
427427
InitQosParam();
428428
if (!IsDiskCacheSafe(kRatioLevel)) {
429429
while (!IsDiskCacheSafe(FLAGS_diskTrimRatio)) {
430+
if (!isRunning_) {
431+
LOG(INFO) << "trim thread end.";
432+
return;
433+
}
430434
UpdateDiskFsUsedRatio();
431435
if (!cachedObjName_->GetBack(&cacheKey)) {
432436
VLOG_EVERY_N(9, 1000) << "obj is empty";

0 commit comments

Comments
 (0)