amaliujia commented on code in PR #1621:
URL: https://github.com/apache/ratis/pull/1621#discussion_r4216684224
##########
ratis-server/src/main/java/org/apache/ratis/server/impl/LeaderStateImpl.java:
##########
@@ -687,7 +691,11 @@ private Collection<LogAppender>
addSenders(Collection<RaftPeer> newPeers, long n
final List<LogAppender> newAppenders = newPeers.stream().map(peer -> {
final FollowerInfo f = new FollowerInfoImpl(server.getMemberId(), peer,
this::getPeer, t, nextIndex, caughtUp);
followerInfoMap.put(peer.getId(), f);
- raftServerMetrics.addFollower(peer.getId());
+ synchronized (followerMetricsLock) {
+ if (!isStopped.get()) {
Review Comment:
Sure the current way is not wrong.
--
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]