jbrisbin / amqp_client

Rebar-friendly fork of rabbitmq-erlang-client
101 stars 118 forks source link

Conflict when combining `seth/pooler` with `jbrisbin/amqp_client` #18

Open dcheckoway opened 9 years ago

dcheckoway commented 9 years ago

Cc: @seth

We recently bumped into an issue when using seth/pooler to pool RabbitMQ channels. When the pooler culls stale channels, it kills them via exit(Pid, kill) (instead of, say, doing it gracefully via amqp_channel:close).

Long story short, amqp_client interprets the killed channel as an internal_error (541), and it then closes the AMQP connection entirely, which affects all of the other channels on that connection.

Behavior on both sides (pooler and amqp_client) makes sense when considered separately, but when combined, this is a problem. I mention this less as a bug report, and more as a heads-up -- perhaps something that could help other folks if it were documented?

videlalvaro commented 9 years ago

Be aware that this is not the official amqp_client repo. Development of said repo is here http://hg.rabbitmq.com/rabbitmq-erlang-client/ and we have discussions about RabbitMQ and related libraries here: https://groups.google.com/forum/#!forum/rabbitmq-users

seth commented 9 years ago

Hi there,

I'd love for us to add a feature to pooler to optionally attempt a graceful shutdown function for pool members. I think that would help this case (and others). It might be that within some timeout we want to resort to the exit/2 call approach, but I agree that adding the ability to specify a stop function for pool members would be generally useful. Would such a feature help this situation?

videlalvaro commented 9 years ago

@seth as I said in mu comment, please discuss this in our RabbitMQ forum linked above

seth commented 9 years ago

@videlalvaro is there a thread I can reply to? I just went to look and didn't find any hits searching the list for pooler.

videlalvaro commented 9 years ago

@seth not that I know of, but you can start your own thread