-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
request_id_extension: Add noop impl by default #10687
request_id_extension: Add noop impl by default #10687
Conversation
Signed-off-by: Ruslan Nigmatullin <elessar@dropbox.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks this looks right, thanks. Can you add some tests? Both maybe in the TCP proxy case explicitly and also in stream_info_impl_test to make sure the NOP impl behaves correctly? Thank you!
/wait
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
namespace { | ||
|
||
// NoopRequestIDExtension is the implementation used outside of HTTP context. | ||
class NoopRequestIDExtension : public RequestIDExtension { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: it would be nice to get coverage of the other methods here in the unit test you added.
@@ -20,12 +21,14 @@ struct StreamInfoImpl : public StreamInfo { | |||
StreamInfoImpl(TimeSource& time_source) | |||
: time_source_(time_source), start_time_(time_source.systemTime()), | |||
start_time_monotonic_(time_source.monotonicTime()), | |||
filter_state_(std::make_shared<FilterStateImpl>(FilterState::LifeSpan::FilterChain)) {} | |||
filter_state_(std::make_shared<FilterStateImpl>(FilterState::LifeSpan::FilterChain)), | |||
request_id_extension_(Http::RequestIDExtensionFactory::noopInstance()) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking at this, I think these constructors can mostly be collapsed with each one invoking the previous with fewer arguments. This would be a nice follow up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, will send a follow up pr. Does it need a TODO for the time being?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #10691, will rebase once this one is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Description: By default use noop
RequestIDExtension
implementation inStreamInfo
. This allows avoiding nullptr checks outside of HTTP context.Risk Level: low
Testing: added unit test, updated integration test (crashes without
StreamInfoImpl
changes)Docs Changes: n/a
Release Notes: n/a
Fixes #10686