You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/02/18 08:35:32 UTC

[GitHub] [incubator-kyuubi] turboFei opened a new issue #1936: [Bug] Engine token expired issue after idle for long time

turboFei opened a new issue #1936:
URL: https://github.com/apache/incubator-kyuubi/issues/1936


   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   
   
   ### Search before asking
   
   - [X] I have searched in the [issues](https://github.com/apache/incubator-kyuubi/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Describe the bug
   
   We enable the `HadoopCredentialsManager` to refresh delegation token.
   
   But meet token expired issue when the backend engine is idle for long time.
   
   I think that we can refresh the token for per connection to prevent this issue.
   ```
   22/02/18 00:58:44 INFO ExecuteStatement: 
              Spark application name: kyuubi_apollorno_USER_SPARK_SQL_b_stf_default_06dc1722-f0ff-4535-bea1-d2abe5d3ebf2
                    application ID: application_1635906065713_7300973
                    application web UI: https://apollo-rno-rm-1.vip.hadoop.ebay.com:50030/proxy/application_1635906065713_7300973,https://apollo-rno-rm-2.vip.hadoop.ebay.com:50030/proxy/application_1635906065713_7300973
                    master: yarn
                    deploy mode: cluster
                    version: 3.1.1.0.6.0
              Start time: 2022-02-15T05:07:49.417
              User: b_stf
   22/02/18 00:58:45 WARN Client: Exception encountered while connecting to the server : org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.token.SecretManager$InvalidToken): token (HDFS_DELEGATION_TOKEN token 22821449 for b_stf) can't be found in cache
   22/02/18 00:58:45 INFO DAGScheduler: Asked to cancel job group 292fd765-4f99-44f8-afb3-a35fcc96e1a6
   22/02/18 00:58:45 INFO ExecuteStatement: Processing b_stf's query[292fd765-4f99-44f8-afb3-a35fcc96e1a6]: RUNNING_STATE -> ERROR_STATE, statement: select count(*) from ddm_notiplat_t.nss_event_queue where src_cre_dt>='2022-02-16 00:00:00', time taken: 1.108 seconds
   22/02/18 00:58:45 ERROR ExecuteStatement: Error operating EXECUTE_STATEMENT: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.token.SecretManager$InvalidToken): token (HDFS_DELEGATION_TOKEN token 22821449 for b_stf) can't be found in cache
   	at org.apache.hadoop.ipc.Client.getRpcResponse(Client.java:1586)
   	at org.apache.hadoop.ipc.Client.call(Client.java:1530)
   	at org.apache.hadoop.ipc.Client.call(Client.java:1430)
   	at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:255)
   	at com.sun.proxy.$Proxy16.getFileInfo(Unknown Source)
   	at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getFileInfo(ClientNamenodeProtocolTranslatorPB.java:881)
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.lang.reflect.Method.invoke(Method.java:498)
   ```
   
   ### Affects Version(s)
   
   1.4.0-incubating
   
   ### Kyuubi Server Log Output
   
   _No response_
   
   ### Kyuubi Engine Log Output
   
   _No response_
   
   ### Kyuubi Server Configurations
   
   _No response_
   
   ### Kyuubi Engine Configurations
   
   _No response_
   
   ### Additional context
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!


-- 
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: dev-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] zhouyifan279 edited a comment on issue #1936: [Bug] Engine token expired issue after idle for long time

Posted by GitBox <gi...@apache.org>.
zhouyifan279 edited a comment on issue #1936:
URL: https://github.com/apache/incubator-kyuubi/issues/1936#issuecomment-1044473643


   We can send credentials  in `LaunchEngine` operation when it succeeds.
   
   By the way, another case should also be taken into consideration if kyuubi engine will be idle longer than credentials's renewal interval:  
   1. User created a KyuubiSession on kyuubi-server-1 to a credentials-expired engine.
   2. Due to some reason (server restarted or server never talked to this engine),  kyuubi-server-1 has no cached credentials for this engine.
   3. Invoking `HadoopCredentialsManager#sendCredentialsIfNeeded` triggers a task to renew credentials and returns. New credentials will not be sent to engine until  renewal task succeeds.
   4. Following SQL operation still fails due to expired credentials.
   


