channel.writeAndFlush(request).addListener(new ChannelFutureListener() {
@OverRide
public void operationComplete(ChannelFuture f) throws Exception {
if (f.isSuccess()) {
responseFuture.setSendRequestOK(true);
return;
}
requestFail(opaque);
log.warn("send a request command to channel <{}> failed.", RemotingHelper.parseChannelRemoteAddr(channel));
}
});
question: the method scanResponseTable() has been callback the responseFuture before f.isSuccess(), scanResponseTable() think the responseFuture is error or timeout, but responseFuture is success.
suggestion: like requestFail(). from responseTable get it
if (f.isSuccess()) {
responseFuture.setSendRequestOK(true);
return;
}
replace::
if(f.isSuccess()) {
ResponseFuture responseFuture = responseTable.get(opaque);
if (responseFuture != null) {
responseFuture.setSendRequestOK(true);
}
}
channel.writeAndFlush(request).addListener(new ChannelFutureListener() {
@OverRide
public void operationComplete(ChannelFuture f) throws Exception {
if (f.isSuccess()) {
responseFuture.setSendRequestOK(true);
return;
}
requestFail(opaque);
log.warn("send a request command to channel <{}> failed.", RemotingHelper.parseChannelRemoteAddr(channel));
}
});
question: the method scanResponseTable() has been callback the responseFuture before f.isSuccess(), scanResponseTable() think the responseFuture is error or timeout, but responseFuture is success.
suggestion: like requestFail(). from responseTable get it
if (f.isSuccess()) {
responseFuture.setSendRequestOK(true);
return;
}
replace::
if(f.isSuccess()) {
ResponseFuture responseFuture = responseTable.get(opaque);
if (responseFuture != null) {
responseFuture.setSendRequestOK(true);
}
}