[jboss-jira] [JBoss JIRA] Commented: (JBMESSAGING-696) Closing a connection that failed over can close the Invoker

Clebert Suconic (JIRA) jira-events at jboss.com
Thu Dec 21 17:47:41 EST 2006


    [ http://jira.jboss.com/jira/browse/JBMESSAGING-696?page=comments#action_12349256 ] 
            
Clebert Suconic commented on JBMESSAGING-696:
---------------------------------------------

This is the testcase added into Messaging:

   public void testCloseOnFailover() throws Exception
   {
      JBossConnectionFactory factory = (JBossConnectionFactory) ic[0].lookup("/ConnectionFactory");

      Connection conn1 = factory.createConnection();
      Connection conn2 = factory.createConnection();
      Connection conn3 = factory.createConnection();

      Connection[] conn = new Connection[]{conn1, conn2, conn3};

      log.info("Connection delegate information after creation");
      for (int i = 0; i < conn.length; i++)
      {
         log.info("conn" + i + ".serverid=" + getServerId(conn[i]) + " conn" + i + ".ObjectID=" + getObjectId(conn[i])
            + " locatorURL=" + getLocatorURL(conn[i]));
      }

      log.info("Killing server 1 and waiting 30 seconds for failover to kick in on client (from Lease)");
      ServerManagement.kill(1);
      Thread.sleep(30000);

      log.info("Connection delegate information after failover");
      for (int i = 0; i < conn.length; i++)
      {
         log.info("conn" + i + ".serverid=" + getServerId(conn[i]) + " conn" + i + ".ObjectID=" + getObjectId(conn[i])
            + " locatorURL=" + getLocatorURL(conn[i]));
      }

      ConnectionState state2 = getConnectionState(conn2);
      ConnectionState state3 = getConnectionState(conn3);

      assertNotSame(state2.getRemotingConnection(), state3.getRemotingConnection());
      assertNotSame(state2.getRemotingConnection().getInvokingClient(), state3.getRemotingConnection().getInvokingClient());



      conn1.close();
      assertNotNull(state2.getRemotingConnection());
      assertNotNull(state2.getRemotingConnection().getInvokingClient().getInvoker());
      assertTrue(state2.getRemotingConnection().getInvokingClient().getInvoker().isConnected());
      conn2.close();

      log.info("Closing connection 3 now");

      assertNotNull(state3.getRemotingConnection());
      assertNotNull(state3.getRemotingConnection().getInvokingClient().getInvoker());
      assertTrue(state3.getRemotingConnection().getInvokingClient().getInvoker().isConnected());
      // When I created the testcase this was failing, throwing exceptions. This was basically why I created this testcase
      conn3.close();
   }


> Closing a connection that failed over can close the Invoker
> -----------------------------------------------------------
>
>                 Key: JBMESSAGING-696
>                 URL: http://jira.jboss.com/jira/browse/JBMESSAGING-696
>             Project: JBoss Messaging
>          Issue Type: Bug
>    Affects Versions: 1.2.0.Beta1
>            Reporter: Clebert Suconic
>         Assigned To: Tom  Elrod
>             Fix For: 1.2.0.Beta2
>
>
> There is a bug on remoting, where connections created inside Lease will loose reference counting.
> HATest::testCloseOnFailover reproduces this problem.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list