From 487dd0810a818ef037a73515226e2be30070cc4e Mon Sep 17 00:00:00 2001 From: Fei Wang Date: Fri, 15 Dec 2023 09:31:55 -0800 Subject: [PATCH] [KYUUBI #5795][FOLLOWUP] Using correct time unit for pod cleanup executor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # :mag: Description ## Issue References ๐Ÿ”— https://github.com/apache/kyuubi/blob/a0fdead6d257be54127d84f526918e4fd52a18ce/kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala#L1234-L1241 The timeunit should be millsecond not minute here. And using ThreadUtils.scheduleTolerableRunnableWithFixedDelay to prevent unexpected issue. ## 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 :bookmark: - [ ] 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 :coffin: #### Behavior With This Pull Request :tada: #### Related Unit Tests --- # Checklists ## ๐Ÿ“ Author Self Checklist - [ ] 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 - [ ] Pull request title is okay. - [ ] No license issues. - [ ] Milestone correctly set? - [ ] Test coverage is ok - [ ] Assignees are selected. - [ ] Minimum number of approvals - [ ] No changes are requested **Be nice. Be informative.** Closes #5858 from turboFei/clean_pod. Closes #5795 910e72550 [Fei Wang] fix Authored-by: Fei Wang Signed-off-by: Fei Wang --- .../kyuubi/engine/KubernetesApplicationOperation.scala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala b/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala index c7c69cc160f..6afe3257be9 100644 --- a/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala +++ b/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala @@ -153,7 +153,8 @@ class KubernetesApplicationOperation extends ApplicationOperation with Logging { .build() expireCleanUpTriggerCacheExecutor = ThreadUtils.newDaemonSingleThreadScheduledExecutor( "pod-cleanup-trigger-thread") - expireCleanUpTriggerCacheExecutor.scheduleWithFixedDelay( + ThreadUtils.scheduleTolerableRunnableWithFixedDelay( + expireCleanUpTriggerCacheExecutor, () => { try { cleanupTerminatedAppInfoTrigger.asMap().asScala.foreach { @@ -165,9 +166,9 @@ class KubernetesApplicationOperation extends ApplicationOperation with Logging { case NonFatal(e) => error("Failed to evict clean up terminated app cache", e) } }, - 5, cleanupDriverPodCheckInterval, - TimeUnit.MINUTES) + cleanupDriverPodCheckInterval, + TimeUnit.MILLISECONDS) } override def isSupported(appMgrInfo: ApplicationManagerInfo): Boolean = {