[Kde-pim] trying to understand akonadi

Daniel Vrátil dvratil at redhat.com
Thu Oct 17 10:31:55 BST 2013


On Wednesday 16 of October 2013 20:45:06 Martin Koller wrote:
> On Wednesday 16 October 2013 20:06:16 Kevin Krammer wrote:
> > Hi,
> > 
> > Am Mittwoch, 2013-10-16, 19:47:00 schrieb Martin Koller:
> > > Hi,
> > > 
> > > I have a problem with kmail (4.11.2) where my mbox resource (which is
> > > filled from an external program) often shows a mail with
> > > subject/sender/date:Unknown.
> > > 
> > > Currently I have such a mail and I try to find out what's going on in
> > > akonadi. This mbox file has a few other mails (e.g. grep ^Date: finds 4
> > > lines), but only 1 is shown (I assume the others are already
> > > marked/stored
> > > internally by the mbox resource as deleted, which is fine). The one
> > > shown
> > > is the "unknown" problem.
> > 
> > [snip analysis]
> > 
> > > I have no idea what this columns shall contain, but checking some other
> > > entries shows that the PLD:ENVELOPE record should contain something
> > > useful
> > > in the data field (Date, subject, etc.). So this situation would explain
> > > why I see "unknown" as the data holds "NIL ..."
> > > 
> > > Any idea why this can happen ?
> > > Who fills that fiels and when ?
> > 
> > One possible reason could be that the mbox resource is acting to quickly
> > to
> > the file change notification.
> > I.e. maybe the resource starts parsing the new mail before it is ready.
> 
> this should not happen as both lock the file.
> Also in this case, the mbox entry (the From ... header) shows a date/time of
> 2013-10-16T17:40:18 but in akonadi I see 2013-10-16 17:40:23

Quick look into MBoxResource code shows, that the bug is indeed on our side.

When the mbox file changes, SingleFileResourceBase calls invalidateCache( 
Collection::rootCollection() ), which leads to calling MBox::retriveItems(). 
It tries to lock the MBox (calling MBox::lock()), but completely ignores it's 
return value, whether the locking was successful or not and just continues 
syncing. Proper fix would probably be to call delayTask() if locking fails, but 
I'll have to test it, as I don't use MBox (maybe tomorrow, unless someone 
beats me to it).

>
<snip>
> 
> can I somehow force kmail to re-read the mail ? (update folder does not
> change anything). Sometimes I have seen that when selecting such a mail and
> apply the filters (CTRL-J) the mail suddenly is moved correctly to the
> target folder and there it is shown with all details.

In Akonadi Console in Browser tab right-click the folder and click "Clear 
Akonadi Cache", then click "Synchronize folder". Restart AC and KMail to show 
the changes.


-- 
Daniel Vrátil
KDE Desktop Team
Associate Software Engineer, Red Hat, Inc.

GPG Key: 0xC59D614F6F4AE348
Fingerprint: 4EC1 86E3 C54E 0B39 5FDD B5FB C59D 614F 6F4A E348
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20131017/dece4f41/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list