Skip to content

Commit

Permalink
rbd: return gRPC code Aborted when the RBD-image is in-use on delete
Browse files Browse the repository at this point in the history
According to the error scheme documented in the CSI specification, the
Aborted error code should be initiate retries, whereas the Internal
error code does not require this behaviour.

When an RBD-image is still in-use, it can not be removed. The
DeleteVolume procedure should be retried and will succeed once the
RBD-image is not in-use anymore.

Fixes: ceph#5166
Signed-off-by: Niels de Vos <[email protected]>
  • Loading branch information
nixpanic committed Feb 20, 2025
1 parent ac8cda5 commit b79df92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/rbd/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ func cleanupRBDImage(ctx context.Context,
if inUse {
log.ErrorLog(ctx, "rbd %s is still being used", rbdVol)

return nil, status.Errorf(codes.Internal, "rbd %s is still being used", rbdVol.RbdImageName)
return nil, status.Errorf(codes.Aborted, "rbd %s is still being used", rbdVol.RbdImageName)
}

// delete the temporary rbd image created as part of volume clone during
Expand Down

0 comments on commit b79df92

Please sign in to comment.