Skip to content

Commit

Permalink
fix: throw error if volume is down state and with pending status, it …
Browse files Browse the repository at this point in the history
…might not recover (#2383)

* fix: throw error if volume is down state and with pending status, it might not recover

Signed-off-by: Shivanjan Chakravorty <[email protected]>

* refactor: update error message for volume state down and pending

Signed-off-by: Shivanjan Chakravorty <[email protected]>

---------

Signed-off-by: Shivanjan Chakravorty <[email protected]>
  • Loading branch information
Glitchfix committed Dec 15, 2023
1 parent 4ddd75f commit 95a9061
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/server/sdk/volume_ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ func (s *VolumeServer) waitForVolumeReady(ctx context.Context, id string) (*api.
return false, nil
}

// The volume has entered a state of that might not recover from hence the status might be down and will be in pending state forever.
if v.GetStatus() == api.VolumeStatus_VOLUME_STATUS_DOWN && v.GetState() != api.VolumeState_VOLUME_STATE_PENDING {
return false, status.Errorf(codes.Internal, "Volume id %s got created but due to Internal issues is in Down State. The Volume creation needs to be retried.", v.GetId())
}

// Continue waiting
return true, nil
})
Expand Down

0 comments on commit 95a9061

Please sign in to comment.