Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 240987 - [externalization] consider using save + copy cycle
Summary: [externalization] consider using save + copy cycle
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P1 major (vote)
Target Milestone: ---   Edit
Assignee: Robert Elves CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 236649 248367
  Show dependency tree
 
Reported: 2008-07-15 16:29 EDT by Robert Elves CLA
Modified: 2009-04-13 19:14 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Elves CLA 2008-07-15 16:29:16 EDT
Currently snapshots are taken before save, investigate updating this to a write and copy cycle for the next release to help guard against VM crashes.
Comment 1 Robert Elves CLA 2008-07-16 16:34:46 EDT
Remaining failure scenario: 

1) write takes place but gets corrupted in the process (file exists and is > 0 bytes and is corrupt)
2) system remains operational (i.e. NOT a VM crash so workbench remains).  The case of recovering from corruption upon reading is already handled.
3) upon subsequent save, the snapshot taken is of a corrupt file wiping out a good backup

If this (tricky) scenario happens we now have two corrupt files instead of one corrupt and one good snapshot. Unfortunately, even if we are writing to a temp file and then copying, we may still overwrite a perfectly good file with a corrupt one if upon write the stream is unknowingly corrupted. Our only option here may be to verify the file before copying (be it the existing copy -> write solution or the write -> copy alternative).
Comment 2 Robert Elves CLA 2008-08-11 17:17:17 EDT
Since last fix to activity persistence, we haven't had report of more failures.  Looking into background information before proceeding with any further optimization.  If I can locate some solid literature on this then we might be able to apply it to 3.1. 
Comment 3 Mik Kersten CLA 2009-04-13 19:14:39 EDT
The current model has been working well.