mirror of
https://github.com/zrepl/zrepl.git
synced 2025-02-07 05:59:15 +01:00
zfs: recv: fix deadlock if streamCopier returns io.EOF
Close the write end of the pipe * before we start waiting on the error channels * and after everything from streamCopier has been written to the pipe
This commit is contained in:
parent
99ab16d7be
commit
6ebd9f1037
@ -814,6 +814,7 @@ func ZFSRecv(ctx context.Context, fs string, streamCopier StreamCopier, opts Rec
|
||||
copierErrChan := make(chan StreamCopierError)
|
||||
go func() {
|
||||
copierErrChan <- streamCopier.WriteStreamTo(stdinWriter)
|
||||
stdinWriter.Close()
|
||||
}()
|
||||
waitErrChan := make(chan *ZFSError)
|
||||
go func() {
|
||||
|
Loading…
Reference in New Issue
Block a user