-- 
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: dev-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] zhouyifan279 edited a comment on issue #1936: [Bug] Engine token expired issue after idle for long time

Posted by GitBox <gi...@apache.org>.
zhouyifan279 edited a comment on issue #1936:
URL: https://github.com/apache/incubator-kyuubi/issues/1936#issuecomment-1044473643


   We can send credentials  in `LaunchEngine` operation when it succeeds.
   
   By the way, another case should also be taken into consideration if kyuubi engine will be idle longer than credentials's renewal interval:  
   1. User created a KyuubiSession on kyuubi-server-1 to a credentials-expired engine.
   2. Due to some reason (server restarted or server never talked to this engine),  kyuubi-server-1 has no cached credentials for this engine.
   3. Invoking `HadoopCredentialsManager#sendCredentialsIfNeeded` triggered a task to renew credentials but engine did not receive new credentials.
   4. Following SQL operation still fails due to expired credentials.
   


-- 
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: dev-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] zhouyifan279 edited a comment on issue #1936: [Bug] Engine token expired issue after idle for long time

Posted by GitBox <gi...@apache.org>.
zhouyifan279 edited a comment on issue #1936:
URL: https://github.com/apache/incubator-kyuubi/issues/1936#issuecomment-1044473643


   We can send credentials  in `LaunchEngine` operation when it succeeds.
   
   By the way, another case should also be taken into consideration if kyuubi engine will be idle longer than credentials's renewal interval:  
   1. User created a KyuubiSession on kyuubi-server-1 to a credentials-expired engine.
   2. Due to some reason (server restarted or server never talked to this engine),  kyuubi-server-1 has no cached credentials for this engine.
   3. Invoking `HadoopCredentialsManager#sendCredentialsIfNeeded` triggers a task to renew credentials but can not send new credentials to engine until credentials are obtained.
   4. Following SQL operation still fails due to expired credentials.
   


-- 
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: dev-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] turboFei commented on issue #1936: [Bug] Engine token expired issue after idle for long time

Posted by GitBox <gi...@apache.org>.
turboFei commented on issue #1936:
URL: https://github.com/apache/incubator-kyuubi/issues/1936#issuecomment-1044544075


   > Invoking HadoopCredentialsManager#sendCredentialsIfNeeded triggers a task to renew credentials and returns. New credentials will not be sent to engine until renewal task succeeds.
   > Following SQL operation still fails due to expired credentials.
   
   Seems that we need wait the renewal task completion before executing query.


-- 
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: dev-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] ulysses-you commented on issue #1936: [Bug] Engine token expired issue after idle for long time

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on issue #1936:
URL: https://github.com/apache/incubator-kyuubi/issues/1936#issuecomment-1044162064


   FYI @zhouyifan279 


-- 
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: dev-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] turboFei edited a comment on issue #1936: [Bug] Engine token expired issue after idle for long time

Posted by GitBox <gi...@apache.org>.
turboFei edited a comment on issue #1936:
URL: https://github.com/apache/incubator-kyuubi/issues/1936#issuecomment-1044142872


   FYI:
   here is the ticket for `Implement delegation token renewal framework`
   https://github.com/apache/incubator-kyuubi/issues/1007


-- 
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: dev-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] ulysses-you closed issue #1936: [Bug] Engine token expired issue after idle for long time

Posted by GitBox <gi...@apache.org>.
ulysses-you closed issue #1936:
URL: https://github.com/apache/incubator-kyuubi/issues/1936


   


-- 
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


[GitHub] [incubator-kyuubi] turboFei commented on issue #1936: [Bug] Engine token expired issue after idle for long time

Posted by GitBox <gi...@apache.org>.
turboFei commented on issue #1936:
URL: https://github.com/apache/incubator-kyuubi/issues/1936#issuecomment-1044142872


   FYI:
   here is the ticket for `Implement delegation token renewal framework`


