Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 5e5bcce

Browse files
authored
Merge pull request #1749 from thaJeztah/ignore_sigurg
mobycli: ignore SIGURG on Linux and Darwin
2 parents 94cbff0 + b4c8a9d commit 5e5bcce

File tree

3 files changed

+59
-2
lines changed

3 files changed

+59
-2
lines changed

cli/mobycli/exec.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,13 @@ func RunDocker(childExit chan bool, args ...string) error {
106106
if cmd.Process == nil {
107107
continue // can happen if receiving signal before the process is actually started
108108
}
109-
// nolint errcheck
110-
cmd.Process.Signal(sig)
109+
// In go1.14+, the go runtime issues SIGURG as an interrupt to
110+
// support preemptable system calls on Linux. Since we can't
111+
// forward that along we'll check that here.
112+
if isRuntimeSig(sig) {
113+
continue
114+
}
115+
_ = cmd.Process.Signal(sig)
111116
case <-childExit:
112117
return
113118
}

cli/mobycli/exec_unix.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// +build !windows
2+
3+
/*
4+
Copyright 2020 Docker Compose CLI authors
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
*/
18+
19+
package mobycli
20+
21+
import (
22+
"os"
23+
24+
"golang.org/x/sys/unix"
25+
)
26+
27+
func isRuntimeSig(s os.Signal) bool {
28+
return s == unix.SIGURG
29+
}

cli/mobycli/exec_windows.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
Copyright 2020 Docker Compose CLI authors
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package mobycli
18+
19+
import "os"
20+
21+
func isRuntimeSig(s os.Signal) bool {
22+
return false
23+
}

0 commit comments

Comments
 (0)