Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 196283 - Improve task list save mechanism ideally eliminating deferred write
Summary: Improve task list save mechanism ideally eliminating deferred write
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: 2.0   Edit
Hardware: PC All
: P2 normal (vote)
Target Milestone: 3.0   Edit
Assignee: Robert Elves CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 158067
  Show dependency tree
 
Reported: 2007-07-12 05:43 EDT by Tilmann Zaeschke CLA
Modified: 2008-05-05 17:53 EDT (History)
1 user (show)

See Also:


Attachments
in progress patch (378.33 KB, patch)
2008-04-29 03:50 EDT, Robert Elves CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tilmann Zaeschke CLA 2007-07-12 05:43:54 EDT
When eclipse crashes, then it appears to loose all updates and new tasks that have been entered since eclipse has been started.
I'm using a "Local Repository" for my Tasks, but haven't tried any other task.

To reproduce:
-------------
Create a new Task in the "Local Repository" or modify an existing task.
Press "save".
[optional] Press "synchronize changes"
Kill eclipse using 'xkill' or 'kill -9'.
Restart eclipse and all changes are lost.


Workaround:
-----------
shut-down and restart eclipse after every new/modified task.

Platform:
---------
I'm using eclipse 3.3 on RedHat 4.0, with Mylyn 2.0.0 as shipped with the standard 3.3 distribution.


I hope I'm simply doing something wrong, but I can't see what.
In case I'm indeed doing something wrong, it would be good if I'd see a warning, telling me that my changes are not stored persistently for whatever reason.
Comment 1 Mik Kersten CLA 2007-07-13 03:47:49 EDT
Nothing should be lost other than any unsaved contents of task editors (the standard Eclipse save policy).

Rob: I have never seen this, please investigate.
Comment 2 Tilmann Zaeschke CLA 2007-07-13 10:05:40 EDT
Update:
After installing eclipse on a different machine, it was a bit difficult to reproduce the problem. It seemed that I had first to add a new "Category" (called "Completed"). I then added Tasks to the old and the new category, restarted eclipse, modified the Task and then killed eclipse with 'kill -9'. Then problem occurred again, further updates were lost, unless eclipse was shut down properly.
The problem remained, even when I removed this new Category.

For clarification: I had this additional category also on the machine were the problem initially occurred.


Comment 3 Robert Elves CLA 2007-07-13 13:50:45 EDT
There is a delayed write to disk of the task list for performance reasons. Perhaps this should be reduced or made configurable?
Comment 4 Eugene Kuleshov CLA 2007-07-13 14:07:49 EDT
There should be no delay (because it will cause data loss like one reported), however all subsequential write requests need to be posponed until the first write is completed and they should be also optimized into one request. For some reason I thought it is working this way, but maybe it is been lost after one of the refactorings.
Comment 5 Tilmann Zaeschke CLA 2007-07-20 04:21:34 EDT
Just for clarification, could you tell how long this delay is?
Because I have lost several hours of work, which were not saved.
I hope this doesn't sound too harsh, but according to my experience, once I have created the additional category and added one or two tasks, _no_ changes are stored _ever_, even if eclipse crashes only several hours later.

I couldn't find any information on when 3.0 will be released, but if this is only next year, then I will have to stop using Mylyn, because it is simply not feasible to shut-down/restart eclipse every time I update a task. This would be a pity, because after using this plug-in for a month, I can already not imagine any more to work without it.
I know this stuff doesn't really belong into a bug report, but please consider releasing a fix as a patch/minor release, rather than waiting for the next major release.

Please let me know if you have problems reproducing it, so I can come up with more details.
Comment 6 Robert Elves CLA 2007-07-20 13:41:48 EDT
The save interval of the tasklist is 1 minute. So worst case scenario is you add a task, add some note to it etc then kill the workbench all within 1 minute. This could cause a loss of information. But from your comment it appears there is a larger problem here.  Could you check for tasklist...-save files in your <workspace>/.metadata/.mylyn folder.  Is there an old <workspace>/.mylar folder around?
Comment 7 Tilmann Zaeschke CLA 2007-07-23 07:31:53 EDT
I checked, and I couldn't see any of these files, only the following ones:

ls -a ~/eclipse-workspace/.metadata/
./   .bak_0.log  .bak_2.log  .bak_4.log  .bak_6.log  .bak_8.log  .lock	.mylyn/    version.ini
../  .bak_1.log  .bak_3.log  .bak_5.log  .bak_7.log  .bak_9.log  .log	.plugins/

ls -a ~/eclipse-workspace/.metadata/.mylyn/
./  ../  backup/  contexts/  offline/  repositories.xml.zip  tasklist.xml.zip


I also realised that during my efforts to reproduce the problem, I may have always stayed below the 1 minute limit.

I can now only blame it on the fact that I was switching back and forth between eclipse 3.2 and 3.3 an umber of times, or on the OutOfMemory problems that I had, which kept my eclipse crashing (and maybe caused some background threads to bail out prior to the crash?).

So I can't reproduce it at the moment (with delay > 1 minute), I'll will let you know in case it happens again.
Comment 8 Robert Elves CLA 2007-07-24 00:38:44 EDT
Thanks for the update Tilmann. Renaming this report to address task list save interval.
Comment 9 Robert Elves CLA 2008-04-29 03:50:39 EDT
Created attachment 97925 [details]
in progress patch
Comment 10 Robert Elves CLA 2008-05-05 17:53:39 EDT
Save now executes immediately and is a copy write operation. 
Save/Reload/Import/Dir Change operations all protected.