On 09/17/2010 03:51 AM, [email protected] wrote:
Author: rajith
Date: Fri Sep 17 02:51:22 2010
New Revision: 997965
URL: http://svn.apache.org/viewvc?rev=997965&view=rev
Log:
QPID-2861
Added a simple null check to eliminate acting on a result that is no longer
valid.
I am also adding a log message at "WARN" level if we receive a result for a
command that is no longer in our map.
Modified:
qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java
Modified:
qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java?rev=997965&r1=997964&r2=997965&view=diff
==============================================================================
---
qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java
(original)
+++
qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java
Fri Sep 17 02:51:22 2010
@@ -767,7 +767,17 @@ public class Session extends SessionInvo
{
future = results.remove(command);
}
- future.set(result);
+
+ if (future != null)
+ {
+ future.set(result);
+ }
+ else
+ {
+ log.warn("Broker sent a result in response to a command" +
+ " that's no longer valid on the client side." +
+ " [ command id : %s , result : %s ]",command, result);
I don't believe this is actually what is occurring here. The broker is
not sending responses to commands issued prior to failover, I believe
the client is getting confused in some other way.
I have no issue with the null check, but I think the warning is incorrect.
+ }
}
void setException(ExecutionException exc)
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]