aboutsummaryrefslogtreecommitdiff
path: root/pkg/driver
diff options
context:
space:
mode:
authorViktor Kuzmin <kvaster@gmail.com>2023-08-06 21:19:26 +0300
committerChris Lu <chrislusf@users.noreply.github.com>2023-08-07 10:22:05 -0700
commitd84db4bbebec5d8c0d0e20dbf9deffdd24ba1151 (patch)
treef8f43d972064dd3bf68dd215d1032824f397db50 /pkg/driver
parent615c145190e7cb880bf2542d3ae9e750b28b9a89 (diff)
downloadseaweedfs-csi-driver-d84db4bbebec5d8c0d0e20dbf9deffdd24ba1151.tar.xz
seaweedfs-csi-driver-d84db4bbebec5d8c0d0e20dbf9deffdd24ba1151.zip
Use SIGTERM for shutting down weed mount, adjust timeouts
Diffstat (limited to 'pkg/driver')
-rw-r--r--pkg/driver/mounter.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/driver/mounter.go b/pkg/driver/mounter.go
index 64eae33..2e51314 100644
--- a/pkg/driver/mounter.go
+++ b/pkg/driver/mounter.go
@@ -96,7 +96,8 @@ func fuseMount(path string, command string, args []string) (Unmounter, error) {
func (fu *fuseUnmounter) finish(timeout time.Duration) error {
// ignore error, just inform we want process to exit
- _ = fu.cmd.Process.Signal(syscall.Signal(1))
+ // SIGHUP is used to reload weed config - we need to use SIGTERM
+ _ = fu.cmd.Process.Signal(syscall.SIGTERM)
if err := fu.waitFinished(timeout); err != nil {
glog.Errorf("weed mount terminate timeout, pid: %d, path: %v", fu.cmd.Process.Pid, fu.path)
@@ -122,11 +123,11 @@ func (fu *fuseUnmounter) waitFinished(timeout time.Duration) error {
}
func (fu *fuseUnmounter) Unmount() error {
- if ok, err := mountutil.IsLikelyNotMountPoint(fu.path); !ok || mount.IsCorruptedMnt(err) {
+ if ok, err := mountutil.IsMountPoint(fu.path); ok || mount.IsCorruptedMnt(err) {
if err := mountutil.Unmount(fu.path); err != nil {
return err
}
}
- return fu.finish(time.Second * 30)
+ return fu.finish(time.Second * 5)
}