Browse Source

YARN-9794. RM crashes due to runtime errors in TimelineServiceV2Publisher. Contributed by Tarun Parimi.

Abhishek Modi 5 years ago
parent
commit
da2b4fe204

+ 2 - 0
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TimelineServiceV2Publisher.java

@@ -485,6 +485,8 @@ public class TimelineServiceV2Publisher extends AbstractSystemMetricsPublisher {
     } catch (IOException e) {
       LOG.error("Error when publishing entity " + entity);
       LOG.debug("Error when publishing entity {}", entity, e);
+    } catch (Exception e) {
+      LOG.error("Unexpected error when publishing entity {}", entity, e);
     }
   }
 

+ 4 - 0
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/collector/TimelineCollectorWebService.java

@@ -196,6 +196,10 @@ public class TimelineCollectorWebService {
       LOG.error("Error putting entities", e);
       throw new WebApplicationException(e,
           Response.Status.INTERNAL_SERVER_ERROR);
+    } catch (Exception e) {
+      LOG.error("Unexpected error while putting entities", e);
+      throw new WebApplicationException(e,
+          Response.Status.INTERNAL_SERVER_ERROR);
     } finally {
       long latency = Time.monotonicNow() - startTime;
       if (isAsync) {