diff --git a/.bazelrc b/.bazelrc index 6df5eb871f..219518c00d 100644 --- a/.bazelrc +++ b/.bazelrc @@ -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 diff --git a/envoy b/envoy index adfe88bc7f..3267361ced 160000 --- a/envoy +++ b/envoy @@ -1 +1 @@ -Subproject commit adfe88bc7f49a8da806ff33bb156945fe6206d08 +Subproject commit 3267361cedf936e219fb467bc84d62bea05b04e7 diff --git a/library/common/engine.cc b/library/common/engine.cc index 7dc5cb7e09..2d22285c12 100644 --- a/library/common/engine.cc +++ b/library/common/engine.cc @@ -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); diff --git a/library/common/engine.h b/library/common/engine.h index af6ec860ea..6e47e1f194 100644 --- a/library/common/engine.h +++ b/library/common/engine.h @@ -138,7 +138,7 @@ class Engine : public Logger::Loggable { std::vector& 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_; diff --git a/library/common/extensions/retry/options/network_configuration/predicate.cc b/library/common/extensions/retry/options/network_configuration/predicate.cc index bb75bf3135..c5aa06c43b 100644 --- a/library/common/extensions/retry/options/network_configuration/predicate.cc +++ b/library/common/extensions/retry/options/network_configuration/predicate.cc @@ -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::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. @@ -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