Skip to content

Conversation

@chenyuzhi459
Copy link
Contributor

@chenyuzhi459 chenyuzhi459 commented Dec 11, 2024

What is the purpose of the change

Support external eventLoopGroup for RestClient

Brief change log

  • Support pass an external eventLoopGroup in the constructor of RestClient
  • Close only for internal eventLoopGroup, not for external

Verifying this change

The change is tested by RestClientTest.testExternalEventGroup

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): ( no)
  • The serializers: (no)
  • The runtime per-record code paths (performance sensitive): (no)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (no)
  • The S3 file system connector: (no)

Documentation

  • Does this pull request introduce a new feature? (no)
  • If yes, how is the feature documented? (not applicable)

@flinkbot
Copy link
Collaborator

flinkbot commented Dec 11, 2024

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

ConcurrentHashMap.newKeySet();

private final List<OutboundChannelHandlerFactory> outboundChannelHandlerFactories;
private final Boolean useInternalEventLoopGroup;
Copy link
Contributor

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

WaitStrategy waitStrategy,
ClientHighAvailabilityServicesFactory clientHAServicesFactory)
ClientHighAvailabilityServicesFactory clientHAServicesFactory,
EventLoopGroup group)
Copy link
Contributor

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;
Copy link
Contributor

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

Copy link
Contributor

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?

Copy link
Contributor Author

@chenyuzhi459 chenyuzhi459 Dec 16, 2024

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 ?

Copy link
Contributor Author

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

This check is necessary and the logic has been added. Thanks

@davidradl
Copy link
Contributor

Reviewed by Chi on 12/12/24. Asked submitter questions

@chenyuzhi459
Copy link
Contributor Author

Reviewed by Chi on 12/12/24. Asked submitter questions

The code has been updated and the question has been answered. Please review again.

@davidradl

@github-actions
Copy link

This PR is being marked as stale since it has not had any activity in the last 90 days.
If you would like to keep this PR alive, please leave a comment asking for a review.
If the PR has merge conflicts, update it with the latest from the base branch.

If you are having difficulty finding a reviewer, please reach out to the
community, contact details can be found here: https://flink.apache.org/what-is-flink/community/

If this PR is no longer valid or desired, please feel free to close it.
If no activity occurs in the next 30 days, it will be automatically closed.

@gyfora
Copy link
Contributor

gyfora commented Apr 29, 2025

@chenyuzhi459 can you please rebase on the latest master to retrigger the tests before we merge this?

@github-actions github-actions bot removed the stale label May 3, 2025
@gyfora gyfora merged commit 4594f5e into apache:master May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants