diff --git a/pipe.go b/pipe.go index 8e8840b4..4091f4e6 100644 --- a/pipe.go +++ b/pipe.go @@ -1481,7 +1481,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)