zhangmeng916 commented on a change in pull request #1460:
URL: https://github.com/apache/helix/pull/1460#discussion_r504152792
##########
File path:
helix-core/src/main/java/org/apache/helix/messaging/handling/AsyncCallbackService.java
##########
@@ -113,12 +104,19 @@ public HelixTaskResult handleMessage() throws
InterruptedException {
+ _correlationId);
AsyncCallback callback = _callbackMap.get(_correlationId);
- synchronized (callback) {
- callback.onReply(_message);
- if (callback.isDone()) {
- _logger.info("Removing finished callback, correlationid:" +
_correlationId);
- _callbackMap.remove(_correlationId);
+ if (callback != null) {
+ synchronized (callback) {
+ callback.onReply(_message);
+ if (callback.isDone()) {
+ _logger.info("Removing finished callback, correlationid:" +
_correlationId);
+ _callbackMap.remove(_correlationId);
+ }
}
+ } else {
+ String msg = "Message " + _message.getMsgId()
+ + " does not have correponding callback. Probably timed out
already. Correlation id: "
+ + _correlationId;
+ _logger.warn(msg);
Review comment:
Actually I meant this missing ID exception and exceptions in the later
functions in onReply. Do we need to consider distinguishing between them? like
in your test `Assert.assertFalse(callback.isDone())`. Any other errors may
happen in middle?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]