Skip to content

Commit

Permalink
fix: This fixes jobs child processes (#1665)
Browse files Browse the repository at this point in the history
Jobs where getting stuck in busy because for some reason the mechanism for kiling the jos on timeout was loosing track of the process at SO level.
  • Loading branch information
vcastellm authored Feb 9, 2025
1 parent 42589b0 commit 3f2f201
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugin/shell/shell_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,16 @@ func setCmdAttr(cmd *exec.Cmd, config map[string]string) error {
} else {
gid, _ = strconv.Atoi(u.Gid)
}
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
cmd.SysProcAttr.Credential = &syscall.Credential{
Uid: uint32(uid),
Gid: uint32(gid),
}
}

jobTimeout := config["timeout"]
if jobTimeout != "" {
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
}
return nil
}

Expand Down

0 comments on commit 3f2f201

Please sign in to comment.