diff --git a/pipe.go b/pipe.go index b0eb02e9..2aa7677c 100644 --- a/pipe.go +++ b/pipe.go @@ -1480,7 +1480,10 @@ func (p *pipe) Close() { p.background() } if block == 1 && (stopping1 || stopping2) { // make sure there is no block cmd - <-p.queue.PutOne(cmds.PingCmd) + select { + case <-p.queue.PutOne(cmds.PingCmd): + case <-time.After(time.Second): + } } } atomic.AddInt32(&p.waits, -1)