Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » problem with unwanted notifications
problem with unwanted notifications [message #332139] Mon, 06 October 2008 19:29 Go to next message
Randall Theobald is currently offline Randall TheobaldFriend
Messages: 34
Registered: July 2009
Member
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 #332141 is a reply to message #332139] Mon, 06 October 2008 20:54 Go to previous messageGo to next message
Randall Theobald is currently offline Randall TheobaldFriend
Messages: 34
Registered: July 2009
Member
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.
Re: problem with unwanted notifications [message #332142 is a reply to message #332141] Mon, 06 October 2008 22:22 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33264
Registered: July 2009
Senior Member
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.
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: problem with unwanted notifications [message #332151 is a reply to message #332142] Tue, 07 October 2008 13:19 Go to previous message
Randall Theobald is currently offline Randall TheobaldFriend
Messages: 34
Registered: July 2009
Member
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
Previous Topic:Re: Command Dropdown in Toolbar
Next Topic:External tools and Build configuration variables
Goto Forum:
  


Current Time: Sat Dec 21 16:40:24 GMT 2024

Powered by FUDForum. Page generated in 0.05669 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top