akshatb1 commented on a change in pull request #3325:
URL: https://github.com/apache/hadoop/pull/3325#discussion_r702628323
##########
File path:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/clientrm/FederationClientInterceptor.java
##########
@@ -628,18 +629,29 @@ public GetApplicationReportResponse getApplicationReport(
public GetApplicationsResponse getApplications(GetApplicationsRequest
request)
throws YarnException, IOException {
if (request == null) {
+ routerMetrics.incrMultipleAppsFailedRetrieved();
RouterServerUtil.logAndThrowException(
"Missing getApplications request.",
null);
}
+ long startTime = clock.getTime();
Map<SubClusterId, SubClusterInfo> subclusters =
federationFacade.getSubClusters(true);
ClientMethod remoteMethod = new ClientMethod("getApplications",
new Class[] {GetApplicationsRequest.class}, new Object[] {request});
- Map<SubClusterId, GetApplicationsResponse> applications =
- invokeConcurrent(subclusters.keySet(), remoteMethod,
- GetApplicationsResponse.class);
+ Map<SubClusterId, GetApplicationsResponse> applications;
+
+ try {
+ applications = invokeConcurrent(subclusters.keySet(), remoteMethod,
+ GetApplicationsResponse.class);
+ } catch (Exception ex) {
Review comment:
This encapsulates any exception throws by `invokeConcurrent`. Without
metrics, it would just throw the exception. In case of metrics, catching,
recording metrics and throwing the exception.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]