[stunnel-users] Redis with stunnel, need to reset a client connection if the remote server drops

Michal Trojnara Michal.Trojnara at mirt.net
Mon Apr 20 20:58:15 CEST 2015


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

Cocytus wrote:
> If the remote EC2 node goes dark for a bit (ie: reboot), the local 
> stunnel client will reconnect, however the internal process which
> is establishing its connection to the local stunnel client does not
> get disconnected and therefore doesn't know that redis became
> unavailable and needs to re-subscribe to the redis stream. I need
> to invalidate the established session when the remote reconnects.

Do you see anything in your log files indicating that stunnel gets
notified about the peer being disconnected?  If not then stunnel does
not make any difference for you.  You would bump into the same issue
without stunnel.

Either way, you need some kind of keepalive.  It may be implemented
either at the application level by periodically sending a command
(some no-op) to your redis server, or at the TCP level.  Stunnel can
help you with it.  The stunnel.conf option is:
    socket = r:SO_KEEPALIVE=1

Mike
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJVNUxGAAoJEC78f/DUFuAUy6YP/A5+8r0oncDT44qy+986qz7E
4jfN/LHZdH92N9F4jSjubP/0B/qTFO7Qif+isBSyle7AU0Ex/oimqynBbm1acsIl
h0FL6mufP0s6e/OPb7wEZtAi5CIbngz1hx6iOh9K/tOVA9Bs0+JAoje5JgRMP6OI
wwPcrd5ef5yIArywZjr5DBmVzPyxPUHH2R6eOgOf5xcs9idviabv32daHf0rVOvG
c30j+VEoL8Zm61dbcKLMGnMBwjE5LVb/dhOcBdqEsofegcEdeKDkAZFSXqUeX9Ud
ndkR8WXHVYngmx4jkSPEqV2+xtlgN+2wQBCQnLYJaEV0Wj1EfvxOH0epkT3Q8u3y
F6uwkyMFCN6+1hN0feL/wekRW0w1nxp0hhfvT7nBTkomUAhzthE/DoU4u+7BrM3r
O+0M5KYQUd4W3XOMcXnBqaIg3A7dzLGzFWK5tWrWo4Tk0PmvKlGdHqFeYGlUY2S1
JH0V8vYfLLsc2/Ty9YEosuJWdnmqv+gO+hZjKTvw8wO3O3au78MG9UY6HZwrujoq
eJHxfNsXSL8FX5JX365ZU11UTDdeceLGyT7XWuI9A2dFbNCAhjatbuNEW0Lh50kQ
fHk2lh/iZDAGYwnugjyFXRuqLBC6r3h6PnGUYnl6Tj2DZXEUcDyey8uvRwO0LW0h
DLzYpnbPMHp9EKaVus06
=symg
-----END PGP SIGNATURE-----



More information about the stunnel-users mailing list