Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313993 - [terminal] [ssh] hangs eclipse UI at splash screen
Summary: [terminal] [ssh] hangs eclipse UI at splash screen
Status: RESOLVED INVALID
Alias: None
Product: Target Management
Classification: Tools
Component: Terminal (show other bugs)
Version: 3.2   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: dsdp.tm.core-inbox CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-21 18:51 EDT by Bryan Hunt CLA
Modified: 2010-05-21 20:23 EDT (History)
1 user (show)

See Also:


Attachments
project to reproduce problem (7.12 KB, application/zip)
2010-05-21 18:51 EDT, Bryan Hunt CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bryan Hunt CLA 2010-05-21 18:51:54 EDT
Created attachment 169567 [details]
project to reproduce problem

There is a case where an ssh terminal will completely hang the eclipse UI at startup and never get past the splash screen.  The problem is in the ssh code where it asks for the users password with a dialog inside a Display.syncExec().

To reproduce, launch a runtime workbench with the attached project.  Select: Window -> Show View -> Other -> Terminal.  When the dialog appears asking for your password, click cancel.  Exit the runtime workbench.  Re-launch the runtime workbench (make sure you don't clear the workspace in the launch config) and the workbench will never appear.
Comment 1 Martin Oberhuber CLA 2010-05-21 19:00:15 EDT
Uhm, are you sure that this is a critical issue? After all it is YOUR code which initiates the Terminal that early. Can't you wait until Workbench is fully up before you try to connect? Issues with syncExec while the Workspace is still coming up have appeared in the past, see bug 239230.

Quite frankly, at the moment I don't see us investing time into this on the TM Terminal side. Unless you can argue really well why you think this is our fault.
Comment 2 Michael Scharf CLA 2010-05-21 19:35:31 EDT
open the terminal with an async exec:

	@Override
	public void createPartControl(final Composite parent)
	{
		parent.setLayout(new FillLayout());
		PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
			
			@Override
			public void run() {
				ITerminalConnector[] connectors = TerminalConnectorExtension.makeTerminalConnectors();
				terminal = TerminalViewControlFactory.makeControl(TerminalView.this, parent, connectors);
				connector = TerminalConnectorExtension.makeTerminalConnector("org.eclipse.tm.internal.terminal.ssh.SshConnector");
				terminal.setConnector(connector);

				terminalSettings.put("Host", "localhost");
				terminalSettings.put("User", "user");

				connector.load(terminalSettings);
				terminal.connectTerminal();
			}
		});
	}
Comment 3 Michael Scharf CLA 2010-05-21 19:38:08 EDT
I thing nothing has to be changed in the terminal therefore I marked it as fixed.

If you still see the problem reopen the bug.
Comment 4 Martin Oberhuber CLA 2010-05-21 19:52:56 EDT
Thanks for the extra info and code, Michael.

I'd just like to note that as per Eclipse Bugzilla conventions, the reporter owns the severity field, so resetting to what it was until Bryan decides to change it.

Also, we cannot mark this as CLOSED until the reporter agrees.
From our point of view, it's resolved.
Comment 5 Michael Scharf CLA 2010-05-21 20:23:54 EDT
OOPS, sorry for not following the convention -- I should fix more bugs to get used to the conventions ;-)