Skip to content

listener: add an option to continue on listener filters timeout#7859

Merged
lizan merged 10 commits intoenvoyproxy:masterfrom
lizan:listener_filter_timeout
Aug 9, 2019
Merged

listener: add an option to continue on listener filters timeout#7859
lizan merged 10 commits intoenvoyproxy:masterfrom
lizan:listener_filter_timeout

Conversation

@lizan
Copy link
Copy Markdown
Member

@lizan lizan commented Aug 7, 2019

Signed-off-by: Lizan Zhou lizan@tetrate.io

Description:
Add an option to continue on listener filters timeout.

Risk Level: Med (mostly guarded by config)
Testing: unittest
Docs Changes: Added
Release Notes: Added
Fixes #7195

Signed-off-by: Lizan Zhou <lizan@tetrate.io>
@lizan
Copy link
Copy Markdown
Member Author

lizan commented Aug 7, 2019

no test yet, cc @silentdai

Signed-off-by: Lizan Zhou <lizan@tetrate.io>
@repokitteh-read-only
Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/.

🐱

Caused by: #7859 was synchronize by lizan.

see: more, trace.

Signed-off-by: Lizan Zhou <lizan@tetrate.io>
@repokitteh-read-only
Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/.

🐱

Caused by: #7859 was synchronize by lizan.

see: more, trace.

Signed-off-by: Lizan Zhou <lizan@tetrate.io>
@repokitteh-read-only
Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/.

🐱

Caused by: #7859 was synchronize by lizan.

see: more, trace.

@lizan lizan marked this pull request as ready for review August 8, 2019 00:52
@lizan lizan requested review from lambdai and rshriram August 8, 2019 00:57
Signed-off-by: Lizan Zhou <lizan@tetrate.io>
@repokitteh-read-only
Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/.

🐱

Caused by: #7859 was synchronize by lizan.

see: more, trace.

@lizan
Copy link
Copy Markdown
Member Author

lizan commented Aug 8, 2019

This is ready to review, PTAL

@lambdai
Copy link
Copy Markdown
Contributor

lambdai commented Aug 8, 2019

If listener option is the solution, can you add the document that a listener with proxy_protocol should not set continue_on_listener_filters_timeout?
The reason is that proxy_protocol may consume bytes instead of PEEK.

That is the initial motivation of the my PR: It's harmless for the listener to decide to close the socket, but only listener filter itself can decide whether it's appropriate to continue.

LGTM if the above case is omitted

rshriram
rshriram previously approved these changes Aug 8, 2019
Copy link
Copy Markdown
Member

@rshriram rshriram left a comment

Choose a reason for hiding this comment

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

This works as well!

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, LGTM with some small nits.

/wait

Signed-off-by: Lizan Zhou <lizan@tetrate.io>
@repokitteh-read-only
Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/.

🐱

Caused by: #7859 was synchronize by lizan.

see: more, trace.

Signed-off-by: Lizan Zhou <lizan@tetrate.io>
@repokitteh-read-only
Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/.

🐱

Caused by: #7859 was synchronize by lizan.

see: more, trace.

Signed-off-by: Lizan Zhou <lizan@tetrate.io>
@repokitteh-read-only
Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/.

🐱

Caused by: #7859 was synchronize by lizan.

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.

LGTM, also needs a format fix.

/wait

Signed-off-by: Lizan Zhou <lizan@tetrate.io>

Co-Authored-By: Matt Klein <mattklein123@gmail.com>
@repokitteh-read-only
Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/.

🐱

Caused by: #7859 was synchronize by lizan.

see: more, trace.

Signed-off-by: Lizan Zhou <lizan@tetrate.io>
@repokitteh-read-only
Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/.

🐱

Caused by: #7859 was synchronize by lizan.

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.

Nice!

* @return std::chrono::milliseconds the time to wait for all listener filters to complete
* operation. If the timeout is reached, the accepted socket is closed without a
* connection being created. 0 specifies a disabled timeout.
* connection being created unless continueOnListenerFiltersTimeout() returns true.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One random thought, thinking about the use case that @silentdai had, would it make sense to have a timeout in the listener filter config as well to enable override on a per-filter basis? In theory you might want to have different timeouts for TLS vs. some other filter. I think the point is probably moot right now, because folks have shallow (maybe typically 1 deep) filter chains, but just a consideration for future.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

A listener filter can still do their own timeout, to continue or fail, from their opaque config, such as @silentdai did in #7853. This option applies only to when listener level timeout happens.

Copy link
Copy Markdown
Contributor

@lambdai lambdai left a comment

Choose a reason for hiding this comment

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

Thank you for the update!
/approve

@lizan lizan merged commit 975c62d into envoyproxy:master Aug 9, 2019
@lizan lizan deleted the listener_filter_timeout branch August 9, 2019 23:10
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.

allow fallback to default filter chain when listener filters timeout

5 participants