[Bug 104956] dimap: sudden mail loss

Pierre Habouzit madcoder at debian.org
Wed Jun 28 17:22:43 UTC 2006


------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
         
http://bugs.kde.org/show_bug.cgi?id=104956         




------- Additional Comments From madcoder debian org  2006-06-28 19:22 -------
I've rethought a bit, and here is IMHO the explanation for the many instances of the dimap mail loss bug (that I really think is not in one but many places).

dimap is stateful, and kmail then has to trust a set of file to track what is already synced and what needs to. Those files are critical, because *any* corruption has to be noticed, and in case of corruption you have to fall back to the previous state.

When I tried to make kmail loose mails (in #71) I expected it to crash, or to say "internal error" because he can't write/read the uidcache file. which it didn't. so what has to be done is (IMHO):

(1) list all the files responsible for the statefulness of dimap in kmail (uidcache is part of them) ;
(2) track all uses of those files in the kmail source code, and CATCH THE DAMN ERRORS, and in case of errors, fail loudly.

If it happens to do things like:

a. begin transaction (read uidcache)
b. do a lot of things with our local cache of mails
c. end transaction (write uidcache) <--- fails here *bang*

then kmail should try hard to fall back to the state of (a)

Moreover if kmail craches during (b), it must have a way to tell he was in the middle of a transaction. A way could be to write in the uidcache (or like I already suggested to create a new file, but one more is maybe one too much ;p) that kmail is starting a transaction. When you restart a transaction, and that it already says that a transaction is started, then you are recovering from a previous crash, and you MUST HANDLE IT WITH GREAT CARE.



What I proved with my way to reproduce the bug is that kmail trusts files that it does not deals with with enough care. so it trusts crap, and no surprise it breaks from time to time.


and since kmail design of implicit deletion is fragile, (like kmail developers already aknowleged it) that quite big flaw of handling of index files, becomes a terrible catastrophe.



More information about the pkg-kde-bugs-fwd mailing list