Another stab at IMAP IDLE

Ethan Glasser-Camp glasse at cs.rpi.edu
Sun Dec 5 19:15:53 UTC 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.
>>
>> https://github.com/glasserc/offlineimap/tree/readd-idle
> 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?

Hi,

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 
work *sometimes*.

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).

Ethan




More information about the OfflineIMAP-project mailing list