Skip to content

Commit

Permalink
curvefs-mds: fix an uninitialized that spawn infinite threads
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-hanqing committed Apr 12, 2022
1 parent 2a84e86 commit 05ada9e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions curvefs/conf/mds.conf
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ mds.scheduler.metaserver.cooling.timeSec=1800
# the backend thread check whether fs is able to delete,
# check partition of deleting fs is deleting
mds.fsmanager.backEndThreadRunInterSec=10
# number of threads that load space info of volume
mds.fsmanager.reloadSpaceConcurrency=10

#### s3
# TODO(huyao): use more meaningfull name
Expand Down
2 changes: 1 addition & 1 deletion curvefs/src/mds/fs_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ using ::curvefs::mds::topology::TopologyManager;

struct FsManagerOption {
uint32_t backEndThreadRunInterSec;
uint32_t spaceReloadConcurrency;
uint32_t spaceReloadConcurrency = 10;
curve::common::S3AdapterOption s3AdapterOption;
};

Expand Down
8 changes: 8 additions & 0 deletions curvefs/src/mds/mds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ void MDS::InitScheduleOption(ScheduleOption* scheduleOption) {
void MDS::InitFsManagerOptions(FsManagerOption* fsManagerOption) {
conf_->GetValueFatalIfFail("mds.fsmanager.backEndThreadRunInterSec",
&fsManagerOption->backEndThreadRunInterSec);

LOG_IF(ERROR,
conf_->GetUInt32Value("mds.fsmanager.reloadSpaceConcurrency",
&fsManagerOption->spaceReloadConcurrency))
<< "Get `mds.fsmanager.reloadSpaceConcurrency` from conf error, use "
"default value: "
<< fsManagerOption->spaceReloadConcurrency;

::curve::common::InitS3AdaptorOptionExceptS3InfoOption(
conf_.get(), &fsManagerOption->s3AdapterOption);
}
Expand Down

0 comments on commit 05ada9e

Please sign in to comment.