[zeromq-dev] Reconnect REQ socket with REQ_RELAXED option

Christian Kamm kamm at incasoftware.de
Fri Jan 24 18:02:24 CET 2014


It's indeed a bug with REQ_RELAXED. :/

The test2() function in the attached file models Alexey's report. I
don't have time to take care of this right now, unfortunately.

A brief debugging session tells me that when the second send() on the
REQ calls terminate() on the pipe, that pipe doesn't seem to come up
again. This is seen as send() calls returning EAGAIN when they
shouldn't. (sends for connected sockets should never EAGAIN unless we
hit the HWM)

So maybe terminate()ing that pipe is a bad idea? We wanted to terminate
the underlying connection to cause a reconnect. Maybe there's a better
way to do it. See the original discussion here:
https://github.com/zeromq/libzmq/pull/619/

Christian

On 01/24/2014 03:27 PM, Pieter Hintjens wrote:
> The REQ_RELAXED code is newish and may have things to fix. Could you
> make a minimal test case (see the zeromq/issues repo for examples),
> and log an issue?
> 
> Thanks
> Pieter
> 
> On Fri, Jan 24, 2014 at 6:09 AM, Alexey Melnichuk <mimir at newmail.ru> wrote:
>> Alexey Melnichuk <mimir <at> newmail.ru> writes:
>>
>>>
>>> Server ROUTER socket (e.g. basic echo server)
>>> Client REQ socket with REQ_RELAXED and REQ_CORRELATE.
>>>
>>> 1) Server and client starts.
>>> 2) Client send request and recv response.
>>> 3) Server stops
>>> 4) Client send request and get error EAGAIN on recv
>>> 5) Client get error EAGAIN on send
>>> 6) Server starts
>>> 7) Client continue gets error EAGAIN on send
>>>
>>
>> I also get same result with inproc transport.
>> Is it bug or it just should not works?
>>
>>
>>
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_req_relaxed.cpp
Type: text/x-c++src
Size: 5892 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140124/7d611305/attachment.cpp>


More information about the zeromq-dev mailing list