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

Bug 316506

Summary: RemoteTools hangs UI
Product: [Tools] PTP Reporter: Roland Schulz <roland>
Component: Remote ToolsAssignee: Greg Watson <g.watson>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 Flags: g.watson: review? (roland)
Version: 4.0   
Target Milestone: 4.0.1   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
fix for hang in close none

Description Roland Schulz CLA 2010-06-10 14:08:24 EDT
Steps to reproduce:
1) Connect to Abe
2) Create new remote project (or open existing one)
3) Optional: test that your are able to open files / build
4) wait 30 min -> after 30min you will get Server finished with exit code -1
5) try to access a file -> the UI hangs

Abe kill process after 30min. I'm not sure whether it also kills the connection. Requires some more testing. Also not sure why it freezes everything. 


It hangs in:
org.eclipse.ptp.remotetools.internal.ssh.ExecutionManager.close()

Close tries to close all tunnels by calling releaseTunnel but it throws an execption and thus this while loop never terminates. The exception is thrown by org.eclipse.ptp.remotetools.internal.ssh.Connection.test() because the connection is closed.

I'm not sure whether releaseTunnel shouldn't call test or the exception thrown if the connection isn't up should be handled different and not just ignored.
Comment 1 Greg Watson CLA 2010-06-10 20:21:03 EDT
I'd say this is the same or similar to bug 316388.
Comment 2 Roland Schulz CLA 2010-06-10 23:57:13 EDT
(In reply to comment #1)
> I'd say this is the same or similar to bug 316388.

They are similar but not the same. This bug hangs the UI. The other one only prevents the executionmanager to (ever) notify the UI that a script execution has been interrupted by a failed connection. They both are caused by not handling closed connection correctly. But at different places in the code.
Comment 3 Greg Watson CLA 2010-06-15 11:25:22 EDT
See patch for proposed fix. I was unable to replicate the exact situation however, as I waited 1hr and my process still hadn't been killed. I tried manually killing the java server and received the server finished message (exit code 134 though). I then tried accessing a file and after a few seconds the connection was re-established and everything seemed to be working again. 

Please apply the patch in bug 316388 in addition to this one.
Comment 4 Greg Watson CLA 2010-06-15 11:25:57 EDT
Created attachment 171950 [details]
fix for hang in close
Comment 5 Greg Watson CLA 2010-06-22 10:39:28 EDT
Roland, would you please review this patch? I'd like to get it into 4.0.1.
Comment 6 Roland Schulz CLA 2010-06-30 05:41:03 EDT
(In reply to comment #5)
> Roland, would you please review this patch? I'd like to get it into 4.0.1.

I'm also not able to reproduce the original problem. Probably the connection has to break up some specific way. Thus I can't test whether it fixes it. 

But by looking at the patch I think the dead-lock I observed should be resolved. Thus OK from me.
Comment 7 Greg Watson CLA 2010-06-30 13:02:05 EDT
Fixed in 4.0 and HEAD.