Hello rabbitmq-users,
I'm running:
rabbitmq server 3.7.12 with erlang 21.2.6 (clustered setup)
rabbitmq client 5.7.3
And I'm seeing a possible issue where after a disconnection and recovery, there's a short lived stale / zombie connection. Is that a problem?
The issue happens with client config:
factory.setRequestedHeartbeat(60);
factory.setAutomaticRecoveryEnabled(true);
factory.setNetworkRecoveryInterval(5000); // 5s is the default
For example, after the initial connection
- view the admin UI to ensure that the client consumer is connected
- disconnect the client's network cable
- wait for a SocketException or UnknownHostException on the client
- reconnect the client's network cable
- the client successfully recovers as expected
- view the admin UI and check if there are two consumer connections
- after awhile, the original connection is cleared
However, is it a problem that there are two connections for a short time before the server cleans up the old connection? I suspect that this happens because after the client first disconnects, the server is still waiting for 3 missed heartbeats before it clears the old connection. But when the client reconnects, because the default recovery interval is only 5s, now there are two connections. During recovery should the client check for existing connections and close them before opening a new connection?
Thanks,
Austin.
ps - I was able to work around this by setting the setNetworkRecoveryInterval(150000) or about 1 1/2 times greater than the heartbeat timeout. Or similarly I set the heartbeat timeout to 30s and the network recovery interval to 90s.