Hello.<br><br>We have rabbitMQ 2.7.1 java clients remotely connected to the server.<br>We started experience short-term bad network scenarios and serious problem occurred:<br>1. factory.setRequestedHeartbeat set to 30s<br>
2. factory.setConnectionTimeout set to 30000ms<br>client properly closes connection after missing 30 seconds of heartbeats.<br>But sometimes it hangs completely when tries to open a new connection.<br><br>I tried to analyze java client code and what is result:<br>
<br>AMQConnection.java:286 :<br> _frameHandler.setTimeout(HANDSHAKE_TIMEOUT); - socket.soTimeout is set to 10s here<br>then it starts the MainLoop at line 294<br>and blocks till get a reply for a handshake at line 300:<br>
connStart =<br> (AMQP.Connection.Start) connStartBlocker.getReply().getMethod();<br><br>problem is that it's possible that it'll never get a reply. Because MainLoop relies on heartbeats functional to handle such situation which is not enabled yet. It happens only at line 368:<br>
setHeartbeat(heartbeat);<br>MainLoop endlessly runs at 492: <br> Frame frame = _frameHandler.readFrame();<br>which returns null every 10s (this is how SocketTimeoutException handled in Frame.readFrom..)<br>
and handleSocketTimeout() do nothing because _heartbeat is not set yet.<br><br>Thanks.<br>