Bug 189268 - Right-click > Copy must not download files
Summary: Right-click > Copy must not download files
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: 2.0   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 187714
  Show dependency tree
 
Reported: 2007-05-25 22:16 EDT by Martin Oberhuber CLA
Modified: 2008-08-13 13:20 EDT (History)
2 users (show)

See Also:
mober.at+eclipse: review+


Attachments
patch to avoid downloading on copy to clipboard (1.74 KB, patch)
2007-05-30 11:14 EDT, David McKnight CLA
no flags Details | Diff
complete patch for avoiding copy (3.23 KB, patch)
2007-05-30 12:04 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 Martin Oberhuber CLA 2007-05-25 22:16:55 EDT
On an SSH connection, I want to copy a large folder tree from
one location to another. But select the source, right-click > copy already starts downloading thousands of files in thousands of jobs.

Marking as Critical since I have no chance canceling all these jobs except quit Eclipse. I did not want to download anything but do a plain remote-to-remote copy only.

I think that the impact of "download on copy" is just too severe and does not justify the (small) improvement made for bug #181458.

-----------Enter bugs above this line-----------
TM 2.0RC1 Testing
installation : eclipse-platform-3.3M6 (I20070323-1616), cdt-4.0M5, emf-2.3M5
RSE install  : download RSE 2.0RC1 runtime-all + terminal
java.runtime : Sun 1.6.0-b105
os.name:     : Windows XP 5.1, Service Pack 2
------------------------------------------------
systemtype   : Linux-ssh (dstore-processes)
targetos     : SUSE Linux Enterprise Server 10 (ppc)
targetuname  : Linux build 2.6.16.27-0.9-ppc64 #1 SMP ppc64 GNU/Linux
targetvm     : ibm-java2-sdk-5.0-0-4.0-linux-ppc
------------------------------------------------
Comment 1 David McKnight CLA 2007-05-28 09:45:39 EDT
Martin, you already agreed that you wanted copy to work for windows explorer and now apparently you're changing you mind on this.  If you want to change your mind of this then you realize we're going to be regressing all of that work.
Comment 2 Martin Oberhuber CLA 2007-05-29 18:01:33 EDT
With an ssh connection to build.eclipse.org (reasonably slow), I tried this:

1. Select remote *.tgz archive 30MB large, right-click > Copy
   Select Windows folder, right-click > paste
   --> File is created with 272KB size only. 
       No error message about truncated file.

2. While The "Download-due-to-copy" was still ongoing, drag&drop another
   30MB file to the windows explorer folder
   --> All of Eclipse freezes, no UI updates any more, my session is dead.

My debugger shows this backtrace on the main thread:

