Skip to content

Commit 538c666

Browse files
lifubangthaJeztah
authored andcommitted
fix pipe in broken may cause shim lock forever for runtime v1
Signed-off-by: Lifubang <[email protected]> (cherry picked from commit e76a887) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 02f79c0 commit 538c666

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)