Closed Bug 155281 Opened 23 years ago Closed 23 years ago

Moving msgs to local folders when disk space is full results in loss of msgs

Categories

(MailNews Core :: Backend, defect)

x86
Windows NT
defect
Not set
critical

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: sheelar, Assigned: naving)

Details

(Keywords: dataloss)

Attachments

(1 file)

commercial branch and trunk build: 2002-07-01 on winNT Found this bug while verifying for another disk space bug(151699). We don't check for the disk space when we are moving messages and we loose that message from the source folder. If you check the destination folder you would see the message in the thread pane and the contents of the message is lost permanently Steps to repro: Move message from pop inbox to a local folder without any disk space left. Actual: You loose the message from source. The message is seen on the thread pane in the destination folder but the contents are lost. Expected: Should detect the disk space and then move the message if not abort the move.
Sorry correcting the summary. Nominating this for RTM since it is a data loss.
Keywords: dataloss, nsbeta1
Summary: messgs when disk space is full results in loss of messages → Moving messgs when disk space is full results in loss of messages
working on a fix.
Status: NEW → ASSIGNED
Component: Networking: POP → Mail Back End
Summary: Moving messgs when disk space is full results in loss of messages → Moving msgs when disk space is full results in loss of msgs
Summary: Moving msgs when disk space is full results in loss of msgs → Moving msgs to local folders when disk space is full results in loss of msgs
Attached patch proposed fixSplinter Review
The fix is to check how many bytes have actually been written. If it doesn't match the number of bytes we wanted to write throw write error alert and abort the operation. The error needs to be propogated so that the file transport request can be cancelled. I had to add a boolean m_writeFailed so that we know the write has failed in EndCopy and EndMove code.
David, Cavin, Can I get reviews? thx. I have tested this by shrinking my partition and this fix works.
did you try this on Linux and mac?
How will it make any difference. We have other code that checks for write failure in the same way, like when we are downloading pop3 msgs.
I just want to make sure it doesn't break anything on linux or mac, since file system stuff tends to be rather platform dependent (things like line endings, file io buffering, etc). It would also be nice to know if this fixes the problem on linux and/or mac as well.
Comment on attachment 89993 [details] [diff] [review] proposed fix sr=bienvenu, but I really think this should be at least run on linux and mac.
Attachment #89993 - Flags: superreview+
Our nsOutputFileStream::Write is platform independent. I don't think anything should change but I can run the fix on other platforms. BTW, this is for trunk, so could I use release builds after I have checked in.
Comment on attachment 89993 [details] [diff] [review] proposed fix r=cavin.
Attachment #89993 - Flags: review+
yes, a release build is OK - you should, however, get the error message text reviewed by robinf. Would we be putting up that same error message in the case of a move?
yes, I ran the fix on mac and linux and it doesn't break anything, though I have not tested the fix. yes, we would be putting the same error msg for move also. It is the copy that is failing so I think it is ok.
whoa, wouldn't a move fail in exactly the same way? Internally, a move is simply a copy followed by a delete.
and, to elaborate, the delete doesn't save any disk space because you'd need to compact the local folder before any of the disk space would be reclaimed.
I am saying move and copy will show the same alert because it is actual copying of msg that fails, so the alert wording will be same for both cases.
ah, sorry. I'm saying that the user may be doing a move, and thus to see a message saying that the copy failed might be a bit confusing/wrong.
+copyMsgWriteFailed=... Suggested text: "The messages could not be moved or copied to folder '%S' because writing to the folder failed. From the File menu, choose Compact Folders, and then try again."
I can change "copied" or "moved/copied" if robin also agrees.
robin, Compact will not work. So we need to alert the user that there is no disk space (this is important).
unfortunately (an understatement!), compact folders might not work in true low disk situations, because to compact the folder, we must first copy all the non-deleted messages into a new temporary folder, before we can reclaim space from the original folder. I know we like to offer a remedy to problems in our error messages - in this case, recommending emptying the trash and then maybe compacting folders might be better advice.
I meant Compact *may* not work. why can't we ask user to create free disk space and try again, something like we have for other similar write failure alerts (like the compact one...) "Verify that you have enough disk space, and that you have write privileges to the file system, then try again."
I think we *should* ask them to free up disk space, and emptying the trash is the best way to free up disk space, at least from our app.
"The messages could not be moved or copied to folder '%S' because there is not enough disk space. To gain disk space, from the File menu, first choose Empty Trash, and then choose Compact Folders, and then try again."
fixed on trunk.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Keywords: adt1.0.1
Resolution: --- → FIXED
Keywords: nsbeta1nsbeta1+
if we're proposing this for the release, note that there's a ui resource change required.
I'm not sure we need this for this release. We need verification and l10n approval before it could be considered.
we're adding adt1.0.1-. Let's get this in the next release.
Keywords: adt1.0.1adt1.0.1-
I was able verify this on both WinNT and Linux rh6.2. I still have to check this on Mac machine. We do not move the message if we run out of disk space. And I did see the dlg come up when trying to move a message when the disk space was full. But the wording is a little bit different from what has been suggested in comment # 23. I will break a seperate bug for that. But we don't loose the message anymore. Commercial trunk build: 07-03-08 on win98, linux rh6.2 fixed. Will try to verify this on the mac as well[looking for a machine to test] Any means to tweak easily on Mac to fill the disk space? I have a dual boot OS X and Mac 9.1 with 21.55GB available space.
QA Contact: sheelar → stephend
Using branch build 20030610 on macosx this is fixed. verfied. I tried to move a message that exceeded my disk space size and received and error that there was not enough disk space to move the message. The message or message header did not get moved and was still intact after the failure. Verified
Status: RESOLVED → VERIFIED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: