filter: check if connection is open before and after filter read/write#7256
filter: check if connection is open before and after filter read/write#7256mattklein123 merged 5 commits intoenvoyproxy:masterfrom
Conversation
Signed-off-by: Yan Xue <yxyan@google.com>
mattklein123
left a comment
There was a problem hiding this comment.
Thanks for working on this. While I think this change is generally correct, historically we have assumed that filters will stop iteration if they close the connection/stream. WDYT about just putting in asserts to this effect? it would be a much less scary change.
/wait-any
I think the assumption is totally correct but sometimes users might not follow it or they are not intend to break the assumption. I found this bug from a filter extended by istio/mixer. I think either of them is ok. I would prefer providing some tolerance when users don't follow the convention rather than terminating the process. WDYT? |
Fair enough. Sounds good. |
mattklein123
left a comment
There was a problem hiding this comment.
Thanks. My general preference here is to have a check after a filter runs, since I can see easily making that mistake, but asserts otherwise.
/wait
Signed-off-by: Yan Xue <yxyan@google.com>
mattklein123
left a comment
There was a problem hiding this comment.
Thanks, do you have test coverage for all of these new cases?
/wait
Signed-off-by: Yan Xue <yxyan@google.com>
I have 2 tests which should cover these cases. |
Signed-off-by: Yan Xue <yxyan@google.com>
|
If you were able to change the if statement after the filter call without changing your tests, I don't think your tests are complete. Please make them more robust to cover all cases. /wait |
Signed-off-by: Yan Xue <yxyan@google.com>
I didn't add test for |
|
/retest |
|
🤷♀️ nothing to rebuild. |
|
/azp run |
|
Commenter does not have sufficient privileges for PR 7256 in repo envoyproxy/envoy |
Signed-off-by: Yan Xue yxyan@google.com
Description: Check if connection is open before and after filter read/write. In
onDataoronWrite, filter could close the underlying connection.Risk Level: Low
Testing: unit test
Docs Changes: N/A
Release Notes: N/A
[Optional Fixes #Issue]
[Optional Deprecated:]