Skip to content
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

[Improve] [Flink-Kubernetes-V2] add observer untrack on Flink-Kubernetes-V2-Session #3216

Merged
merged 8 commits into from
Oct 8, 2023
Merged

[Improve] [Flink-Kubernetes-V2] add observer untrack on Flink-Kubernetes-V2-Session #3216

merged 8 commits into from
Oct 8, 2023

Conversation

caicancai
Copy link
Member

@caicancai caicancai commented Oct 7, 2023

What changes were proposed in this pull request

[Improve] [FLink-Kubernetes-V2] add observer untrack on Flink-Kubernetes-V2-Session

Brief change log

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

Does this pull request potentially affect one of the following parts

  • Dependencies (does it add or upgrade a dependency): (yes / no)

@github-actions github-actions bot added the FLINK label Oct 7, 2023
@caicancai caicancai changed the title [Improve] [FLink-Kubernetes-V2] add observer untrack on Flink-Kubernetes-V2-Session [Improve] [Flink-Kubernetes-V2] add observer untrack on Flink-Kubernetes-V2-Session Oct 7, 2023
@caicancai
Copy link
Member Author

cc @Al-assad @wolfboys

@@ -125,6 +128,9 @@ object KubernetesSessionClientV2 extends KubernetesClientV2Trait with Logger {

FlinkK8sOperator.k8sCrOpr.deleteSessionJob(namespace, name).runIOAsTry match {
case Success(_) =>
observer.trackedKeys
.find(_.id == shutDownRequest.id)
.someOrUnitZIO(key => observer.untrack(key))
Copy link
Member

Choose a reason for hiding this comment

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

This section is a ZIO value, so in fact it will not be executed.

Copy link
Member Author

Choose a reason for hiding this comment

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

thank you

@@ -125,6 +128,9 @@ object KubernetesSessionClientV2 extends KubernetesClientV2Trait with Logger {

FlinkK8sOperator.k8sCrOpr.deleteSessionJob(namespace, name).runIOAsTry match {
Copy link
Member

Choose a reason for hiding this comment

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

When the shutdown here is shutting down a flink cluster, the FlinkK8sOperator.delete() function should be called, which automatically untracks the flink cluster resources

Copy link
Member Author

Choose a reason for hiding this comment

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

thank you

@Al-assad Al-assad merged commit 373ec18 into apache:dev Oct 8, 2023
6 checks passed
@caicancai caicancai deleted the observer_untrack branch October 9, 2023 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants