apache / apache/kyuubi

There are too many Spark sessions and the session timeout parameter is not effective

Open
#6,855 6 comments 0 reactions 0 assignees View on GitHub
kind:question
Dominant language
Scala
Stars
2.4k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

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

When using kyuubi to start a spark SQL ON K8S cluster, the number of internal sessions increases. The parameter `kyuubi.engine.user.isolated.spark.session.idle.timeout=PT30M` is found in the documentation. The default value is 6H. After changing it to 30M, there are still sessions that exceed 30M and are not closed, and the SQL of the session has been executed. I would like to ask whether the creation of this session is based on a SQL or how it is created. I found that there are not so many SQLs in my cluster, but there are many sessions. I don't know how they are created.

![image](https://github.com/user-attachments/assets/978c1aa4-0d32-4e97-82e1-9ed48e4addb0)

![image](https://github.com/user-attachments/assets/646a9925-47e8-4f78-acb7-ec9d06008922)

![image](https://github.com/user-attachments/assets/146acb02-5cd1-4bff-bca5-b3349b178349)

### Affects Version(s)

1.9.1

### 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 would be willing to submit a PR with guidance from the Kyuubi community to fix.
- [ ] No. I cannot submit a PR at this time.

Contributor guide

Open the contributing guide

Research direction

Start by locating the documentation and configuration handling for kyuubi.engine.user.isolated.spark.session.idle.timeout, then trace how Spark SQL sessions are created and timed out on Kubernetes. The report provides no server or engine logs, configurations, files, or tests, so done should include identifying why sessions exceed 30 minutes and adding a verified fix or clear lifecycle documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
kubernetes, scala, spark
Domain
backend, distributed-systems, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.