Closed Bug 12850 Opened 25 years ago Closed 17 years ago

We need to bring over folder locks from 4.5

Categories

(MailNews Core :: Backend, defect, P4)

defect

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: mscott, Assigned: mscott)

References

Details

(Keywords: arch, helpwanted)

In 4.5 we had locks on each berkley mail folder. These locks prevented
multiple instances of the code from reading/writing into the same berkley mail
folder at the same time. We need to port this code into 5.0 as we don't have it
right now. Without this code, it is possible to run into the following
scenario:
    downloading new mail for a pop account which involves writing the messages
    into your berkley mail folder (your inbox)

    At the same time, you try to display a message in your inbox. This involves
    reading out of the same file we are trying to write new messages into.

Bad things can happen in this scenario. This is part of what may have happend to
Kat in Bug #11895. I'm just pulling it out into a separate bug.

We can hang the folder locks off the mail session or possibly off the particular
server which I believe has a list of all the subfolders in it.
Status: NEW → ASSIGNED
Target Milestone: M11
Accepting. M11.
Blocks: 11091
I was not paying attention yesterday - please ignore my previous comment.  I
pasted in the wrong text.
mscott - do you think this should be a dogfood bug as more people are going to
use mail?
Target Milestone: M11 → M12
Not holding M11 for this
Target Milestone: M12 → M13
Is this inbox lock going to be held throughout a POP download?  Or released
regularly so you can still read the inbox (with degraded performance due to lock
blocking)?
Target Milestone: M13 → M14
matty, in 4.x it was a write lock. You could have as many concurrent readers as
you want, but only one writer for as long as one operation (like POP download)
needed the write state to be consistent.

With respect to the performance question, we didn't keep multiple write requests
waiting in a queue -- we just turned them away, saying "come back later" or
something. So no performance degradation.
Keywords: beta1
Putting on PDT+ radar for beta1.
Whiteboard: [PDT+]
OK, you can have an appender while people are reading, makes sense.

I recall Win 4.x being OK in this area, but Linux 4.x prevents me from reading
msgs in the folder I had selected at the time of POP download initiation. 
Workaround is to switch to another folder and back.  I'm presuming here that
that's a lock problem.  No longer a problem?
Priority: P3 → P4
I'd nominate this bug for the early PDT+ cut award....Clearing the resolution so
PDT team can re-evaluate tomorrow when they begin cutting PDT bugs
Whiteboard: [PDT+]
Whiteboard: [PDT-]
Moving my remaining M14 bugs to M15 which is the next targeted milestone.
Target Milestone: M14 → M15
Since this bug is marked P4, moving to M17.  If you disagree, please let me know.
Target Milestone: M15 → M17
Mail Review recommends beta2 stopper.  Adding nsbeta2 keyword.
Keywords: nsbeta2
Putting on [nsbeta2+][6/01] radar.  This work must be done by 06/01 or we may 
pull this for PR2.
Whiteboard: [PDT-] → [nsbeta2+][6/01][PDT-]
Due to slip in schedule, moving this bug from [6/01] to [Will be minus on 6/15] 
for fix deadline.
Whiteboard: [nsbeta2+][6/01][PDT-] → [nsbeta2+][Will be minus on 6/15]
6/15 has passed... so I'm cleaning up the whiteboard and markeing beta2 minus.
The potential for corruption of a mail folders is a Real Bad Thing (TM), and 
hence I'm nominating for beta3.
Keywords: nsbeta3
Whiteboard: [nsbeta2+][Will be minus on 6/15] → [nsbeta2-]
... but as a side comment... I would have guessed that a "read" of a message 
from the POP server would amount to an append to a file, which would not 
significantly conflict with an effort to display a message.  Unless I'm missing 
the point, the only problem that would really appear would have to surround the 
deletion (or marking for deletion?) of a message, in such a way that the file 
size changed, *while* an attempt was made to appeand (or do a second write 
operation).  If I'm understanding, then the *critical* locking is between all 
write operations (includes delete, and append), and a less critical (?) bug 
involves getting locking on all read operations tied in.  Corruption can result 
from multiple read ops, but only a "seemingly trashed" message can result from 
failing to lock on a read.

Since I read the bug, I thought I'd toss in my 2 cents about what seemed more 
crucial... but not being a berkely mail folder expert... I could be way off.

Caveat Fixor.

Whiteboard: [nsbeta2-] → [nsbeta2-] [nsbeta3-]
for some reason beta1 keywords are turning into nsbeta1. removing it to not
cause confusion.
Keywords: beta1
Milestone 0.8 has been released. We should either resolve this bug or update its
milestone.
Keywords: nsbeta2, nsbeta3arch, helpwanted
OS: Windows NT → All
Whiteboard: [nsbeta2-] [nsbeta3-]
Target Milestone: M17 → ---
general profile locking bug for product is 
http://bugzilla.mozilla.org/show_bug.cgi?id=76431.
bienvenu, mscott thought that you might have implemented this, but all I could 
find was the stuff you did for folder locking and compacting.
QA Contact: lchiang → nobody
Product: MailNews → Core
Blocks: 20548
bienvenu says "nah" to this still being relevant to current mail infrastructure, so closing invalid.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → INVALID
we have folder semaphores in Thunderbird - we don't have external locks; we count on profile mgr locking to prevent multiple apps from accesssing the same folder
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.