Skip to content

Commit

Permalink
curvefs/client: fix waitIntervalSec_ is not init
Browse files Browse the repository at this point in the history
  • Loading branch information
baijiaruo1 committed Apr 8, 2022
1 parent 89269ab commit 9b1c60b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions curvefs/src/client/s3/client_s3_adaptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ S3ClientAdaptorImpl::Init(
inodeManager_ = inodeManager;
mdsClient_ = mdsClient;
fsCacheManager_ = fsCacheManager;
waitInterval_.Init(option.intervalSec * 1000);
diskCacheManagerImpl_ = diskCacheManagerImpl;
if (HasDiskCache()) {
diskCacheManagerImpl_ = diskCacheManagerImpl;
Expand Down Expand Up @@ -275,7 +276,7 @@ void S3ClientAdaptorImpl::BackGroundFlush() {
fsCacheManager_->FsSync(true);

} else {
waitIntervalSec_.WaitForNextExcution();
waitInterval_.WaitForNextExcution();
VLOG(6) << "BackGroundFlush, write cache num is:"
<< fsCacheManager_->GetDataCacheNum()
<< "cache ratio is: " << fsCacheManager_->MemCacheRatio();
Expand All @@ -288,7 +289,7 @@ void S3ClientAdaptorImpl::BackGroundFlush() {

int S3ClientAdaptorImpl::Stop() {
LOG(INFO) << "start Stopping S3ClientAdaptor.";
waitIntervalSec_.StopWait();
waitInterval_.StopWait();
toStop_.store(true, std::memory_order_release);
FsSyncSignal();
bgFlushThread_.join();
Expand Down
2 changes: 1 addition & 1 deletion curvefs/src/client/s3/client_s3_adaptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class S3ClientAdaptorImpl : public S3ClientAdaptor {
std::mutex mtx_;
std::mutex ioMtx_;
std::condition_variable cond_;
curve::common::WaitInterval waitIntervalSec_;
curve::common::WaitInterval waitInterval_;
std::shared_ptr<FsCacheManager> fsCacheManager_;
std::shared_ptr<InodeCacheManager> inodeManager_;
std::shared_ptr<DiskCacheManagerImpl> diskCacheManagerImpl_;
Expand Down

0 comments on commit 9b1c60b

Please sign in to comment.