Skip to content

Commit 943f15f

Browse files
authored
Merge pull request #2816 from thaJeztah/1.1_backport_shimlockwhenstdinclose
[release/1.1] fix pipe in broken may cause shim lock forever for runtime v1
2 parents 02f79c0 + 538c666 commit 943f15f

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

linux/shim/service_linux.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ func (p *linuxPlatform) CopyConsole(ctx context.Context, console console.Console
4949
cwg.Add(1)
5050
go func() {
5151
cwg.Done()
52-
p := bufPool.Get().(*[]byte)
53-
defer bufPool.Put(p)
54-
io.CopyBuffer(epollConsole, in, *p)
52+
bp := bufPool.Get().(*[]byte)
53+
defer bufPool.Put(bp)
54+
io.CopyBuffer(epollConsole, in, *bp)
55+
// we need to shutdown epollConsole when pipe broken
56+
epollConsole.Shutdown(p.epoller.CloseConsole)
5557
}()
5658
}
5759

0 commit comments

Comments
 (0)