From 0f02614d951b3dd0eac3cfe9f673596f300fe8c5 Mon Sep 17 00:00:00 2001 From: Prabhjyot Singh Date: Wed, 20 Nov 2024 12:39:44 -0500 Subject: [PATCH] ODP-2646: TEZ-4455: Add LoggingHandler in ShuffleHandler pipeline for better debuggability. (#249) (Dmitriy Fingerman reviewed by Laszlo Bodor) (#21) (cherry picked from commit 65f9ee32a46518c89ad2347a8e39541d3e669e2d) (cherry picked from commit 2c2be57f302003f38c1632c327b4fa6ed92e3cba) (cherry picked from commit 12be783071a8589e4f1873281d7d5ca2b56fa6ad) Co-authored-by: Dmitriy Fingerman --- .../main/java/org/apache/tez/auxservices/ShuffleHandler.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tez-plugins/tez-aux-services/src/main/java/org/apache/tez/auxservices/ShuffleHandler.java b/tez-plugins/tez-aux-services/src/main/java/org/apache/tez/auxservices/ShuffleHandler.java index 94f869e950..e9664045fb 100644 --- a/tez-plugins/tez-aux-services/src/main/java/org/apache/tez/auxservices/ShuffleHandler.java +++ b/tez-plugins/tez-aux-services/src/main/java/org/apache/tez/auxservices/ShuffleHandler.java @@ -32,6 +32,8 @@ 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 io.netty.handler.logging.LogLevel; +import io.netty.handler.logging.LoggingHandler; import java.io.File; import java.io.FileNotFoundException; @@ -598,6 +600,9 @@ public void initChannel(NioSocketChannel ch) throws Exception { if (sslFactory != null) { pipeline.addLast("ssl", new SslHandler(sslFactory.createSSLEngine())); } + if (LOG.isDebugEnabled()) { + pipeline.addLast("loggingHandler", new LoggingHandler(LogLevel.DEBUG)); + } pipeline.addLast("decoder", new HttpRequestDecoder()); pipeline.addLast("aggregator", new HttpObjectAggregator(1 << 16)); pipeline.addLast("encoder", new HttpResponseEncoder());