[rabbitmq-discuss] Catching channel disconnect

Valentino Volonghi dialtone at gmail.com
Wed Oct 15 00:31:56 BST 2008


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


On Oct 14, 2008, at 3:54 PM, Ben Hood wrote:

> Valentino,
>
> On Tue, Oct 14, 2008 at 10:23 PM, Valentino Volonghi <dialtone at gmail.com 
> > wrote:
>> This all works fine until I shut down the remote host, then shovel
>> crashes
>> and I can't see how to recover it.
>
> You may be running into the same issue that has been addressed in
> branch 19251 (which is awaiting QA before being folded back into the
> trunk).


Well, I can see that with the patch what would happen is that at the  
exact moment
of the disconnect the process would crash and then would be restarted  
instead of
waiting until a tx_select() fails to then restart everything.

This is fine and more in line with what I would expect, it's just that  
even in this case
erlang appears to not have any kind of exponential backoff  
reconnection strategy.

Basically when it restarts it tries to connect to the remote rabbitmq  
instance and of course,
since it's down (in my test), it raises an econnrefused because no  
port is open. This is
all good and fine. I suspect that since econnrefused is an exception I  
should plug my
logic right there and catch it and start a loop there that runs until  
the connection is
established and use an exponential backoff to ask for new connections.

Do you think this makes sense?

- --
Valentino Volonghi aka Dialtone
Now running MacOS X 10.5
Home Page: http://www.twisted.it
http://www.adroll.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iEYEARECAAYFAkj1K+wACgkQ9Llz28widGX/vgCfQCPv06ZNsG0nGGNNqYuLw07r
fWsAnAzgQHAQCWEUrpi6Fuf8wqc1E5jF
=4Wuz
-----END PGP SIGNATURE-----




More information about the rabbitmq-discuss mailing list