Summary: | Incorrect error reporting when PRE_CLOSE listener changes tree | ||
---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | John Arthorne <john.arthorne> |
Component: | Resources | Assignee: | Platform-Resources-Inbox <platform-resources-inbox> |
Status: | ASSIGNED --- | QA Contact: | |
Severity: | normal | ||
Priority: | P5 | CC: | thatnitind |
Version: | 3.1 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Whiteboard: |
Description
John Arthorne
2005-05-11 11:48:00 EDT
PRE_CLOSE notification currently happens before acquiring any scheduling rule. Thus if another workspace operation runs in another thread during PRE_CLOSE notification, it will reset the "tree locked" flag when it finishes (POST_CHANGE notification at the end). After that, if a PRE_CLOSE listener tries to modify the workspace, the tree is no longer locked, so they get the scheduling rule error instead. One solution is to use a ThreadLocal for storing the tree locked state, to avoid it being corrupted by a concurrent operation in another thread. Another solution is to hold the workspace lock while performing PRE_CLOSE notification. This will prevent concurrent operations from happening in other threads. This might be the better solution since resource change listeners are likely not expecting to be called in multiple threads concurrently. This might be a bit risky for 3.1. Considering it has always been this way there is not a compelling risk of waiting until 3.2 to fix it properly. *** Bug 104456 has been marked as a duplicate of this bug. *** 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. If you have further information on the current state of the bug, please add it. 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. |