Skip to content

Commit 88a5139

Browse files
authored
Merge pull request #854 from andyzhangx/refine-mount-logs
chore: refine blobfuse mount logs
2 parents abaa87e + 996a08a commit 88a5139

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

pkg/blob/nodeserver.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,12 @@ func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolu
146146
}
147147

148148
func (d *Driver) mountBlobfuseWithProxy(args string, protocol string, authEnv []string) (string, error) {
149-
klog.V(2).Infof("mouting using blobfuse proxy")
150149
var resp *mount_azure_blob.MountAzureBlobResponse
151150
var output string
152151
connectionTimout := time.Duration(d.blobfuseProxyConnTimout) * time.Second
153152
ctx, cancel := context.WithTimeout(context.Background(), connectionTimout)
154153
defer cancel()
154+
klog.V(2).Infof("start connecting to blobfuse proxy, protocol: %s, args: %s", protocol, args)
155155
conn, err := grpc.DialContext(ctx, d.blobfuseProxyEndpoint, grpc.WithInsecure(), grpc.WithBlock())
156156
if err == nil {
157157
mountClient := NewMountClient(conn)
@@ -160,7 +160,7 @@ func (d *Driver) mountBlobfuseWithProxy(args string, protocol string, authEnv []
160160
Protocol: protocol,
161161
AuthEnv: authEnv,
162162
}
163-
klog.V(2).Infof("calling BlobfuseProxy: MountAzureBlob function")
163+
klog.V(2).Infof("begin to mount with blobfuse proxy, protocol: %s, args: %s", protocol, args)
164164
resp, err = mountClient.service.MountAzureBlob(context.TODO(), &mountreq)
165165
if err != nil {
166166
klog.Error("GRPC call returned with an error:", err)
@@ -173,15 +173,16 @@ func (d *Driver) mountBlobfuseWithProxy(args string, protocol string, authEnv []
173173
func (d *Driver) mountBlobfuseInsideDriver(args string, protocol string, authEnv []string) (string, error) {
174174
var cmd *exec.Cmd
175175

176-
klog.V(2).Infof("mounting blobfuse inside driver")
176+
mountLog := "mount inside driver with"
177177
if protocol == Fuse2 {
178-
klog.V(2).Infof("using blobfuse V2 to mount")
178+
mountLog += " v2"
179179
args = "mount " + args
180180
cmd = exec.Command("blobfuse2", strings.Split(args, " ")...)
181181
} else {
182-
klog.V(2).Infof("using blobfuse V1 to mount")
182+
mountLog += " v1"
183183
cmd = exec.Command("blobfuse", strings.Split(args, " ")...)
184184
}
185+
klog.V(2).Infof("%s, protocol: %s, args: %s", mountLog, protocol, args)
185186

186187
cmd.Env = append(os.Environ(), authEnv...)
187188
output, err := cmd.CombinedOutput()

pkg/blobfuse-proxy/server/server.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,22 @@ func (server *MountServer) MountAzureBlob(ctx context.Context,
6464
args := req.GetMountArgs()
6565
authEnv := req.GetAuthEnv()
6666
protocol := req.GetProtocol()
67-
klog.V(2).Infof("received mount request: Protocol: %s, server default blobfuseVersion: %v, Mounting with args %v \n", protocol, server.blobfuseVersion, args)
67+
klog.V(2).Infof("received mount request: protocol: %s, server default blobfuseVersion: %v, mount args %v \n", protocol, server.blobfuseVersion, args)
6868

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

0 commit comments

Comments
 (0)