Skip to content

Commit e8281f4

Browse files
authored
Merge pull request #943 from mattcary/queue-fix
Return error when queued
2 parents 09ff4a0 + 63775c0 commit e8281f4

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
@@ -393,12 +393,16 @@ func (gceCS *GCEControllerServer) ControllerPublishVolume(ctx context.Context, r
393393
return gceCS.executeControllerPublishVolume(ctx, req)
394394
}
395395

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

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

0 commit comments

Comments
 (0)