Skip to content

Commit

Permalink
Merge pull request moby#49298 from thaJeztah/layerstore_logs
Browse files Browse the repository at this point in the history
layerStore.registerWithDescriptor: improve logs for cleaning up cache
  • Loading branch information
vvoland authored Jan 22, 2025
2 parents df0cb85 + 61aa165 commit de7800b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions layer/layer_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,12 @@ func (ls *layerStore) registerWithDescriptor(ts io.Reader, parent ChainID, descr

defer func() {
if cErr != nil {
log.G(context.TODO()).Debugf("Cleaning up layer %s: %v", layer.cacheID, cErr)
log.G(context.TODO()).WithFields(log.Fields{"cache-id": layer.cacheID, "error": cErr}).Debug("Cleaning up cache layer after error")
if err := ls.driver.Remove(layer.cacheID); err != nil {
log.G(context.TODO()).Errorf("Error cleaning up cache layer %s: %v", layer.cacheID, err)
log.G(context.TODO()).WithFields(log.Fields{"cache-id": layer.cacheID, "error": err}).Error("Error cleaning up cache layer after error")
}
if err := tx.Cancel(); err != nil {
log.G(context.TODO()).Errorf("Error canceling metadata transaction %q: %s", tx.String(), err)
log.G(context.TODO()).WithFields(log.Fields{"cache-id": layer.cacheID, "error": err, "tx": tx.String()}).Error("Error canceling metadata transaction")
}
}
}()
Expand Down

0 comments on commit de7800b

Please sign in to comment.