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

Bug 315275

Summary: Run on Server may hold the UI if delegate call hangs
Product: [WebTools] WTP ServerTools Reporter: Troy Bishop <tjbishop>
Component: wst.serverAssignee: Angel Vera <arvera>
Status: RESOLVED FIXED QA Contact: Angel Vera <arvera>
Severity: normal    
Priority: P3 CC: melickm
Version: 3.2   
Target Milestone: 3.2.3   
Hardware: PC   
OS: Windows XP   
See Also: https://git.eclipse.org/r/109010
Whiteboard:
Attachments:
Description Flags
possible patch. none

Description Troy Bishop CLA 2010-06-01 14:52:43 EDT
Build Identifier: WTP 3.2

The action Run on Server can cause the UI to hang if the call to the delegates ILaunchableAdapter.getLaunchable() hangs.  In this situation the delegate call hangs (which is likely a defect in our adaptor product) but the WTP server tools framework could handle this scenario better by not putting this call in the UI thread.

The Run on Server action is meant to be a background job however in the code for LaunchClientJob#run() a call to Display#asyncExec() is made to run the client in the UI (since the UI could be to launch a web browser, i.e. running a servlet on the server).  I think this code tries to be too safe by executing the call to ILaunchableAdapter.getLaunchable() in the UI thread but I do not think that is necessary.  Since this call would never really run any UI code (the call to IClient#launch will do that) then I think it would be safe to take it out of the Display.asyncExec() block.

I will attached a patch which will correct this problem.

Reproducible: Always

Steps to Reproduce:
1. Cause the call to ILaunchableAdapter.getLaunchable() to hang when performing a Run on Server scenario.
Comment 1 Troy Bishop CLA 2010-06-01 14:54:13 EDT
Created attachment 170679 [details]
possible patch.
Comment 2 Angel Vera CLA 2011-01-05 21:41:05 EST
Changes committed to 32M
Comment 3 Angel Vera CLA 2011-01-05 21:56:37 EST
Changes released to 32M
Comment 4 Angel Vera CLA 2011-01-05 22:01:44 EST
changes committed to HEAD
Comment 5 Angel Vera CLA 2011-01-05 22:02:40 EST
changes released to HEAD
Comment 6 Eclipse Genie CLA 2017-10-11 16:35:22 EDT
New Gerrit change created: https://git.eclipse.org/r/109010