From 625d5453c834e84fd8ed3d1bd6690aefa27a5acb Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Thu, 25 Dec 2025 08:33:41 +0000 Subject: [PATCH] cleanup: refine mount time out error message --- pkg/nfs/nodeserver.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/nfs/nodeserver.go b/pkg/nfs/nodeserver.go index eebab4832..20c7b8e89 100644 --- a/pkg/nfs/nodeserver.go +++ b/pkg/nfs/nodeserver.go @@ -34,6 +34,8 @@ import ( azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" ) +const mountTimeoutInSec = 110 + // NodeServer driver type NodeServer struct { Driver *Driver @@ -134,8 +136,10 @@ func (ns *NodeServer) NodePublishVolume(_ context.Context, req *csi.NodePublishV execFunc := func() error { return ns.mounter.Mount(source, targetPath, "nfs", mountOptions) } - timeoutFunc := func() error { return fmt.Errorf("time out") } - if err := WaitUntilTimeout(90*time.Second, execFunc, timeoutFunc); err != nil { + timeoutFunc := func() error { + return fmt.Errorf("mount volume %s to %s timeout after %ds", source, targetPath, mountTimeoutInSec) + } + if err := WaitUntilTimeout(mountTimeoutInSec*time.Second, execFunc, timeoutFunc); err != nil { if os.IsPermission(err) { return nil, status.Error(codes.PermissionDenied, err.Error()) }