| 
| problem with unwanted notifications [message #332139] | Mon, 06 October 2008 15:29  |  | 
| Eclipse User  |  |  |  |  | I am a performance analyst for an adopting product on the 3.4 release. I am currently chasing an intermittent issue caused by what I think might be
 a bug in the Workspace or NotificationManager classes.
 
 Basically, I have an IWorkspaceRunnable which is running with the
 IWorkspace.AVOID_UPDATE option. I am creating many files and they all need
 to be created before notification of resource change events occurs.
 However, a resource change listener is getting notified after an
 individual File.create call, instead of at the end of the workspace
 runnable. As I understand it, this should not be happening. Here is a
 partial callstack showing the problem:
 
 at
 org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponent ClasspathUpdater.resourceChanged
 at org.eclipse.core.internal.events.NotificationManager$2.run
 at org.eclipse.core.runtime.SafeRunner.run
 at org.eclipse.core.internal.events.NotificationManager.notify
 at  org.eclipse.core.internal.events.NotificationManager.broadca stChanges
 at  org.eclipse.core.internal.resources.Workspace.broadcastPostC hange
 at org.eclipse.core.internal.resources.Workspace.endOperation
 at org.eclipse.core.internal.resources.File.create
 at org.eclipse.core.internal.resources.File.create
 at <product class 1>.createFile
 at <product class 1>.run
 at <product class 2>.run
 at org.eclipse.core.internal.resources.Workspace.run
 at <product class 3>.run
 at org.eclipse.core.internal.resources.Workspace.run
 
 Where both of the Workspace.run calls pass in the AVOID_UPDATE flag. It
 seems that just the fact that I am getting this proves that something is
 amiss. However, I might not fully understand when notifications are
 permitted.
 
 Has anybody seen a problem like this?
 
 Looking at the code, it appears that the only way that this could happen
 is if a NotificationManager.notifyJob was scheduled before entering the
 IWorkspaceRunnable (though I have not confirmed this). Wouldn't it be
 better to either (1) run any pending notifications before entering the
 IWorkspaceRunnable, or (2) defer any pending notifications until after
 exiting the IWorkspaceRunnable? A third option might be to allow the
 notifications, but only those that took place before entering the runnable.
 |  |  |  | 
|  | 
|  | 
| 
| Re: problem with unwanted notifications [message #332151 is a reply to message #332142] | Tue, 07 October 2008 09:19  |  | 
| Eclipse User  |  |  |  |  | Ed Merks wrote: 
 > Randall,
 
 > Opening a bugzilla, along with a test case, seems like a great idea.
 > Please post the bugzilla number here.  Many projects have JUnit tests
 > they public, so basing the test case on one of those is a good
 > approach.    I know that the internal processes you follow require a
 > test case, so it's likely you can get help with how to do that...
 
 
 
 > Randall Theobald wrote:
 >> I confirmed that the notification is indeed running during the
 >> IWorkspaceRunnable (from a previous notifyJob.schedule outside the
 >> IWorkspaceRunnable). I will be opening a bug for this unless told
 >> otherwise very soon.
 >> I hope to write a testcase to show the problem, but since I've never
 >> done that, some help would be appreciated.
 >>
 >>
 
 I have opened:
 
 https://bugs.eclipse.org/bugs/show_bug.cgi?id=249951
 |  |  |  | 
Powered by 
FUDForum. Page generated in 0.03896 seconds