-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
network: catch SIGPIPEs via SO_NOSIGPIPE on Darwin #12039
Conversation
@rebello95 interesting. As far as I know, we are not trying to re-set |
Definitely possible. Unfortunately I haven't been able to confirm the exact root cause since it hasn't been reproducible. |
Signed-off-by: Michael Rebello <[email protected]>
@rebello95 I think the master merge is missing DCO |
@junr03 yep, rebased and fixed DCO just now |
@ggreenway I was wondering if you could take a look at this. I feel this is up your alley. |
Signed-off-by: Michael Rebello <[email protected]>
I think CI failures are unrelated - updated with master 🤷♂️ |
Signed-off-by: Michael Rebello <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a few small comments, thanks.
/wait
Network::Socket::appendOptions(cluster_options, | ||
Network::SocketOptionFactory::buildSocketSigpipeOptions()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we have this here and on the listener side, do we still need the process-wide signal()
call that attempts to ignore SIGPIPE? I suppose that would be a riskier change, but can you add a TODO above that call to consider removing it and maybe also add some comments here and on the listener side of why we set this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll always need the process-wide signal()
call since this additional socket option only applies on certain OSes, as gated by #ifdef SO_NOSIGPIPE
in this PR, so it probably doesn't make sense to have a todo. I updated with additional documentation as requested.
Signed-off-by: Michael Rebello <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM please check format.
/wait
Signed-off-by: Michael Rebello <[email protected]>
@mattklein123 fixed |
And thank you for the reviews! |
Signed-off-by: Michael Rebello <[email protected]>
CI failures look legit. /wait |
Signed-off-by: Michael Rebello <[email protected]>
Signed-off-by: Michael Rebello <[email protected]>
Signed-off-by: Michael Rebello <[email protected]>
Signed-off-by: Michael Rebello <[email protected]>
Fixed most of the tests, but still working with @junr03 to resolve the rest |
Signed-off-by: Jose Nino <[email protected]>
Signed-off-by: Michael Rebello <[email protected]>
Should be good now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Bumping upstream to include iOS fixes for SIGPIPE error handling: envoyproxy/envoy#12039 Signed-off-by: Michael Rebello <[email protected]>
Bumping upstream to include iOS fixes for SIGPIPE error handling: envoyproxy/envoy#12039 Signed-off-by: Michael Rebello <[email protected]>
Signed-off-by: Michael Rebello <[email protected]> Co-authored-by: Jose Nino <[email protected]> Signed-off-by: Kevin Baichoo <[email protected]>
Signed-off-by: Michael Rebello <[email protected]> Co-authored-by: Jose Nino <[email protected]> Signed-off-by: scheler <[email protected]>
Bumping upstream to include iOS fixes for SIGPIPE error handling: #12039 Signed-off-by: Michael Rebello <[email protected]> Signed-off-by: JP Simard <[email protected]>
Bumping upstream to include iOS fixes for SIGPIPE error handling: #12039 Signed-off-by: Michael Rebello <[email protected]> Signed-off-by: JP Simard <[email protected]>
With Envoy Mobile, we have started seeing some
SIGPIPE
fatal crashes in our iOS application. This is a bit strange considering Envoy attempts to suppressSIGPIPE
errors. However, this is done at the global process-wide level, meaning something else could be re-setting it.It's worth noting that:
SIGPIPE
if something changed there.This fix takes advantage of Apple's
SO_NOSIGPIPE
setting on a per-socket level to catch theSIGPIPE
s that we're now seeing. It's being set on the upstream and listener socket creation codepaths in line with Envoy's existing setup to catch allSIGPIPE
s.Risk Level: Low, Envoy was already attempting to suppress
SIGPIPE
sTesting: Existing tests
Docs Changes: N/A
Release Notes: N/A
Signed-off-by: Michael Rebello [email protected]
Co-authored-by: Jose Nino [email protected]