From bba9934da299bb4bd0d3ccdbfff6a60a7c6033fe Mon Sep 17 00:00:00 2001 From: Martin Oberhuber < martin.oberhuber@windriver.com> Date: Mon, 15 Mar 2010 21:44:38 +0000 Subject: [PATCH] Bug 300394 - [ftp] Deadlock due to NOOP command not receiving response on the main thread --- releng/org.eclipse.rse.build/maps/rse.map | 4 ++-- .../feature.properties | 4 ++-- .../org.eclipse.rse.ftp-feature/feature.xml | 4 ++-- .../sourceTemplateFeature/feature.properties | 4 ++-- .../sourceTemplateFeature/feature.xml | 4 ++-- .../sourceTemplatePlugin/about.properties | 4 ++-- .../META-INF/MANIFEST.MF | 2 +- .../about.properties | 4 ++-- .../services/files/ftp/FTPService.java | 20 +++++++------------ 9 files changed, 22 insertions(+), 28 deletions(-) diff --git a/releng/org.eclipse.rse.build/maps/rse.map b/releng/org.eclipse.rse.build/maps/rse.map index bb9a60be7cc..1fc598e6e28 100644 --- a/releng/org.eclipse.rse.build/maps/rse.map +++ b/releng/org.eclipse.rse.build/maps/rse.map @@ -4,7 +4,7 @@ feature@org.eclipse.rse=v201003151933,:pserver:anonymous:none@dev.eclipse.org:/c feature@org.eclipse.rse.core=v201003151933,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/features/org.eclipse.rse.core-feature feature@org.eclipse.rse.dstore=v201003010830,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/features/org.eclipse.rse.dstore-feature feature@org.eclipse.rse.examples=v200905272300,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/examples/org.eclipse.rse.examples-feature -feature@org.eclipse.rse.ftp=v200909160005,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/features/org.eclipse.rse.ftp-feature +feature@org.eclipse.rse.ftp=v201003151933,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/features/org.eclipse.rse.ftp-feature feature@org.eclipse.rse.local=v201003010830,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/features/org.eclipse.rse.local-feature feature@org.eclipse.rse.sdk=v201003151933,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/features/org.eclipse.rse.sdk-feature feature@org.eclipse.rse.ssh=v200909160005,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/features/org.eclipse.rse.ssh-feature @@ -35,7 +35,7 @@ plugin@org.eclipse.rse.importexport=v201003010830,:pserver:anonymous:none@dev.ec plugin@org.eclipse.rse.processes.ui=v201003010830,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.rse.processes.ui plugin@org.eclipse.rse.sdk=v201003151933,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.rse.sdk plugin@org.eclipse.rse.services.dstore=v201003151238,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.rse.services.dstore -plugin@org.eclipse.rse.services.files.ftp=v200909160005,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.rse.services.files.ftp +plugin@org.eclipse.rse.services.files.ftp=v201003151933,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.rse.services.files.ftp plugin@org.eclipse.rse.services.local=v201003010830,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.rse.services.local plugin@org.eclipse.rse.services.ssh=v200909160005,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.rse.services.ssh plugin@org.eclipse.rse.services.telnet=v200905272300,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.rse.services.telnet diff --git a/rse/features/org.eclipse.rse.ftp-feature/feature.properties b/rse/features/org.eclipse.rse.ftp-feature/feature.properties index bf2815ad19b..693322ca205 100644 --- a/rse/features/org.eclipse.rse.ftp-feature/feature.properties +++ b/rse/features/org.eclipse.rse.ftp-feature/feature.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2006, 2009 IBM Corporation and others. +# Copyright (c) 2006, 2010 IBM Corporation and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at @@ -27,7 +27,7 @@ implementation of the file services defined by the RSE API. # "copyright" property - text of the "Feature Update Copyright" copyright=\ -Copyright (c) 2000, 2009 Symbian Software Ltd. and others.\n\ +Copyright (c) 2000, 2010 Symbian Software Ltd. and others.\n\ All rights reserved. This program and the accompanying materials\n\ are made available under the terms of the Eclipse Public License v1.0\n\ which accompanies this distribution, and is available at\n\ diff --git a/rse/features/org.eclipse.rse.ftp-feature/feature.xml b/rse/features/org.eclipse.rse.ftp-feature/feature.xml index f50f3cf92fe..a6489986fe5 100644 --- a/rse/features/org.eclipse.rse.ftp-feature/feature.xml +++ b/rse/features/org.eclipse.rse.ftp-feature/feature.xml @@ -1,5 +1,5 @@ - + %description diff --git a/rse/features/org.eclipse.rse.ftp-feature/sourceTemplatePlugin/about.properties b/rse/features/org.eclipse.rse.ftp-feature/sourceTemplatePlugin/about.properties index 40a68c561b4..ee1e669a168 100644 --- a/rse/features/org.eclipse.rse.ftp-feature/sourceTemplatePlugin/about.properties +++ b/rse/features/org.eclipse.rse.ftp-feature/sourceTemplatePlugin/about.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2000, 2009 IBM Corporation and others. +# Copyright (c) 2000, 2010 IBM Corporation and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at @@ -21,6 +21,6 @@ blurb=RSE FTP Service Source\n\ Version: {featureVersion}\n\ Build id: {0}\n\ \n\ -(c) Copyright Symbian Software Ltd. and others 2000, 2009. All rights reserved.\n\ +(c) Copyright Symbian Software Ltd. and others 2000, 2010. All rights reserved.\n\ Visit http://www.eclipse.org/dsdp/tm diff --git a/rse/plugins/org.eclipse.rse.services.files.ftp/META-INF/MANIFEST.MF b/rse/plugins/org.eclipse.rse.services.files.ftp/META-INF/MANIFEST.MF index 21fdfc3a8aa..c934c77061f 100644 --- a/rse/plugins/org.eclipse.rse.services.files.ftp/META-INF/MANIFEST.MF +++ b/rse/plugins/org.eclipse.rse.services.files.ftp/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.rse.services.files.ftp;singleton:=true -Bundle-Version: 3.0.101.qualifier +Bundle-Version: 3.0.200.qualifier Bundle-Activator: org.eclipse.rse.internal.services.files.ftp.Activator Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/rse/plugins/org.eclipse.rse.services.files.ftp/about.properties b/rse/plugins/org.eclipse.rse.services.files.ftp/about.properties index 6291eb83e64..c4f1dad2a3b 100644 --- a/rse/plugins/org.eclipse.rse.services.files.ftp/about.properties +++ b/rse/plugins/org.eclipse.rse.services.files.ftp/about.properties @@ -1,5 +1,5 @@ ################################################################################ -# Copyright (c) 2006, 2009 Wind River Systems, Inc. and others. +# Copyright (c) 2006, 2010 Wind River Systems, Inc. and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at @@ -25,7 +25,7 @@ blurb=RSE FTP Service\n\ Version: {featureVersion}\n\ Build id: {0}\n\ \n\ -(c) Copyright Symbian Software Ltd. and others 2000, 2009. All rights reserved.\n\ +(c) Copyright Symbian Software Ltd. and others 2000, 2010. All rights reserved.\n\ Visit http://www.eclipse.org/dsdp/tm\n\ \n\ This product includes software developed by the\n\ diff --git a/rse/plugins/org.eclipse.rse.services.files.ftp/src/org/eclipse/rse/internal/services/files/ftp/FTPService.java b/rse/plugins/org.eclipse.rse.services.files.ftp/src/org/eclipse/rse/internal/services/files/ftp/FTPService.java index 7965e503133..070a8a96511 100644 --- a/rse/plugins/org.eclipse.rse.services.files.ftp/src/org/eclipse/rse/internal/services/files/ftp/FTPService.java +++ b/rse/plugins/org.eclipse.rse.services.files.ftp/src/org/eclipse/rse/internal/services/files/ftp/FTPService.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2006, 2009 IBM Corporation and others. All rights reserved. + * Copyright (c) 2006, 2010 IBM Corporation and others. All rights reserved. * This program and the accompanying materials are made available under the terms * of the Eclipse Public License v1.0 which accompanies this distribution, and is * available at http://www.eclipse.org/legal/epl-v10.html @@ -83,6 +83,7 @@ * Martin Oberhuber (Wind River) - [217472][ftp] Error copying files with very short filenames * Martin Oberhuber (Wind River) - [285942] Throw exception when listing a non-folder * Martin Oberhuber (Wind River) - [285948] Avoid recursive deletion over symbolic links + * Martin Oberhuber (Wind River) - [300398] Avoid product hang-up on isConnected() ********************************************************************************/ package org.eclipse.rse.internal.services.files.ftp; @@ -109,7 +110,6 @@ import org.apache.commons.net.ProtocolCommandListener; import org.apache.commons.net.ftp.FTP; import org.apache.commons.net.ftp.FTPClient; import org.apache.commons.net.ftp.FTPClientConfig; -import org.apache.commons.net.ftp.FTPConnectionClosedException; import org.apache.commons.net.ftp.FTPFile; import org.apache.commons.net.ftp.FTPReply; import org.eclipse.core.runtime.IProgressMonitor; @@ -721,17 +721,11 @@ public class FTPService extends AbstractFileService implements IFTPService, IFil if(_ftpClient!=null) { isConnected = _ftpClient.isConnected(); - if (isConnected){ // make sure that there hasn't been a timeout - try { - _ftpClient.noop(); - } - catch (FTPConnectionClosedException e){ - return false; - } - catch (IOException e2){ - return false; - } - } + // Bug 300394: isConnected() is called on the main thread, so it must + // return fast without really checking the remote. In FTP, we deal + // with "virtual connections" which can automatically re-connect + // through the getFTPClient() method at any time. Sending NOOP as + // keepalive is a separate thing to be done. } return isConnected;