https://issues.apache.org/bugzilla/show_bug.cgi?id=50667
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 9 Feb 2011 17:39:24 +0000 (17:39 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 9 Feb 2011 17:39:24 +0000 (17:39 +0000)
Move the callback outside try/catch to avoid duplicate callbacks

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1068989 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/tribes/group/RpcChannel.java

index c40aaba..38f63c5 100644 (file)
@@ -158,9 +158,6 @@ public class RpcChannel implements ChannelListener{
                         channel.send(new Member[] {sender}, rmsg,replyMessageOptions & ~Channel.SEND_OPTIONS_SYNCHRONIZED_ACK);
                     }
                     finished = true;
-                    if (excallback != null && !asyncReply) {
-                        excallback.replySucceeded(rmsg.message, reply, sender);
-                    }
                 }catch ( Exception x )  {
                     if (excallback != null && !asyncReply) {
                         finished = !excallback.replyFailed(rmsg.message, reply, sender, x);
@@ -169,6 +166,9 @@ public class RpcChannel implements ChannelListener{
                         log.error("Unable to send back reply in RpcChannel.",x);
                     }
                 }
+                if (finished && excallback != null && !asyncReply) {
+                    excallback.replySucceeded(rmsg.message, reply, sender);
+                }
             }
         }//end if
     }