Skip to content

Commit

Permalink
(fix) Heartbeating failure counter error
Browse files Browse the repository at this point in the history
  • Loading branch information
killme2008 committed Oct 9, 2016
1 parent a68e431 commit 73f622f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main/java/net/rubyeye/xmemcached/impl/MemcachedHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,13 @@ public void run() {
if (!this.versionCommand.getLatch().await(2000,
TimeUnit.MILLISECONDS)) {
heartBeatFailCount.incrementAndGet();
}
if (this.versionCommand.getResult() == null) {
heartBeatFailCount.incrementAndGet();
} else {
// reset
heartBeatFailCount.set(0);
if (this.versionCommand.getResult() == null) {
heartBeatFailCount.incrementAndGet();
} else {
// reset the failure counter
heartBeatFailCount.set(0);
}
}
if (heartBeatFailCount.get() > MAX_HEART_BEAT_FAIL_COUNT) {
log.warn("Session("
Expand Down

0 comments on commit 73f622f

Please sign in to comment.