network: catch SIGPIPEs via SO_NOSIGPIPE on Darwin#12039
network: catch SIGPIPEs via SO_NOSIGPIPE on Darwin#12039mattklein123 merged 12 commits intoenvoyproxy:masterfrom
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 <me@michaelrebello.com>
|
@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 <me@michaelrebello.com>
|
I think CI failures are unrelated - updated with master 🤷♂️ |
Signed-off-by: Michael Rebello <me@michaelrebello.com>
mattklein123
left a comment
There was a problem hiding this comment.
LGTM with a few small comments, thanks.
/wait
| Network::Socket::appendOptions(cluster_options, | ||
| Network::SocketOptionFactory::buildSocketSigpipeOptions()); |
There was a problem hiding this comment.
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.
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.
mattklein123
left a comment
There was a problem hiding this comment.
LGTM please check format.
/wait
Signed-off-by: Michael Rebello <me@michaelrebello.com>
|
@mattklein123 fixed |
|
And thank you for the reviews! |
|
CI failures look legit. /wait |
Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: Michael Rebello <me@michaelrebello.com>
|
Fixed most of the tests, but still working with @junr03 to resolve the rest |
Signed-off-by: Jose Nino <jnino@lyft.com>
|
Should be good now! |
Bumping upstream to include iOS fixes for SIGPIPE error handling: envoyproxy/envoy#12039 Signed-off-by: Michael Rebello <me@michaelrebello.com>
Bumping upstream to include iOS fixes for SIGPIPE error handling: envoyproxy/envoy#12039 Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: Michael Rebello <me@michaelrebello.com> Co-authored-by: Jose Nino <jnino@lyft.com> Signed-off-by: Kevin Baichoo <kbaichoo@google.com>
Signed-off-by: Michael Rebello <me@michaelrebello.com> Co-authored-by: Jose Nino <jnino@lyft.com> Signed-off-by: scheler <santosh.cheler@appdynamics.com>
Bumping upstream to include iOS fixes for SIGPIPE error handling: #12039 Signed-off-by: Michael Rebello <me@michaelrebello.com> Signed-off-by: JP Simard <jp@jpsim.com>
Bumping upstream to include iOS fixes for SIGPIPE error handling: #12039 Signed-off-by: Michael Rebello <me@michaelrebello.com> Signed-off-by: JP Simard <jp@jpsim.com>
With Envoy Mobile, we have started seeing some
SIGPIPEfatal crashes in our iOS application. This is a bit strange considering Envoy attempts to suppressSIGPIPEerrors. However, this is done at the global process-wide level, meaning something else could be re-setting it.It's worth noting that:
SIGPIPEif something changed there.This fix takes advantage of Apple's
SO_NOSIGPIPEsetting on a per-socket level to catch theSIGPIPEs 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 allSIGPIPEs.Risk Level: Low, Envoy was already attempting to suppress
SIGPIPEsTesting: Existing tests
Docs Changes: N/A
Release Notes: N/A
Signed-off-by: Michael Rebello me@michaelrebello.com
Co-authored-by: Jose Nino jnino@lyft.com