Skip to content

Commit

Permalink
Destroy the temporary export layer before removing it
Browse files Browse the repository at this point in the history
Fix: microsoft#696

Signed-off-by: Pierre Tardy <[email protected]>
  • Loading branch information
tardyp authored and TBBle committed Feb 11, 2021
1 parent 811c3fc commit 70082f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/wclayer/exportlayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ func (r *legacyLayerReaderWrapper) Close() (err error) {
defer func() { oc.SetSpanStatus(r.s, err) }()

err = r.legacyLayerReader.Close()
// if the layer is not Destroyed at hcs level before removing
// we might enter in a race-condition for large containers
// which end-up in a hang of the os.RemoveAll() call
DestroyLayer(r.ctx, r.root)
os.RemoveAll(r.root)
return err
}

0 comments on commit 70082f6

Please sign in to comment.