mirror of
https://github.com/php/frankenphp.git
synced 2026-03-24 00:52:11 +01:00
fix: prevent segfault on early shutdown. (#2120)
Fixes #2114
This early
[Shutdown](11160fb7b3/frankenphp.go (L281))
introduced in #2031 segfaults instead of returning an error since
threads have not started yet.
This commit is contained in:
committed by
GitHub
parent
11160fb7b3
commit
ecad5ec0a0
@@ -79,6 +79,9 @@ func initPHPThreads(numThreads int, numMaxThreads int, phpIni map[string]string)
|
||||
}
|
||||
|
||||
func drainPHPThreads() {
|
||||
if mainThread == nil {
|
||||
return // mainThread was never initialized
|
||||
}
|
||||
doneWG := sync.WaitGroup{}
|
||||
doneWG.Add(len(phpThreads))
|
||||
mainThread.state.Set(state.ShuttingDown)
|
||||
|
||||
Reference in New Issue
Block a user