anandnalya opened a new issue, #7304: URL: https://github.com/apache/kyuubi/issues/7304
### 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/kyuubi/issues?q=is%3Aissue) and found no similar issues. ### Describe the bug SparkSessionImpl fails to parse ISO 8601 duration format (e.g., `PT40M`) for `kyuubi.session.idle.timeout` passed via JDBC URL, throwing `NumberFormatException`. ### Regression introduced in Commit 9a50bfa81 ([KYUUBI #7158]) ### To Reproduce Pass `kyuubi.session.idle.timeout=PT40M` in JDBC connection string. ### Error ``` java.lang.NumberFormatException: For input string: "PT40M" at org.apache.kyuubi.engine.spark.session.SparkSessionImpl.<init>(SparkSessionImpl.scala:63) ``` ### Root Cause `SparkSessionImpl.scala:63` uses `.toLong` directly instead of `Duration.parse()`: ```scala conf.get(SESSION_IDLE_TIMEOUT.key) .map(_.toLong) // BUG: should use Duration.parse() ``` ### Expected behavior Should parse ISO 8601 duration format like `ConfigBuilder.timeFromStr` does. ### Affects Version(s) 1.11.0 ### Kyuubi Server Log Output ```logtalk ``` ### Kyuubi Engine Log Output ```logtalk 2026-01-15 02:03:20,325 [WARN ] org.apache.kyuubi.jdbc.hive.KyuubiConnection: Could not open client transport with JDBC Uri: jdbc:hive2://kyuubi-hiyu.a8c.com:10009/default;retries=3;trustStorePassword=;?spark.sql.parquet.compression.codec=gzip;spark.yarn.queue=root.kyuubi;spark.sql.autobroadcastjointhreshold=-1;kyuubi.engine.share.level.subdomain=pythia;kyuubi.session.engine.idle.timeout=PT30M;kyuubi.session.idle.timeout=PT40M: org.apache.kyuubi.KyuubiSQLException: java.lang.NumberFormatException: For input string: "PT40M" at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67) at java.base/java.lang.Long.parseLong(Long.java:711) at java.base/java.lang.Long.parseLong(Long.java:836) at scala.collection.StringOps$.toLong$extension(StringOps.scala:928) at org.apache.kyuubi.engine.spark.session.SparkSessionImpl.$anonfun$sessionIdleTimeoutThreshold$1(SparkSessionImpl.scala:63) at org.apache.kyuubi.engine.spark.session.SparkSessionImpl.$anonfun$sessionIdleTimeoutThreshold$1$adapted(SparkSessionImpl.scala:63) at scala.Option.map(Option.scala:242) at org.apache.kyuubi.engine.spark.session.SparkSessionImpl.<init>(SparkSessionImpl.scala:63) at org.apache.kyuubi.engine.spark.session.SparkSQLSessionManager.$anonfun$createSession$3(SparkSQLSessionManager.scala:170) at scala.Option.getOrElse(Option.scala:201) at org.apache.kyuubi.engine.spark.session.SparkSQLSessionManager.createSession(SparkSQLSessionManager.scala:155) at org.apache.kyuubi.session.SessionManager.openSession(SessionManager.scala:105) at org.apache.kyuubi.service.AbstractBackendService.openSession(AbstractBackendService.scala:45) at org.apache.kyuubi.service.TFrontendService.getSessionHandle(TFrontendService.scala:182) at org.apache.kyuubi.engine.spark.SparkTBinaryFrontendService.OpenSession(SparkTBinaryFrontendService.scala:78) at org.apache.kyuubi.shaded.hive.service.rpc.thrift.TCLIService$Processor$OpenSession.getResult(TCLIService.java:1595) at org.apache.kyuubi.shaded.hive.service.rpc.thrift.TCLIService$Processor$OpenSession.getResult(TCLIService.java:1575) at org.apache.kyuubi.shaded.thrift.ProcessFunction.process(ProcessFunction.java:38) at org.apache.kyuubi.shaded.thrift.TBaseProcessor.process(TBaseProcessor.java:38) at org.apache.kyuubi.service.authentication.TSetIpAddressProcessor.process(TSetIpAddressProcessor.scala:35) at org.apache.kyuubi.shaded.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:250) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:840) at org.apache.kyuubi.KyuubiSQLException$.apply(KyuubiSQLException.scala:69) at org.apache.kyuubi.KyuubiSQLException$.apply(KyuubiSQLException.scala:81) at org.apache.kyuubi.util.ThriftUtils$.verifyTStatus(ThriftUtils.scala:27) at org.apache.kyuubi.client.KyuubiSyncThriftClient.openSession(KyuubiSyncThriftClient.scala:198) at org.apache.kyuubi.session.KyuubiSessionImpl.$anonfun$openEngineSession$2(KyuubiSessionImpl.scala:181) at org.apache.kyuubi.session.KyuubiSessionImpl.$anonfun$openEngineSession$2$adapted(KyuubiSessionImpl.scala:134) at org.apache.kyuubi.ha.client.DiscoveryClientProvider$.withDiscoveryClient(DiscoveryClientProvider.scala:36) at org.apache.kyuubi.session.KyuubiSessionImpl.$anonfun$openEngineSession$1(KyuubiSessionImpl.scala:134) at org.apache.kyuubi.session.KyuubiSession.handleSessionException(KyuubiSession.scala:49) at org.apache.kyuubi.session.KyuubiSessionImpl.openEngineSession(KyuubiSessionImpl.scala:134) at org.apache.kyuubi.operation.LaunchEngine.$anonfun$runInternal$1(LaunchEngine.scala:60) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: java.lang.RuntimeException: java.lang.NumberFormatException:For input string: "PT40M" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:67) at java.lang.Long.parseLong(Long.java:711) at java.lang.Long.parseLong(Long.java:836) at scala.collection.StringOps$.toLong$extension(StringOps.scala:928) at org.apache.kyuubi.engine.spark.session.SparkSessionImpl.$anonfun$sessionIdleTimeoutThreshold$1(SparkSessionImpl.scala:63) at org.apache.kyuubi.engine.spark.session.SparkSessionImpl.$anonfun$sessionIdleTimeoutThreshold$1$adapted(SparkSessionImpl.scala:63) at scala.Option.map(Option.scala:242) at org.apache.kyuubi.engine.spark.session.SparkSessionImpl.<init>(SparkSessionImpl.scala:63) at org.apache.kyuubi.engine.spark.session.SparkSQLSessionManager.$anonfun$createSession$3(SparkSQLSessionManager.scala:170) at scala.Option.getOrElse(Option.scala:201) at org.apache.kyuubi.engine.spark.session.SparkSQLSessionManager.createSession(SparkSQLSessionManager.scala:155) at org.apache.kyuubi.session.SessionManager.openSession(SessionManager.scala:105) at org.apache.kyuubi.service.AbstractBackendService.openSession(AbstractBackendService.scala:45) at org.apache.kyuubi.service.TFrontendService.getSessionHandle(TFrontendService.scala:182) at org.apache.kyuubi.engine.spark.SparkTBinaryFrontendService.OpenSession(SparkTBinaryFrontendService.scala:78) at org.apache.kyuubi.shaded.hive.service.rpc.thrift.TCLIService$Processor$OpenSession.getResult(TCLIService.java:1595) at org.apache.kyuubi.shaded.hive.service.rpc.thrift.TCLIService$Processor$OpenSession.getResult(TCLIService.java:1575) at org.apache.kyuubi.shaded.thrift.ProcessFunction.process(ProcessFunction.java:38) at org.apache.kyuubi.shaded.thrift.TBaseProcessor.process(TBaseProcessor.java:38) at org.apache.kyuubi.service.authentication.TSetIpAddressProcessor.process(TSetIpAddressProcessor.scala:35) at org.apache.kyuubi.shaded.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:250) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.lang.Thread.run(Thread.java:840) ``` ### Kyuubi Server Configurations ```yaml ``` ### Kyuubi Engine Configurations ```yaml ``` ### Additional context _No response_ ### Are you willing to submit PR? - [x] Yes. I would be willing to submit a PR with guidance from the Kyuubi community to fix. - [ ] No. I cannot submit a PR at this time. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
