Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362440 - File opened using remote system connection (SSH - Sftp) at some point save action was not saving it to the file system.
Summary: File opened using remote system connection (SSH - Sftp) at some point save ac...
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 3.3   Edit
Hardware: PC Linux
: P3 critical (vote)
Target Milestone: 3.4 M7   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 376094
  Show dependency tree
 
Reported: 2011-10-30 17:11 EDT by Yevgeny Shifrin CLA
Modified: 2012-05-07 14:51 EDT (History)
1 user (show)

See Also:


Attachments
patch to use early startup for files.ui (2.22 KB, patch)
2011-11-01 10:37 EDT, David McKnight CLA
no flags Details | Diff
patch to force load of files.ui plugin when subsystem instantiated (2.35 KB, patch)
2012-04-04 11:20 EDT, David McKnight CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yevgeny Shifrin CLA 2011-10-30 17:11:42 EDT
Build Identifier: 20110615-0604

Hi

I was working on a file (script) for several hours (most of the day) using SSH connection (Sftp). At some point I did not understand why code written in the script is not running as expected. After an hour of struggle, I found out that each save action did not save the file to its location. This is very serious problem as information could be lost !!! I catched the problem and did not loose any information. What would happen if I closed eclipse and find out that my work is not on the file system. After closing and opening the file the problem was solved. I would appreciate high attention for this issue. From my point of view it makes RSE unreliable. I saw this behavior in the past once before.

Log file does not have any exception.

Thanks a lot,
Yevgeny

Reproducible: Sometimes
Comment 1 David McKnight CLA 2011-10-31 10:17:29 EDT
Could you provide more details about this?  What are the client and server OSes.  What SSH server is being used?  What is the file type of the script you're editing (i.e. .pl, .sh, etc.) and which editor are you using to edit it with?  Does this happen with any file or just particular files?
Comment 2 Yevgeny Shifrin CLA 2011-11-01 05:49:15 EDT
>What are the client and server OSes.

client: ubuntu 10.04, Linux 2.6.32-32-generic #62-Ubuntu SMP Wed Apr 20 21:52:38 UTC 2011 x86_64 GNU/Linux
server: centos 5, Linux 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

> What SSH server is being used?

openssh 4.3p2-24.el5

>What is the file type of the script you're editing (i.e. .pl, .sh, etc.) and which editor are you using to edit it with?  Does this happen with any file or just particular files?

In my case I was using ".pl" file (it was opened using ShellEd editor). In the past it occurred once on "txt" file (using eclipse TextEditor) when I used "local" connection as well.

Additional info that could help: My file was opened and save seems to be working. I closed eclipse, then opened it again and continued working on it. I am not sure but at some time save stopped working close after the eclipse  restart.

Thanks,
Yevgeny
Comment 3 David McKnight CLA 2011-11-01 10:36:27 EDT
I investigated this a bit further and discovered that it can be reproduced by doing the following:
1) open the editor
2) disconnect the connection
3) collapse all nodes in the Remote Systems view
4) restart Eclipse
5) edit the file and save

The problem is that, in this state, the org.eclipse.rse.files.ui plugin has not yet been activated.  That plugin needs to be active so that it's resource change listener can receive events when files get saved.

One possible solution to this would be to add an org.eclipse.ui.startup extension to force the files.ui plugin to load right away.  This will ensure the listener is always active. It may slow down the startup time a little bit but it's certainly better than potential loss of data.  I'll attach a patch the uses that approach.

Martin, do you have any other ideas or advice on this one?
Comment 4 David McKnight CLA 2011-11-01 10:37:28 EDT
Created attachment 206268 [details]
patch to use early startup for files.ui
Comment 5 David McKnight CLA 2011-11-02 16:30:37 EDT
(In reply to comment #4)
> Created attachment 206268 [details]
> patch to use early startup for files.ui
Comment 6 Martin Oberhuber CLA 2011-11-03 10:09:22 EDT
An ui.startup extension is a no-go for me since it will drag in dependencies for users who don't need RSE.

Apparently at some point the connection drops, and the information that there _should_ be a connection is not persisted. RSE is supposed to restore connections on restart, right ? I'd look at checking why the connection isn't restored in this case. Restoring the connection will also load the files plugin.
Comment 7 David McKnight CLA 2011-11-03 10:16:05 EDT
(In reply to comment #6)
> An ui.startup extension is a no-go for me since it will drag in dependencies
> for users who don't need RSE.
> 
> Apparently at some point the connection drops, and the information that there
> _should_ be a connection is not persisted. RSE is supposed to restore
> connections on restart, right ? I'd look at checking why the connection isn't
> restored in this case. Restoring the connection will also load the files
> plugin.

There are lots of reason why RSE would not have reconnected a connection.  First, the user could be a perspective without an RSE view which would defer the initialization of RSE.  Second, even in the Remote Systems view, the user may leave the nodes collapsed and/or disconnected on restart.  Note also that the files.core plugin will get loaded but the files.ui doesn't automatically load with it.
Comment 8 David McKnight CLA 2011-11-04 15:03:22 EDT
Martin, do you plan to respond about this?
Comment 9 David McKnight CLA 2012-02-02 09:31:53 EST
This bug has been idle for some time and I'd rather not leave a 'critical' bug for so long.  Martin, since my proposal to pull in files.ui is unacceptable for you, what would you suggest we do to address this?
Comment 10 Yevgeny Shifrin CLA 2012-04-03 17:19:00 EDT
Hi guys,

Is there a timeline for fixing this issue? 

Thanks a lot,
Yevgeny
Comment 11 David McKnight CLA 2012-04-04 11:20:12 EDT
Created attachment 213588 [details]
patch to force load of files.ui plugin when subsystem instantiated

Can you try with this patch?
Comment 12 David McKnight CLA 2012-04-04 11:31:37 EDT
I've committed the fix to the HEAD stream and opened bug 376094 for a backport to R3_2_maintenance.