Skip to content

listener: remove the peek from the listener filters#20728

Merged
mattklein123 merged 18 commits intoenvoyproxy:mainfrom
soulxu:remove_peek_data_again
Apr 18, 2022
Merged

listener: remove the peek from the listener filters#20728
mattklein123 merged 18 commits intoenvoyproxy:mainfrom
soulxu:remove_peek_data_again

Conversation

@soulxu
Copy link
Copy Markdown
Member

@soulxu soulxu commented Apr 8, 2022

Commit Message: listener: remove the peek from the listener filters
Additional Description:
To avoid the listener filters to peek the data from the socket directly, allow the ActiveTcpSocket to peek the data
into the buffer. The ActiveTcpSocket will get the max data expected from the filters through the
filter interface size_t maxReadBytes(). Then ActiveTcpSocket will listen on the file event on the socket.
And peek the data into the buffer. And calling the listener filter callback onData(Buffer::Instance&).

If the filter doesn't need any data from the connection, it should return 0 on the interface 'maxReadBytes()'.
The ActiveTcpSocket won't listen on the file event if there is no filter expecting any data.

The buffer will be shared across the listener filter. no duplicated peek need anymore.

The buffer is implemented by ListenerFilterBufferImpl. It will store the data peeked from the socket, and provide
the const pointer to the listener filter to access the data. It also provides the interface for listener filter to drain the data,
and the data will be drained on the socket in the end.

Risk Level: high
Testing: unit tests and integration tests
Docs Changes: add document for the new stats
Release Notes: add release note for new stats
Fixes: #17229

Signed-off-by: He Jie Xu hejie.xu@intel.com

soulxu added 3 commits April 8, 2022 04:35
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
@soulxu
Copy link
Copy Markdown
Member Author

soulxu commented Apr 8, 2022

@mattklein123 @ggreenway @kyessenov I fixed the HTTP inspect issue, also comment inline for what was wrong in the previous.

@kyessenov let me know if there is a way to trigger the istio CI to test on under-review PR. It is still scare me for this huge PR break something. Thanks for helping diagnosing the issue and add integration again!

Signed-off-by: He Jie Xu <hejie.xu@intel.com>
@soulxu
Copy link
Copy Markdown
Member Author

soulxu commented Apr 8, 2022

/wait

soulxu added 7 commits April 9, 2022 01:52
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
@soulxu
Copy link
Copy Markdown
Member Author

soulxu commented Apr 10, 2022

/wait

soulxu added 2 commits April 10, 2022 13:23
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
@soulxu
Copy link
Copy Markdown
Member Author

soulxu commented Apr 11, 2022

/wait

adding more integration test for multiple filters.

soulxu added 2 commits April 12, 2022 01:15
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
@soulxu
Copy link
Copy Markdown
Member Author

soulxu commented Apr 12, 2022

Summary what changed here:

@mattklein123 @kyessenov This is ready for review. Sorry for more change here, that probably will spend your more review bandwidth. Thanks in advance!

Signed-off-by: He Jie Xu <hejie.xu@intel.com>
@mattklein123
Copy link
Copy Markdown
Member

We are going to cut a release this week. Given the risk of this PR let's hold on re-applying until right after we cut the release, so we can merge early next week. Thank you!

@soulxu
Copy link
Copy Markdown
Member Author

soulxu commented Apr 12, 2022

We are going to cut a release this week. Given the risk of this PR let's hold on re-applying until right after we cut the release, so we can merge early next week. Thank you!

Got it, thanks!

@mattklein123
Copy link
Copy Markdown
Member

Can you merge main to move the release note to the new current.rst and then we can merge? Thank you.

/wait

Copy link
Copy Markdown
Contributor

@kyessenov kyessenov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding multiple inspector tests.

Signed-off-by: He Jie Xu <hejie.xu@intel.com>
@soulxu
Copy link
Copy Markdown
Member Author

soulxu commented Apr 15, 2022

Can you merge main to move the release note to the new current.rst and then we can merge? Thank you.

/wait

thanks! done.

Signed-off-by: He Jie Xu <hejie.xu@intel.com>
@soulxu
Copy link
Copy Markdown
Member Author

soulxu commented Apr 17, 2022

/retest

@repokitteh-read-only
Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #20728 (comment) was created by @soulxu.

see: more, trace.

@soulxu
Copy link
Copy Markdown
Member Author

soulxu commented Apr 17, 2022

/retest

@repokitteh-read-only
Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #20728 (comment) was created by @soulxu.

see: more, trace.

Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working through the fix and getting it back in!

@mattklein123 mattklein123 merged commit 30ebb2c into envoyproxy:main Apr 18, 2022
vehre-x41 pushed a commit to vehre-x41/envoy that referenced this pull request Apr 19, 2022
Signed-off-by: He Jie Xu <hejie.xu@intel.com>
Signed-off-by: Andre Vehreschild <vehre@x41-dsec.de>
ravenblackx pushed a commit to ravenblackx/envoy that referenced this pull request Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

envoy should read the data from the buffer Instead of listener filter to peek the data from socket buffer directly

3 participants