[zeromq-dev] client not reconnecting properly or syn-fin death spiral

Stephen Hemminger shemminger at vyatta.com
Fri Oct 26 02:33:19 CEST 2012


On Thu, 18 Oct 2012 12:11:06 +0900
Pieter Hintjens <ph at imatix.com> wrote:

> On Thu, Oct 18, 2012 at 11:39 AM, Pieter Hintjens <ph at imatix.com> wrote:
> 
> > Probably irrelevant, but setting identity on SUB and DEALER sockets is
> > meaningless.
> 
> Sorry, this was wrong... it's legal on DEALER but not on SUB.
> 
> -Pieter

The problem was related to setting identity on the DEALER.
Turns out than when the DEALER reconnects the internal ROUTER
code thinks the new socket is a duplicate of the old (still timing out)
socket and closes it.

Trace looks like:

DEALER       ->   ROUTER
       Syn ->
       <- Syn/Ack
       Ack ->

       Request -> [ID, data]
       <-ACK
       <- Response

==== DEALER crashes ===
       Syn ->
       <- Syn/Ack
       Ack ->

       Request -> [ID, data]
       <- Ack
       <- Fin
       Fin,Ack ->

The application was (mis)using IDENTITY as a form of session ID.
When client restarts it needs to be a new session.

This also explains why it would eventually clear out.
The ROUTER (server) would eventually do keepalive and detect dead old
socket.



More information about the zeromq-dev mailing list