[rabbitmq-discuss] Linking to a channel process (erlang client)

Hunter Morris huntermorris+rabbitmq at gmail.com
Tue Jun 14 18:22:41 BST 2011


This is a rough continuation of
http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2010-September/009032.html
which is the only mailing list post I could find relevant to my issue.
(Aside: kudos to Matthew Sackman for clear explanations including
ASCII diagrams!)

I have a similar application to Erik which supervises a connection via
a worker and creates a channel per application worker process so that
channel exceptions kill only worker processes and the entire
supervision tree is torn down by a connection exception. In general
this works brilliantly well. However, on rare but possible occasions,
the following happens when a worker process opens a channel:

    {ok, ChanPid} = amqp_connection:open_channel(ConnPid),
    % self() dies due to exit signal from another linked process
    link(ChanPid), % we never get here due to exit race

Unfortunately, this leaves a "hanging chad" channel in the supervision
tree. Am I missing something subtle? Is it possible to avoid such a
race?

Best,
Hunter Morris


More information about the rabbitmq-discuss mailing list