Three ways an SGLang server stops
A serving SGLang server that receives SIGTERM on its main process drains, sends ShutdownReq, and exits with code 0. The same server forced to exit skips the drain, and a SIGTERM sent to the whole process group kills the scheduler child first, so the parent takes the crash path and kills the process tree.
GRACEFUL PATH
serving
/health 200
draining
/health 503
drain every 5 s
ShutdownReq
15 s to exit
exit code 0
drained in 13 s
1
2
3
FORCED
force_exit_handler
drops running work
4
SIGNAL SENT TO THE GROUP
scheduler_0 exit -15
the child dies first
SIGQUIT
kill_process_tree
5
6
1
SIGTERM to the main process: /health returns 503 and the drain loop starts
2
remaining requests reach 0, logged every 5 s while the drain runs
3
ShutdownReq goes to the schedulers, which get 15 s to exit
4
force exit when the server is UnHealthy or SGL_FORCE_SHUTDOWN is set
5
SIGTERM to the whole process group: scheduler_0 exits first with -15
6
the parent reads a crashed child and kills the tree with no drain