Closed
Bug 368317
Opened 18 years ago
Closed 17 years ago
temp files remain if MoveToNative fails in nsSafeFileOutputStream::Finish()
Categories
(Core :: Networking: File, defect)
Core
Networking: File
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha5
People
(Reporter: Brade, Assigned: sciguyryan)
References
Details
(Keywords: fixed1.8.1.5)
Attachments
(1 file, 1 obsolete file)
1.69 KB,
patch
|
dveditz
:
approval1.8.1.5+
|
Details | Diff | Splinter Review |
When writing some extension code that uses nsSafeFileOutputStream, I noticed that temp files were not always removed. I tracked the problem down to the fact that inside nsSafeFileOutputStream::Finish(), mTempFile is not removed when MoveToNative() fails. Is this behavior intentional? It seems to me that a failure in the final move should be treated the same as other errors such as failure while writing to the temp file. I am happy to create a patch if this is indeed a bug.
Reporter | ||
Comment 1•18 years ago
|
||
Possibly related: In one of my main Firefox profiles, I see many files named bookmarks-nn.html. I'm not sure if this bug is causing that.
Reporter | ||
Comment 2•18 years ago
|
||
For reference, the original work and discussion is in bug 246675.
Comment 3•17 years ago
|
||
I'm not planning on working on this: -> default assignee.
Assignee: mvl → nobody
Assignee | ||
Comment 4•17 years ago
|
||
mvl: Is this behaviour actually intended? If not can we actually just remove the backup files without the risk of data loss or could there be another solution too this problem?
Comment 5•17 years ago
|
||
I guess one could argue that removing the temp file means there is data that's getting lost. But because the temp file won't be read anyway, I think that it's OK to remove the temp file.
Assignee | ||
Comment 6•17 years ago
|
||
Patch v1 Sounds good MVL, patch to make it so.
Assignee: nobody → sciguyryan
Status: NEW → ASSIGNED
Attachment #264390 -
Flags: superreview?(cbiesinger)
Attachment #264390 -
Flags: review?(cbiesinger)
Updated•17 years ago
|
Attachment #264390 -
Flags: superreview?(cbiesinger)
Attachment #264390 -
Flags: superreview+
Attachment #264390 -
Flags: review?(mvl)
Attachment #264390 -
Flags: review?(cbiesinger)
Comment 7•17 years ago
|
||
Comment on attachment 264390 [details] [diff] [review] Patch v1 >Index: netwerk/base/src/nsFileStreams.cpp >+ else { > nsCAutoString targetFilename; > rv = mTargetFile->GetNativeLeafName(targetFilename); I know you are not changing those two lines, but please do fix the indeting to 4 spaces. That's the file's style. r=mvl
Attachment #264390 -
Flags: review?(mvl) → review+
Assignee | ||
Comment 8•17 years ago
|
||
For checkin. (updated to comments)
Attachment #264390 -
Attachment is obsolete: true
Assignee | ||
Updated•17 years ago
|
Whiteboard: [checkin needed]
Comment 9•17 years ago
|
||
do you want this just on trunk? (bug was filed for 1.8 branch)
Assignee | ||
Comment 10•17 years ago
|
||
(In reply to comment #9) > do you want this just on trunk? (bug was filed for 1.8 branch) > Yea, the "version" should have been set to trunk (and I thought I did that actually).
Version: 1.8 Branch → Trunk
Comment 11•17 years ago
|
||
ok, checked in to trunk.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Updated•17 years ago
|
Flags: in-testsuite-
Comment 12•17 years ago
|
||
Er. It has occurred to me that it *is* actually possible to make MoveToNative reliably fail (permissions would be easiest on Unix-ish platforms, at the least), but I'd been thinking that it wasn't when I set this to -. Resetting to ? since making it fail reliably is *not* difficult, and thanks to biesi for making me think again about this...
Flags: in-testsuite- → in-testsuite?
Comment 13•17 years ago
|
||
Could we please get this patch for the branch as well? This would fix 351551 which can lead to notable performance issues.
Flags: blocking1.8.1.5?
Comment 14•17 years ago
|
||
A branch patch would be nice to have, not sure this is a "blocker" though. If you come up with a branch version please request branch approval for it.
Flags: blocking1.8.1.5? → wanted1.8.1.x+
Comment 15•17 years ago
|
||
Comment on attachment 265425 [details] [diff] [review] For checkin So, this patch even still applies cleanly to the 1.8.1 branch. Nice.
Attachment #265425 -
Flags: approval1.8.1.5?
Comment 16•17 years ago
|
||
Comment on attachment 265425 [details] [diff] [review] For checkin approved for 1.8.1.5, a=dveditz for release-drivers
Attachment #265425 -
Flags: approval1.8.1.5? → approval1.8.1.5+
Updated•17 years ago
|
Whiteboard: [checkin needed (1.8 branch)]
Target Milestone: --- → mozilla1.9alpha5
Comment 17•17 years ago
|
||
netwerk/base/src/nsFileStreams.cpp 1.72.8.1
Keywords: fixed1.8.1.5
Whiteboard: [checkin needed (1.8 branch)]
You need to log in
before you can comment on or make changes to this bug.
Description
•