mirror of
https://github.com/zrepl/zrepl.git
synced 2025-06-19 08:16:38 +02: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)
|
copierErrChan := make(chan StreamCopierError)
|
||||||
go func() {
|
go func() {
|
||||||
copierErrChan <- streamCopier.WriteStreamTo(stdinWriter)
|
copierErrChan <- streamCopier.WriteStreamTo(stdinWriter)
|
||||||
|
stdinWriter.Close()
|
||||||
}()
|
}()
|
||||||
waitErrChan := make(chan *ZFSError)
|
waitErrChan := make(chan *ZFSError)
|
||||||
go func() {
|
go func() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user