From ba1f9d66d94ed0b85084d7c40c09a87478b3a05a Mon Sep 17 00:00:00 2001 From: Jason Lowe Date: Tue, 6 Nov 2018 17:55:51 -0600 Subject: [PATCH] MAPREDUCE-7156. NullPointerException when reaching max shuffle connections. Contributed by Peter Bacsko --- .../main/java/org/apache/hadoop/mapred/ShuffleHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java index aeda9cc688..c2226855fd 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-shuffle/src/main/java/org/apache/hadoop/mapred/ShuffleHandler.java @@ -910,6 +910,8 @@ private List splitMaps(List mapq) { @Override public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent evt) throws Exception { + super.channelOpen(ctx, evt); + if ((maxShuffleConnections > 0) && (accepted.size() >= maxShuffleConnections)) { LOG.info(String.format("Current number of shuffle connections (%d) is " + "greater than or equal to the max allowed shuffle connections (%d)", @@ -925,8 +927,6 @@ public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent evt) return; } accepted.add(evt.getChannel()); - super.channelOpen(ctx, evt); - } @Override