Skip to content

Commit

Permalink
Merge branch 'master' into fix_filter_bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Sophie-Xie authored Sep 19, 2023
2 parents c2cfe26 + e84e236 commit 3a84045
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/kvstore/raftex/Host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,11 +426,12 @@ folly::Future<cpp2::HeartbeatResponse> Host::sendHeartbeat(
if (t.hasException()) {
using TransportException = apache::thrift::transport::TTransportException;
auto exWrapper = std::move(t).exception();
VLOG(2) << self->idStr_ << "Heartbeat: " << exWrapper.what();
auto exception = exWrapper.get_exception<TransportException>();
VLOG(2) << self->idStr_ << "Heartbeat: " << exception->what();
// If we keeps receiving NOT_OPEN exception after some HB intervals,
// If we keeps receiving NOT_OPEN and TIMED_OUT exception after some HB intervals,
// we can assume that the peer is down so we mark paused_ as true
if (exception && exception->getType() == TransportException::NOT_OPEN) {
if (exception && (exception->getType() == TransportException::NOT_OPEN ||
exception->getType() == TransportException::TIMED_OUT)) {
if (!self->paused_) {
auto now = time::WallClock::fastNowInMilliSec();
if (now - self->lastHeartbeatTime_ >=
Expand Down
1 change: 1 addition & 0 deletions src/kvstore/raftex/Host.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class Host final : public std::enable_shared_from_this<Host> {
committedLogId_ = 0;
sendingSnapshot_ = false;
followerCommittedLogId_ = 0;
lastHeartbeatTime_ = 0;
}

/**
Expand Down

0 comments on commit 3a84045

Please sign in to comment.