[Akonadi] [Bug 335776] IMAP agent crashes frequently

Christian Mollekopf mollekopf at kolabsys.com
Thu Sep 25 18:39:40 BST 2014


https://bugs.kde.org/show_bug.cgi?id=335776

--- Comment #6 from Christian Mollekopf <mollekopf at kolabsys.com> ---
(In reply to Daniel Vrátil from comment #5)
> I discovered one of the possible causes of the crash:
> 
> In ItemSync, when the ItemCreateJob fails, the TransactionSequence is rolled
> back and ItemSync emits finished() - to which ResourceBase reacts by marking
> the task as done and scheduling another task. However the BatchFetcher in
> IMAP resource is not aware of this and keeps feeding more items through
> ResourceBase::itemsRetrieved() - which eventually hits the assert in
> ResourceBase, because ResourceBase has already moved on to another non-sync
> task.
> 

Interesting, I actually checked this codepath and though it's fine.
ItemSync::slotResult is supposed to handle this case by silently ignoring
errors and continuing anyways. I take that somehow doesn't work then?

> Not sure how to solve this - ItemSync is internal to ResourceBase, so
> there's no way how to tell resource implementation that ItemSync has failed
> and so that they should stop sending more items. 

Just as we can ask for more items, we should also be able to signal that the
task was aborted.
But it's in any case a mess to pass this through the current API, so I'd prefer
to postpone that for a new API.

>Good-enough fix would
> probably be to make TransactionSequence in ItemSync to ignore ItemCreateJob
> failures and handle the error manually (somehow) and continue, or just
> abort, but let the caller to feed ItemSync all its items (just do nothing
> with them) and then terminate - i.e. prevent ItemSync for ever aborting
> prematurely. Proper fix would be to make Sync a cancellable operation, so
> that we can tell resource to stop feeding ResourceBase with items because
> there was an error.
> 

I'm for simply continuing with the sync.

> 
> Regarding the reasons for ItemCreateJob failure: in my case this was
> happening because somehow I had two items with the same RID in one
> Collection (probably the RID wasn't reset during MOVE or something), so
> MERGE handler will abort with "Multiple merge candidates" error and so the
> ItemCreateJob fails.

Something to investigate.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Kdepim-bugs mailing list