[Bug] Engine does not exit when graceful stop waits on sessions of a stopped session manager

Aperta
#7,776 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@afterincomparableyum ci sta già lavorando.

Dal 12/10/2026.

  • #7777 di @afterincomparableyum — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
scala, spark

Direzione di ricerca

Start with ServiceDiscovery.stopGracefully and trace how SessionManager.stop() affects the active session count and idle-session timeout checker. Reproduce the shutdown path with a stopped engine backend and sessions left by disconnected clients; done means graceful stop can finish and the JVM can exit when those sessions cannot be closed. Pull request #7777 is already open for this issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

kind:bug priority:major
Code of Conduct
Search before asking
  • I have searched in the issues and found no similar issues.
Describe the bug

ServiceDiscovery.stopGracefully loops while sessionManager.getActiveUserSessionCount > 0. If the engine backend has already stopped (e.g. SparkSQLEngine stopped after its SparkContext ended), SessionManager.stop() has shut down the idle-session timeout checker. Sessions left by disconnected clients (common with kyuubi.session.close.on.disconnect=false) are then never closed, the count never drops, and the loop never ends.

With etcd, stopGracefully runs on the non-daemon deregister-watcher-thread, so the JVM cannot exit after main returns. On Kubernetes the driver pod stays Running with no SparkContext and no executors until it is deleted by hand.

Observed: an engine lost its etcd lease during a long GC pause. Its SparkContext and backend later stopped, and the driver then logged N connection(s) are active, delay shutdown every 10 seconds for hours. KYUUBI #6790 made the loop re-read the count each iteration, but that does not help when nothing can close the sessions.

Affects Version(s)

1.12.0

Kyuubi Server Log Output

Kyuubi Engine Log Output
Kyuubi Engine Log Output
  INFO KyuubiServiceDiscovery: 15 connection(s) are active, delay shutdown
  INFO KyuubiServiceDiscovery: 15 connection(s) are active, delay shutdown
  ... (repeats every 10s indefinitely)
Kyuubi Server Configurations

Kyuubi Engine Configurations
Kyuubi Engine Configurations
  kyuubi.ha.client.class=org.apache.kyuubi.ha.client.etcd.EtcdDiscoveryClient
  kyuubi.session.close.on.disconnect=false
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.
Lingua principale
Scala
Stelle
2.4k
Fork
1k
Merge medio
18h 17m
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/kyuubi

Tutte le issue di apache/kyuubi

Issue simili

Altre issue su Scala

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.