Skip to content

Commit 3f0eb60

Browse files
author
schintap
committed
Make event loop group final
1 parent 657dff2 commit 3f0eb60

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

common/network-common/src/main/java/org/apache/spark/network/TransportContext.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public class TransportContext {
8888
// Separate thread pool for handling ChunkFetchRequest. This helps to enable throttling
8989
// max number of TransportServer worker threads that are blocked on writing response
9090
// of ChunkFetchRequest message back to the client via the underlying channel.
91-
private EventLoopGroup chunkFetchWorkers;
91+
private final EventLoopGroup chunkFetchWorkers;
9292

9393
public TransportContext(TransportConf conf, RpcHandler rpcHandler) {
9494
this(conf, rpcHandler, false, false);
@@ -122,14 +122,15 @@ public TransportContext(
122122
this.closeIdleConnections = closeIdleConnections;
123123
this.isClientOnly = isClientOnly;
124124

125-
if (chunkFetchWorkers == null &&
126-
conf.getModuleName() != null &&
125+
if (conf.getModuleName() != null &&
127126
conf.getModuleName().equalsIgnoreCase("shuffle") &&
128127
!isClientOnly) {
129128
chunkFetchWorkers = NettyUtils.createEventLoop(
130129
IOMode.valueOf(conf.ioMode()),
131130
conf.chunkFetchHandlerThreads(),
132131
"shuffle-chunk-fetch-handler");
132+
} else {
133+
chunkFetchWorkers = null;
133134
}
134135
}
135136

0 commit comments

Comments
 (0)