CFT: fix OfflineIMAP lockup in single-threaded mode
boite.pour.spam at gmail.com
Mon Jan 28 20:37:18 GMT 2013
I'm ok with the first patch, but I would merge it with the last one, and
update the part that read:
if self.suggeststhreads() and self.config.get('general',
'single-thread') == 'False':
to simply this:
suggeststhreads() should do the self.config.get uglyness in this patch, so
it's self sufficient (one can apply it and does not depend on any later
Then, the depot/Option part, if you don't mind, need a bit a work, before
If I understand what you're doing, your Singleton class has a static dict
member called "__options", and each time you need to check for an "option",
you create an instance of the Option class that simply refer to this static
This is, a bit unusual. If one changes the Option() instance, it's only
local, as a static member change make it instance member, right ?
In that case, it's not const (read only). In the same module, a change of
the option variable would still work, so it won't break as soon as you're
changing it (but at least it'll not break the other modules) .
You probably meant this:
# Put in const.py...:class _const:
class ConstError(TypeError): pass
raise self.ConstError, "Can't rebind const(%s)"%name
And it'd be used as this:
import const# and bind an attribute ONCE:const.singlethread = True;
# else it fails:const.singlethread = False; # raise const.ConstError:
Let me know if I understand correctly, so we can have a better
implementation of the "depot" idea. I find the idea of a global "depot"
more interesting than instantiating a new object each time needed.
Then we would again update the suggestthreads() to use the depot
(const)option object directly.
On Mon, Jan 28, 2013 at 8:46 PM, Eygene Ryabinkin <rea at codelabs.ru> wrote:
> Mon, Jan 28, 2013 at 05:10:50PM +0100, Nicolas Sebrecht wrote:
> > On Mon, Jan 28, 2013 at 02:10:57AM +0400, Eygene Ryabinkin wrote:
> > > Sun, Jan 27, 2013 at 08:39:13PM +0100, Nicolas Sebrecht wrote:
> > > > So, about this subtle and critical topic I'd say it's fine to go
> step by
> > > > step. This would prevent from non-required headaches and could later
> > > > help to distinguish newly introduced issues coming from the "core"
> > > > and the "polishing" commit.
> > >
> > > Well, I had missed this paragraph while I was polishing my commit.
> > > split it into two tomorrow.
> > There is no requirements for two commits either. ,-)
> But it will really be good, so here we go. The first patch,
> I expect that Cyril will review it, I had posted an answer to his
> The second one, that adds singleton options depot,
> Cyril had some comments, I had some answers. Will see tomorrow.
> Small patch that disables IMAP suggestion to use multithreaded operations
> if we're in single-threaded mode,
> In the current form relies on the previous patch.
> OfflineIMAP-project mailing list
> OfflineIMAP-project at lists.alioth.debian.org
> OfflineIMAP homepage: http://software.complete.org/offlineimap
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the OfflineIMAP-project