Skip to content
Open
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
14 changes: 14 additions & 0 deletions driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"strconv"
"strings"
"syscall"
"time"
)

const (
Expand Down Expand Up @@ -636,6 +637,19 @@ func (p *S3fsPlugin) mountInternal(mountRequest interfaces.FlexVolumeMountReques
return fmt.Errorf("s3fs mount failed: %s", string(out))
}

// Wait for 1 second before checking whether s3fs process really terminated
time.Sleep(1 * time.Second)
// Check whether s3fs process terminated
cmd := "ps aux | grep " + podUID + " | grep s3fs | grep -v grep"
output, err = command("bash", "-c", cmd).CombinedOutput()
if err == nil {
s3fsProcStatus := strings.SplitAfterN(string(output), "\n", 2)
if s3fsProcStatus[1] == "" {
p.Logger.Error(podUID + ":" + "s3fs process terminated.")
return fmt.Errorf("s3fs mount failed: s3fs process terminated.")
}
}

fInfo, err = os.Lstat(mountRequest.MountDir)
if err == nil {
p.Logger.Info(podUID+":"+"Target directory after-mount: ",
Expand Down