-- 
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: dev-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] zhouyifan279 edited a comment on issue #1936: [Bug] Engine token expired issue after idle for long time

Posted by GitBox <gi...@apache.org>.
zhouyifan279 edited a comment on issue #1936:
URL: https://github.com/apache/incubator-kyuubi/issues/1936#issuecomment-1044473643


   We can send credentials  in `LaunchEngine` operation when it succeeds.
   
   By the way, another case should also be taken into consideration:
   1. kyuubi engine being idle and credentials have been expired.
   2. User created a KyuubiSession to this engine on kyuubi-server-1.
   3. Due to some reason (server restarted or server never talked to this engine),  kyuubi-server-1 has no cached credentials for this engine.
   4. Invoking `HadoopCredentialsManager#sendCredentialsIfNeeded` triggered a task to renew credentials but engine did not receive new credentials.
   5. Following SQL operation still fails due to expired credentials.
   


-- 
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: dev-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] zhouyifan279 edited a comment on issue #1936: [Bug] Engine token expired issue after idle for long time

Posted by GitBox <gi...@apache.org>.
zhouyifan279 edited a comment on issue #1936:
URL: https://github.com/apache/incubator-kyuubi/issues/1936#issuecomment-1044473643


   We can send credentials  in `LaunchEngine` operation when it succeeds.
   
   By the way, another case should also be taken into consideration if kyuubi engine will be idle longer than credentials's renewal interval:  
   1. User created a KyuubiSession on kyuubi-server-1 to a credentials-expired engine.
   2. Due to some reason (server restarted or server never talked to this engine),  kyuubi-server-1 has no cached credentials for this engine.
   3. Invoking `HadoopCredentialsManager#sendCredentialsIfNeeded` triggers a task to renew credentials but does not send new credentials to engine until credentials are obtained.
   4. Following SQL operation still fails due to expired credentials.
   


-- 
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: dev-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] zhouyifan279 edited a comment on issue #1936: [Bug] Engine token expired issue after idle for long time

Posted by GitBox <gi...@apache.org>.
zhouyifan279 edited a comment on issue #1936:
URL: https://github.com/apache/incubator-kyuubi/issues/1936#issuecomment-1044473643


   We can send credentials  in `LaunchEngine` operation when it succeeds.
   
   By the way, another case should also be taken into consideration if kyuubi engine will be idle longer than credentials's renewal interval:  
   1. User created a KyuubiSession on kyuubi-server-1 to a credentials-expired engine.
   2. Due to some reason (server restarted or server never talked to this engine),  kyuubi-server-1 has no cached credentials for this engine.
   3. Invoking `HadoopCredentialsManager#sendCredentialsIfNeeded` triggers a task to renew credentials but will not send new credentials to engine until credentials are obtained.
   4. Following SQL operation still fails due to expired credentials.
   


-- 
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: dev-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] zhouyifan279 commented on issue #1936: [Bug] Engine token expired issue after idle for long time

Posted by GitBox <gi...@apache.org>.
zhouyifan279 commented on issue #1936:
URL: https://github.com/apache/incubator-kyuubi/issues/1936#issuecomment-1044473643


   We can send credentials  in `LaunchEngine` operation when it succeeds.
   
   Another case should be taken into consideration:
   1. kyuubi engine being idle and credentials have been expired.
   2. User created a KyuubiSession to this engine on kyuubi-server-1.
   3. Due to some reason (server restarted or server never talked to this engine),  kyuubi-server-1 has no cached credentials for this engine.
   4. Invoking `HadoopCredentialsManager#sendCredentialsIfNeeded` triggered a task to renew credentials but engine did not receive new credentials.
   5. Following SQL operation still fails due to expired credentials.
   


-- 
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: dev-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] turboFei commented on issue #1936: [Bug] Engine token expired issue after idle for long time

Posted by GitBox <gi...@apache.org>.
turboFei commented on issue #1936:
URL: https://github.com/apache/incubator-kyuubi/issues/1936#issuecomment-1044141693


   @lightning-L could you help on this issue?


-- 
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: dev-unsubscribe@kyuubi.apache.org

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