Skip to content

Commit

Permalink
[ROCKETMQ-188]RemotingExecption is not consistent between invoke asyn…
Browse files Browse the repository at this point in the history
…c and invoke oneway closes apache#98
  • Loading branch information
Jaskey authored and dongeforever committed Jun 6, 2017
1 parent 031347d commit 7ab59a3
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -417,14 +417,18 @@ public void operationComplete(ChannelFuture f) throws Exception {
throw new RemotingSendRequestException(RemotingHelper.parseChannelRemoteAddr(channel), e);
}
} else {
String info =
String.format("invokeAsyncImpl tryAcquire semaphore timeout, %dms, waiting thread nums: %d semaphoreAsyncValue: %d", //
timeoutMillis, //
this.semaphoreAsync.getQueueLength(), //
this.semaphoreAsync.availablePermits()//
);
PLOG.warn(info);
throw new RemotingTooMuchRequestException(info);
if (timeoutMillis <= 0) {
throw new RemotingTooMuchRequestException("invokeAsyncImpl invoke too fast");
} else {
String info =
String.format("invokeAsyncImpl tryAcquire semaphore timeout, %dms, waiting thread nums: %d semaphoreAsyncValue: %d", //
timeoutMillis, //
this.semaphoreAsync.getQueueLength(), //
this.semaphoreAsync.availablePermits()//
);
PLOG.warn(info);
throw new RemotingTimeoutException(info);
}
}
}

Expand Down

0 comments on commit 7ab59a3

Please sign in to comment.