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

Bug 315713

Summary: Enable autolaunch of pbs proxy
Product: [Tools] PTP Reporter: Greg Watson <g.watson>
Component: RM.PBSAssignee: Greg Watson <g.watson>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: arossi, roland
Version: unspecified   
Target Milestone: 4.0   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
autolaunch patch none

Description Greg Watson CLA 2010-06-04 00:24:08 EDT
Here is a patch to enable autolaunch. 

Notes:

1. The build.xml script is not finished. It still needs to package up the jar correctly, but unfortunately it can only be tested by running a build which requires everything to be checked in first. 

2. The build.sh script won't be checked in. It's just for testing purposes to build a pbs_proxy.jar. Change the value JDT_UI to the correct one for your installation then run it from the org.eclipse.ptp.rm.pbs.jproxy directory in your workspace. It should build a pbs_proxy.jar file.

If you're ok with what's here then I'll check it in and fix the build script. Feel free to ask any questions on this bug.
Comment 1 Greg Watson CLA 2010-06-04 00:27:09 EDT
Created attachment 171061 [details]
autolaunch patch
Comment 2 Roland Schulz CLA 2010-06-04 18:13:04 EDT
Great. Works. Only problem was that the build.sh was missing org.eclipse.ptp.utils.core. The proxy depends on that package too. That's why the nodes didn't show up.

Please go ahead and commit it. I'm happy to commit it but I'm not sure what remains to be done for build.xml and without being able to test it - it would be great if you can do that.

Al: Please commit the UI change we discussed.

Let me know if you have something I can help. Until I hear something from you I'll work on some of the other bugs.
Comment 3 Albert L. Rossi CLA 2010-06-04 18:21:28 EDT
I've committed the UI changes.
Comment 4 Roland Schulz CLA 2010-06-04 18:29:00 EDT
great. Looks good. 

I guess in most cases it won't work with RSE because of missing port forwarding. 

Yesterday I got this forwarding issue confused with this unrelated autolaunch issue. That is why I was confused that it would also work with RSE.
Comment 5 Greg Watson CLA 2010-06-04 19:21:12 EDT
Committed. I'll work on the build script and see if I can get it into tonight's build.

It should still work with RSE, but you won't be able to forward over an ssh connection. If your local machine accepts incoming connections it should be fine.

Roland, can you set your formatting to use a column width of 132? It'll make merging easier. Thanks.
Comment 6 Roland Schulz CLA 2010-06-04 19:41:43 EDT
OK. Great.

Changed it to 132. Could you (after the release) export your Code-Style->Formatter settings and put them on the wiki. That would make it easier.

There is one more problem:
createExecutionManager called by:

org.eclipse.ptp.remote.remotetools.core.environment.PTPTargetControl.createExecutionManager()
org.eclipse.ptp.remote.remotetools.core.RemoteToolsConnection.createExecutionManager()
org.eclipse.ptp.remote.remotetools.core.RemoteToolsProcessBuilder.start()
org.eclipse.ptp.remote.launch.core.AbstractRemoteServerRunner.launchServer(IRemoteConnection, IProgressMonitor)

checks that the connection is connected correctly but does not automatically reconnect if it is not connected anymore. Thus when one tries to start a RM and the connection is not open anymore one gets: "Connection is not open" as an error. 

Is it OK to change createExecutionManager to automatically reconnect? Or on what level of the above call-tree should the reconnect be implemented to not break anything else?
Comment 7 Greg Watson CLA 2010-06-04 20:17:17 EDT
AbstractRemoteServerRunner.startServer already checks if the connection is open and reopens it if not. Is this not working? 

In any case, Remote Tools should not automatically reopen connections. This should be left as the callers responsibility.
Comment 8 Roland Schulz CLA 2010-06-04 23:06:48 EDT
(In reply to comment #7)
> AbstractRemoteServerRunner.startServer already checks if the connection is open
> and reopens it if not. Is this not working? 
> 
> In any case, Remote Tools should not automatically reopen connections. This
> should be left as the callers responsibility.

yes startServer does. But launchServer didn't. I just committed a change that launchServer does the same as startServer.
Comment 9 Greg Watson CLA 2010-06-04 23:53:38 EDT
This is not correct. launchserver is only called by the job run method after startserver is called. it shouldn't need to reopen the connection since startserver already checks this.
Comment 10 Greg Watson CLA 2010-06-05 00:32:33 EDT
I've reversed this commit.
Comment 11 Roland Schulz CLA 2010-06-05 02:42:05 EDT
(In reply to comment #10)
> I've reversed this commit.

Sorry. Yes that change didn't make any sense.
I opened a new bug (315864) for the connection reopen problem.
Comment 12 Albert L. Rossi CLA 2010-06-05 19:12:38 EDT
When I try to launch a local version of the proxy, I get

 Unable to locate payload "pbs_proxy.jar" in bundle "org.eclipse.ptp.rm.pbs.jproxy"

And, indeed, I don't see any .jar in the plugin.  I've sync'd with CVS Head.  What am I doing wrong?
Comment 13 Roland Schulz CLA 2010-06-05 19:23:52 EDT
you need to run the build.sh script