You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/03/11 03:53:17 UTC

[GitHub] [incubator-kyuubi] turboFei commented on a change in pull request #2092: [KYUUBI #1936][FOLLOWUP] Send credentials when opening session and wait for completion

turboFei commented on a change in pull request #2092:
URL: https://github.com/apache/incubator-kyuubi/pull/2092#discussion_r824366025



##########
File path: kyuubi-server/src/main/scala/org/apache/kyuubi/credentials/HadoopCredentialsManager.scala
##########
@@ -212,17 +215,18 @@ class HadoopCredentialsManager private (name: String) extends AbstractService(na
     providers.contains(serviceName)
   }
 
-  private def scheduleRenewal(
-      userRef: CredentialsRef,
-      delay: Long,
-      waitCompletion: Boolean = false): Unit = {
+  private def scheduleRenewal(userRef: CredentialsRef, delay: Long): Unit = {
     val renewalTask = new Runnable {
       override def run(): Unit = {
         try {
-          val creds = new Credentials()
-          providers.values
-            .foreach(_.obtainDelegationTokens(userRef.getAppUser, creds))
-          userRef.updateCredentials(creds)
+          val credentialsFuture: Future[Unit] = Future {
+            val creds = new Credentials()
+            providers.values
+              .foreach(_.obtainDelegationTokens(userRef.getAppUser, creds))
+            userRef.updateCredentials(creds)
+          }(ExecutionContext.fromExecutorService(renewalExecutor.get))
+          userRef.setFuture(credentialsFuture)

Review comment:
       shall we wait the future completion here?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org