Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ptp-dev] Hang in RemoteServicesProxy.getConnectionManager

Greg
I'm using the preferences dialog I get by going to 
preferences->PTP->Service Configurations then adding service 
configurations there
This seems to work better after updating to the latest PTP, although any 
launch service (PE proxy) I add doesn't seem to get added to the service 
configuration. If I add the PE proxy to the service configuration thru the 
dialogs invoked from the resource managers view, then the launch service 
gets added to the service configuration. I'm not sure if this is a problem 
or I'm going thru a wrong sequence in adding launch services.

The hang seems to be a timing/race condition at plugin startup. My plugin 
has registered a listener for IServiceModelEvents. I register it for 
IServiceModelEvent.SERVICE_CONFIGURATION_CHANGED and 
IServiceModelEvent.SERVICE_CONFIGURATION_SELECTED events. My listener is 
pasted below. I can see where it gets 
IServiceModelEvent.SERVICE_CONFIGURATION_CHANGED events pretty early in 
Eclipse startup, and I never get an Eclipse main window.

If I only handle  IServiceModelEvent.SERVICE_CONFIGURATION_SELECTED 
events, I don't get a hang.

        private void setServiceAttributes() {
                IResourceManager resourceManagers[];
                IResourceManager resourceManager;
                String remoteServiceID;
                IPUniverse universe;
                IServiceProvider launchServiceProvider;
                IServiceProvider newToolServiceProvider;
                IRemoteConnection newRemoteConnection;
                IRemoteServices newRemoteServices;
                IRemoteFileManager newFileManager;

                newToolServiceProvider = newServiceConfiguration
                                .getServiceProvider(hpctService);
                if (newToolServiceProvider == null) {
                        MessageDialog
                                        .openError(null, Messages.
PTPRemoteOperations_0,
                                                        "Performance 
analysis service not defined in active service configuration");
                        return;
                }
                launchServiceProvider = newServiceConfiguration
                                .getServiceProvider(launchService);
                if (launchServiceProvider == null) {
                        MessageDialog
                                        .openError(null, Messages.
PTPRemoteOperations_0,
                                                        "Launch service 
provider not defined in active service configuration");
                        return;
                }
                if (!(launchServiceProvider instanceof 
IResourceManagerConfiguration)) {
                        MessageDialog.openError(null, Messages.
PTPRemoteOperations_0,
                                        "Launch service provider is not a 
resource manager");
                        return;
                }
                remoteServiceID = ((IResourceManagerConfiguration) 
launchServiceProvider)
                                .getRemoteServicesId();
                if (remoteServiceID == null) {
                        MessageDialog.openError(null, Messages.
PTPRemoteOperations_0,
                                        "No remote service id for launch 
service");
                        return;
                }
                newRemoteServices = PTPRemoteCorePlugin.getDefault
().getRemoteServices(
                                remoteServiceID);
                if (newRemoteServices == null) {
                        MessageDialog.openError(null, Messages.
PTPRemoteOperations_0,
                                        "No resource manager selected for 
launch service");
                        return;
                }
                newRemoteConnection = 
newRemoteServices.getConnectionManager()
                                .getConnection(
 ((IResourceManagerConfiguration) launchServiceProvider)
 .getConnectionName());
                newFileManager = 
newRemoteServices.getFileManager(newRemoteConnection);
                if (newFileManager == null) {
                        MessageDialog.openError(null, Messages.
PTPRemoteOperations_0,
                                        "No file manager available for 
launch service");
                        return;
                }
                // Update to new attributes for newly selected service 
configuration
                // only if there were no prior errors. This avoids ending 
up in a mixed
                // state with some attributes from both old and new 
service
                // configurations.
                currentServiceConfiguration = newServiceConfiguration;
                toolServiceProvider = newToolServiceProvider;
                remoteServices = newRemoteServices;
                remoteConnection = newRemoteConnection;
                remoteFileManager = newFileManager;
        }
Dave



From:
Greg Watson <g.watson@xxxxxxxxxxxx>
To:
Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>
Date:
10/08/2009 08:25 AM
Subject:
Re: [ptp-dev] Hang in RemoteServicesProxy.getConnectionManager
Sent by:
ptp-dev-bounces@xxxxxxxxxxx



Dave,

Please update everything as I've made a large number of changes in the 
last couple of days.

Service configurations should be saved when the services core plugin is 
stopped. This should happen when Eclipse is shut down, but it may be 
unreliable. If you kill the Eclipse session then it definitely won't be 
saved. I plan to change this to save whenever a configuration is changed 
which should make it more robust.

Which preferences dialog are you using to edit the service configuration? 
These are still in a bit of transition at the moment.

What sort of RSE connection are you using? Is RSE running before you see 
the hang (i.e can you browse files in the Remote Systems view?

Greg


On Oct 6, 2009, at 10:34 AM, Dave Wootton wrote:


I updated to the current PTP head this morning and I am now running into a 
hang on a call to RemoteServicesProxy.getConnectionManager(). 
I started an Eclipse runtime instance using the debugger and suspended the 
main thread. I consistently get the traceback in the attached screen 
capture. It looks like RSE is waiting for an operation to complete. 

The remote service I see displayed in the preceding println call is 
'Remote service is 
org.eclipse.ptp.remote.internal.core.RemoteServicesProxy@d0c3d5' 

The method in my code where the hang happens is the following, where I 
have set up currentServiceConfiguration when my code gets an 
IServiceConfiguration event notification. It also seems that service 
configurations, resource managers and services within a service 
configuration are not always being saved in persistent storage, since if I 
shut down and restart the runtime Eclipse instance these objects aren't 
always restored. Finally, it seems that if I use the service configuration 
preferences dialog to edit a service configuration, and there is a launch 
service defined, then when I add a performance analysis service, the 
launch service seems to disappear. Could this be related to the hang? 

Any other ideas? 

         * (non-Javadoc) 
         * 
         * @see 
         * 
org.eclipse.ptp.services.core.IServiceModelEventListener#handleEvent( 
         * org.eclipse.ptp.services.core.IServiceModelEvent) 
         */ 
        public void handleEvent(IServiceModelEvent event) { 
                currentServiceConfiguration = (IServiceConfiguration) 
event.getSource(); 
                if (currentServiceConfiguration == null) { 
                        MessageDialog 
                                        .openError(null, Messages.
PTPRemoteOperations_0, 
                                                        "No service 
configuration is selected as active service configuration"); 
                        return; 
                } 
                setServiceAttributes(); 
        } 

        private void setServiceAttributes() { 
                IResourceManager resourceManagers[]; 
                IResourceManager resourceManager; 
                String remoteServiceID; 
                IPUniverse universe; 
                IServiceProvider launchServiceProvider; 

                paServiceProvider = currentServiceConfiguration 
                                .getServiceProvider(hpctService); 
                if (paServiceProvider == null) { 
                        MessageDialog 
                                        .openError(null, Messages.
PTPRemoteOperations_0, 
                                                        "Performance 
analysis service not defined in active service configuration"); 
                        return; 
                } 
                launchServiceProvider = currentServiceConfiguration 
                                .getServiceProvider(launchService); 
                if (launchServiceProvider == null) { 
                        MessageDialog 
                                        .openError(null, Messages.
PTPRemoteOperations_0, 
                                                        "Launch service 
provider not defined in active service configuration"); 
                        return; 
                } 
                if (!(launchServiceProvider instanceof 
IResourceManagerConfiguration)) { 
                        MessageDialog.openError(null, Messages.
PTPRemoteOperations_0, 
                                        "Launch service provider is not a 
resource manager"); 
                        return; 
                } 
                remoteServiceID = ((IResourceManagerConfiguration) 
launchServiceProvider) 
                                .getRemoteServicesId(); 
                if (remoteServiceID == null) { 
                        MessageDialog.openError(null, Messages.
PTPRemoteOperations_0, 
                                        "No remote services for launch 
service"); 
                        return; 
                } 
                remoteService = PTPRemoteCorePlugin.getDefault
().getRemoteServices( 
                                remoteServiceID); 
                System.out.println("Remote service is " + remoteService); 
Hung here==>          remoteConnection = remoteService
.getConnectionManager().getConnection( 
                                ((IResourceManagerConfiguration) 
launchServiceProvider) 
                                                .getConnectionName()); 
                System.out.println("Host is " + remoteConnection
.getName()); 
        } 

<Mail Attachment.gif> 
Dave_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev
_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev





Back to the top