DRILL-5274: Exception thrown in Drillbit shutdown in UDF cleanup code closes #760
Project: http://git-wip-us.apache.org/repos/asf/drill/repo Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/470558e6 Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/470558e6 Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/470558e6 Branch: refs/heads/master Commit: 470558e6620d0e23b0b3b8003678dd97749a08bb Parents: 6bc398f Author: Arina Ielchiieva <arina.yelchiy...@gmail.com> Authored: Fri Feb 24 14:06:50 2017 +0200 Committer: Sudheesh Katkam <sudhe...@apache.org> Committed: Fri Feb 24 18:41:48 2017 -0800 ---------------------------------------------------------------------- .../drill/exec/expr/fn/FunctionImplementationRegistry.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/drill/blob/470558e6/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionImplementationRegistry.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionImplementationRegistry.java b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionImplementationRegistry.java index 590a99a..ce0d68b 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionImplementationRegistry.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionImplementationRegistry.java @@ -466,7 +466,10 @@ public class FunctionImplementationRegistry implements FunctionLookupContext, Au FileUtils.deleteQuietly(tmpDir); } else { try { - FileUtils.cleanDirectory(new File(localUdfDir.toUri().getPath())); + File localDir = new File(localUdfDir.toUri().getPath()); + if (localDir.exists()) { + FileUtils.cleanDirectory(localDir); + } } catch (IOException e) { logger.warn("Problems during local udf directory clean up", e); }