[rabbitmq-discuss] Channel takes everyone down?

James Aimonetti james at 2600hz.com
Wed Jul 20 22:33:12 BST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alex,

Thanks for the response. I did indeed have a solution similar to Run2(),
but was finding channels were leaking, in that the third party
monitoring process wasn't shutting the channels down when the consumer
exited.

Linking the two was my quick solution to the problem but I guess not
feasible at the moment. I'll re-work my monitoring code and see if I
can't sniff out the leak.

Thanks again,

James

On 07/20/2011 02:00 PM, Alexandru Scvorţov wrote:
> Hi James,
> 
>> However, when a consumer has a non-normal exit, the channel goes down,
>> but the exit signal bubbles up all the way to where *all* other channels
>> go down as well.
> 
> I've just tried it and you're right: sending a non-normal exit to a
> channel will cause the connection to go down, taking all the other
> channels with it.
> 
> For what it's worth, this also happens with 2.5.1 and we don't have any
> plans to change this behaviour right now.  It happens because channels
> don't trap exits.
> 
> I'm afraid there isn't anyway to do it automatically.  You could start
> a separate process that traps exits and is linked to your consumer.
> When you receive an exit from the consumer, close its channel cleanly.
> So, a very basic supervisor.
> 
> Maybe something like this:
>   https://gist.github.com/1095910
> 
> Run() is what I think you're doing.  Run2() starts up a separate thread
> to monitor the consumer and close its channel when the time comes.
> That's 2.5.1 code, btw: the parameters for connection:open/1 changed a
> bit.
> 
> Hope this helps.
> 
> Cheers,
> Alex
> 
> On Tue, Jul 19, 2011 at 02:20:59PM -0700, James Aimonetti wrote:
> My setup is as follows: I have a channel per consumer, and I'm trying to
> link the consumer to the channel so that if either dies, the other goes
> down (most consumers are ephemeral and easy to restart, those that are
> longer living trap exits).
> 
> However, when a consumer has a non-normal exit, the channel goes down,
> but the exit signal bubbles up all the way to where *all* other channels
> go down as well.
> 
> Any pointers how to link a consumer to its channel without taking the
> whole tree of channels down?
> 
> This is with rabbitmq server and erlang-client 2.4.1 and r14b03.
> 
> Thanks!
> 
> James
> 
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss at lists.rabbitmq.com
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

- -- 
James Aimonetti
Distributed Systems Engineer / DJ MC_

2600hz | http://2600hz.com
sip:james at 2600hz.com
tel: 415.886.7905
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJOJ0mYAAoJENc77s1OYoGgX60H/iY53s3e2MrlWtEyK7CQgePL
Bltt1OhOq2Ag2ohsz8HOf8G8X9VbSbeAwx5hJdKpZD+gF1MGuXIc55AClGxQRnD4
CTewQZVJbB6b+ClkiRXBo4yllwmTLzA/MdKAycQSpcmNF6yRZxcFwqsOmXUk+p52
xhxetuPjP1TVpUUTFIfitqdz6NDxd659nnx4YIAoTI1A37FAwpmwZtCvJFCa12ug
oVG9hwsMoP9Dz+N6GHr36p8IQfSeeQOaR/ZCaJESQkHAvqx9Jmior6P+YZyD6Th3
c7/Os2GOGrP6rUv9i6YytgA1coLDOKTLn1c6HZfSwzck7GpkFZtgMlodMibyoLM=
=1fsj
-----END PGP SIGNATURE-----


More information about the rabbitmq-discuss mailing list