[lxc-devel] [lxd/master] Revert "lxd/instance/drivers/driver/qemu: Fix go routine leak and hanging lxc clients

tomponline on Github lxc-bot at linuxcontainers.org
Tue Feb 11 17:40:05 UTC 2020

A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 750 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200211/2a89ef1a/attachment.bin>
-------------- next part --------------
From d6054a856259657fec682d9f8e4dfbc87f1df4aa Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parrott at canonical.com>
Date: Tue, 11 Feb 2020 17:38:02 +0000
Subject: [PATCH] Revert "lxd/instance/drivers/driver/qemu: Fix go routine leak
 and hanging lxc clients"

This reverts commit 78b4b396c8413e4b6e6c32317611d0fead72d09b.

This is because although it fixes the hanging lxc clients and leaking go routines, it also introduces a regression when using `lxc exec` without a single command that is expected to output data directly to the console.

With the escape sequence being sent, this was intermittently wiping out the output of the command.

Signed-off-by: Thomas Parrott <thomas.parrott at canonical.com>
 lxd/instance/drivers/driver_qemu.go | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/lxd/instance/drivers/driver_qemu.go b/lxd/instance/drivers/driver_qemu.go
index 83a7522315..efb2276fbb 100644
--- a/lxd/instance/drivers/driver_qemu.go
+++ b/lxd/instance/drivers/driver_qemu.go
@@ -2904,14 +2904,7 @@ func (vm *qemu) Exec(req api.InstanceExecPost, stdin *os.File, stdout *os.File,
 			return nil, err
-		revert.Add(func() {
-			termios.Restore(int(stdin.Fd()), oldttystate)
-			// Write a reset escape sequence to the console to cancel any ongoing reads to the handle
-			// and then close it.
-			stdout.Write([]byte("\x1bc"))
-			stdout.Close()
-		})
+		revert.Add(func() { termios.Restore(int(stdin.Fd()), oldttystate) })
 	dataDone := make(chan bool)

More information about the lxc-devel mailing list