proxy: keep the fd open to the control file

A future version of the 9P server will shutdown the forward on 9P
clunk, so if this process crashes the forward will be cleaned up
properly.

Signed-off-by: David Scott <dave.scott@docker.com>
This commit is contained in:
David Scott 2016-04-11 18:27:11 +01:00
parent e49fff3c5e
commit d5f25d2727

View File

@ -63,9 +63,8 @@ func exposePort(host net.Addr, port int) error {
log.Printf("Failed to read from /port/%s/ctl: %#v\n", name, err)
return err
}
// TODO: consider whether close/clunk of ctl would be a better tear down
// signal
ctl.Close()
// We deliberately keep the control file open since 9P clunk
// will trigger a shutdown on the host side.
response := string(results[0:count])
if strings.HasPrefix(response, "ERROR ") {