[zeromq-dev] identity bug

Martin Sustrik sustrik at 250bpm.com
Mon May 24 13:54:46 CEST 2010

Hi Serge,

> I am working on completing Erlang 0MQ bindings I ran into this odd scenario:
> 1. 0MQ REP server opens a socket
> 2. The server sets ZMQ_IDENTIFY option to some value (e.g. "XYZ")
> 3. The server binds the socket to local TCP port
> 4. 0MQ REQ client opens a socket and connects to the server.
> 5. 0MQ REP server is terminated by ^C and restarted.
> 6. The server opens a socket
> 7. The server binds it to local TCP port (without setting ZMQ_IDENTITY)
> 8! The client core dumps with:
> Assertion failed: peer_identity == peer_identity_ (session.cpp:215)
> Aborted (core dumped)

What's happening here is that client connects to a service named 'XYZ'.

Then (from the client's perspective) connection breaks and after a while 
it becomes available again.

However, now it's someone else on the other side of the connection, not 
the good old XYZ.

This is most probably caused by misconfiguration of services and thus 
the client shouldn't proceed. It should reject the connection and 
complain so that user fixes the configuration

Currently the complain is realised using the assertion above. However, 
it should be made more user-friendly. Presumably, client should drop the 
connection, write a warning to the system log and try reconnecting 
again, just in case the XYZ gets online again.


More information about the zeromq-dev mailing list