thrift_proxy: fix crash when remote closes the connection#6549
thrift_proxy: fix crash when remote closes the connection#6549zuercher merged 6 commits intoenvoyproxy:masterfrom
Conversation
There's a few paths within the Thrift Proxy where we should ensure the connection is not closed, before trying to write. This change ensures that sendLocalReply() will return early if the connection is gone. It also adds a check for transformEnd(), which gets called from upstreamData(). Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
|
Will follow-up with tests in a bit. |
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
|
@rgs1 this looks correct to me -- are you going to add a test for the |
Yup, yup. For the first unit test tho, I am still figuring out why |
|
I believe
If the downstream request was partial (e.g. if the buffer didn't have a complete RPC message in it), But, small requests will fit in a buffer so this isn't just an artifact of the test. If you really want to count these as |
This ensures we correctly handle the case when the remote downstream already closed the connection. Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
|
@zuercher thanks for the detailed explanation. I am not that crazy about another counter for this special-ish case... In the meanwhile, I'll remove my comment about that counter not being incremented. @fishcakez @derekargueta thoughts? |
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
fishcakez
left a comment
There was a problem hiding this comment.
I'm not sure we need to differentiate at that level if it adds complexity, and the current behavior around having seen transportEnd makes good sense. I left a couple of nits for other metrics though.
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
zuercher
left a comment
There was a problem hiding this comment.
Look good. Thanks for picking this up.
We've been using this in prod for a couple of months and for a few different services. A few critical bugs have been fixed (envoyproxy#9089 and envoyproxy#6549) and some necessary stats/features have been added (envoyproxy#9203 and envoyproxy#8994), so it's probably a good time to graduate this filter. Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
We've been using this in prod for a couple of months and for a few different services. A few critical bugs have been fixed (envoyproxy#9089 and envoyproxy#6549) and some necessary stats/features have been added (envoyproxy#9203 and envoyproxy#8994), so it's probably a good time to graduate at least the proxy and the router filter. Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
We've been using this in prod for a couple of months and for a few different services. A few critical bugs have been fixed (#9089 and #6549) and some necessary stats/features have been added (#9203 and #8994), so it's probably a good time to graduate at least the proxy and the router filter. Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
There's a few paths within the Thrift Proxy where we should ensure
the connection is not closed, before trying to write. This change
ensures that sendLocalReply() will return early if the connection
is gone.
It also adds a check for transformEnd(), which gets called from
upstreamData().
Risk Level: low
Testing: unit tests added
Fixes: #6496
Signed-off-by: Raul Gutierrez Segales rgs@pinterest.com