[zeromq-dev] authentication failure and zmq_msg_send blocking

Pieter Hintjens ph at imatix.com
Tue May 27 16:17:43 CEST 2014


It's kind of the same problem as how to detect TCP connection failures
(DNS errors, network failures, etc.), and arguably the same answers.

On Tue, May 27, 2014 at 12:23 PM, Goswin von Brederlow
<goswin-v-b at web.de> wrote:
> On Mon, May 26, 2014 at 05:08:43PM +0200, Pieter Hintjens wrote:
>> Sorry for the slow reply. I assume you've passed this glitch, with the
>> latest master and have everything you need now?
>>
>> On Mon, May 19, 2014 at 3:19 PM, Goswin von Brederlow <goswin-v-b at web.de> wrote:
>> > Hi,
>> >
>> > I just tried building latest git and now 3 tests block:
>> >
>> > * test_security_null
>> > * test_security_plain
>> > * test_security_curve
>> >
>> > I only looked at the first so far but I believe all will be the same
>> > cause.
>> >
>> > test_security_null uses a DEALER socket and tests what happens when
>> > the authenication fails using expect_bounce_fail(). The expectation is
>> > that the send message is never recieved and gives a timeout since the
>> > client can't authenticate.
>> >
>> > But now the test blocks in zmq_send(), which doesn't have a timeout. I
>> > blieve this is a side effect of the recently merged work by hutonm
>> > concerning handing auth errors and reporting them to the client. My
>> > guess is this causes the DEALER socket to remain in the state where it
>> > has no available peers, which means zmq_send() blocks till there is
>> > one (which obviously never happens).
>> >
>> >
>> > This behaviour seems rather suboptimal to me. Wouldn't it make more
>> > sense for zmq_send() to return an error like EAUTH or ENOPEER when all
>> > peers of the socket have connected but got an error back? The
>> > connections will not be retried and wouldn't work the second time
>> > around (usualy) anyway. So zmq_send can never succeed and waiting
>> > seems pointless.
>> >
>> > Secondly how is the client supposed to detect authentication failures
>> > at all?
>> >
>> > MfG
>> >         Goswin
>
> The blockage is gone thanks to adding a timeout on send (my pull
> request and your minor fixup a bit later).
>
> But the problem remains how to detect authentication failures in the
> client.
>
> MfG
>         Goswin
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev



More information about the zeromq-dev mailing list