Skip to content

Commit

Permalink
[KYUUBI #5264] [FLINK] Force disable Flink's session timeout
Browse files Browse the repository at this point in the history
### _Why are the changes needed?_
Flink sessions are now managed by Kyuubi, hence disable session timeout from Flink itself.

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

- [x] [Run test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests) locally before make a pull request

### _Was this patch authored or co-authored using generative AI tooling?_
No.

Closes #5264 from link3280/disable_flink_session_timeout.

Closes #5264

fff5c54 [Paul Lin] Force disable Flink's session timeout

Authored-by: Paul Lin <[email protected]>
Signed-off-by: Paul Lin <[email protected]>
  • Loading branch information
link3280 committed Sep 9, 2023
1 parent 1f0901b commit 9302110
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ package org.apache.kyuubi.engine.flink

import java.io.File
import java.nio.file.Paths
import java.time.Duration
import java.util.concurrent.CountDownLatch

import scala.collection.JavaConverters._

import org.apache.flink.configuration.{Configuration, DeploymentOptions, GlobalConfiguration, PipelineOptions}
import org.apache.flink.table.api.TableEnvironment
import org.apache.flink.table.gateway.api.config.SqlGatewayServiceConfigOptions
import org.apache.flink.table.gateway.service.context.DefaultContext

import org.apache.kyuubi.{Logging, Utils}
Expand Down Expand Up @@ -146,6 +148,11 @@ object FlinkSQLEngine extends Logging {
kyuubiConf.getOption(KYUUBI_SESSION_USER_KEY)
.foreach(flinkConf.setString(KYUUBI_SESSION_USER_KEY, _))

// force disable Flink's session timeout
flinkConf.set(
SqlGatewayServiceConfigOptions.SQL_GATEWAY_SESSION_IDLE_TIMEOUT,
Duration.ofMillis(0))

executionTarget match {
case "yarn-per-job" | "yarn-application" =>
if (flinkConf.containsKey("high-availability.cluster-id")) {
Expand Down

0 comments on commit 9302110

Please sign in to comment.