Bug 194897 - Refreshing subsystem via F5 leads to Unhandled exception in event loop
Summary: Refreshing subsystem via F5 leads to Unhandled exception in event loop
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-29 05:52 EDT by Uwe Stieber CLA
Modified: 2007-07-04 12:30 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 Uwe Stieber CLA 2007-06-29 05:52:54 EDT
- Launch RSE 2.0
- Expand Locals node
- Select Local Shells
- Use keyboard shortcut F5 to refresh node
- Unhandled exception in event loop is thrown

org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.AssertionError: EVENT_REFRESH_REMOTE outside subsystem)
at org.eclipse.swt.SWT.error(SWT.java:3563)
at org.eclipse.swt.SWT.error(SWT.java:3481)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:126)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3659)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3296)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:504)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
at org.eclipse.equinox.launcher.Main.main(Main.java:1144)
Caused by: java.lang.AssertionError: EVENT_REFRESH_REMOTE outside subsystem
at org.eclipse.rse.internal.ui.view.SystemView.refreshRemoteObject(SystemView.java:2903)
at org.eclipse.rse.internal.ui.view.SystemView$ResourceChangedJob.runInUIThread(SystemView.java:2170)
at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:94)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
... 23 more
Comment 1 Martin Oberhuber CLA 2007-06-29 06:26:36 EDT
Uwe - why do you think this is major? I cannot see any major loss of functionality, at the most a dialog pops up that the user can click away, so I'm reducing to severity normal. Leaving P2 for now unless you can confirm that this is not urgent.

I guess the interesting part of the backtrace is this, and we need to understand why refreshing on a Shell Subsystem tries to fire an EVENT_REFRESH_REMOTE:

Caused by: java.lang.AssertionError: EVENT_REFRESH_REMOTE outside subsystem
at
org.eclipse.rse.internal.ui.view.SystemView.refreshRemoteObject(SystemView.java:2903)
at
org.eclipse.rse.internal.ui.view.SystemView$ResourceChangedJob.runInUIThread(SystemView.java:2170)

Comment 2 Uwe Stieber CLA 2007-06-29 06:32:21 EDT
If you do something such simple and exceptions are thrown, that is always major. You cannot do what you want to do and you have major loss of functionality as the requested functionality is not executed. IMHO "normal" is to low for everything like this, but it is your call.
Comment 3 Martin Oberhuber CLA 2007-06-29 07:10:19 EDT
Ok, I see your point... Not being able to refresh the Shell Subsystem may not be much of an issue, but not being able to refresh a custom debugger subsystem is an issue.

But I cannot reproduce your problem on TM 2.0 -- tried the Local Shell, Local Files, DStore Files/Processes/SHell both while connected and unconnected, even the Tests and Daytime and all worked fine. Only problem I found was a different NPE than yours when trying to refresh a local shell (filed as bug #194898).

What version of RSE did you test? Can you try reproducing with the 2.0 Release? Could this be an issue with your own extension on top of RSE?
Comment 4 Uwe Stieber CLA 2007-06-29 07:40:31 EDT
>What version of RSE did you test? Can you try reproducing with the 2.0 Release?

CVS HEAD version. Should be == 2.0, shouldn't it?

>Could this be an issue with your own extension on top of RSE?

Nope. Because I used a RSE only workspace and target platform.
Comment 5 Martin Oberhuber CLA 2007-06-29 08:00:09 EDT
Hm... 4 fixes went into rse.ui yesterday: bug 192716, bug 177587, bug 182403, bug 187707.

Since I cannot reproduce it on R2_0, could you try select rse.ui and Team > Switch to another branch or version > R2_0 and see if you can still reproduce it? If not, then one of the four bugs mentioned introduced a regression.
Comment 6 Uwe Stieber CLA 2007-06-29 08:15:55 EDT
Falling back to R2_0 of org.eclipse.rse.ui. Same issue.
Comment 7 David McKnight CLA 2007-06-29 11:06:26 EDT
I can't reproduce this on my dev driver.
Comment 8 Kevin Doyle CLA 2007-06-29 17:54:19 EDT
I can reproduce this in my dev driver and rse 2.0, if I create a Local Shell and press F5 on that shell.  Pressing F5 on "Local Shells" doesn't give me an error.
Comment 9 Martin Oberhuber CLA 2007-07-02 06:54:34 EDT
I think what you see by doing F5 on a Shell is bug #194898 and not this one -- did you compare the backtraces seen?
Comment 10 Kevin Doyle CLA 2007-07-03 09:09:58 EDT
Martin, what I described is bug #194898.  Thought I had already posted this after making my initial post.
Comment 11 Martin Oberhuber CLA 2007-07-04 07:06:46 EDT
Ok, now I know why I first could not reproduce it: The exception is only seen when launching in the debugger, and on the Launch Configuration's 2nd tab ("Arguments") the following is entered:

Program Arguments:
-debug
VM Arguments:
-ea -esa

In other words, the application needs to be launched with assertions enabled. I'd recommend every TM developer / committer change his launch configurations to enable assertions as mentioned above.
Comment 12 David McKnight CLA 2007-07-04 10:01:00 EDT
After following Martin's suggestion, I hit the assert exception.  What's happening is that on remote refresh, we're getting the parent of the subsystem (the IHost) and calling refreshRemoteObject() on it.  The code expects there to be an associated subsystem, but for an IHost, the view adapter returns null hence the failed assertion.
Comment 13 Martin Oberhuber CLA 2007-07-04 10:44:32 EDT
I guess the bug is that when refreshing a subsystem, we should NOT refresh the parent instead. Same when refreshing a host -- if I'm not mistaken there is a separate bug saying that "Refresh All" is done for refresh on a host.
Comment 14 David McKnight CLA 2007-07-04 12:15:56 EDT
I don't think we should be doing a refresh remote for non-remote things like subsystems.  That's not what that event was intended for.  For now, I will make sure that non-remote objects don't go into refreshRemoteObject().
Comment 15 David McKnight CLA 2007-07-04 12:27:03 EDT
I take that back, a subsystem could contain remote objects directly (as opposed to via filters) so we'll need to keep the refreshRemoteObject for subsystems.
Comment 16 David McKnight CLA 2007-07-04 12:30:31 EDT
I've changed this to not refresh on the parent if the object is a subsystem.  I've committed this to cvs.