Skip to content

Commit 0a7a206

Browse files
authored
Merge pull request #945 from mattcary/cp-queue
Return error when queued
2 parents 41576a7 + 0f97ad7 commit 0a7a206

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pkg/gce-pd-csi-driver/controller.go

+7-3
Original file line numberDiff line numberDiff line change
@@ -389,12 +389,16 @@ func (gceCS *GCEControllerServer) ControllerPublishVolume(ctx context.Context, r
389389
return gceCS.executeControllerPublishVolume(ctx, req)
390390
}
391391

392-
// Node is marked so queue up the request
392+
// Node is marked so queue up the request. Note the original gRPC context may get canceled,
393+
// so a new one is created here.
394+
//
395+
// Note that the original context probably has a timeout (see csiAttach in external-attacher),
396+
// which is ignored.
393397
gceCS.queue.AddRateLimited(&workItem{
394-
ctx: ctx,
398+
ctx: context.Background(),
395399
publishReq: req,
396400
})
397-
return &csi.ControllerPublishVolumeResponse{}, nil
401+
return nil, status.Error(codes.Unavailable, "Request queued due to error condition on node")
398402
}
399403

400404
func (gceCS *GCEControllerServer) validateControllerPublishVolumeRequest(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (string, *meta.Key, error) {

0 commit comments

Comments
 (0)