ACCUMULO-2162 Make better checks before warning the user. Currently, multiple processes share one temp directory, which means that the tempDir being unable to be deleted is expected, and thus shouldn't be WARN'ed.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/deae04f6 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/deae04f6 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/deae04f6 Branch: refs/heads/master Commit: deae04f670986ce7e465a89f61dd844d2d416903 Parents: 9372608 Author: Josh Elser <[email protected]> Authored: Fri Jan 10 15:55:58 2014 -0500 Committer: Josh Elser <[email protected]> Committed: Fri Jan 10 15:55:58 2014 -0500 ---------------------------------------------------------------------- .../accumulo/start/classloader/vfs/UniqueFileReplicator.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/deae04f6/start/src/main/java/org/apache/accumulo/start/classloader/vfs/UniqueFileReplicator.java ---------------------------------------------------------------------- diff --git a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/UniqueFileReplicator.java b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/UniqueFileReplicator.java index 328bb54..f60e165 100644 --- a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/UniqueFileReplicator.java +++ b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/UniqueFileReplicator.java @@ -93,7 +93,10 @@ public class UniqueFileReplicator implements VfsComponent, FileReplicator { log.warn("File does not exist: " + tmpFile); } } - if (!tempDir.delete()) - log.warn("Directory does not exists: " + tempDir); + if (tempDir.exists()) { + int numChildren = tempDir.list().length; + if (0 == numChildren && !tempDir.delete()) + log.warn("Cannot delete empty directory: " + tempDir); + } } }
