Skip to content

Commit

Permalink
Fix race in stream (#1632)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonjohnsonjr authored Apr 6, 2023
1 parent 65e78dc commit 4a79e94
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/v1/stream/layer.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ func (l *Layer) Uncompressed() (io.ReadCloser, error) {

// Compressed implements v1.Layer.
func (l *Layer) Compressed() (io.ReadCloser, error) {
l.mu.Lock()
defer l.mu.Unlock()
if l.consumed {
return nil, ErrConsumed
}
Expand Down

0 comments on commit 4a79e94

Please sign in to comment.