chenyuzhi459 commented on code in PR #25788:
URL: https://github.com/apache/flink/pull/25788#discussion_r1886236906
##########
flink-runtime/src/main/java/org/apache/flink/runtime/rest/RestClient.java:
##########
@@ -264,15 +278,21 @@ protected void initChannel(SocketChannel socketChannel) {
}
};
- // No NioEventLoopGroup constructor available that allows passing
nThreads, threadFactory,
- // and selectStrategyFactory without also passing a SelectorProvider,
so mimicking its
- // default value seen in other constructors
- NioEventLoopGroup group =
- new NioEventLoopGroup(
- 1,
- new ExecutorThreadFactory("flink-rest-client-netty"),
- SelectorProvider.provider(),
- selectStrategyFactory);
+ if (group == null) {
+ // No NioEventLoopGroup constructor available that allows passing
nThreads,
+ // threadFactory,
+ // and selectStrategyFactory without also passing a
SelectorProvider, so mimicking its
+ // default value seen in other constructors
+ group =
+ new NioEventLoopGroup(
+ 1,
+ new
ExecutorThreadFactory("flink-rest-client-netty"),
+ SelectorProvider.provider(),
+ selectStrategyFactory);
+ useInternalEventLoopGroup = true;
+ } else {
+ useInternalEventLoopGroup = false;
Review Comment:
I think the extenal service doesn't care the type of SocketChannel. As the
jira says, it just pass a shared event group to avoid heap memory leak.
Maybe it's a better choice to specify the contruct param `group` as
NioEventLoopGroup, which could avoid the type error building `Bootstrap`
instance ?
--
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]