[rabbitmq-discuss] Creating an auth plugin (Kerberos)

Simon MacMullen simon at rabbitmq.com
Tue Nov 13 17:21:19 GMT 2012


On 13/11/12 14:35, Simon Lundström wrote:
>> So make sure to receive that message in your plugin...
>
> In my receive, here
> <https://github.com/simmel/rabbitmq-auth-backend-kerberos/blob/213a831a61e1524cb187273b7d78ff5bc415a678/src/rabbit_auth_backend_kerberos.erl#L42-55>,
> I tried to add:
>
>      {'EXIT', Port, PosixCode} ->
>        rabbit_log:error("EXIT: ~p~n", [PosixCode]),
>        false;
>
> however I still get the same error.
> I even tried to add:
>      {A, B, C} ->
>        rabbit_log:error("EXIT: ~p : ~p : ~p~n", [A,B,C]),
>        false;
>
> just to see so I could "catch" every case but I still got the same error.

You don't want to add that message to the existing receive block - since 
you will receive the {Port, {exit_status, A}} message as well, and 
you'll only receive one message per receive block. So you need a second 
block after the first to receive the 'EXIT' message.

> Since the crash report mentions a supervisor I suspected it had
> something to do with "my" sup in

No, not at all. The crash report mentions a supervisor since pretty much 
all crash reports do - the supervisor *for the reader* detected that the 
reader had crashed.

After all, that's what supervisors are for.

> <https://github.com/simmel/rabbitmq-auth-backend-kerberos/blob/213a831a61e1524cb187273b7d78ff5bc415a678/src/rabbit_auth_backend_kerberos_app.erl>
> so I tried to add this to the start function:
>    receive
>      {'EXIT', Port, PosixCode} ->
>        rabbit_log:error("EXIT in sup: ~p~n", [PosixCode]),
>        false
>    end.
>
> but RabbitMQ wouldn't even start and didn't log anything anywhere then = D

Well yes, at that point you're in the application startup; you haven't 
opened the port yet. Also you haven't specified a timeout this time, so 
your application hangs waiting for this message to arrive.

Cheers, Simon

-- 
Simon MacMullen
RabbitMQ, VMware


More information about the rabbitmq-discuss mailing list