-
Notifications
You must be signed in to change notification settings - Fork 9.1k
YARN-11240. Fix incorrect placeholder in yarn-module. #4678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
@ayushtkn Can you help review this pr? Thank you very much! |
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to keep the message, just e is enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for helping to review the code!
There is a problem with the use of placeholders in this part of the code.
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)
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I remove the placeholder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, tensorflow syncSysFs Error is getting printed twice, we don’t need that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your suggestion, I will fix it.
@@ -553,7 +553,7 @@ public void testSyncSysFS() { | |||
am.stop(); | |||
am.close(); | |||
} catch (Exception e) { | |||
LOG.error("Fail to sync sysfs: {}", e); | |||
LOG.error("Fail to sync sysfs: {}", e.getMessage(), e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep only e, message will come as part of that
🎊 +1 overall
This message was automatically generated. |
@ayushtkn Can you help review the code again? Thank you very much! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…Contributed by fanshilun Signed-off-by: Ayush Saxena <ayushsaxena@apache.org>
JIRA: YARN-11240. Fix incorrect placeholder in yarn-module.