Thread [main] (Suspended)	
	Object.wait(long) line: not available [native method]	
	Channel$MyPipedInputStream(PipedInputStream).read() line: 310	
	Channel$MyPipedInputStream(PipedInputStream).read(byte[], int, int) line: 361	
	ChannelSftp._get(String, OutputStream, SftpProgressMonitor, int, long) line: not available	
	ChannelSftp.get(String, String, SftpProgressMonitor, int) line: not available	
	SftpFileService.download(String, String, File, boolean, String, IProgressMonitor) line: 531	
	FileServiceSubSystem.download(IRemoteFile, String, String, IProgressMonitor) line: 446	
	SystemEditableRemoteFile.doDownload(SystemIFileProperties, IProgressMonitor) line: 608	
	SystemEditableRemoteFile.download(IProgressMonitor) line: 587	
	LazyDownloadJob.run(IProgressMonitor) line: 36	
	SystemViewDataDragAdapter.getResource(IAdaptable) line: 378	
	SystemViewDataDragAdapter.dragSetData(DragSourceEvent) line: 244	
	DNDListener.handleEvent(Event) line: 54	
	EventTable.sendEvent(Event) line: 66	
	DragSource(Widget).sendEvent(Event) line: 938	
	DragSource(Widget).sendEvent(int, Event, boolean) line: 962	
	DragSource(Widget).sendEvent(int, Event) line: 947	
	DragSource(Widget).notifyListeners(int, Event) line: 706	
	DragSource.GetData(int, int) line: 411	
	DragSource.access$7(DragSource, int, int) line: 390	
	DragSource$4.method3(int[]) line: 252	
	COMObject.callback3(int[]) line: 92	
	COM.DoDragDrop(int, int, int, int[]) line: not available [native method]	
	DragSource.drag(Event) line: 322	
	DragSource.access$0(DragSource, Event) line: 282	
	DragSource$1.handleEvent(Event) line: 166	
	EventTable.sendEvent(Event) line: 66	
	Tree(Widget).sendEvent(Event) line: 938	
	Display.runDeferredEvents() line: 3673	
	Display.readAndDispatch() line: 3284	
	Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 2389	
	Workbench.runUI() line: 2353	
	Workbench.access$4(Workbench) line: 2219	
	Workbench$4.run() line: 466	
	Realm.runWithDefault(Realm, Runnable) line: 289	
	Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 461	
	PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149	
	IDEApplication.start(IApplicationContext) line: 106	
	EclipseAppHandle.run(Object) line: 153	
	EclipseAppLauncher.runApplication(Object) line: 106	
	EclipseAppLauncher.start(Object) line: 76	
	EclipseStarter.run(Object) line: 363	
	EclipseStarter.run(String[], Runnable) line: 176	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
	Method.invoke(Object, Object...) line: 597	
	Main.invokeFramework(String[], URL[]) line: 497	
	Main.basicRun(String[]) line: 436	
	Main.run(String[]) line: 1162	
	Main.main(String[]) line: 1137	


For me personally, these two experiences are sufficient to ask for backing out the "download-on-copy" change since it has really REALLY bad effects. Imagine somebody dragging & dropping a file to win.explorer and then deleting the remote copy because he thinks it's been transferred properly -- data will be lost.

I'd rather not have the copy-remote-to-windows-explorer feature than risking such problems. For the future, we'll need to work with the Platform to improve SWT drag&drop support to Win.Explorer and Project Explorer.
Comment 3 David McKnight CLA 2007-05-30 11:14:08 EDT
Created attachment 69304 [details]
patch to avoid downloading on copy to clipboard

This patch backs out the download we do on copy.  There should be another one for drag and drop.
Comment 4 David McKnight CLA 2007-05-30 11:56:18 EDT
The drag and drop portion of this only occurs during FileTransfer (i.e. transfer to windows explorer)..but nevertheless, it can be problemmatic for large files so I'll have to take that out.
Comment 5 David McKnight CLA 2007-05-30 12:04:42 EDT
Created attachment 69323 [details]
complete patch for avoiding copy

Here is the complete patch, addressing copy and drag and drop.  To avoid drag and drop logic that does copy, we need to get rid of the FileTransfer type on drag.
Comment 6 Martin Oberhuber CLA 2007-05-30 14:22:00 EDT
Hm, this patch looks much smaller than expected :-)
In Lines 93-111, I actually do not see any difference.

I approve the patch but have one question: does this patch also disable FileTransfer for the "Local" subsystem? I think it should be working there if possible.

Another idea I had in order to accomodate some of the improvements we are losing with backing this out completely is in bug #181458 comment 5.
Comment 7 Martin Oberhuber CLA 2007-05-30 14:23:13 EDT
When verifying this, the other issue (drag&drop on the Display thread) also needs to be verified.
Comment 8 David McKnight CLA 2007-05-30 14:37:10 EDT
The getResource() call is only made when we're supporting resource transfer (i.e. download on copy).  I'm not sure whehter we should be treating local different or not because, under normal RSE behaviour we treat it like any remote subsystem, copying (or downloading) the files to the temp file cache.  I can see why it would  be okay to skip that step but I worry about inconsistencies.
Comment 9 David McKnight CLA 2007-05-30 16:47:02 EDT
I've committed the changes for this.
Comment 10 Martin Oberhuber CLA 2008-08-13 13:20:09 EDT
[target cleanup] 2.0 RC2 was the original target milestone for this bug