pan3793 commented on code in PR #8920:
URL: https://github.com/apache/hadoop/pull/8920#discussion_r4464891733
##########
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/job/impl/TaskAttemptImpl.java:
##########
@@ -1877,7 +1878,10 @@ protected String resolveHost(String src) {
Pattern.compile("\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}");
protected boolean isIP(String src) {
- return ipPattern.matcher(src).matches();
+ // InetAddresses alone also covers IPv4, but it rejects leading zero
octets such as
+ // "010.1.1.1", which the regex accepts and resolveHost() resolves. Keep
the regex so
Review Comment:
I don't think Hadoop intended to support that. I would drop it and call
`InetAddresses.isInetAddress(src)` directly
--
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]