Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 236649

Summary: [externalization] lost activity context after system crash
Product: z_Archived Reporter: Mik Kersten <mik.kersten>
Component: MylynAssignee: Project Inbox <mylyn-triaged>
Status: CLOSED MOVED QA Contact:
Severity: normal    
Priority: P2 CC: robert.elves, shawn.minto, steffen.pingel
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 240987    
Bug Blocks:    
Attachments:
Description Flags
fix for concurrency issue
none
log none

Description Mik Kersten CLA 2008-06-11 10:58:16 EDT
I had to reset my laptop, and when I restarted all my task activity was gone.  This happened to me previously with Mylyn 3.0 as well.  It had never happened happened prior to Mylyn 3.0, so I'm wondering whether we are writing this file much more frequently now.  I addition, it looks like it should be using the proper safe save policy, but isn't.
Comment 1 Steffen Pingel CLA 2008-06-11 15:33:49 EDT
Rob, you might want to check if the reading of the activity file ignore parsing errors. I remember that some changes were made to avoid logging of errors when the file was corrupted.
Comment 2 Mik Kersten CLA 2008-06-12 15:25:35 EDT
Rob: you might just need to copy over the copy-and-move code due to the fact that we haven't yet extracted saving into commons.
Comment 3 Robert Elves CLA 2008-06-13 16:51:17 EDT
Committed activity snapshots.  Any further improvements will need to happen for 3.1 and frequency being addressed on bug#236365.
Comment 4 Mik Kersten CLA 2008-06-30 13:46:44 EDT
I just experience the loss again, running from HEAD.  Same story with the crash: ThinkPad froze during sleep, I had to hard reset it.  Task List and all else looked fine, but activity was lost.
Comment 5 Robert Elves CLA 2008-06-30 14:02:33 EDT
Updated to restore if file exists and length = 0. Please bootstrap when you get a chance.
Comment 6 Robert Elves CLA 2008-07-03 13:11:59 EDT
The problem here is that if sequentially a Task List or Activity rule is acquired, subsequently the root rule can be acquired without blocking.  Lets pair on this today.
Comment 7 Robert Elves CLA 2008-07-03 19:29:43 EDT
Created attachment 106528 [details]
fix for concurrency issue

Updated and tested as per our discussion. Also added the conflict with root check to the task list scheduling rule. If this seems fine just commit it and we can work bootstrapped on this for a while.
Comment 8 Steffen Pingel CLA 2008-07-04 15:55:03 EDT
Patch applied.
Comment 9 Mik Kersten CLA 2008-07-16 02:11:47 EDT
I lost my task activity again.  Looks like it happened on Sunday, since I only see activity for Monday and Tuesday.  I've been working from HEAD.  Reopening to make sure that this is fixed now?
Comment 10 Steffen Pingel CLA 2008-07-16 03:28:55 EDT
The bug was fixed yesterday.
Comment 11 Mik Kersten CLA 2008-11-05 10:30:55 EST
This happened to me again a few weeks ago.  Probably after a hard reset, which I have not being doing muc lately.

Both .activity.zip and activity.xml.zip were 441 bytes afterwards

Had to manual restore from backup.

[Fatal Error] :1:1621448: Attribute "EndDate" was already specified for element "InteractionEvent".
[Fatal Error] :1:1621448: Attribute "EndDate" was already specified for element "InteractionEvent".

Comment 12 Mik Kersten CLA 2008-11-05 10:31:41 EST
Created attachment 117099 [details]
log
Comment 13 Robert Elves CLA 2009-09-11 13:18:03 EDT
Haven't seen this problem in a long time. Moving to backlog...
Comment 14 Steffen Pingel CLA 2010-02-04 22:05:06 EST
Rob, how are out of memory or other VM errors currently handled in the externalization participants? Is there a scenario where repeated failed attempts to save could cause good snapshots to be overridden with corrupt versions (see also bug 251473)?
Comment 15 Shawn Minto CLA 2010-02-05 00:24:31 EST
From my knowledge, this could happen as we don't have a way to validate that the snapshot or the file is not corrupt (which we should probably do before overwriting and saving the snapshot).  If we add support for a verification check given a file, I think that there would be very little chance of corruption.
Comment 16 Robert Elves CLA 2010-02-05 12:23:21 EST
Both have yet to be done.  Validation of what is externalized and a pass through the code to ensure we handle the exceptions similarly to  bug 251473. But before diving into validation we'll need to first consider it conjunction with the mechanism used to achieve bug#236365.  Validation of the entire activity history with every append would not be practical. I'll gather these and other activity concerns and then schedule a design discussion.
Comment 17 Eclipse Webmaster CLA 2022-11-15 11:45:08 EST
Mylyn has been restructured, and our issue tracking has moved to GitHub [1].

We are closing ~14K Bugzilla issues to give the new team a fresh start. If you feel that this issue is still relevant, please create a new one on GitHub.

[1] https://github.com/orgs/eclipse-mylyn