Bug 94764 - Incorrect error reporting when PRE_CLOSE listener changes tree
Summary: Incorrect error reporting when PRE_CLOSE listener changes tree
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P5 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Resources-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-11 11:48 EDT by John Arthorne CLA
Modified: 2019-09-06 16:17 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2005-05-11 11:48:00 EDT
Build: I20050509-2010

If a PRE_CLOSE resource change listener tries to modify the workspace, they
should get an exception explaining that the tree is locked.  In some cases they
do not get this exception, but instead get a different exception stating that
the scheduling rule conflicts (see bug 94435).
Comment 1 John Arthorne CLA 2005-05-11 13:53:13 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.
Comment 2 Chuck Bridgham CLA 2005-09-08 23:58:42 EDT
*** Bug 104456 has been marked as a duplicate of this bug. ***
Comment 3 Eclipse Webmaster CLA 2019-09-06 16:17:11 EDT
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.