Bug 149123 - [dstore][api] Hanging connect cannot be canceled (or takes very long to cancel)
Summary: [dstore][api] Hanging connect cannot be canceled (or takes very long to cancel)
Status: NEW
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: Future   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: api, bugday, helpwanted
Depends on: 173619
Blocks: 189350
  Show dependency tree
 
Reported: 2006-06-29 05:55 EDT by Martin Oberhuber CLA
Modified: 2012-05-22 14:58 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 Martin Oberhuber CLA 2006-06-29 05:55:28 EDT
Observed on Redhat WS4 / Linux-GTK.
Start an RSE server, port 27127 on build.eclipse.org:
  perl server.pl 27127 0
Create an RSE connection, type Linux, Launcher "Server Only" and set port to 27127

Try to connect 
--> supposedly due to firewall on build.eclipse.org, the connection does not work
Open the Progress View and press the cancel button on the connect job
--> connection is not canceled

I suppose that the connect operation is hanging somewhere in Socket:connect. After a long timeout, the connect operation eventually terminates. But it would be better if the Socket:connect() call were made in a separate thread, such that the progress monitor is still checked for canceling, and the "connecting" thread can be canceled.

The SshConnectorService (which is partly copied from Team/CVS) shows how this can be done, in ResponsiveSocketFactory.createSocket(), which in turn calls Util.createSocket(), which does the connection in a separate thread.
Comment 1 Martin Oberhuber CLA 2007-02-09 06:08:42 EST
This should be possible to fix now that RemoteUtil.createSocket() is public available.
Comment 2 Martin Oberhuber CLA 2007-05-18 15:50:17 EDT
Shooting for RC1.
Comment 3 Martin Oberhuber CLA 2008-09-23 16:53:29 EDT
I verified that this is still an issue with RSE 3.0.1 / Eclipse 3.5m2 -- the build.eclipse.org server doesn't even notice that RSE tries to connect, because it's behind the Firewall.

Here is where the connect hangs:

Thread [Worker-6] (Suspended)	
	PlainSocketImpl.socketConnect(InetAddress, int, int) line: not available [native method]	
	SocksSocketImpl(PlainSocketImpl).doConnect(InetAddress, int, int) line: 333	
	SocksSocketImpl(PlainSocketImpl).connectToAddress(InetAddress, int, int) line: 195	
	SocksSocketImpl(PlainSocketImpl).connect(SocketAddress, int) line: 182	
	SocksSocketImpl.connect(SocketAddress, int) line: 366	
	Socket.connect(SocketAddress, int) line: 519	
	Socket.connect(SocketAddress) line: 469	
	Socket.<init>(SocketAddress, SocketAddress, boolean) line: 366	
	Socket.<init>(String, int) line: 180	
	ClientConnection.connect(String, int) line: 488	
	DStoreConnectorService.internalConnect(IProgressMonitor) line: 890	
	DStoreConnectorService(AbstractConnectorService).connect(IProgressMonitor) line: 412	
	SystemFetchOperation.execute(IProgressMonitor) line: 281	
	SystemFetchOperation.run(IProgressMonitor) line: 141	
	SystemViewFilterReferenceAdapter(AbstractSystemViewAdapter).fetchDeferredChildren(Object, IElementCollector, IProgressMonitor) line: 2300	
	DeferredTreeContentManager$1.run(IProgressMonitor) line: 234	
	Worker.run() line: 55	
Comment 4 Martin Oberhuber CLA 2008-09-23 17:03:26 EDT
Unfortunately, ClientConnection is in org.eclipse.dstore.core which doesn't have a dependency on org.eclipse.rse.services -- so if RemoteUtil is to be used, it needs to be duplicated into org.eclipse.rse.dstore.core

Also, a new API method for connect() which takes an IProgressMonitor needs to be added to ClientConnection in order for this to get implemented.

Are the dstore owners interested in making this happen? It shouldn't be too hard now that all the analysis is done.
Comment 5 Martin Oberhuber CLA 2010-05-27 08:24:37 EDT
Reassigning all API related to 3.3
Comment 6 Martin Oberhuber CLA 2011-05-31 17:41:55 EDT
Moving deferred 3.3 api items to 3.4
Comment 7 Martin Oberhuber CLA 2012-05-22 14:58:04 EDT
We are post API freeze.