Bug 271243

Summary: [files] Switching service type brings up TWO file subsystems after restart
Product: [Tools] Target Management Reporter: Uwe Stieber <uwe.st>
Component: RSEAssignee: David McKnight <dmcknigh>
Status: RESOLVED FIXED QA Contact: Martin Oberhuber <mober.at+eclipse>
Severity: critical    
Priority: P1 CC: dmcknigh, martin.gutschelhofer
Version: 3.1   
Target Milestone: 3.1 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 267052    
Bug Blocks:    

Description Uwe Stieber CLA 2009-04-05 05:12:15 EDT
We do have a host type which can have 2 valid configuations for the file service subsystem, SFTP and TCF. The used configuration will be switched either by the user or programatically. So far it basically works nicely except one leaves the session and restart Eclipse. On restart, the connection is not restored correctly:

1) _Both_ File service subsystem nodes are now visible under the connection

    MyConnection
        Sftp Files 
        Files

2) If the user left the session with TCF as active configuration, after restart the active configuration is SFTP again. This might contribute to 1.

Solving this problem is very critical for our product delivery.
Comment 1 David McKnight CLA 2009-04-07 11:04:35 EDT
Dave D, I'm assigning this to you since it appears to be related to persistance.
Comment 2 Martin Oberhuber CLA 2009-04-16 12:58:19 EDT
We've got the problem reproducable with a TCF file service regardless of whether the plugin was installed later or not. Will try debugging this on Monday.
Comment 3 Martin Oberhuber CLA 2009-04-20 09:01:34 EDT
I can easily reproduce with SSH + FTP as follows:

1. Create new connection of type "UNIX"
   In Wizard, pick "Sftp Files" subsystem.

2. Select the new connection, right-click > Properties. On Service page,
   switch to "FTP Files" subsystem.

3. Quit and restart RSE.

--> TWO subsystems named "Files" are shown.

I know quite for sure that this used to work in the past, so I'm assuming that this is a recent regression, most probably due to the fix for bug 267052. DaveD or DaveM, please fix this as soon as possible.

Changed summary, previous value was:
[file service] Problems restoring a connection with 2 configurations for the file service subsystem 
Comment 4 David McKnight CLA 2009-04-20 09:13:03 EDT
This is probably due to bug 267052.
Comment 5 David McKnight CLA 2009-04-20 09:25:04 EDT
I've added a check in the RSEDOMImporter to see whether the subsystem configurations that are being compared are of the same service type.  For a given host, if a subsystem exists for any configuration of a particular service type then we don't create a new subsystem.
Comment 6 Martin Oberhuber CLA 2009-04-20 09:27:04 EDT
Does this ensure that the correct (i.e. "currently active") subsystem gets imported? In other words, if I switch from Sftp to FTP, does this ensure that FTP gets imported?
Comment 7 David McKnight CLA 2009-04-20 09:37:52 EDT
(In reply to comment #6)
> Does this ensure that the correct (i.e. "currently active") subsystem gets
> imported? In other words, if I switch from Sftp to FTP, does this ensure that
> FTP gets imported?
> 

Yes, this is ensured because the after-the-fact subsystem creation only occurs after the regularly restored subsystems are created.  In other words, if the setting was for FTP, then the FTP subsystem gets created before any check is made as to whether an Sftp subsystem needs to be created.