Skip to content

Commit 893d1ac

Browse files
authored
Merge pull request #843 from k8s-infra-cherrypick-robot/cherry-pick-842-to-release-1.19
[release-1.19] fix: add workaround for blobfuse2 mount race condition issue
2 parents 6aac53f + 230260f commit 893d1ac

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

pkg/blob/nodeserver.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,11 @@ func (d *Driver) mountBlobfuseInsideDriver(args string, protocol string, authEnv
181181
cmd.Env = append(os.Environ(), authEnv...)
182182
output, err := cmd.CombinedOutput()
183183
klog.V(2).Infof("mount output: %s\n", string(output))
184-
184+
if err == nil && protocol == Fuse2 {
185+
// todo: remove this when https://github.com/Azure/azure-storage-fuse/issues/1079 is fixed
186+
klog.V(2).Infof("sleep 2s, waiting for blobfuse2 mount complete")
187+
time.Sleep(2 * time.Second)
188+
}
185189
return string(output), err
186190
}
187191

pkg/blobfuse-proxy/server/server.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"os/exec"
2424
"strings"
2525
"sync"
26+
"time"
2627

2728
"google.golang.org/grpc"
2829
"k8s.io/klog/v2"
@@ -95,6 +96,11 @@ func (server *MountServer) MountAzureBlob(ctx context.Context,
9596
if err != nil {
9697
return &result, fmt.Errorf("%w %s", err, result.Output)
9798
}
99+
if protocol == blob.Fuse2 || server.blobfuseVersion == BlobfuseV2 {
100+
// todo: remove this when https://github.com/Azure/azure-storage-fuse/issues/1079 is fixed
101+
klog.V(2).Infof("sleep 2s, waiting for blobfuse2 mount complete\n")
102+
time.Sleep(2 * time.Second)
103+
}
98104
return &result, nil
99105
}
100106

0 commit comments

Comments
 (0)