network filters: add injectDataToFilterChain(data, end_stream) method to network filter callbacks#6750
Conversation
…od to network filter callbacks Signed-off-by: Yaroslav Skopets <y.skopets@gmail.com>
mattklein123
left a comment
There was a problem hiding this comment.
In general this looks great, thanks for taking this on. A few high level comments. Also, can you please work on an integration test maybe using tcp_proxy as well as a fake integration test filter that does injection? We have other test filter examples in the code base now. Thank you!
/wait
Signed-off-by: Yaroslav Skopets <y.skopets@gmail.com>
Signed-off-by: Yaroslav Skopets <y.skopets@gmail.com>
|
@mattklein123 Hi Matt! |
Signed-off-by: Yaroslav Skopets <y.skopets@gmail.com>
Signed-off-by: Yaroslav Skopets <y.skopets@gmail.com>
5e0e599 to
d8a984e
Compare
Signed-off-by: Yaroslav Skopets <y.skopets@gmail.com>
Signed-off-by: Yaroslav Skopets <y.skopets@gmail.com>
mattklein123
left a comment
There was a problem hiding this comment.
Thanks this is really impressive work. Good stuff and thanks a ton for adding the integration tests. Can you merge master to fix CI. Also, please run the new integration tests with --runs_per_test=1000 to take a look for flakes. The timing/throttling tests are particularly susceptible to flakes. Thank you!
/wait
Signed-off-by: Yaroslav Skopets <y.skopets@gmail.com>
Signed-off-by: Yaroslav Skopets <y.skopets@gmail.com>
…ilterChain` and `injectWriteDataToFilterChain` Signed-off-by: Yaroslav Skopets <y.skopets@gmail.com>
Signed-off-by: Yaroslav Skopets <y.skopets@gmail.com>
…ta-into-network-filter-chain Signed-off-by: Yaroslav Skopets <y.skopets@gmail.com>
|
@mattklein123 I'm running tests on my Mac using the following command: occasionally, 1-2 test runs fail with which must be caused by what should I do? |
|
@yskopets you will need to debug the race condition that is causing that to happen. @alyssawilk is our integration test wizard and she has a guide that is helpful here: https://github.com/envoyproxy/envoy/tree/master/test/integration#reproducing-test-flakes /wait |
…ta-into-network-filter-chain Signed-off-by: Yaroslav Skopets <y.skopets@gmail.com>
Signed-off-by: Yaroslav Skopets <y.skopets@gmail.com>
|
@mattklein123 Hi Matt, Sorry, I don't see where the issue might be. I don't think it's caused by timer events in a test filter. When I run the same way one of the existing tests, I observe exactly the same behaviour - 1-2 test runs fail. E.g. |
OK that's fine. I'm mostly just interested in whether your tests are flaking. You can also just run your test specifically in a loop using |
|
Thank you! |
lizan
left a comment
There was a problem hiding this comment.
Great work!
Risk Level: Low
I would at least rate this PR as Med risk or more, the change is large and involving the core of connection management.
mattklein123
left a comment
There was a problem hiding this comment.
Thanks, very impressive work. Can you merge master to pick up CI flake fixes?
/wait
Agreed, good call out @lizan. |
Signed-off-by: Yaroslav Skopets <y.skopets@gmail.com>
…ta-into-network-filter-chain Signed-off-by: Yaroslav Skopets <y.skopets@gmail.com>
|
@lizan @mattklein123 I've changed risk level to "Medium" (since it's mostly a refactoring and majority of the new code are tests). Let me know if I should update it to "High". |
* master: (88 commits) upstream: Null-deref on TCP health checker if setsockopt fails (envoyproxy#6793) ci: switch macOS CI to azure pipelines (envoyproxy#6889) os syscalls lib: break apart syscalls used for hot restart (envoyproxy#6880) Kafka codec: precompute request size before serialization, so we do n… (envoyproxy#6862) upstream: move static and strict_dns clusters to dedicated files (envoyproxy#6886) Rollforward of api: Add total_issued_requests to Upstream Locality and Endpoint Stats. (envoyproxy#6692) (envoyproxy#6784) fix explicit constructor in copy-initialization (envoyproxy#6884) stats: use tag iterator rather than constructing the tag-array and searching that. (envoyproxy#6853) common: use unscoped build target in generate_version_linkstamp (envoyproxy#6877) Addendum to envoyproxy#6778 (envoyproxy#6882) ci: add minimum Linux build for Azure Pipelines (envoyproxy#6881) grpc: utilities for inter-converting grpc::ByteBuffer and Buffer::Instance. (envoyproxy#6732) upstream: allow excluding hosts from lb calculations until initial health check (envoyproxy#6794) stats: prevent unused counters from leaking across hot restart (envoyproxy#6850) network filters: add `injectDataToFilterChain(data, end_stream)` method to network filter callbacks (envoyproxy#6750) delete things that snuck back in (envoyproxy#6873) config: scoped rds (2b): support delta APIs in ConfigProvider framework (envoyproxy#6781) string == string! (envoyproxy#6868) config: add mssing imports to delta_subscription_state (envoyproxy#6869) protobuf: add missing default case to enum (envoyproxy#6870) ... Signed-off-by: Michael Puncel <mpuncel@squareup.com>
Description: Similarly to HTTP use case, add
injectDataToFilterChain(data, end_stream)methodto network filter callbacks (see #6640).
This method should be used in advanced cases in which a filter needs full control over
how subsequent filters view data.
Using this method allows a filter to buffer data (or not) and then periodically inject data
to subsequent filters, indicating end_stream at an appropriate time.
Example use cases include:
Risk Level: Medium
Testing: unit tests, integration tests
Docs Changes: N/A
Release Notes: N/A
Fixes #6640