Merge pull request #43731 from thaJeztah/minor_error_and_logging_improvements
minor error and logging improvements
This commit is contained in:
commit
9c4987ee6b
2 changed files with 8 additions and 5 deletions
|
@ -739,11 +739,13 @@ func (ls *layerStore) assembleTarTo(graphID string, metadata io.ReadCloser, size
|
|||
func (ls *layerStore) Cleanup() error {
|
||||
orphanLayers, err := ls.store.getOrphan()
|
||||
if err != nil {
|
||||
logrus.Errorf("Cannot get orphan layers: %v", err)
|
||||
logrus.WithError(err).Error("cannot get orphan layers")
|
||||
}
|
||||
if len(orphanLayers) > 0 {
|
||||
logrus.Debugf("found %v orphan layers", len(orphanLayers))
|
||||
}
|
||||
logrus.Debugf("found %v orphan layers", len(orphanLayers))
|
||||
for _, orphan := range orphanLayers {
|
||||
logrus.Debugf("removing orphan layer, chain ID: %v , cache ID: %v", orphan.chainID, orphan.cacheID)
|
||||
logrus.WithField("cache-id", orphan.cacheID).Debugf("removing orphan layer, chain ID: %v", orphan.chainID)
|
||||
err = ls.driver.Remove(orphan.cacheID)
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
logrus.WithError(err).WithField("cache-id", orphan.cacheID).Error("cannot remove orphan layer")
|
||||
|
|
|
@ -95,9 +95,10 @@ func NewStore(rootPath string, drivers *drivers.Store, opts ...StoreOpt) (*Volum
|
|||
}
|
||||
|
||||
var err error
|
||||
vs.db, err = bolt.Open(filepath.Join(volPath, "metadata.db"), 0600, &bolt.Options{Timeout: 1 * time.Second})
|
||||
dbPath := filepath.Join(volPath, "metadata.db")
|
||||
vs.db, err = bolt.Open(dbPath, 0600, &bolt.Options{Timeout: 1 * time.Second})
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "error while opening volume store metadata database")
|
||||
return nil, errors.Wrapf(err, "error while opening volume store metadata database (%s)", dbPath)
|
||||
}
|
||||
|
||||
// initialize volumes bucket
|
||||
|
|
Loading…
Add table
Reference in a new issue