Skip to content

Commit

Permalink
Reset the etcd client when probing.
Browse files Browse the repository at this point in the history
Signed-off-by: Ye Cao <[email protected]>
  • Loading branch information
dashanji committed Dec 18, 2023
1 parent 28b1e75 commit ff837cd
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/server/services/etcd_meta_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -382,13 +382,10 @@ void EtcdMetaService::retryDaeminWatch(
Status EtcdMetaService::probe() {
std::string const& etcd_endpoint =
etcd_spec_["etcd_endpoint"].get_ref<std::string const&>();
if (etcd_ == nullptr) {
etcd_.reset(new etcd::Client(etcd_endpoint));
}
etcd_.reset(new etcd::Client(etcd_endpoint));
if (EtcdLauncher::probeEtcdServer(etcd_, prefix_)) {
return Status::OK();
} else {
etcd_.reset(new etcd::Client(etcd_endpoint));
return Status::Invalid(
"Failed to startup meta service, please check your etcd");
}
Expand Down

0 comments on commit ff837cd

Please sign in to comment.