turboFei opened a new pull request, #7592:
URL: https://github.com/apache/kyuubi/pull/7592
### Why are the changes needed?
Closes #7590.
After `SparkContext` stops, engine shutdown can stall before `stopServer`
releases the
main-thread latch. In that state, `SparkSQLEngine` waits indefinitely and
leaves a
zombie engine process.
This patch checks the `SparkContext` state while waiting for normal engine
shutdown.
It also rechecks the latch before reporting failure so that a concurrent
normal
shutdown wins the race.
### How was this patch tested?
Added tests for both the stopped-`SparkContext` path and the concurrent
normal-shutdown
path.
```shell
mvn test -pl :kyuubi-spark-sql-engine_2.12 -am \
-Dtest=none \
-DwildcardSuites=org.apache.kyuubi.engine.spark.SparkSQLEngineSuite
```
Result: 3 tests passed.
Also ran the repository Spotless formatter.
### Was this patch authored or co-authored using generative AI tooling?
Assisted-by: OpenAI Codex with GPT-5
--
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]