Another stab at IMAP IDLE
glasse at cs.rpi.edu
Sun Dec 5 19:15:53 GMT 2010
On 12/02/2010 07:12 PM, Nicolas Sebrecht wrote:
>> I have run it a few times successfully, but it's still a
>> work in progress. If you're interested, it's the readd-idle branch
>> of my github fork of offlineimap.
> Could you please send the whole topics here by mail instead? It would be
> better to have a community work rather than an offline isolated work on
> this. Don't you think?
Well, if you want, sure. I figured putting it on a github fork was an
invitation for other people in the community to give feedback.
I'm not seeing mysterious indefinite hangs with the following patches,
but I am seeing that the offlineimap setting "socktimeout" is no longer
respected. This is because the most recent imaplib2 uses non-blocking IO
(socket.poll) in a separate thread to check for a response. This means
that (on my machine) an offlineimap thread can hang for 15-20 minutes
before getting a "connection timed out" error.
I've been working on this by adding a timeout to the thread that is
waiting for a response (Request.get_response) but this only seems to
Another thing I've noticed is that it seems like an IDLE thread is
created after every sync, including every quick sync. I haven't dug into
this yet, but it seems like this means the number of threads increases
gradually forever, and also that we may have more than one thread doing
an IDLE on a given folder at a time (which is unnecessary at best).
More information about the OfflineIMAP-project