From 13f74a36016c57eb1200e270207785234630e5f1 Mon Sep 17 00:00:00 2001 From: Jason Lowe Date: Wed, 21 Mar 2018 17:19:20 -0500 Subject: [PATCH] YARN-8054. Improve robustness of the LocalDirsHandlerService MonitoringTimerTask thread. Contributed by Jonathan Eagles (cherry picked from commit 5aa7052e319c3273243dda9993fb6c2d776eb7cc) --- .../yarn/server/nodemanager/LocalDirsHandlerService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/LocalDirsHandlerService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/LocalDirsHandlerService.java index c0630b246f6..621cabc1b80 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/LocalDirsHandlerService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/LocalDirsHandlerService.java @@ -166,7 +166,12 @@ public class LocalDirsHandlerService extends AbstractService { @Override public void run() { - checkDirs(); + try { + checkDirs(); + } catch (Throwable t) { + // Prevent uncaught exceptions from killing this thread + LOG.warn("Error while checking local directories: ", t); + } } }