[zeromq-announce] ROUTER socket doesn't receive message

Attila Magyari atti86 at gmail.com
Thu May 12 10:54:03 CET 2022


I have the following Setup:
One Python server with two ROUTER sockets in the main loop:
- one for external requests, bound on TCP
- one for internal worker threads, bound on INPROC
The TCP socket receives the requests from external clients, and forwards
them to worker threads spawned on-demand. The worker threads process the
request, and connect to the INPROC channel via a thread-local DEALER socket
to send the responses as they are ready. The main loop socket receives the
multiple responses from the worker threads, and forwards them to the client
who initiated the request, identified by a random client ID which is set as
the identity of the socket.
In the main loop there is a Poller listening on the two sockets, and once
it's triggered, a recv() loop is started on these sockets until an
exception is caught.

This works 95% of the time, but sometimes messages sent from the worker
thread do not arrive to the inproc main socket. I tracked the frame to make
sure it's sent, but the recv() never gets it. The issue is
reproducible with less than 10 messages, so I don't think the queue is
full. It could still have something to do with the burst of messages, as it
seems to occur less often if I delay the messages,

I tried with different designs, without Poller, without thread-local
sockets, but I cannot think of anything else to try to fix it. Need some
help :(.

Let me know if you have any ideas I could try!
Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-announce/attachments/20220512/b7186acf/attachment.htm>

More information about the zeromq-announce mailing list