diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/EndpointStateMachine.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/EndpointStateMachine.java index 5f78a333d9..a243c93ed3 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/EndpointStateMachine.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/EndpointStateMachine.java @@ -200,16 +200,15 @@ public String toString() { * @param ex - Exception */ public void logIfNeeded(Exception ex) { - LOG.trace("Incrementing the Missed count. Ex : {}", ex); - this.incMissed(); - if (this.getMissedCount() % getLogWarnInterval(conf) == - 0) { + if (this.getMissedCount() % getLogWarnInterval(conf) == 0) { LOG.error( "Unable to communicate to SCM server at {} for past {} seconds.", this.getAddress().getHostString() + ":" + this.getAddress().getPort(), TimeUnit.MILLISECONDS.toSeconds( this.getMissedCount() * getScmHeartbeatInterval(this.conf)), ex); } + LOG.trace("Incrementing the Missed count. Ex : {}", ex); + this.incMissed(); }