Uh oh!
There was an error while loading. Please reload this page.
Ignore SIGURG on Unix (including Darwin) - #3103
Conversation
cpuguy83
commented
May 21, 2021
Wow, that's surprising. Confirmed this is getting fired off quite rapidly on darwin. |
| @@ -1,3 +1,5 @@ | |||
| // +build linux darwin | |||
There was a problem hiding this comment.
Maybe signals_unix.go and make it !windows
I saw some issues related to bsd in the go repo about this as well.
It's a pretty good bet no one will want to forward this signal, ever.
There was a problem hiding this comment.
Was wondering if we should filter by name; does windows also have a "SIGURG" defined?
There was a problem hiding this comment.
I've pushed an update to use signals_unix.go and !windows. Hopefully CircleCI's infra is back on line!
It looks like SIGURG isn't defined on Windows, according to https://stackoverflow.com/a/63396672/6774019 . According to the x/sys/windows docs there is only
const (
// More invented values for signalsSIGHUP=Signal(0x1)
SIGINT=Signal(0x2)
SIGQUIT=Signal(0x3)
SIGILL=Signal(0x4)
SIGTRAP=Signal(0x5)
SIGABRT=Signal(0x6)
SIGBUS=Signal(0x7)
SIGFPE=Signal(0x8)
SIGKILL=Signal(0x9)
SIGSEGV=Signal(0xb)
SIGPIPE=Signal(0xd)
SIGALRM=Signal(0xe)
SIGTERM=Signal(0xf)
)I guess this is good news 😅
Codecov Report
@@ Coverage Diff @@## master #3103 +/- ##
==========================================
- Coverage 56.97% 56.96% -0.01%
==========================================
Files 299 299 Lines 18729 18732 +3 ==========================================
Hits 10670 10670 - Misses 7192 7194 +2 - Partials 867 868 +1 |
| @@ -1,4 +1,4 @@ | |||
| // +build !linux | |||
| // +build !linux,!darwin | |||
There was a problem hiding this comment.
Build tags are redundant here. _windows implicitly makes this only build on windows.
There was a problem hiding this comment.
Good point! I've repushed, removing the build tags here.
| @@ -1,3 +1,5 @@ | |||
| // +build linux darwin | |||
There was a problem hiding this comment.
Sorry usually this is !windows. Any reason to restrict this from other unixes?
There was a problem hiding this comment.
Ah, no reason! I agree having signals_windows.go and then a signals_unix.go with !windows makes sense. For such a small patch it's taking me a while to get it right :)
This extends docker#2929 to Darwin as well as Linux. Running the example in golang/go#37942 I see lots of: ``` dave@m1 sigurg % uname -ms Darwin arm64 dave@m1 sigurg % go run main.go received urgent I/O condition: 2021-05-21 16:03:03.482211 +0100 BST m=+0.014553751 received urgent I/O condition: 2021-05-21 16:03:03.507171 +0100 BST m=+0.039514459 ``` Signed-off-by: David Scott <dave@recoil.org>
cpuguy83
left a comment
There was a problem hiding this comment.
LGTM
Thanks for dealing with nitpicks.
thaJeztah
commented
May 25, 2021
Second commit looks to be the same as #2986 (which removes the warning as well); let me check if that one can be merged 🤗 |
djs55
commented
May 25, 2021
I've force-pushed to remove the second commit, since it has been independently fixed in #2986 |
- What I did
Ignored spurious
SIGURGsignals generated by the Go 1.14+ runtime on Darwin.Running the example in golang/go#37942
I see lots of these signals:
Previously I would also see a spurious error when closing a connection:
- How I did it
#2929 already covered
SIGURGon Linux. I extended it to cover all Unix versions via_unix.go.I added an
okto detect the signals channel being closed and return from the forwarding function.- How to verify it
The unit test for Linux should also cover Mac. On Docker Desktop if you run an interactive container:
and then watch the Docker API proxy log:
and observe no
as seen on docker/for-mac#5712
- Description for the changelog
SIGURGsignals generated by the Go runtime into containers- A picture of a cute animal (not mandatory but encouraged)