Right now the backup fails silently if a panic happens somewhere. This should at minimum be alerted about so manual cleanup steps can be taken.
Or also run appropriate cleanup steps when applicable. It feels like a good time to refactor out the return backupCleanup logic to be a if err := recover(); err != nil { backupCleanup() } and that backupCleanup is smart enough to know when it is safe to delete the volume or not.
Right now the backup fails silently if a panic happens somewhere. This should at minimum be alerted about so manual cleanup steps can be taken.
Or also run appropriate cleanup steps when applicable. It feels like a good time to refactor out the
return backupCleanuplogic to be aif err := recover(); err != nil { backupCleanup() }and thatbackupCleanupis smart enough to know when it is safe to delete the volume or not.