From 2675e9a80daaf5c965f57d956fb41541f4756828 Mon Sep 17 00:00:00 2001 From: fwang12 Date: Mon, 25 Oct 2021 22:37:34 +0800 Subject: [PATCH] [KYUUBI #1290] Reset kinit attempt number once the command execute successfully to prevent transient error accumulation ### _Why are the changes needed?_ Reset attempt number after kinit successfully to prevent transient error accumulation and fail the server. ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #1290 from turboFei/kinit_recover. Closes #1290 c40c2fa6 [fwang12] Reset kinitMaxAttempts to 0 once the kinit command execute successfully to prevent transient error Authored-by: fwang12 Signed-off-by: Cheng Pan --- .../scala/org/apache/kyuubi/server/KinitAuxiliaryService.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/KinitAuxiliaryService.scala b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/KinitAuxiliaryService.scala index dd6f8e119..e8d149b32 100644 --- a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/KinitAuxiliaryService.scala +++ b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/KinitAuxiliaryService.scala @@ -52,6 +52,7 @@ class KinitAuxiliaryService() extends AbstractService("KinitAuxiliaryService") { val process = kinitProc.start() if (process.waitFor() == 0) { info(s"Successfully ${commands.mkString(" ")}") + kinitAttempts = 0 executor.schedule(this, kinitInterval, TimeUnit.MILLISECONDS) } else { if (kinitAttempts >= kinitMaxAttempts) {