From 43b150f14d2858f2bdcd268d8fac16377a98b8a4 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Thu, 20 Feb 2025 14:04:41 +0100 Subject: [PATCH] rbd: return gRPC code `Aborted` when the RBD-image is in-use on delete 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: #5166 Signed-off-by: Niels de Vos --- internal/rbd/controllerserver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/rbd/controllerserver.go b/internal/rbd/controllerserver.go index ab99c0560f2..846bd7af956 100644 --- a/internal/rbd/controllerserver.go +++ b/internal/rbd/controllerserver.go @@ -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