Skip to content

Commit 0f97ad7

Browse files
committed
Return error when queued
Change-Id: Ia4933278dba561697abccff8a6e0bc8ab0b98cc4
1 parent 41576a7 commit 0f97ad7

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)