Skip to content

Commit 4a79e94

Browse files
authored
Fix race in stream (#1632)
1 parent 65e78dc commit 4a79e94

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/v1/stream/layer.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ func (l *Layer) Uncompressed() (io.ReadCloser, error) {
130130

131131
// Compressed implements v1.Layer.
132132
func (l *Layer) Compressed() (io.ReadCloser, error) {
133+
l.mu.Lock()
134+
defer l.mu.Unlock()
133135
if l.consumed {
134136
return nil, ErrConsumed
135137
}

0 commit comments

Comments
 (0)