Skip to content

Commit b72d2aa

Browse files
mattcarysaikat-royc
authored andcommitted
Return error when queued
Change-Id: Ia4933278dba561697abccff8a6e0bc8ab0b98cc4
1 parent dfd3b47 commit b72d2aa

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
@@ -396,12 +396,16 @@ func (gceCS *GCEControllerServer) ControllerPublishVolume(ctx context.Context, r
396396
return gceCS.executeControllerPublishVolume(ctx, req)
397397
}
398398

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

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

0 commit comments

Comments
 (0)