Skip to content

Commit

Permalink
Fixed possible data races. Since nebulaStore and raftpart share a thr…
Browse files Browse the repository at this point in the history
…ead pool (bgWorkers_), (vesoft-inc#1276)

all raft services should to be stopped before bgWorkers_ was cleaned up.
  • Loading branch information
monadbobo authored and dangleptr committed Nov 18, 2019
1 parent 0bf7fc3 commit 501e862
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/kvstore/NebulaStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ namespace kvstore {
NebulaStore::~NebulaStore() {
LOG(INFO) << "Cut off the relationship with meta client";
options_.partMan_.reset();
bgWorkers_->stop();
bgWorkers_->wait();
LOG(INFO) << "Stop the raft service...";
raftService_->stop();
LOG(INFO) << "Waiting for the raft service stop...";
raftService_->waitUntilStop();
spaces_.clear();
bgWorkers_->stop();
bgWorkers_->wait();
LOG(INFO) << "~NebulaStore()";
}

Expand Down

0 comments on commit 501e862

Please sign in to comment.