[jboss-jira] [JBoss JIRA] Updated: (JBREM-596) Lease stops working if the First Client using the same Locator is closed
Clebert Suconic (JIRA)
jira-events at jboss.com
Fri Sep 15 11:50:38 EDT 2006
[ http://jira.jboss.com/jira/browse/JBREM-596?page=all ]
Clebert Suconic updated JBREM-596:
----------------------------------
Summary: Lease stops working if the First Client using the same Locator is closed (was: Lease doesn't work if client has two connections opened when using callbacks)
Description:
If you use always the same locator (say if you need socket pool working), and if you close the first Client opened, Lease will stop as Lease is associated with the Client and not with the Invoker (what is wrong IMO)
Lease should be associated with AbstractInvoker, as the property for Lease will determine an unique ClientInvoker on InvokerRegistry.
Test org.jboss.test.remoting.lease.socket.multiple has the scenario for this failure.
was:
If you have two connections, one of them is using CallBack the Lease is just stopped.
I don't know how to reproduce this with a pure JBossRemoting testcase, but there is a testcase @ JBossMEssaging (Branch_1_0) which reproduces this really easily.
Download JBossMessaging SVN @ Branch_1, and execute ant crash-tests within /testsuite.
You can look at cruisecontrol results at this URL:
http://cruisecontrol.jboss.com/cc/artifacts/jms-1.0-testsuite/20060907220034/results/org/jboss/test/messaging/jms/crash/DurableCrashTest1(Crash).html
and
http://cruisecontrol.jboss.com/cc/artifacts/jms-1.0-testsuite/20060907220034/results/org/jboss/test/messaging/jms/crash/DurableCrashTest2(Crash).html
I have added a couple of messages on JBossRemoting code and I could see that with the code bellow, the lease is stopped. During addCallBAck the client copy calls disconnect and the lease thread never comes back.
Here is the code:
public void testSimplestDurableSubscription() throws Exception
{
ConnectionFactory cf = (ConnectionFactory)ic.lookup("ConnectionFactory");
Topic topic = (Topic)ic.lookup("/topic/TopicCrash");
Connection conn = cf.createConnection();
conn.setClientID("client1");
conn.start();
Connection conn2 = cf.createConnection();
conn2.setClientID("client2");
conn2.start();
Session s = conn.createSession(true, Session.AUTO_ACKNOWLEDGE);
Session s2 = conn2.createSession(true, Session.AUTO_ACKNOWLEDGE);
MessageProducer prod = s.createProducer(topic);
prod.setDeliveryMode(DeliveryMode.PERSISTENT);
MessageConsumer durable = s.createDurableSubscriber(topic, "subs1");
MessageConsumer durable2 = s2.createDurableSubscriber(topic, "subs2");
//conn2.close(); -- do not remote this comment. It was meant to not close the connection
for (int i=0;i<10;i++)
{
prod.send(s.createTextMessage("k"+i));
}
s.commit();
conn.close();
conn = cf.createConnection();
conn.setClientID("client1");
conn.start();
s = conn.createSession(true, Session.AUTO_ACKNOWLEDGE);
durable = s.createDurableSubscriber(topic, "subs1");
for (int i=0;i<2;i++)
{
TextMessage tm = (TextMessage)durable.receive(1000);
assertNotNull(tm);
s.commit();
System.out.println(tm.getText());
assertEquals("k" + i, tm.getText());
}
//conn.close();-- do not remote this comment. It was meant to not close the connection
//System.exit(0); -- this is not needed as there is not tearDown, the client VM will simply be finished the same way an exit would do, and this is better since it will keep proper JUNIT report outputs
}
> Lease stops working if the First Client using the same Locator is closed
> ------------------------------------------------------------------------
>
> Key: JBREM-596
> URL: http://jira.jboss.com/jira/browse/JBREM-596
> Project: JBoss Remoting
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: callbacks
> Affects Versions: 2.0.0.GA (Boon)
> Reporter: Clebert Suconic
> Assigned To: Tom Elrod
> Fix For: 2.2.0.Beta1 (Bluto)
>
>
> If you use always the same locator (say if you need socket pool working), and if you close the first Client opened, Lease will stop as Lease is associated with the Client and not with the Invoker (what is wrong IMO)
> Lease should be associated with AbstractInvoker, as the property for Lease will determine an unique ClientInvoker on InvokerRegistry.
> Test org.jboss.test.remoting.lease.socket.multiple has the scenario for this failure.
--
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