mirror of
https://github.com/zap-proto/zip.git
synced 2026-10-19 15:38:57 +00:00
Graceful Shutdown already stops every child. A host that is SIGKILLed, OOM-killed, or crashes never runs its hooks — and a plugin is a separate process, so it kept running, kept holding its unix socket, and kept serving requests for a host that no longer existed. Orphaned plugins on stale sockets are the one way a subprocess plugin is genuinely more dangerous than a linked-in one, so it is worth the platform-specific code. Children are now started with Pdeathsig on Linux: the kernel signals them when their parent dies, whether or not the parent got to say so. Non-Linux builds get a documented no-op — Shutdown still covers every ordinary exit path there. Found by noticing empty /tmp/zip-* directories left behind by hosts that had been killed rather than shut down. Co-authored-by: Hanzo Dev <[email protected]>
11 lines
287 B
Go
11 lines
287 B
Go
//go:build !linux
|
|
|
|
package zip
|
|
|
|
import "os/exec"
|
|
|
|
// tieToHost is a no-op where the kernel offers no parent-death signal. A host
|
|
// that is killed outright will leave its plugin children running; Shutdown
|
|
// still stops them on every ordinary exit path.
|
|
func tieToHost(cmd *exec.Cmd) {}
|