Reason for zmq error code 156384763
Asked Answered
F

2

7

I am using zmq req/rep pattern communication. The implementation is pretty simple, the req sends some data and waits on recv. The rep receives the data, process and reply back.

//REQ
zmq_connect
zmq_send
zmq_recv //blocking
zmq_close

//REP
zmq_bind
while(true) {
  while(data_received) {
    //miscellaneous process
    zmq_recv //non-blocking
      Print zmq_error_no if zmq_recv fails
  }
  zmq_send
}

In the REP side, during zmq_recv timeout zmq_error_no 11 will be printed. But sometimes i am getting error no 156384763. could anyone tell the meaning for that error?

Filip answered 11/3, 2015 at 14:25 Comment(2)
Look what I found: search results for "zmq 156384763"Selective
@ThomasMatthews shame on you! Googling the error - whatever next?Flurried
B
4

This is the native ZeroMQ error EFSM:

The zmq_send() operation cannot be performed on this socket at the moment due to the socket not being in the appropriate state. This error may occur with socket types that switch between several states, such as ZMQ_REP.

Sources: zmq_send, zmq.h

Briarroot answered 12/3, 2015 at 11:3 Comment(1)
This error can also be seen whilst attempting to receive a message from a REP socket in some cases. From this moment on the receive operation on the REP socket on the server keeps failing with this error until you send a bit of data out again. This effectively means your server is crashing and burning. All other client/REQ sockets are not getting served! What would be the best practice to deal with this error on the REP/server side?Duct
D
2

Here another victim of this EFSM error, which turns up when receiving from a REP socket.

For me the direct reason was not answering some of the requests made by the client. Remember that the messaging pattern strictly requires you to send a reply! If you don't then the server becomes confused and simply stops working.

So, how can this happen in practice?

Well, you could find yourself porting a legacy protocol to ZeroMQ (like me). Where the original author simply didn't bother to reply to some request(s). So as soon as you hit a request like that, the server breaks.

Or imagine an exception occurs in your code while handling that particular problematic request. We can then inadvertently skip our send-the-reply-message code!

Duct answered 15/8, 2018 at 8:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.