-
Notifications
You must be signed in to change notification settings - Fork 9k
HADOOP-19218. Addendum. Update TestFSNamesystemLockReport to exclude hostname resolution from regex. #6951
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. |
@@ -8838,6 +8838,10 @@ private Supplier<String> getLockReportInfoSupplier(String src, String dst, | |||
UserGroupInformation ugi = Server.getRemoteUser(); | |||
String userName = ugi != null ? ugi.toString() : null; | |||
InetAddress addr = Server.getRemoteIp(); | |||
if (addr != null) { |
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.
@virajjasani Thanks for your works. But I am concerned if it will involve more serious impact here because when hold lock for a long time and trigger hostname resolution here which is one IO inner lock. Thanks again.
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.
hmm, FSNamesystemLock#coarseLock (writeLock) is unlocked only after writing above log so we will incur extra latency for long lock holding thread. Btw, i think coarseLock writeLock can be unlocked before logging the info as well (by protecting longestWriteLockHeldInfo
with either synchronizing or using another lock), but this is out of scope here so maybe sometime later.
Shall we keep ip address only for long lock hold audit logs (similar to FSNamesystem audit logs)? If yes, then we can directly make test changes (i.e. revert TestFSNamesystemLockReport changes done with 88914ca)?
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.
Strong +1 to update TestFSNamesystemLockReport only. And move log out of lock could improve at next PR. Thanks.
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.
Sounds good, let me update the test. Thanks @Hexiaoqiao
@@ -8838,6 +8838,10 @@ private Supplier<String> getLockReportInfoSupplier(String src, String dst, | |||
UserGroupInformation ugi = Server.getRemoteUser(); | |||
String userName = ugi != null ? ugi.toString() : null; | |||
InetAddress addr = Server.getRemoteIp(); | |||
if (addr != null) { | |||
// The host name resolution on InetAddress provides Hostname with IP address | |||
addr.getHostName(); |
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.
The parsing result is not used, are you sure it is useful?
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 it is useful because once you perform hostname resolution, the implementation of InetAddress#toString lets you print both hostname as well as ip address.
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
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. +1.
…hostname resolution from regex. (#6951). Contributed by Viraj Jasani. Signed-off-by: He Xiaoqiao <[email protected]> (cherry picked from commit e000cbf)
Committed to trunk and branch-3.4. Thanks @virajjasani . |
…hostname resolution from regex. (apache#6951). Contributed by Viraj Jasani. Signed-off-by: He Xiaoqiao <[email protected]>
…hostname resolution from regex. (apache#6951). Contributed by Viraj Jasani. Signed-off-by: He Xiaoqiao <[email protected]>
Description of PR
Addendum to fix hostname resolution for the longest lock holding thread
How was this patch tested?
UTs
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?