We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3625074 + 33d8261 commit 28cb879Copy full SHA for 28cb879
pkg/parent/parent.go
@@ -68,6 +68,14 @@ func Parent(pipeFDEnvKey string, opt *Opt) error {
68
}
69
defer os.RemoveAll(opt.StateDir)
70
defer lock.Unlock()
71
+ // when the previous execution crashed, the state dir may not be removed successfully.
72
+ // explicitly remove everything in the state dir except the lock file here.
73
+ for _, f := range []string{StateFileChildPID} {
74
+ p := filepath.Join(opt.StateDir, f)
75
+ if err := os.RemoveAll(p); err != nil {
76
+ return errors.Wrapf(err, "failed to remove %s", p)
77
+ }
78
79
80
pipeR, pipeW, err := os.Pipe()
81
if err != nil {
0 commit comments