[zeromq-dev] Forwarder stops forwarding

Martin Sustrik sustrik at 250bpm.com
Tue Jun 15 15:39:56 CEST 2010

Hi Robin,

> I think we've figured out how this happens, and I don't think its
> specific to the forwarder.
> The exact setup is zmq_forwarder A connecting to zmq_forwarder B,
> which is binding. The messages are forwarded in the reverse direction
> i.e. messages are forwarded from B to A. This is done because of
> firewall restrictions. When there is a network interruption the
> server (B) detects it and drops the connection however forwarder A
> never realizes this since the connection isn't shut down cleanly
> since the host B is on is unreachable.
> Netstat confirms that forwarder A still believes its connected to B,
> but B does not see the connection. In fact you can restart forwarder
> B many hours after the network disconnect and forwarder A still
> believes its connected. I'm guessing the issue is that since there is
> no messages flowing from A to B writes never fail so A never realizes
> it has been disconnected. I'm somewhat surprised by this, I thought
> TCP would be able to figure out a connection was disconnected after a
> minute or 2 on both client and server. Any TCP  experts that can
> confirm that this behavior is expected?

Yes. This is exactly how TCP behaves.

What has to be done is implementing heartbeats on 0MQ level.

Btw, a survey: What's the timeout you would be willing to accept to 
assert the connection is dead?


More information about the zeromq-dev mailing list