Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: =?utf-8?Q?G=C3=A1bor?= Melis <mega <at> retes.hu>
Subject: Re: hanging connections
Newsgroups: gmane.mail.imap.offlineimap.general
Date: Friday 25th February 2011 21:23:07 UTC (over 6 years ago)
> I'll try without autorefresh.

I did, but it didn't change a thing.

In the end it seems to be cured by:
  
diff --git a/offlineimap/imaplibutil.py b/offlineimap/imaplibutil.py
index cf82996..e27243f 100644
--- a/offlineimap/imaplibutil.py
+++ b/offlineimap/imaplibutil.py
@@ -111,6 +111,8 @@ class WrappedIMAP4_SSL(IMAP4_SSL):
             # FIXME
             raise socket.error(last_error)
 
+        self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
+
         #connected to socket, now wrap it in SSL
         try:
             if self._cacertfile:
	Modified offlineimap/init.py

and

sysctl -w net.ipv4.tcp_keepalive_time=15 \
          net.ipv4.tcp_keepalive_intvl=15 \
          net.ipv4.tcp_keepalive_probes=20

15s is pretty extreme I think. It has been going working fine for
several hours now with the original config, with autorefresh, two
accounts, four threads each.

I was going to say that this tells me is that one probably needs a
timeout parameter only to realize that there is one named socktimeout.
Bah. I haven't tested it yet, maybe a sensible default value is in
order.

Anyway, setting the SO_KEEPALIVE should not hurt, right?

_______________________________________________
OfflineIMAP-project mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/offlineimap-project

OfflineIMAP homepage: http://software.complete.org/offlineimap
 
CD: 3ms