The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/4650
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === Keeping the proxy around might to lead to weird issues. For example, ceph considers an rbd image to be still in use if the proxy is still alive. Signed-off-by: Christian Brauner <[email protected]>
From cea9ee664b31e918390e0636b89fac6afb0d952f Mon Sep 17 00:00:00 2001 From: Christian Brauner <[email protected]> Date: Thu, 14 Jun 2018 10:54:39 +0200 Subject: [PATCH] proxy: unconditionally kill proxy Keeping the proxy around might to lead to weird issues. For example, ceph considers an rbd image to be still in use if the proxy is still alive. Signed-off-by: Christian Brauner <[email protected]> --- lxd/main_forkproxy.go | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/lxd/main_forkproxy.go b/lxd/main_forkproxy.go index 074bb8c72..7a71ae706 100644 --- a/lxd/main_forkproxy.go +++ b/lxd/main_forkproxy.go @@ -349,25 +349,21 @@ func (c *cmdForkproxy) Run(cmd *cobra.Command, args []string) error { } // Handle SIGTERM which is sent when the proxy is to be removed - terminate := false sigs := make(chan os.Signal, 1) signal.Notify(sigs, syscall.SIGTERM) // Wait for SIGTERM and close the listener in order to exit the loop below - killOnUDP := syscall.Getpid() - go func() { + go func(self int) { <-sigs - terminate = true + file.Close() if lAddr.connType == "udp" { srcConn.Close() - // Kill ourselves since we will otherwise block on UDP - // connect() or poll(). - syscall.Kill(killOnUDP, syscall.SIGKILL) } else { listener.Close() } - }() + syscall.Kill(self, syscall.SIGKILL) + }(syscall.Getpid()) connectAddr := args[3] cAddr := parseAddr(connectAddr) @@ -420,10 +416,6 @@ func (c *cmdForkproxy) Run(cmd *cobra.Command, args []string) error { // Accept a new client srcConn, err = listener.Accept() if err != nil { - if terminate { - break - } - fmt.Printf("error: Failed to accept new connection: %v\n", err) continue }
_______________________________________________ lxc-devel mailing list [email protected] http://lists.linuxcontainers.org/listinfo/lxc-devel
