Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 313993

Summary: [terminal] [ssh] hangs eclipse UI at splash screen
Product: [Tools] Target Management Reporter: Bryan Hunt <bhunt>
Component: TerminalAssignee: dsdp.tm.core-inbox <tm.core-inbox>
Status: RESOLVED INVALID QA Contact: Martin Oberhuber <mober.at+eclipse>
Severity: critical    
Priority: P3 CC: eclipse
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
project to reproduce problem none

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 ;-)