Skip to content

Commit

Permalink
Merge branch 'master' into release-v0.1.3
Browse files Browse the repository at this point in the history
Signed-off-by: Blake Devcich <[email protected]>
  • Loading branch information
bdevcich committed Oct 21, 2024
2 parents 0c02f22 + afc4d0c commit 9af6bb3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
14 changes: 12 additions & 2 deletions pkg/manager-nnf/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -838,11 +838,21 @@ func (*StorageService) StorageServiceIdStoragePoolIdDelete(storageServiceId, sto
}

deleteFunc := func() error {
return p.deallocateVolumes()
err := p.deallocateVolumes()
if err != nil {
log.Error(err, "deallocateVolumes failed, but returning success anyway")
}

return nil
}

if err := s.persistentController.DeletePersistentObject(p, deleteFunc, storagePoolStorageDeleteStartLogEntryType, storagePoolStorageDeleteCompleteLogEntryType); err != nil {
return ec.NewErrInternalServerError().WithResourceType(StoragePoolOdataType).WithError(err).WithCause(fmt.Sprintf("Failed to delete storage pool"))
err := ec.NewErrInternalServerError().WithResourceType(StoragePoolOdataType).WithError(err).WithCause(fmt.Sprintf("Failed to delete storage pool"))
if err != nil {
log.Error(err, "DeletePersistentObject failed, but returning success anyway")
}

return nil
}

event.EventManager.PublishResourceEvent(msgreg.ResourceRemovedResourceEvent(), p)
Expand Down
10 changes: 9 additions & 1 deletion pkg/manager-nvme/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ func (v *Volume) WaitFormatComplete() error {
return err
}

stalledCount := 0
for ns.Utilization != 0 {
log.V(3).Info("Namespace in use", "utilization", ns.Utilization)

Expand All @@ -708,7 +709,14 @@ func (v *Volume) WaitFormatComplete() error {
}

if lastUtilization == ns.Utilization {
return fmt.Errorf("Device %s Format Stalled: Namespace: %d Delay: %s Utilization: %d", v.storage.id, v.namespaceId, delay.String(), ns.Utilization)
stalledCount++
if stalledCount == 10 {
return fmt.Errorf("Device %s Format Stalled: Namespace: %d Delay: %s Stall Count: %d Utilization: %d", v.storage.id, v.namespaceId, delay.String(), stalledCount, ns.Utilization)
}

log.V(1).Info("Format stalled", "device", v.storage.id, "Namespace", v.namespaceId, "utilization", ns.Utilization, "stall count", stalledCount)
} else {
stalledCount = 0
}
}

Expand Down

0 comments on commit 9af6bb3

Please sign in to comment.