hanging connections

Sebastian Spaeth Sebastian at SSpaeth.de
Tue Mar 1 13:55:50 UTC 2011


On Tue, 01 Mar 2011 09:23:42 +0100, mega at retes.hu wrote:
> Sebastian Spaeth <Sebastian at SSpaeth.de> writes:
> > Hi there. I am glad you fixed the hangs for you. I am missing a bit of
> > context for this patch though. Why do you believe can this patch fix the
> > hangs?
> 
> Well, because I tested it :-).

Hehe, I was just wondering how you came to the conclusion that it must
be ssl connections being dropped (and I really wonder why python isn't
throwing Exceptions left and right in this case).
 
> The long story is that I configured the system level keepalive
> parameters so that my ssh (client) connections stay alive and my cisco
> router-modem does not kill 'inactive' tcp connections. For ssh that was
> enough because, I think, it sets SO_KEEPALIVE.

So, it might be routers rather than the remote server that kills
connections, that is true. Still I wonder why we keep SSL connections
unused so that they are being dropped. It really seems there is some
room for improvement there.

> Anyway, setting the system keepalive parameters had no effect on
> offlineimap because one has to explicitly request it by setsockopt
> SO_KEEPALIVE.

Right, and that's why I vote for including this by default, it won't
hurt and can only help.

> So it's not Gmail, but that's kind of unimportant. The important thing
> is that I checked on the local machine and the server and netstat showed
> an ESTABLISHED connection on both while the connection was dropped
> [probably] by my router a long time ago and offlineimap just sit there
> waiting.

Ahh, that is a very interesting data point. Thanks for that. So your box
still thinks that the connection is established while it has been killed
of by your router. That would explain why python doesn't throw
exceptions. I wonder what we can do in that case (except sending
keep-alive messages).

> One could argue that socktimeout covers this use-case, but IMHO they are
> complementary.

Right. socktimeout doesn't really affect existing connections once they
have been established, I believe.

Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/offlineimap-project/attachments/20110301/1a1cc344/attachment.pgp>


More information about the OfflineIMAP-project mailing list