You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by st...@apache.org on 2014/11/11 16:05:05 UTC

[02/17] incubator-slider git commit: SLIDER-622 warn if the directory is still present after the delete (shutdown race condition problem on NTFS)

SLIDER-622 warn if the directory is still present after the delete (shutdown race condition problem on NTFS)


Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/b2768a16
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/b2768a16
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/b2768a16

Branch: refs/heads/develop
Commit: b2768a165f09cb181446f812f2a310eab5e0f2eb
Parents: 8a3258e
Author: Steve Loughran <st...@apache.org>
Authored: Tue Nov 11 12:58:24 2014 +0000
Committer: Steve Loughran <st...@apache.org>
Committed: Tue Nov 11 12:58:24 2014 +0000

----------------------------------------------------------------------
 .../java/org/apache/slider/client/SliderClient.java     | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/b2768a16/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/client/SliderClient.java b/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
index a676fcc..164e2fe 100644
--- a/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
+++ b/slider-core/src/main/java/org/apache/slider/client/SliderClient.java
@@ -23,6 +23,7 @@ import com.google.common.base.Preconditions;
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.PathNotFoundException;
 import org.apache.hadoop.fs.permission.FsAction;
@@ -536,24 +537,23 @@ public class SliderClient extends AbstractSliderLaunchedService implements RunSe
     // create the directory path
     Path clusterDirectory = sliderFileSystem.buildClusterDirPath(clustername);
     // delete the directory;
-    boolean exists = sliderFileSystem.getFileSystem().exists(clusterDirectory);
+    FileSystem fs = sliderFileSystem.getFileSystem();
+    boolean exists = fs.exists(clusterDirectory);
     if (exists) {
       log.debug("Application Instance {} found at {}: destroying", clustername, clusterDirectory);
       boolean deleted =
-          sliderFileSystem.getFileSystem().delete(clusterDirectory, true);
+          fs.delete(clusterDirectory, true);
       if (!deleted) {
         log.warn("Filesystem returned false from delete() operation");
       }
-
-      if(!deleteZookeeperNode(clustername)) {
-        log.warn("Unable to perform node cleanup in Zookeeper.");
+      if (fs.exists(clusterDirectory)) {
+        log.warn("Failed to delete {}", clusterDirectory);
       }
 
     } else {
       log.debug("Application Instance {} already destroyed", clustername);
     }
 
-
     // rm the registry entry —do not let this block the destroy operations
     String registryPath = SliderRegistryUtils.registryPathForInstance(
         clustername);