Skip to content

[FLINK-36876] Add proxy for restClient #956

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

chenyuzhi459
Copy link
Contributor

What is the purpose of the change

Add proxy for restClient, which supports to use shared EventLoopGroup

Brief change log

  • Introduce a new class RestClientProxy as the proxy of restClient
  • Introduce a new configuration: kubernetes.operator.flink.client.io.threads to specify the total thread of sharded eventLoopGroup
  • RestClientProxy supports to use sharded eventLoopGroup

Verifying this change

Unit tests + manual verification

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 changes to the CustomResourceDescriptors: (no)
  • Core observer or reconciler logic that is regularly executed: (yes)

Documentation

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

Copy link
Contributor

@gyfora gyfora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense on a high level, reflection is not great but it's okay if we have a better solution in newer Flink versions.

Which Flink version will contain the Fix for this?

@chenyuzhi459 chenyuzhi459 changed the title Draft PR [FLINK-36876] Add proxy for restClient [FLINK-36876] Add proxy for restClient Apr 29, 2025
@chenyuzhi459
Copy link
Contributor Author

It depends on when will the pr apache/flink#25788 could be merged.

If necessary, I can submit the pr fix in both 1.20 and 2.x versions of Flink.

@gyfora

@chenyuzhi459
Copy link
Contributor Author

Is there any other problem with this pr? I don't know why CI check was cancelled

@gyfora

Copy link
Contributor

@gyfora gyfora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a minor clarifying question, also please rebase to retrigger the CI

this.groupField = groupField;

// close previous group
bootstrap.config().group().shutdown();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will this actually solve the original problem? The rest client still creates an individual group (that we close here) won't that cause the same issue anyways?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because PoolThreadCache is a request-thread-related cache, it is created and initialized when a request is made using the NioEventLoopGroup;

here it is created and closed immediately, with no requests in between, so there is no PoolThreadCache leakage issue.

@chenyuzhi459
Copy link
Contributor Author

Could you help take a look at the latest CI failure issue, which doesn't seem to be related to this code commit?

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.

2 participants