Skip to content

Commit

Permalink
use a forked version of j-keck/arping that fixes a threading issue
Browse files Browse the repository at this point in the history
here is the PR for the upstream version j-keck/arping#17

'
using sock.deinitialize() outside of the goroutine that is using the socket leaves the potential for erroneous and
unexpected behavior. When calling Ping() very quickly the socket fd can be reused while a goroutine is still trying to read
from it and cause the goroutine to deadlock.

removing the sock.deinitialize() from the timeout select case as it will
be taken care of by the goroutine upon its return'

Signed-off-by: Jacob Tanenbaum <[email protected]>
  • Loading branch information
JacobTanenbaum committed Feb 2, 2024
1 parent cbff639 commit cedf636
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 34 deletions.
1 change: 1 addition & 0 deletions go-controller/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,5 @@ require (
replace (
github.com/Microsoft/hcsshim => github.com/Microsoft/hcsshim v0.8.20
github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2
github.com/j-keck/arping => github.com/JacobTanenbaum/arping v0.0.0-20240202195120-71d47a209f60
)
5 changes: 2 additions & 3 deletions go-controller/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbt
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/JacobTanenbaum/arping v0.0.0-20240202195120-71d47a209f60 h1:eehYfYHeD0m5VJo76HFyRx8Q6pZPhpQotY9uqz30m+o=
github.com/JacobTanenbaum/arping v0.0.0-20240202195120-71d47a209f60/go.mod h1:aJbELhR92bSk7tp79AWM/ftfc90EfEi2bQJrbBFOsPw=
github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA=
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
github.com/Microsoft/go-winio v0.4.16-0.20201130162521-d1ffc52c7331/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0=
Expand Down Expand Up @@ -460,9 +462,6 @@ github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH
github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA=
github.com/j-keck/arping v1.0.2 h1:hlLhuXgQkzIJTZuhMigvG/CuSkaspeaD9hRDk2zuiMI=
github.com/j-keck/arping v1.0.2/go.mod h1:aJbELhR92bSk7tp79AWM/ftfc90EfEi2bQJrbBFOsPw=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

3 changes: 2 additions & 1 deletion go-controller/vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ github.com/gorilla/mux
# github.com/imdario/mergo v0.3.12
## explicit; go 1.13
github.com/imdario/mergo
# github.com/j-keck/arping v1.0.2
# github.com/j-keck/arping v1.0.2 => github.com/JacobTanenbaum/arping v0.0.0-20240202195120-71d47a209f60
## explicit; go 1.12
github.com/j-keck/arping
# github.com/josharian/intern v1.0.0
Expand Down Expand Up @@ -1166,3 +1166,4 @@ sigs.k8s.io/structured-merge-diff/v4/value
sigs.k8s.io/yaml
# github.com/Microsoft/hcsshim => github.com/Microsoft/hcsshim v0.8.20
# github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2
# github.com/j-keck/arping => github.com/JacobTanenbaum/arping v0.0.0-20240202195120-71d47a209f60

0 comments on commit cedf636

Please sign in to comment.