Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return success on delete storage pool failure #111

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading