bluegitter / xmemcached

Automatically exported from code.google.com/p/xmemcached
0 stars 0 forks source link

心跳计数错误 #163

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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.getLatch().await(2000,
TimeUnit.MILLISECONDS)) {
heartBeatFailCount.incrementAndGet();
}else if (this.versionCommand.getResult() == null) {
heartBeatFailCount.incrementAndGet();
} else {
// reset
heartBeatFailCount.set(0);
}
这样才能表示如果等待2秒没收到消息次数加1;如果收到的消
息为null,计数器加1

感谢蒋波礼的报告。

Original issue reported on code.google.com by killme2...@gmail.com on 30 Oct 2011 at 10:41

GoogleCodeExporter commented 9 years ago
xmemcached 1.3.6 released.

Original comment by killme2...@gmail.com on 19 Mar 2012 at 2:12