Skip to content

Commit

Permalink
[fix]curvefs/client: diskcahce may deadlock
Browse files Browse the repository at this point in the history
Signed-off-by: Cyber-SiKu <[email protected]>
  • Loading branch information
Cyber-SiKu committed Nov 10, 2023
1 parent 80a9716 commit fd66669
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions curvefs/src/client/s3/disk_cache_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,14 +419,14 @@ void DiskCacheManager::TrimCache() {
while (true) {
UpdateDiskFsUsedRatio();
waitIntervalSec_.WaitForNextExcution();
if (!isRunning_) {
LOG(INFO) << "trim thread end.";
return;
}
VLOG(9) << "trim thread wake up.";
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";
Expand Down

0 comments on commit fd66669

Please sign in to comment.