Skip to content

Commit

Permalink
Revert "PWX-33580 Run stat command with timeout during NFS Unmount (#…
Browse files Browse the repository at this point in the history
…2403) (#2457)" (#2458)

This reverts commit 0ba1aa1.

Signed-off-by: Vignesh Laxman <[email protected]>
  • Loading branch information
vlaxman-px authored and Lakshmi Narasimhan Sundararajan committed Jul 13, 2024
1 parent 34ac6fe commit a00c032
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions pkg/mount/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
package mount

import (
"context"
"crypto/md5"
"encoding/hex"
"errors"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path"
"path/filepath"
"regexp"
Expand Down Expand Up @@ -104,7 +102,6 @@ const (
mountPathRemoveDelay = 30 * time.Second
testDeviceEnv = "Test_Device_Mounter"
bindMountPrefix = "readonly"
statTimeout = 30 * time.Second
)

var (
Expand Down Expand Up @@ -728,11 +725,7 @@ func (m *Mounter) removeMountPath(path string) error {

// RemoveMountPath makes the path writeable and removes it after a fixed delay
func (m *Mounter) RemoveMountPath(mountPath string, opts map[string]string) error {
ctx, cancel := context.WithTimeout(context.Background(), statTimeout)
defer cancel()
cmd := exec.CommandContext(ctx, "stat", mountPath)
_, err := cmd.CombinedOutput()
if err == nil {
if _, err := os.Stat(mountPath); err == nil {
if options.IsBoolOptionSet(opts, options.OptionsWaitBeforeDelete) {
hasher := md5.New()
hasher.Write([]byte(mountPath))
Expand Down

0 comments on commit a00c032

Please sign in to comment.