mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-27 20:48:11 +00:00
proxy: calling Close() on the Accept()ing fd won't cause it to return
This seems to be a difference between the AF_VSOCK and AF_INET implementations. We work around it by exiting the proxy process immediately, which will clean up resources anyway. Signed-off-by: David Scott <dave.scott@docker.com>
This commit is contained in:
parent
586d9c0598
commit
a48307b5e7
@ -67,6 +67,8 @@ func handleStopSignals(p libproxy.Proxy) {
|
|||||||
signal.Notify(s, os.Interrupt, syscall.SIGTERM, syscall.SIGSTOP)
|
signal.Notify(s, os.Interrupt, syscall.SIGTERM, syscall.SIGSTOP)
|
||||||
|
|
||||||
for range s {
|
for range s {
|
||||||
p.Close()
|
os.Exit(0)
|
||||||
|
// The vsock proxy cannot be shutdown the same way as the TCP one:
|
||||||
|
//p.Close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
1
alpine/packages/proxy/vendor/vsock/vsock.go
vendored
1
alpine/packages/proxy/vendor/vsock/vsock.go
vendored
@ -81,6 +81,7 @@ func (v *vsockListener) Accept() (net.Conn, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (v *vsockListener) Close() error {
|
func (v *vsockListener) Close() error {
|
||||||
|
// Note this won't cause the Accept to unblock.
|
||||||
return syscall.Close(v.accept_fd)
|
return syscall.Close(v.accept_fd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user