Skip to content

Commit

Permalink
[KYUUBI #5771] [K8S] Cleanup the terminated app info trigger before c…
Browse files Browse the repository at this point in the history
…lear kubernetes clients

# 🔍 Description

When stopping KubernetesApplicationOperation, we shall cleanup the terminated app info trigger before kubernetes clients.

Because for the `removalListener` of `cleanupTerminatedAppInfoTrigger`, it need to invoke the kubernetes client to cleanup the terminated application pods.

## Issue References 🔗

This pull request fixes #

## Describe Your Solution 🔧

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

## Types of changes 🔖

- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Test Plan 🧪

#### Behavior Without This Pull Request ⚰️

#### Behavior With This Pull Request 🎉

#### Related Unit Tests

---

# Checklists
## 📝 Author Self Checklist

- [x] My code follows the [style guidelines](https://kyuubi.readthedocs.io/en/master/contributing/code/style.html) of this project
- [ ] I have performed a self-review
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

## 📝 Committer Pre-Merge Checklist

- [x] Pull request title is okay.
- [x] No license issues.
- [x] Milestone correctly set?
- [ ] Test coverage is ok
- [x] Assignees are selected.
- [x] Minimum number of approvals
- [x] No changes are requested

**Be nice. Be informative.**

Closes #5771 from turboFei/stop_k8s_op.

Closes #5771

4b11127 [fwang12] stop trigger before k8s clients

Authored-by: fwang12 <[email protected]>
Signed-off-by: fwang12 <[email protected]>
(cherry picked from commit e22a7f7)
Signed-off-by: fwang12 <[email protected]>
  • Loading branch information
turboFei committed Nov 24, 2023
1 parent 902815d commit a8d4719
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,15 @@ class KubernetesApplicationOperation extends ApplicationOperation with Logging {
}
enginePodInformers.clear()

kubernetesClients.asScala.foreach { case (_, client) =>
Utils.tryLogNonFatalError(client.close())
}
kubernetesClients.clear()

if (cleanupTerminatedAppInfoTrigger != null) {
cleanupTerminatedAppInfoTrigger.cleanUp()
cleanupTerminatedAppInfoTrigger = null
}

kubernetesClients.asScala.foreach { case (_, client) =>
Utils.tryLogNonFatalError(client.close())
}
kubernetesClients.clear()
}

private class SparkEnginePodEventHandler(kubernetesInfo: KubernetesInfo)
Expand Down

0 comments on commit a8d4719

Please sign in to comment.