-
Notifications
You must be signed in to change notification settings - Fork 93
Update Envoy to f95f5391b0b8683081ec786ea946026594955fc6 #562
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
Changes from 3 commits
1a08d1d
e717c91
49106b6
dc0b618
6136e81
30d7f20
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,9 +21,10 @@ void StreamDecoder::decodeHeaders(Envoy::Http::ResponseHeaderMapPtr&& headers, b | |
| stream_info_.response_code_ = static_cast<uint32_t>(response_code); | ||
| if (!latency_response_header_name_.empty()) { | ||
| const auto timing_header_name = Envoy::Http::LowerCaseString(latency_response_header_name_); | ||
| const Envoy::Http::HeaderEntry* timing_header = response_headers_->get(timing_header_name); | ||
| if (timing_header != nullptr) { | ||
| absl::string_view timing_value = timing_header->value().getStringView(); | ||
| const Envoy::Http::HeaderMap::GetResult& timing_header = | ||
| response_headers_->get(timing_header_name); | ||
| if (!timing_header.empty()) { | ||
| absl::string_view timing_value = timing_header[0]->value().getStringView(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could possibly use a comment or maybe even an assertion of sorts. It looks like the envoy function was changed to now allow multiple HeaderEntries to be returned rather than one? I gather that our use case would always expect only one - would it be reasonable to add a failure here if we received more than one?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added a sparse warning log line in dc0b618 and also testing for that case to make sure we don't track timings when there's ambiguity because of multiple header/value pairs. |
||
| int64_t origin_delta; | ||
| if (absl::SimpleAtoi(timing_value, &origin_delta) && origin_delta >= 0) { | ||
| origin_latency_statistic_.addValue(origin_delta); | ||
|
|
@@ -142,6 +143,7 @@ StreamDecoder::streamResetReasonToResponseFlag(Envoy::Http::StreamResetReason re | |
| return Envoy::StreamInfo::ResponseFlag::LocalReset; | ||
| case Envoy::Http::StreamResetReason::Overflow: | ||
| return Envoy::StreamInfo::ResponseFlag::UpstreamOverflow; | ||
| case Envoy::Http::StreamResetReason::ConnectError: | ||
| case Envoy::Http::StreamResetReason::RemoteReset: | ||
| case Envoy::Http::StreamResetReason::RemoteRefusedStreamReset: | ||
| return Envoy::StreamInfo::ResponseFlag::UpstreamRemoteReset; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,11 +13,11 @@ FilterConfigurationBase::FilterConfigurationBase( | |
|
|
||
| void FilterConfigurationBase::computeEffectiveConfiguration( | ||
| const Envoy::Http::RequestHeaderMap& headers) { | ||
| const auto* request_config_header = headers.get(TestServer::HeaderNames::get().TestServerConfig); | ||
| if (request_config_header) { | ||
| const auto& request_config_header = headers.get(TestServer::HeaderNames::get().TestServerConfig); | ||
| if (request_config_header.size() == 1) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we have an else condition here now? again, taking into consideration receiving more than 1
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, you're right. Done in dc0b618 + explicit tests for the case. |
||
| nighthawk::server::ResponseOptions response_options = *server_config_; | ||
| std::string error_message; | ||
| if (Configuration::mergeJsonConfig(request_config_header->value().getStringView(), | ||
| if (Configuration::mergeJsonConfig(request_config_header[0]->value().getStringView(), | ||
| response_options, error_message)) { | ||
| effective_config_ = | ||
| std::make_shared<const nighthawk::server::ResponseOptions>(std::move(response_options)); | ||
|
|
||
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.
This seems to be the first instance where us just using envoy's .bazelrc isn't great for us. No action required here on this PR, but we should keep an eye on it.