[lxc-devel] [lxd/master] lxc/exec_unix: use buffered chan in sig forwarding

brauner on Github lxc-bot at linuxcontainers.org
Tue Oct 18 08:43:32 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 442 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20161018/cc8e271f/attachment.bin>
-------------- next part --------------
From e7ea5814d36de412da25f92de67802f0bc36fd2d Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at canonical.com>
Date: Tue, 18 Oct 2016 10:42:04 +0200
Subject: [PATCH] lxc/exec_unix: use buffered chan in sig forwarding

We should use a buffered channel since we might miss signals otherwise.

Signed-off-by: Christian Brauner <christian.brauner at canonical.com>
---
 lxc/exec_unix.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxc/exec_unix.go b/lxc/exec_unix.go
index c527549..d804878 100644
--- a/lxc/exec_unix.go
+++ b/lxc/exec_unix.go
@@ -19,7 +19,7 @@ func (c *execCmd) getStdout() io.WriteCloser {
 }
 
 func (c *execCmd) controlSocketHandler(d *lxd.Client, control *websocket.Conn) {
-	ch := make(chan os.Signal)
+	ch := make(chan os.Signal, 3)
 	signal.Notify(ch,
 		syscall.SIGWINCH,
 		syscall.SIGTERM,


More information about the lxc-devel mailing list