[
https://issues.apache.org/jira/browse/YARN-11240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17582686#comment-17582686
]
ASF GitHub Bot commented on YARN-11240:
---------------------------------------
slfan1989 commented on code in PR #4678:
URL: https://github.com/apache/hadoop/pull/4678#discussion_r950949402
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/ServiceScheduler.java:
##########
@@ -1139,7 +1139,7 @@ public void syncSysFs(Service yarnApp) {
LOG.info("YARN sysfs synchronized.");
}
} catch (IOException | URISyntaxException | InterruptedException e) {
- LOG.error("Fail to sync service spec: {}", e);
+ LOG.error("Fail to sync service spec: {}", e.getMessage(), e);
Review Comment:
Thanks a lot for your help reviewing the code, but there is a problem with
the use of placeholders for logging.
When an exception occurs, the placeholder is not replaced, We can view the
following logs.
```
2022-08-22 09:59:13,755 ERROR [Listener at 0.0.0.0/51213]
service.TestServiceAM (TestServiceAM.java:testSyncSysFS(556)) -
Fail to sync sysfs: {}
java.lang.RuntimeException: tensorflow syncSysFs Error
at
org.apache.hadoop.yarn.service.ServiceScheduler.syncSysFs(ServiceScheduler.java:1137)
at
org.apache.hadoop.yarn.service.TestServiceAM.testSyncSysFS(TestServiceAM.java:551)
...
```
Because the log uses the void error(String var1, Throwable var2); method, it
cannot be replaced.
So I added e.getMessage() to make the placeholder take effect and the log
format would be better.
```
2022-08-22 10:03:55,450 ERROR [Listener at 0.0.0.0/51354]
service.TestServiceAM (TestServiceAM.java:testSyncSysFS(556)) -
Fail to sync sysfs: tensorflow syncSysFs Error
java.lang.RuntimeException: tensorflow syncSysFs Error
at
org.apache.hadoop.yarn.service.ServiceScheduler.syncSysFs(ServiceScheduler.java:1137)
at
org.apache.hadoop.yarn.service.TestServiceAM.testSyncSysFS(TestServiceAM.java:551)
...
```
> Fix incorrect placeholder in yarn-module
> ----------------------------------------
>
> Key: YARN-11240
> URL: https://issues.apache.org/jira/browse/YARN-11240
> Project: Hadoop YARN
> Issue Type: Improvement
> Affects Versions: 3.4.0
> Reporter: fanshilun
> Assignee: fanshilun
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Try to deal with the moudle problem at a time.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]