1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #21840 from tonistiigi/fix-closing-attach-streams

Fix closing attach streams on lost tcp connection
This commit is contained in:
Brian Goff 2016-04-07 12:02:33 -04:00
commit 4f8a6f3e02

View file

@ -51,6 +51,7 @@ func (bp *BytesPipe) Write(p []byte) (int, error) {
bp.mu.Lock()
written := 0
loop0:
for {
if bp.closeErr != nil {
bp.mu.Unlock()
@ -85,6 +86,9 @@ func (bp *BytesPipe) Write(p []byte) (int, error) {
// make sure the buffer doesn't grow too big from this write
for bp.bufLen >= blockThreshold {
bp.wait.Wait()
if bp.closeErr != nil {
continue loop0
}
}
// add new byte slice to the buffers slice and continue writing