Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
curvefs/client: fix bug of io hang
Browse files Browse the repository at this point in the history
wuhongsong committed Apr 29, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent ae566eb commit 55f1b0f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions curvefs/src/client/s3/client_s3_cache_manager.cpp
Original file line number Diff line number Diff line change
@@ -999,13 +999,12 @@ CURVEFS_ERROR FileCacheManager::Flush(bool force, bool toS3) {
flushTasks.emplace_back(context);
}
pendingReq.fetch_add(flushTasks.size(), std::memory_order_seq_cst);
for (auto iter = flushTasks.begin();
iter != flushTasks.end(); ++iter) {
s3ClientAdaptor_->Enqueue(*iter);
}

if (pendingReq.load(std::memory_order_seq_cst)) {
VLOG(6) << "wait for pendingReq";
for (auto iter = flushTasks.begin();
iter != flushTasks.end(); ++iter) {
s3ClientAdaptor_->Enqueue(*iter);
}
cond.Wait();
}
VLOG(6) << "file cache flush over";

0 comments on commit 55f1b0f

Please sign in to comment.