Skip to content

Commit

Permalink
mount: wait until new service process is ready (#5641)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijian-pro authored Feb 12, 2025
1 parent 871df1d commit cb3f3f5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/mount_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ func checkMountpoint(name, mp, logPath string, background bool) {
logger.Infof("\033[92mOK\033[0m, %s with special mount point %s", name, mp)
return
}
_, oldConf, _ := loadConfig(mp)
mountTimeOut := 10 // default 10 seconds
interval := 500 // check every 500 Millisecond
if tStr, ok := os.LookupEnv("JFS_MOUNT_TIMEOUT"); ok {
Expand All @@ -222,6 +223,13 @@ func checkMountpoint(name, mp, logPath string, background bool) {
st, err := os.Stat(mp)
if err == nil {
if sys, ok := st.Sys().(*syscall.Stat_t); ok && sys.Ino == uint64(meta.RootInode) {
// in pod, pid probably the same
if csiCommPath == "" && oldConf != nil {
_, newConf, _ := loadConfig(mp)
if newConf == nil || newConf.Pid == oldConf.Pid {
continue
}
}
logger.Infof("\033[92mOK\033[0m, %s is ready at %s", name, mp)
return
}
Expand Down

0 comments on commit cb3f3f5

Please sign in to comment.