turboFei opened a new pull request, #7498:
URL: https://github.com/apache/kyuubi/pull/7498

   ## Why
   
   `ServiceDiscovery.stopGracefully` waits for `getActiveUserSessionCount > 0` 
to reach zero before shutting down. This count includes batch sessions, which 
are just handles to jobs running on external clusters (YARN/K8s). Those jobs 
can run for hours or days — causing the server to hang indefinitely on shutdown.
   
   ## What
   
   Introduces a `closeOnServerStop` flag on the `Session` trait (default `true` 
— fully backward-compatible with all existing session types).
   
   `KyuubiBatchSession` overrides it to `false`. 
`ServiceDiscovery.stopGracefully` now waits only for sessions where 
`closeOnServerStop = true`, so batch sessions no longer block server shutdown.
   
   ## Changes
   
   - `Session` trait: add `closeOnServerStop: Boolean = true`
   - `KyuubiBatchSession`: override to `false`
   - `ServiceDiscovery.stopGracefully`: switch from `getActiveUserSessionCount` 
to `allSessions().count(_.closeOnServerStop)`
   
   ## Test plan
   
   - [ ] Server shuts down promptly when only batch sessions are active
   - [ ] Server still waits for active interactive sessions before shutting down
   - [ ] Batch jobs continue running on cluster after server restart


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

Reply via email to