If mark Read/Unread, Add/Remove Tag etc. is executed while "Compact Folder" is running, marking/tagging is lost after end of compaction
Categories
(MailNews Core :: Database, defect)
Tracking
(Not tracked)
People
(Reporter: World, Unassigned)
References
(Blocks 3 open bugs)
Details
Comment 1•16 years ago
|
||
| Reporter | ||
Comment 2•16 years ago
|
||
| Reporter | ||
Comment 3•16 years ago
|
||
| Reporter | ||
Comment 4•16 years ago
|
||
| Reporter | ||
Comment 7•16 years ago
|
||
| Reporter | ||
Updated•16 years ago
|
| Reporter | ||
Updated•16 years ago
|
| Reporter | ||
Comment 9•16 years ago
|
||
Updated•13 years ago
|
Updated•3 years ago
|
Comment 10•8 months ago
|
||
Should this issue be gone with the compact rewrite?
Comment 11•8 months ago
|
||
(In reply to Wayne Mery (:wsmwk) from comment #10)
Should this issue be gone with the compact rewrite?
No, I think it'll be the same. The compaction locks the folder, but there are loads of places which fiddle with things, ignoring the locking.
A bit part of the issue is that there isn't really any good definition of what the locking is suppose to protect - it's kind of a catchall covering the folder, database and local store, but it's not a good model.
For this issue, I think quick/easy thing would be to check the lock in the folder nsIMsgFolder functions, and fail the operation (NS_MSG_FOLDER_BUSY) if it is.
These functions would need the check (there's likely a few others I've missed):
.markMessagesRead()
.markAllMessagesRead()
.markMessagesFlagged()
.markThreadRead()
.markMessagesRead()
.addKeywordsToMessages()
.removeKeywordsFromMessages()
The lock checking shouldn't be done down at the database level (things like compaction, "repair folder" and IMAP checking messages hold a lock and call the DB-level functions, so they'd fail).
It also shouldn't be done up at the GUI level - way too much noise to add to code that shouldn't have to deal with it.
So, folder level it is.
It's possible that some of those folder-level functions are called in contexts where a lock is already held, which would complicate things for any server-linked protocols (IMAP, EWS etc).
In any case, I'd say the first step here would be to implement failing unit tests to simulate mark/tag operations being lost during compaction, to reliably demonstrate the issue...
Then write fixes to the code to make the tests pass.
Description
•