Skip to content

Commit

Permalink
envoy: 3267361cedf936 (#2076)
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Nino <jnino@lyft.com>

Co-authored-by: Alan Chiu <achiu@lyft.com>
  • Loading branch information
junr03 and Alan Chiu authored Mar 2, 2022
1 parent 7899c3d commit 439a002
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ build --define cxxopts=-std=c++17
build --features=-per_object_debug_info
# Suppress deprecated declaration warnings due to extensive transitive noise from protobuf.
build --copt -Wno-deprecated-declarations
# Abseil Flag literals are compiled out by default on mobile platforms. These flags are needed for
# Envoy's runtime system. This option prevents them from being compiled out.
build --copt -DABSL_FLAGS_STRIP_NAMES=0

# Override PGV validation with NOP functions
build --@com_envoyproxy_protoc_gen_validate//bazel:template-flavor=nop
Expand Down
2 changes: 1 addition & 1 deletion envoy
Submodule envoy updated 654 files
2 changes: 1 addition & 1 deletion library/common/engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ envoy_status_t Engine::main(const std::string config, const std::string log_leve
// Ensure destructors run on Envoy's main thread.
postinit_callback_handler_.reset(nullptr);
network_configurator_.reset();
client_scope_.reset(nullptr);
client_scope_.reset();
stat_name_set_.reset();
log_delegate_ptr_.reset(nullptr);
main_common.reset(nullptr);
Expand Down
2 changes: 1 addition & 1 deletion library/common/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class Engine : public Logger::Loggable<Logger::Id::main> {
std::vector<Network::InterfacePair>& interfaces);

Event::Dispatcher* event_dispatcher_{};
Stats::ScopePtr client_scope_;
Stats::ScopeSharedPtr client_scope_;
Stats::StatNameSetPtr stat_name_set_;
envoy_engine_callbacks callbacks_;
envoy_logger logger_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,19 @@ NetworkConfigurationRetryOptionsPredicate::updateOptions(
return Upstream::RetryOptionsPredicate::UpdateOptionsReturn{absl::nullopt};
}

auto& extra_stream_info =
StreamInfo::ExtraStreamInfo* extra_stream_info =
filter_state->getDataMutable<StreamInfo::ExtraStreamInfo>(StreamInfo::ExtraStreamInfo::key());

if (extra_stream_info == nullptr) {
ENVOY_LOG(warn, "extra stream info is missing");

// Returning nullopt results in existing socket options being preserved.
return Upstream::RetryOptionsPredicate::UpdateOptionsReturn{absl::nullopt};
}

// This check is also defensive. The NetworkConfigurationFilter should always set this when
// ExtraStreaminfo is created.
if (!extra_stream_info.configuration_key_.has_value()) {
if (!extra_stream_info->configuration_key_.has_value()) {
ENVOY_LOG(warn, "network configuration key is missing");

// Returning nullopt results in existing socket options being preserved.
Expand All @@ -54,11 +61,11 @@ NetworkConfigurationRetryOptionsPredicate::updateOptions(

// Report request status to network configurator, so that socket configuration may be adapted
// to current network conditions.
network_configurator_->reportNetworkUsage(extra_stream_info.configuration_key_.value(),
network_configurator_->reportNetworkUsage(extra_stream_info->configuration_key_.value(),
network_fault);

// Update socket configuration for next retry attempt.
extra_stream_info.configuration_key_ = network_configurator_->addUpstreamSocketOptions(options);
extra_stream_info->configuration_key_ = network_configurator_->addUpstreamSocketOptions(options);

// The options returned here replace any existing socket options used for a prior attempt. At
// present, all socket options set in Envoy Mobile are provided by the NetworkConfigurator, so
Expand Down

0 comments on commit 439a002

Please sign in to comment.