Revert "Wait for client side copy goroutines to start"

This reverts commit 06dc87ae59.

Revert "Change oom metric to const"

This reverts commit e800f08f9f.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-08-18 16:09:18 -04:00
parent e3696cfb4e
commit 4950c26757
5 changed files with 11 additions and 47 deletions

View File

@@ -36,7 +36,6 @@ func copyIO(fifos *FIFOSet, ioset *ioSet, tty bool) (_ *wgCloser, err error) {
var (
f io.ReadWriteCloser
set []io.Closer
cwg sync.WaitGroup
ctx, cancel = context.WithCancel(context.Background())
wg = &sync.WaitGroup{}
)
@@ -53,9 +52,7 @@ func copyIO(fifos *FIFOSet, ioset *ioSet, tty bool) (_ *wgCloser, err error) {
return nil, err
}
set = append(set, f)
cwg.Add(1)
go func(w io.WriteCloser) {
cwg.Done()
io.Copy(w, ioset.in)
w.Close()
}(f)
@@ -65,9 +62,7 @@ func copyIO(fifos *FIFOSet, ioset *ioSet, tty bool) (_ *wgCloser, err error) {
}
set = append(set, f)
wg.Add(1)
cwg.Add(1)
go func(r io.ReadCloser) {
cwg.Done()
io.Copy(ioset.out, r)
r.Close()
wg.Done()
@@ -80,15 +75,12 @@ func copyIO(fifos *FIFOSet, ioset *ioSet, tty bool) (_ *wgCloser, err error) {
if !tty {
wg.Add(1)
cwg.Add(1)
go func(r io.ReadCloser) {
cwg.Done()
io.Copy(ioset.err, r)
r.Close()
wg.Done()
}(f)
}
cwg.Wait()
return &wgCloser{
wg: wg,
dir: fifos.Dir,