[ openjms-Bugs-1611385 ] Client-Server Connection hangs and locks clients

"SourceForge.net" <[email protected]> Fri, 22 Dec 2006 04:57:49 -0800
Newsgroups gmane.comp.java.openjms.devel
Message-ID <[email protected]>
Bugs item #1611385, was opened at 2006-12-08 14:59
Message generated for change (Comment added) made by targeted
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=474136&aid=1611385&group_id=54559

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: server
Group: v0.7.7-alpha-3
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Peter De Leuze (cajundust)
Assigned to: Nobody/Anonymous (nobody)
Summary: Client-Server Connection hangs and locks clients

Initial Comment:
OpenJMS works fine for 2-3 days, then suddenly, client connections seem to keep hanging on the server side. 

When doing a netstat:
tcp        0      0 ::ffff:192.168.111.190:3035 ::ffff:192.168.111.166:1397 ESTABLISHED
tcp        0      0 ::ffff:192.168.111.190:3035 ::ffff:192.168.111.162:1389 ESTABLISHED
tcp        0      0 ::ffff:192.168.111.190:3035 ::ffff:192.168.111.161:1193 ESTABLISHED

And these hanging connections cause all new incoming client connections to lock on creating a session on the connection. 
The place where the client JMS implementation blocks is:

 javax.jms.ConnectionFactory factory = (ConnectionFactory) context.lookup("TCPConnectionFactory");
 javax.jms.Connection connection = factory.createConnection();

 // blocks here forever !
 // -----------------------
 javax.jms.Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 // -----------------------

This situation is only resolved when stopping the jms server and restarting it. Then it works fine again for 2-3 days, and the whole problem reoccurs.

The problem mostly occurs when client applications connect through a VPN, and when the connection is then lost because the VPN disconnects. 
There should be a (server.xml) configurable option that stalled connections should be disconnected after a while, but there is no configuration option.

Also in the JMS client API, there is no way to set a connection timeout when creating a session from a connection object or when sending a message on a disconnected connection.
connection.stop,close or session.close does not do anything !!! The client keeps blocked on the connection.createSession !

Please take this bug serious, because it seems that others also have this problem.


----------------------------------------------------------------------

Comment By: Dmitry Dvoinikov (targeted)
Date: 2006-12-22 17:57

Message:
Logged In: YES 
user_id=1120792
Originator: NO

I also experience this problem. What I did to reproduce was essentially a
multiple-senders-multiple-receivers kind of test over a network which loses
packets. It happens almost immediately, may be a few minutes of activity
and it locks up.

The clients appear to block in createSession, like Peter said. The bad
thing about this is that the server simply won't come back to life, no
matter if I kill all the clients and wait (for reasonable amount of time).
It has to be restarted.

----------------------------------------------------------------------

Comment By: Peter De Leuze (cajundust)
Date: 2006-12-08 15:25

Message:
Logged In: YES 
user_id=1663703
Originator: YES

I tried to force the phenomenon, and I succeeded.
What I did was: (using Windows XP and VPN connection)
1) Start a VPN connection to remote network with our openJMS server. Let
it only have a Topic with a TCP connection factory configured.
2) connect a JMS client application (via the VPN connection) and let it
send repeated messages to the topic (send/receive)
3) disconnect hard the VPN connection while client is sending/receiving
4) check on remote site that network connection was still in netstat.
5) the JMS server now hangs, and does allow incoming connections, but
blocks on all other connecting clients when creating a session on that
connection.
6) situation only resolves when restarting jms server again.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=474136&aid=1611385&group_id=54559

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV