There is a subtle race condition in JMSClientInterceptor:
ResultJoinHandler handler = createResultJoinHandler(methodInvocation, metadata);
// send request to topic
requestor.request(destination, requestMessage, handler, getMultipleResponseTimeout());
// race to here if the response comes back fast
RemoteInvocationResult result = handler.waitForResult();
return recreateRemoteInvocationResult(result);
due to a bug in the ResultJoinHandler methods:
public RemoteInvocationResult waitForResult() {
while (true) {
synchronized (lock) {
if (result != null) {
return result;
}
If the onMessage result could have been already called before we call waitForResult and so result could be != null but the unblockCallerThread could still return false.
I've attached a patch which fixes the problem. Few of the unit tests work for me because of outside dependencies so I'm not sure how to best test this issue.
LINGO-33as well.