14 Replies Latest reply on Sep 15, 2008 1:21 PM by brian.stansberry

    Handling soft versus hard pooledInvoker exceptions in JRMPIn

    smarlow

      Before I create a jira for this issue, I wanted to gather some feedback. Let me know if I didn't explain this clearly enough. :-)

      I noticed that the PooledInvokerProxy.invoke() handles java.io.EOFException by throwing a java.rmi.ConnectException (this is in a general catch all Exception).

      I happened to hit this case and found that the call target (cluster member) is removed as a dead member (in JRMPInvokerProxyHA.invoke). This is not the right thing to do for java.io.EOFException which only means that the pooled connection went bad but the cluster member is still alive (in my case the cluster member was still fine.)

      As a quick hack, I'm going to try changing the JRMPInvokerProxyHA.invoke from the following:

       catch (java.rmi.ConnectException e)
       {
       lastException = e;
       }
      

      To:
       catch (java.rmi.ConnectException e)
       {
       lastException = e;
       if(e.getCause() != null && e.getCause() instanceof java.io.EOFException)
       {
       // don't failover as we may of reached the target
       invocationHasReachedAServer (invocation);
       throw e;
       }
       }
      


      I need to do more testing to see if this is the right approach (need to ensure that the real fail-over case still works).

      Perhaps there are other exceptions that should also be treated differently.

      Thoughts?