Skip to content

Commit

Permalink
feat: Ignore SIGURG in argoexec emissary. Fixes #10129 (#10141)
Browse files Browse the repository at this point in the history
Signed-off-by: Kazuki Suda <[email protected]>
  • Loading branch information
superbrothers authored Dec 1, 2022
1 parent 6673cfb commit 6166464
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 6 additions & 2 deletions cmd/argoexec/commands/emissary.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,13 @@ func NewEmissaryCommand() *cobra.Command {

go func() {
for s := range signals {
if !osspecific.IsSIGCHLD(s) {
_ = osspecific.Kill(command.Process.Pid, s.(syscall.Signal))
if osspecific.CanIgnoreSignal(s) {
logger.Debugf("ignore signal %s", s)
continue
}

logger.Debugf("forwarding signal %s", s)
_ = osspecific.Kill(command.Process.Pid, s.(syscall.Signal))
}
}()
pid := command.Process.Pid
Expand Down
4 changes: 3 additions & 1 deletion workflow/executor/os-specific/signal_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import (
"github.com/argoproj/argo-workflows/v3/util/errors"
)

func IsSIGCHLD(s os.Signal) bool { return s == syscall.SIGCHLD }
func CanIgnoreSignal(s os.Signal) bool {
return s == syscall.SIGCHLD || s == syscall.SIGURG
}

func Kill(pid int, s syscall.Signal) error {
pgid, err := syscall.Getpgid(pid)
Expand Down
4 changes: 2 additions & 2 deletions workflow/executor/os-specific/signal_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"syscall"
)

func IsSIGCHLD(s os.Signal) bool {
return false // this does not exist on windows
func CanIgnoreSignal(s os.Signal) bool {
return false
}

func Kill(pid int, s syscall.Signal) error {
Expand Down

0 comments on commit 6166464

Please sign in to comment.