-
Notifications
You must be signed in to change notification settings - Fork 9.1k
HADOOP-15327. Upgrade MR ShuffleHandler to use Netty4 #3259
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. |
.../hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle/src/test/resources/log4j.properties
Outdated
Show resolved
Hide resolved
...reduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/LoggingHttpResponseEncoder.java
Outdated
Show resolved
Hide resolved
...reduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/LoggingHttpResponseEncoder.java
Outdated
Show resolved
Hide resolved
...t/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java
Outdated
Show resolved
Hide resolved
...t/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java
Outdated
Show resolved
Hide resolved
...t/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java
Outdated
Show resolved
Hide resolved
...t/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java
Outdated
Show resolved
Hide resolved
...t/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java
Outdated
Show resolved
Hide resolved
...t/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java
Outdated
Show resolved
Hide resolved
...t/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java
Outdated
Show resolved
Hide resolved
...doop-mapreduce-client-shuffle/src/test/java/org/apache/hadoop/mapred/TestShuffleHandler.java
Outdated
Show resolved
Hide resolved
...doop-mapreduce-client-shuffle/src/test/java/org/apache/hadoop/mapred/TestShuffleHandler.java
Outdated
Show resolved
Hide resolved
...doop-mapreduce-client-shuffle/src/test/java/org/apache/hadoop/mapred/TestShuffleHandler.java
Outdated
Show resolved
Hide resolved
...doop-mapreduce-client-shuffle/src/test/java/org/apache/hadoop/mapred/TestShuffleHandler.java
Outdated
Show resolved
Hide resolved
...doop-mapreduce-client-shuffle/src/test/java/org/apache/hadoop/mapred/TestShuffleHandler.java
Outdated
Show resolved
Hide resolved
...doop-mapreduce-client-shuffle/src/test/java/org/apache/hadoop/mapred/TestShuffleHandler.java
Outdated
Show resolved
Hide resolved
...doop-mapreduce-client-shuffle/src/test/java/org/apache/hadoop/mapred/TestShuffleHandler.java
Outdated
Show resolved
Hide resolved
...doop-mapreduce-client-shuffle/src/test/java/org/apache/hadoop/mapred/TestShuffleHandler.java
Outdated
Show resolved
Hide resolved
...doop-mapreduce-client-shuffle/src/test/java/org/apache/hadoop/mapred/TestShuffleHandler.java
Outdated
Show resolved
Hide resolved
...doop-mapreduce-client-shuffle/src/test/java/org/apache/hadoop/mapred/TestShuffleHandler.java
Outdated
Show resolved
Hide resolved
148287b
to
7922573
Compare
💔 -1 overall
This message was automatically generated. |
Is there any update on this PR? @szilard-nemeth We are also waiting for the change of using netty4 to replace netty3 due to its vulnerability issues. |
Hi @jasonwzs, |
Thanks @szilard-nemeth . Will there be any issue if we backport this change to 3.2.x? |
7922573
to
6ba9c41
Compare
Hopefully not but we need to take care of this. |
Hi @jasonwzs, |
💔 -1 overall
This message was automatically generated. |
Hi @szilard-nemeth , I referred PR provided in this jira for netty upgrade for fixing Netty CVE vulnerability and did some fixes for maven shading issues. I am happy to contribute the patch to open source. Can i attach patch in this PR or open a new PR. Let me know your thoughts. Thanks |
Hi @ayushpal24, |
💔 -1 overall
This message was automatically generated. |
d244fcf
to
31287c0
Compare
Hi @ayushpal24, |
Hi @szilard-nemeth , some imports got auto reformatted in previous commit , so i amended the changes in that commit. I have verified the changes are not significant .I will check for Maven shading issue after the current build . |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
Hi @szilard-nemeth ,this is my first patch and i am not able to find any detail report to understand the reason of failures, any suggestions? |
Hi, |
💔 -1 overall
This message was automatically generated. |
31287c0
to
7f43fd6
Compare
💔 -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.
Thanks for the PR and the huge effort on it @szilard-nemeth. I had a few suggestions/questions in the first round of my review.
...t/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java
Outdated
Show resolved
Hide resolved
...doop-mapreduce-client-shuffle/src/test/java/org/apache/hadoop/mapred/TestShuffleHandler.java
Outdated
Show resolved
Hide resolved
...doop-mapreduce-client-shuffle/src/test/java/org/apache/hadoop/mapred/TestShuffleHandler.java
Outdated
Show resolved
Hide resolved
...t/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java
Outdated
Show resolved
Hide resolved
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.
This is actually threadsafe according to the documentation. However, GlobalEventExecutor instance is a non-scalable option, perhaps a custom executor will be needed here.
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.
Fixed, please check again.
...t/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java
Outdated
Show resolved
Hide resolved
...t/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java
Outdated
Show resolved
Hide resolved
...t/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java
Outdated
Show resolved
Hide resolved
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
… 5 thread instance of DefaultEventExecutorGroup
f6c3739
to
6f36b38
Compare
💔 -1 overall
This message was automatically generated. |
Merged to trunk. Thanks @szilard-nemeth for the patch and @shuzirra @9uapaw @K0K0V0K @ashutoshcipher for the review! |
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.
Hi thanks for working on this. It's not an easy feat to pull off. I do have a few questions& comments. If it passes unit tests and has used netty's memory leak detection tool, it should be okay to land it in the trunk branch for 3.4.0 release.
LOG.debug("Fetcher " + id + " going to fetch from " + host + " for: " | ||
+ maps); | ||
if (LOG.isDebugEnabled()) { | ||
LOG.debug("Fetcher " + id + " going to fetch from " + host + " for: " + maps); |
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.
slf4j logger messages can be rewritten using parameterized logging format. But let's not worry about that now. This PR is already too big.
import static io.netty.handler.codec.http.HttpResponseStatus.OK; | ||
import static io.netty.handler.codec.http.HttpResponseStatus.UNAUTHORIZED; | ||
import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1; | ||
import static org.apache.hadoop.mapred.ShuffleHandler.NettyChannelHelper.*; |
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.
let's not use wildcard import
private ServerBootstrap bootstrap; | ||
private Channel ch; | ||
private final ChannelGroup accepted = | ||
new DefaultChannelGroup(new DefaultEventExecutorGroup(5).next()); |
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.
So, if I understand it correct from the context, the size of the channel group should be maxShuffleConnections, which is unlimited by default (configurable via mapreduce.shuffle.max.connections)
if ((maxShuffleConnections > 0) && (accepted.size() >= maxShuffleConnections)) { | ||
NettyChannelHelper.channelActive(ctx.channel()); | ||
int numConnections = activeConnections.incrementAndGet(); | ||
if ((maxShuffleConnections > 0) && (numConnections > maxShuffleConnections)) { |
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.
Perhaps these channel bookeeping is no longer needed given that channel size is limited.
} else if (cause instanceof IOException) { | ||
if (cause instanceof ClosedChannelException) { | ||
LOG.debug("Ignoring closed channel error", cause); | ||
LOG.debug("Ignoring closed channel error, channel id: " + ch.id(), cause); |
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.
Use parameterized logging, otherwise wrap it in a LOG.isDebugEnabled() check.
Closing this PR as it's already merged into trunk. Thank you. |
NOTICE
Please create an issue in ASF JIRA before opening a pull request,
and you need to set the title of the pull request which starts with
the corresponding JIRA issue number. (e.g. HADOOP-XXXXX. Fix a typo in YYY.)
For more details, please see https://cwiki.apache.org/confluence/display/HADOOP/How+To+Contribute