From 63775c0c7a6c23e00876622ceb6beeb4fb8ea740 Mon Sep 17 00:00:00 2001 From: Matthew Cary Date: Fri, 25 Mar 2022 13:44:28 -0700 Subject: [PATCH] Return error when queued Change-Id: Ia4933278dba561697abccff8a6e0bc8ab0b98cc4 --- pkg/gce-pd-csi-driver/controller.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/gce-pd-csi-driver/controller.go b/pkg/gce-pd-csi-driver/controller.go index 705ac41e3..0d44458be 100644 --- a/pkg/gce-pd-csi-driver/controller.go +++ b/pkg/gce-pd-csi-driver/controller.go @@ -393,12 +393,16 @@ func (gceCS *GCEControllerServer) ControllerPublishVolume(ctx context.Context, r return gceCS.executeControllerPublishVolume(ctx, req) } - // Node is marked so queue up the request + // Node is marked so queue up the request. Note the original gRPC context may get canceled, + // so a new one is created here. + // + // Note that the original context probably has a timeout (see csiAttach in external-attacher), + // which is ignored. gceCS.queue.AddRateLimited(&workItem{ - ctx: ctx, + ctx: context.Background(), publishReq: req, }) - return &csi.ControllerPublishVolumeResponse{}, nil + return nil, status.Error(codes.Unavailable, "Request queued due to error condition on node") } func (gceCS *GCEControllerServer) validateControllerPublishVolumeRequest(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (string, *meta.Key, error) {