Skip to content

Commit 978fffc

Browse files
authored
Merge pull request #2289 from k8s-infra-cherrypick-robot/cherry-pick-2288-to-release-1.27
[release-1.27] chore: increase blobfuse mount timeout
2 parents e431a75 + a92d4e9 commit 978fffc

File tree

5 files changed

+30
-29
lines changed

5 files changed

+30
-29
lines changed

pkg/blob/blob.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ type DriverOptions struct {
182182
DriverName string
183183
BlobfuseProxyEndpoint string
184184
EnableBlobfuseProxy bool
185-
BlobfuseProxyConnTimout int
185+
BlobfuseProxyConnTimeout int
186186
EnableBlobMockMount bool
187187
AllowInlineVolumeKeyAccessWithIdentity bool
188188
EnableGetVolumeStats bool
@@ -202,7 +202,7 @@ func (option *DriverOptions) AddFlags() {
202202
flag.StringVar(&option.NodeID, "nodeid", "", "node id")
203203
flag.StringVar(&option.DriverName, "drivername", DefaultDriverName, "name of the driver")
204204
flag.BoolVar(&option.EnableBlobfuseProxy, "enable-blobfuse-proxy", false, "using blobfuse proxy for mounts")
205-
flag.IntVar(&option.BlobfuseProxyConnTimout, "blobfuse-proxy-connect-timeout", 5, "blobfuse proxy connection timeout(seconds)")
205+
flag.IntVar(&option.BlobfuseProxyConnTimeout, "blobfuse-proxy-connect-timeout", 5, "blobfuse proxy connection timeout(seconds)")
206206
flag.BoolVar(&option.EnableBlobMockMount, "enable-blob-mock-mount", false, "enable mock mount(only for testing)")
207207
flag.BoolVar(&option.EnableGetVolumeStats, "enable-get-volume-stats", false, "allow GET_VOLUME_STATS on agent node")
208208
flag.BoolVar(&option.AppendTimeStampInCacheDir, "append-timestamp-cache-dir", false, "append timestamp into cache directory on agent node")
@@ -238,7 +238,7 @@ type Driver struct {
238238
allowInlineVolumeKeyAccessWithIdentity bool
239239
appendTimeStampInCacheDir bool
240240
appendMountErrorHelpLink bool
241-
blobfuseProxyConnTimout int
241+
blobfuseProxyConnTimeout int
242242
mountPermissions uint64
243243
enableAznfsMount bool
244244
enableVolumeMountGroup bool
@@ -283,7 +283,7 @@ func NewDriver(options *DriverOptions, kubeClient kubernetes.Interface, cloud *s
283283
blobfuseProxyEndpoint: options.BlobfuseProxyEndpoint,
284284
enableBlobfuseProxy: options.EnableBlobfuseProxy,
285285
allowInlineVolumeKeyAccessWithIdentity: options.AllowInlineVolumeKeyAccessWithIdentity,
286-
blobfuseProxyConnTimout: options.BlobfuseProxyConnTimout,
286+
blobfuseProxyConnTimeout: options.BlobfuseProxyConnTimeout,
287287
enableBlobMockMount: options.EnableBlobMockMount,
288288
enableGetVolumeStats: options.EnableGetVolumeStats,
289289
enableVolumeMountGroup: options.EnableVolumeMountGroup,

pkg/blob/blob_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func NewFakeDriver() *Driver {
5757
DriverName: DefaultDriverName,
5858
BlobfuseProxyEndpoint: "",
5959
EnableBlobfuseProxy: false,
60-
BlobfuseProxyConnTimout: 5,
60+
BlobfuseProxyConnTimeout: 5,
6161
WaitForAzCopyTimeoutMinutes: 1,
6262
EnableBlobMockMount: false,
6363
}
@@ -70,12 +70,12 @@ func NewFakeDriver() *Driver {
7070

7171
func TestNewFakeDriver(t *testing.T) {
7272
driverOptions := DriverOptions{
73-
NodeID: fakeNodeID,
74-
DriverName: DefaultDriverName,
75-
BlobfuseProxyEndpoint: "",
76-
EnableBlobfuseProxy: false,
77-
BlobfuseProxyConnTimout: 5,
78-
EnableBlobMockMount: false,
73+
NodeID: fakeNodeID,
74+
DriverName: DefaultDriverName,
75+
BlobfuseProxyEndpoint: "",
76+
EnableBlobfuseProxy: false,
77+
BlobfuseProxyConnTimeout: 5,
78+
EnableBlobMockMount: false,
7979
}
8080
d := NewDriver(&driverOptions, nil, &storage.AccountRepo{})
8181
assert.NotNil(t, d)
@@ -87,7 +87,7 @@ func TestNewDriver(t *testing.T) {
8787
DriverName: DefaultDriverName,
8888
BlobfuseProxyEndpoint: "",
8989
EnableBlobfuseProxy: false,
90-
BlobfuseProxyConnTimout: 5,
90+
BlobfuseProxyConnTimeout: 5,
9191
WaitForAzCopyTimeoutMinutes: 1,
9292
EnableBlobMockMount: false,
9393
}

pkg/blob/nodeserver.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import (
4747

4848
const (
4949
waitForMountInterval = 20 * time.Millisecond
50-
waitForMountTimeout = 60 * time.Second
50+
waitForMountTimeout = 110 * time.Second
5151
)
5252

5353
type MountClient struct {
@@ -158,10 +158,8 @@ func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolu
158158
}
159159

160160
func (d *Driver) mountBlobfuseWithProxy(args, protocol string, authEnv []string) (string, error) {
161-
var resp *mount_azure_blob.MountAzureBlobResponse
162-
var output string
163-
connectionTimout := time.Duration(d.blobfuseProxyConnTimout) * time.Second
164-
ctx, cancel := context.WithTimeout(context.Background(), connectionTimout)
161+
connectionTimeout := time.Duration(d.blobfuseProxyConnTimeout) * time.Second
162+
ctx, cancel := context.WithTimeout(context.Background(), connectionTimeout)
165163
defer cancel()
166164
klog.V(2).Infof("start connecting to blobfuse proxy, protocol: %s, args: %s", protocol, args)
167165
conn, err := grpc.DialContext(ctx, d.blobfuseProxyEndpoint, grpc.WithInsecure(), grpc.WithBlock())
@@ -182,12 +180,15 @@ func (d *Driver) mountBlobfuseWithProxy(args, protocol string, authEnv []string)
182180
AuthEnv: authEnv,
183181
}
184182
klog.V(2).Infof("begin to mount with blobfuse proxy, protocol: %s, args: %s", protocol, args)
185-
resp, err = mountClient.service.MountAzureBlob(context.TODO(), &mountreq)
183+
resp, err := mountClient.service.MountAzureBlob(context.TODO(), &mountreq)
186184
if err != nil {
187185
klog.Error("GRPC call returned with an error:", err)
188186
}
189-
output = resp.GetOutput()
190-
187+
var output string
188+
if resp != nil {
189+
output = resp.GetOutput()
190+
}
191+
klog.V(2).Infof("mount with blobfuse proxy completed, protocol: %s, args: %s, output: %s, error: %v", protocol, args, output, err)
191192
return output, err
192193
}
193194

pkg/blob/nodeserver_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ func TestMountBlobfuseWithProxy(t *testing.T) {
996996
// Create the driver with the configured proxy
997997
d := NewFakeDriver()
998998
d.blobfuseProxyEndpoint = lis.Addr().String()
999-
d.blobfuseProxyConnTimout = 5 // 5 second timeout
999+
d.blobfuseProxyConnTimeout = 5 // 5 second timeout
10001000

10011001
return d, s, lis
10021002
},
@@ -1037,7 +1037,7 @@ func TestMountBlobfuseWithProxy(t *testing.T) {
10371037
// Create the driver with the configured proxy
10381038
d := NewFakeDriver()
10391039
d.blobfuseProxyEndpoint = lis.Addr().String()
1040-
d.blobfuseProxyConnTimout = 5 // 5 second timeout
1040+
d.blobfuseProxyConnTimeout = 5 // 5 second timeout
10411041

10421042
return d, s, lis
10431043
},
@@ -1057,7 +1057,7 @@ func TestMountBlobfuseWithProxy(t *testing.T) {
10571057
// Create the driver with a non-existent endpoint
10581058
d := NewFakeDriver()
10591059
d.blobfuseProxyEndpoint = "unix://non-existent-socket.sock"
1060-
d.blobfuseProxyConnTimout = 1 // 1 second timeout for quick failure
1060+
d.blobfuseProxyConnTimeout = 1 // 1 second timeout for quick failure
10611061

10621062
// No server or listener for this test
10631063
return d, nil, nil

test/e2e/suite_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@ var _ = ginkgo.SynchronizedBeforeSuite(func(ctx ginkgo.SpecContext) []byte {
122122
_, useBlobfuseProxy := os.LookupEnv("ENABLE_BLOBFUSE_PROXY")
123123
os.Setenv("AZURE_CREDENTIAL_FILE", credentials.TempAzureCredentialFilePath)
124124
driverOptions := blob.DriverOptions{
125-
NodeID: os.Getenv("nodeid"),
126-
DriverName: blob.DefaultDriverName,
127-
BlobfuseProxyEndpoint: "",
128-
EnableBlobfuseProxy: useBlobfuseProxy,
129-
BlobfuseProxyConnTimout: 5,
130-
EnableBlobMockMount: false,
125+
NodeID: os.Getenv("nodeid"),
126+
DriverName: blob.DefaultDriverName,
127+
BlobfuseProxyEndpoint: "",
128+
EnableBlobfuseProxy: useBlobfuseProxy,
129+
BlobfuseProxyConnTimeout: 5,
130+
EnableBlobMockMount: false,
131131
}
132132
kubeClient, err := util.GetKubeClient(kubeconfig, 25.0, 50, "")
133133
gomega.Expect(err).NotTo(gomega.HaveOccurred())

0 commit comments

Comments
 (0)