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

Bug 381832

Summary: Concurrent workspace save operations
Product: [Eclipse Project] Platform Reporter: Szymon Ptaszkiewicz <sptaszkiewicz>
Component: ResourcesAssignee: Platform-Resources-Inbox <platform-resources-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: Szymon.Brandys
Version: 3.8   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug
Bug Depends on: 381724    
Bug Blocks:    
Attachments:
Description Flags
Test case
none
Updated test case none

Description Szymon Ptaszkiewicz CLA 2012-06-06 05:20:48 EDT
Created attachment 216914 [details]
Test case

Specific implementation of ISaveParticipant can create possibility to bypass the workspace lock. In conjunction with bypassing conflicting scheduling rules as described in bug 381724, this allows to begin two workspace save operations at the same time.

See the attached test case for a sample implementation.

To reproduce the problem you need to run the test case in debug mode with the following steps:
1. Create a breakpoint in SaveManager in line 1128 (the line with broadcastLifecycle(PREPARE_TO_SAVE, ...)).
2. When the breakpoint is hit for the first time 'Step Over' the line.
3. See that now you have two threads inside workspace save operation that is secured by scheduling rule and workspace lock.

The two threads are not running concurrently as independent operations - they acquire workspace lock in turns depending on the save participant method being called, but they managed two enter critical section at the same time which is already bad. Simultaneous workspace.save(..) operations are one of the potential root causes of bug 149121.
Comment 1 Szymon Ptaszkiewicz CLA 2012-06-07 10:14:01 EDT
Created attachment 217025 [details]
Updated test case

The proposed fix for bug 381724 solves this bug for full save and snapshot. It is still possible to run two project save operations concurrently. Updated test cases shows a sample scenario.
Comment 2 Szymon Brandys CLA 2012-11-05 07:56:30 EST
Szymon P., do you plan to work on this during 4.3. If not, please reset the target milestone.
Comment 3 Szymon Ptaszkiewicz CLA 2012-11-05 08:18:05 EST
(In reply to comment #2)
> Szymon P., do you plan to work on this during 4.3. If not, please reset the
> target milestone.

I am still chasing intermittent problems with workspace save and metadata corruption so in general yes.
Comment 4 Eclipse Genie CLA 2020-01-26 11:53:28 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.