Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-1.19] chore: refine blobfuse mount logs #855

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions pkg/blob/nodeserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolu
}

func (d *Driver) mountBlobfuseWithProxy(args string, protocol string, authEnv []string) (string, error) {
klog.V(2).Infof("mouting using blobfuse proxy")
var resp *mount_azure_blob.MountAzureBlobResponse
var output string
connectionTimout := time.Duration(d.blobfuseProxyConnTimout) * time.Second
ctx, cancel := context.WithTimeout(context.Background(), connectionTimout)
defer cancel()
klog.V(2).Infof("start connecting to blobfuse proxy, protocol: %s, args: %s", protocol, args)
conn, err := grpc.DialContext(ctx, d.blobfuseProxyEndpoint, grpc.WithInsecure(), grpc.WithBlock())
if err == nil {
mountClient := NewMountClient(conn)
Expand All @@ -155,7 +155,7 @@ func (d *Driver) mountBlobfuseWithProxy(args string, protocol string, authEnv []
Protocol: protocol,
AuthEnv: authEnv,
}
klog.V(2).Infof("calling BlobfuseProxy: MountAzureBlob function")
klog.V(2).Infof("begin to mount with blobfuse proxy, protocol: %s, args: %s", protocol, args)
resp, err = mountClient.service.MountAzureBlob(context.TODO(), &mountreq)
if err != nil {
klog.Error("GRPC call returned with an error:", err)
Expand All @@ -168,15 +168,16 @@ func (d *Driver) mountBlobfuseWithProxy(args string, protocol string, authEnv []
func (d *Driver) mountBlobfuseInsideDriver(args string, protocol string, authEnv []string) (string, error) {
var cmd *exec.Cmd

klog.V(2).Infof("mounting blobfuse inside driver")
mountLog := "mount inside driver with"
if protocol == Fuse2 {
klog.V(2).Infof("using blobfuse V2 to mount")
mountLog += " v2"
args = "mount " + args
cmd = exec.Command("blobfuse2", strings.Split(args, " ")...)
} else {
klog.V(2).Infof("using blobfuse V1 to mount")
mountLog += " v1"
cmd = exec.Command("blobfuse", strings.Split(args, " ")...)
}
klog.V(2).Infof("%s, protocol: %s, args: %s", mountLog, protocol, args)

cmd.Env = append(os.Environ(), authEnv...)
output, err := cmd.CombinedOutput()
Expand Down
6 changes: 3 additions & 3 deletions pkg/blobfuse-proxy/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,22 @@ func (server *MountServer) MountAzureBlob(ctx context.Context,
args := req.GetMountArgs()
authEnv := req.GetAuthEnv()
protocol := req.GetProtocol()
klog.V(2).Infof("received mount request: Protocol: %s, server default blobfuseVersion: %v, Mounting with args %v \n", protocol, server.blobfuseVersion, args)
klog.V(2).Infof("received mount request: protocol: %s, server default blobfuseVersion: %v, mount args %v \n", protocol, server.blobfuseVersion, args)

var cmd *exec.Cmd
var result mount_azure_blob.MountAzureBlobResponse
if protocol == blob.Fuse2 || server.blobfuseVersion == BlobfuseV2 {
klog.V(2).Infof("using blobfuse V2 to mount")
args = "mount " + args
// add this arg for blobfuse2 to solve the issue:
// https://github.com/Azure/azure-storage-fuse/issues/1015
if !strings.Contains(args, "--ignore-open-flags") {
klog.V(2).Infof("append --ignore-open-flags=true to mount args")
args = args + " " + "--ignore-open-flags=true"
}
klog.V(2).Infof("mount with v2, protocol: %s, args: %s", protocol, args)
cmd = exec.Command("blobfuse2", strings.Split(args, " ")...)
} else {
klog.V(2).Infof("using blobfuse V1 to mount")
klog.V(2).Infof("mount with v1, protocol: %s, args: %s", protocol, args)
cmd = exec.Command("blobfuse", strings.Split(args, " ")...)
}

Expand Down