-
Notifications
You must be signed in to change notification settings - Fork 13.4k
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
[FLINK-36876] Support external eventLoopGroup for RestClient #25788
base: master
Are you sure you want to change the base?
Conversation
@@ -143,30 +144,42 @@ public class RestClient implements AutoCloseableAsync { | |||
ConcurrentHashMap.newKeySet(); | |||
|
|||
private final List<OutboundChannelHandlerFactory> outboundChannelHandlerFactories; | |||
private final Boolean useInternalEventLoopGroup; |
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.
nit: why not boolean, I assume we do not want this ever to be null
} | ||
|
||
private RestClusterClient( | ||
Configuration configuration, | ||
@Nullable RestClient restClient, | ||
T clusterId, | ||
WaitStrategy waitStrategy, | ||
ClientHighAvailabilityServicesFactory clientHAServicesFactory) | ||
ClientHighAvailabilityServicesFactory clientHAServicesFactory, | ||
EventLoopGroup group) |
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.
should we tag with @nullable?
selectStrategyFactory); | ||
useInternalEventLoopGroup = true; | ||
} else { | ||
useInternalEventLoopGroup = false; |
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.
should we check that the supplied group is not shutting down or shutdown
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.
I see the channel is NioSocketChannel.class
is this always the case for external groups?
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.
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 ?
Reviewed by Chi on 12/12/24. Asked submitter questions |
What is the purpose of the change
Support external eventLoopGroup for RestClient
Brief change log
Verifying this change
The change is tested by RestClientTest.testExternalEventGroup
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: ( no)Documentation