slfan1989 commented on code in PR #1621:
URL: https://github.com/apache/ratis/pull/1621#discussion_r4216247864
##########
ratis-server/src/main/java/org/apache/ratis/server/impl/LeaderStateImpl.java:
##########
@@ -1370,7 +1378,12 @@ public void checkHealth(FollowerInfo follower) {
server.getStateMachine().leaderEvent().notifyFollowerSlowness(leaderInfo,
follower.getPeer());
}
final RaftPeerId followerId = follower.getId();
- raftServerMetrics.recordFollowerHeartbeatElapsedTime(followerId,
elapsedTime.toLong(TimeUnit.NANOSECONDS));
+ synchronized (followerMetricsLock) {
Review Comment:
The same reasoning applies here: the check inside the lock prevents a late
heartbeat update from repopulating the map after cleanup. I’d prefer to keep
the current placement for consistency.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]