[Kde-pim] trying to understand akonadi

Daniel Vrátil dvratil at redhat.com
Fri Oct 18 15:11:17 BST 2013


On Thursday 17 of October 2013 18:44:56 you wrote:
> On Thursday 17 October 2013 11:31:55 Daniel Vrátil wrote:
> > > > 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).
> 
> That sounds great! If you send me the patch, I'll compile it here and try it
> out.

Ooops, turns out I was too fast in my judgement. The lock() method will block 
(at least when using the "lockfile" utility, haven't tried other), so there's 
no  need to check for return value of lock() and the code is fine.

Maybe make sure your code calls fsync() to ensure the data are actually 
written do disk (afaik QFile::flush() only sends buffers to OS, but does not 
ensure they are written).

> > <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.
> 
> Thanks for the hint

-- 
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/20131018/ec131686/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