From 959fd1f5113fe3e44d1cac48fbb4401c5e93870a Mon Sep 17 00:00:00 2001 From: Martin Matusiak Date: Thu, 25 Jun 2020 08:18:51 +1000 Subject: [PATCH 01/27] api: rename num_retries to max_retries (#11729) This PR proposes to rename the RetryPolicy field num_retries to max_retries. This parameter exists in two places: 1) the RetryPolicy message in the route configuration and 2) the header x-envoy-max-retries. The naming inconsistency is a UX papercut. max_retries feels like right name for what this field is for ie. the maximum number of retries that are permitted. There is also a stripped down RetryPolicy message which is used by RemoteDataSource which has a num_retries field. I'm including a matching rename of that for consistency. Risk Level: Low Testing: N/A Docs Changes: N/A Release Notes: N/A Signed-off-by: Martin Matusiak Signed-off-by: chaoqinli --- api/envoy/config/core/v3/base.proto | 4 +++- api/envoy/config/core/v4alpha/base.proto | 2 +- api/envoy/config/route/v3/route_components.proto | 4 +++- api/envoy/config/route/v4alpha/route_components.proto | 2 +- generated_api_shadow/envoy/config/core/v3/base.proto | 4 +++- generated_api_shadow/envoy/config/core/v4alpha/base.proto | 2 +- .../envoy/config/route/v3/route_components.proto | 4 +++- .../envoy/config/route/v4alpha/route_components.proto | 2 +- 8 files changed, 16 insertions(+), 8 deletions(-) diff --git a/api/envoy/config/core/v3/base.proto b/api/envoy/config/core/v3/base.proto index b8ce5bff4bd5..6175e585d708 100644 --- a/api/envoy/config/core/v3/base.proto +++ b/api/envoy/config/core/v3/base.proto @@ -13,6 +13,7 @@ import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; +import "udpa/annotations/migrate.proto"; import "udpa/annotations/status.proto"; import "udpa/annotations/versioning.proto"; import "validate/validate.proto"; @@ -332,7 +333,8 @@ message RetryPolicy { // Specifies the allowed number of retries. This parameter is optional and // defaults to 1. - google.protobuf.UInt32Value num_retries = 2; + google.protobuf.UInt32Value num_retries = 2 + [(udpa.annotations.field_migrate).rename = "max_retries"]; } // The message specifies how to fetch data from remote and how to verify it. diff --git a/api/envoy/config/core/v4alpha/base.proto b/api/envoy/config/core/v4alpha/base.proto index dbc3c31e40e4..29364d51b5b8 100644 --- a/api/envoy/config/core/v4alpha/base.proto +++ b/api/envoy/config/core/v4alpha/base.proto @@ -332,7 +332,7 @@ message RetryPolicy { // Specifies the allowed number of retries. This parameter is optional and // defaults to 1. - google.protobuf.UInt32Value num_retries = 2; + google.protobuf.UInt32Value max_retries = 2; } // The message specifies how to fetch data from remote and how to verify it. diff --git a/api/envoy/config/route/v3/route_components.proto b/api/envoy/config/route/v3/route_components.proto index 33fa2779f727..e51f4ab87d93 100644 --- a/api/envoy/config/route/v3/route_components.proto +++ b/api/envoy/config/route/v3/route_components.proto @@ -17,6 +17,7 @@ import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; import "envoy/annotations/deprecation.proto"; +import "udpa/annotations/migrate.proto"; import "udpa/annotations/status.proto"; import "udpa/annotations/versioning.proto"; import "validate/validate.proto"; @@ -1085,7 +1086,8 @@ message RetryPolicy { // Specifies the allowed number of retries. This parameter is optional and // defaults to 1. These are the same conditions documented for // :ref:`config_http_filters_router_x-envoy-max-retries`. - google.protobuf.UInt32Value num_retries = 2; + google.protobuf.UInt32Value num_retries = 2 + [(udpa.annotations.field_migrate).rename = "max_retries"]; // Specifies a non-zero upstream timeout per retry attempt. This parameter is optional. The // same conditions documented for diff --git a/api/envoy/config/route/v4alpha/route_components.proto b/api/envoy/config/route/v4alpha/route_components.proto index 02161ffd48ef..741ff2cd540d 100644 --- a/api/envoy/config/route/v4alpha/route_components.proto +++ b/api/envoy/config/route/v4alpha/route_components.proto @@ -1064,7 +1064,7 @@ message RetryPolicy { // Specifies the allowed number of retries. This parameter is optional and // defaults to 1. These are the same conditions documented for // :ref:`config_http_filters_router_x-envoy-max-retries`. - google.protobuf.UInt32Value num_retries = 2; + google.protobuf.UInt32Value max_retries = 2; // Specifies a non-zero upstream timeout per retry attempt. This parameter is optional. The // same conditions documented for diff --git a/generated_api_shadow/envoy/config/core/v3/base.proto b/generated_api_shadow/envoy/config/core/v3/base.proto index 6f8c1129ac0f..af93ab8e9a09 100644 --- a/generated_api_shadow/envoy/config/core/v3/base.proto +++ b/generated_api_shadow/envoy/config/core/v3/base.proto @@ -13,6 +13,7 @@ import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; +import "udpa/annotations/migrate.proto"; import "udpa/annotations/status.proto"; import "udpa/annotations/versioning.proto"; import "validate/validate.proto"; @@ -330,7 +331,8 @@ message RetryPolicy { // Specifies the allowed number of retries. This parameter is optional and // defaults to 1. - google.protobuf.UInt32Value num_retries = 2; + google.protobuf.UInt32Value num_retries = 2 + [(udpa.annotations.field_migrate).rename = "max_retries"]; } // The message specifies how to fetch data from remote and how to verify it. diff --git a/generated_api_shadow/envoy/config/core/v4alpha/base.proto b/generated_api_shadow/envoy/config/core/v4alpha/base.proto index dbc3c31e40e4..29364d51b5b8 100644 --- a/generated_api_shadow/envoy/config/core/v4alpha/base.proto +++ b/generated_api_shadow/envoy/config/core/v4alpha/base.proto @@ -332,7 +332,7 @@ message RetryPolicy { // Specifies the allowed number of retries. This parameter is optional and // defaults to 1. - google.protobuf.UInt32Value num_retries = 2; + google.protobuf.UInt32Value max_retries = 2; } // The message specifies how to fetch data from remote and how to verify it. diff --git a/generated_api_shadow/envoy/config/route/v3/route_components.proto b/generated_api_shadow/envoy/config/route/v3/route_components.proto index db7dec95dd26..0c1b7fd6ce7b 100644 --- a/generated_api_shadow/envoy/config/route/v3/route_components.proto +++ b/generated_api_shadow/envoy/config/route/v3/route_components.proto @@ -17,6 +17,7 @@ import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; import "envoy/annotations/deprecation.proto"; +import "udpa/annotations/migrate.proto"; import "udpa/annotations/status.proto"; import "udpa/annotations/versioning.proto"; import "validate/validate.proto"; @@ -1092,7 +1093,8 @@ message RetryPolicy { // Specifies the allowed number of retries. This parameter is optional and // defaults to 1. These are the same conditions documented for // :ref:`config_http_filters_router_x-envoy-max-retries`. - google.protobuf.UInt32Value num_retries = 2; + google.protobuf.UInt32Value num_retries = 2 + [(udpa.annotations.field_migrate).rename = "max_retries"]; // Specifies a non-zero upstream timeout per retry attempt. This parameter is optional. The // same conditions documented for diff --git a/generated_api_shadow/envoy/config/route/v4alpha/route_components.proto b/generated_api_shadow/envoy/config/route/v4alpha/route_components.proto index f8622decd12a..a107ecf7efbf 100644 --- a/generated_api_shadow/envoy/config/route/v4alpha/route_components.proto +++ b/generated_api_shadow/envoy/config/route/v4alpha/route_components.proto @@ -1092,7 +1092,7 @@ message RetryPolicy { // Specifies the allowed number of retries. This parameter is optional and // defaults to 1. These are the same conditions documented for // :ref:`config_http_filters_router_x-envoy-max-retries`. - google.protobuf.UInt32Value num_retries = 2; + google.protobuf.UInt32Value max_retries = 2; // Specifies a non-zero upstream timeout per retry attempt. This parameter is optional. The // same conditions documented for From 41e092a121304fd96eca23e07a0c65e264d4f9a6 Mon Sep 17 00:00:00 2001 From: foreseeable Date: Thu, 25 Jun 2020 00:24:58 +0000 Subject: [PATCH 02/27] test: Split huge monolith mock header to speed up test compilation (#11649) Commit Message: Split huge monolith mock header to speed up test compilation Additional Description: `cluster_manager_test` only used a simple mock class `MockAdmin` from `test/mocks/server/mocks.h`, which is a huge mock library. After splitting, the overall build time for `cluster_manager_test` reduced from 143.481s to 82.443s in my build cluster. Risk Level: low Testing: existing tests Docs Changes: N/A Release Notes: no Related Issues: #10917 Signed-off-by: Muge Chen Signed-off-by: chaoqinli --- test/mocks/server/BUILD | 21 +++++++++ test/mocks/server/admin.cc | 18 ++++++++ test/mocks/server/admin.h | 39 ++++++++++++++++ test/mocks/server/config_tracker.cc | 26 +++++++++++ test/mocks/server/config_tracker.h | 30 +++++++++++++ test/mocks/server/mocks.cc | 15 ------- test/mocks/server/mocks.h | 45 +------------------ test/server/config_validation/BUILD | 3 +- .../config_validation/cluster_manager_test.cc | 3 +- 9 files changed, 140 insertions(+), 60 deletions(-) create mode 100644 test/mocks/server/admin.cc create mode 100644 test/mocks/server/admin.h create mode 100644 test/mocks/server/config_tracker.cc create mode 100644 test/mocks/server/config_tracker.h diff --git a/test/mocks/server/BUILD b/test/mocks/server/BUILD index c6fcf62562ed..a907ca21feb7 100644 --- a/test/mocks/server/BUILD +++ b/test/mocks/server/BUILD @@ -8,6 +8,25 @@ licenses(["notice"]) # Apache 2 envoy_package() +envoy_cc_mock( + name = "config_tracker_mocks", + srcs = ["config_tracker.cc"], + hdrs = ["config_tracker.h"], + deps = [ + "//include/envoy/server:configuration_interface", + ], +) + +envoy_cc_mock( + name = "admin_mocks", + srcs = ["admin.cc"], + hdrs = ["admin.h"], + deps = [ + "//include/envoy/server:admin_interface", + "//test/mocks/server:config_tracker_mocks", + ], +) + envoy_cc_mock( name = "server_mocks", srcs = ["mocks.cc"], @@ -44,6 +63,8 @@ envoy_cc_mock( "//test/mocks/router:router_mocks", "//test/mocks/runtime:runtime_mocks", "//test/mocks/secret:secret_mocks", + "//test/mocks/server:admin_mocks", + "//test/mocks/server:config_tracker_mocks", "//test/mocks/thread_local:thread_local_mocks", "//test/mocks/tracing:tracing_mocks", "//test/mocks/upstream:upstream_mocks", diff --git a/test/mocks/server/admin.cc b/test/mocks/server/admin.cc new file mode 100644 index 000000000000..2411ef375f00 --- /dev/null +++ b/test/mocks/server/admin.cc @@ -0,0 +1,18 @@ +#include "admin.h" + +#include + +#include "gmock/gmock.h" +#include "gtest/gtest.h" + +namespace Envoy { +namespace Server { +MockAdmin::MockAdmin() { + ON_CALL(*this, getConfigTracker()).WillByDefault(testing::ReturnRef(config_tracker_)); +} + +MockAdmin::~MockAdmin() = default; + +} // namespace Server + +} // namespace Envoy diff --git a/test/mocks/server/admin.h b/test/mocks/server/admin.h new file mode 100644 index 000000000000..2a82d23859c6 --- /dev/null +++ b/test/mocks/server/admin.h @@ -0,0 +1,39 @@ +#pragma once + +#include + +#include "envoy/server/admin.h" + +#include "absl/strings/string_view.h" +#include "config_tracker.h" +#include "gmock/gmock.h" + +namespace Envoy { +namespace Server { +class MockAdmin : public Admin { +public: + MockAdmin(); + ~MockAdmin() override; + + // Server::Admin + MOCK_METHOD(bool, addHandler, + (const std::string& prefix, const std::string& help_text, HandlerCb callback, + bool removable, bool mutates_server_state)); + MOCK_METHOD(bool, removeHandler, (const std::string& prefix)); + MOCK_METHOD(Network::Socket&, socket, ()); + MOCK_METHOD(ConfigTracker&, getConfigTracker, ()); + MOCK_METHOD(void, startHttpListener, + (const std::string& access_log_path, const std::string& address_out_path, + Network::Address::InstanceConstSharedPtr address, + const Network::Socket::OptionsSharedPtr& socket_options, + Stats::ScopePtr&& listener_scope)); + MOCK_METHOD(Http::Code, request, + (absl::string_view path_and_query, absl::string_view method, + Http::ResponseHeaderMap& response_headers, std::string& body)); + MOCK_METHOD(void, addListenerToHandler, (Network::ConnectionHandler * handler)); + + ::testing::NiceMock config_tracker_; +}; +} // namespace Server + +} // namespace Envoy diff --git a/test/mocks/server/config_tracker.cc b/test/mocks/server/config_tracker.cc new file mode 100644 index 000000000000..bf53f7501e3a --- /dev/null +++ b/test/mocks/server/config_tracker.cc @@ -0,0 +1,26 @@ +#include "config_tracker.h" + +#include + +#include "gmock/gmock.h" +#include "gtest/gtest.h" + +namespace Envoy { +namespace Server { + +using ::testing::_; +using ::testing::Invoke; + +MockConfigTracker::MockConfigTracker() { + ON_CALL(*this, add_(_, _)) + .WillByDefault(Invoke([this](const std::string& key, Cb callback) -> EntryOwner* { + EXPECT_TRUE(config_tracker_callbacks_.find(key) == config_tracker_callbacks_.end()); + config_tracker_callbacks_[key] = callback; + return new MockEntryOwner(); + })); +} + +MockConfigTracker::~MockConfigTracker() = default; + +} // namespace Server +} // namespace Envoy diff --git a/test/mocks/server/config_tracker.h b/test/mocks/server/config_tracker.h new file mode 100644 index 000000000000..a84b87c7feb0 --- /dev/null +++ b/test/mocks/server/config_tracker.h @@ -0,0 +1,30 @@ +#pragma once + +#include + +#include "envoy/server/config_tracker.h" + +#include "gmock/gmock.h" + +namespace Envoy { +namespace Server { +class MockConfigTracker : public ConfigTracker { +public: + MockConfigTracker(); + ~MockConfigTracker() override; + + struct MockEntryOwner : public EntryOwner {}; + + MOCK_METHOD(EntryOwner*, add_, (std::string, Cb)); + + // Server::ConfigTracker + MOCK_METHOD(const CbsMap&, getCallbacksMap, (), (const)); + EntryOwnerPtr add(const std::string& key, Cb callback) override { + return EntryOwnerPtr{add_(key, std::move(callback))}; + } + + std::unordered_map config_tracker_callbacks_; +}; +} // namespace Server + +} // namespace Envoy diff --git a/test/mocks/server/mocks.cc b/test/mocks/server/mocks.cc index e5b7fb43c63b..e9fc293558c5 100644 --- a/test/mocks/server/mocks.cc +++ b/test/mocks/server/mocks.cc @@ -53,21 +53,6 @@ MockOptions::MockOptions(const std::string& config_path) : config_path_(config_p } MockOptions::~MockOptions() = default; -MockConfigTracker::MockConfigTracker() { - ON_CALL(*this, add_(_, _)) - .WillByDefault(Invoke([this](const std::string& key, Cb callback) -> EntryOwner* { - EXPECT_TRUE(config_tracker_callbacks_.find(key) == config_tracker_callbacks_.end()); - config_tracker_callbacks_[key] = callback; - return new MockEntryOwner(); - })); -} -MockConfigTracker::~MockConfigTracker() = default; - -MockAdmin::MockAdmin() { - ON_CALL(*this, getConfigTracker()).WillByDefault(testing::ReturnRef(config_tracker_)); -} -MockAdmin::~MockAdmin() = default; - MockAdminStream::MockAdminStream() = default; MockAdminStream::~MockAdminStream() = default; diff --git a/test/mocks/server/mocks.h b/test/mocks/server/mocks.h index 6e5060014f72..1685d0f706d2 100644 --- a/test/mocks/server/mocks.h +++ b/test/mocks/server/mocks.h @@ -53,6 +53,8 @@ #include "test/test_common/test_time_system.h" #include "absl/strings/string_view.h" +#include "admin.h" +#include "config_tracker.h" #include "gmock/gmock.h" #include "spdlog/spdlog.h" @@ -128,49 +130,6 @@ class MockOptions : public Options { std::vector disabled_extensions_; }; -class MockConfigTracker : public ConfigTracker { -public: - MockConfigTracker(); - ~MockConfigTracker() override; - - struct MockEntryOwner : public EntryOwner {}; - - MOCK_METHOD(EntryOwner*, add_, (std::string, Cb)); - - // Server::ConfigTracker - MOCK_METHOD(const CbsMap&, getCallbacksMap, (), (const)); - EntryOwnerPtr add(const std::string& key, Cb callback) override { - return EntryOwnerPtr{add_(key, std::move(callback))}; - } - - std::unordered_map config_tracker_callbacks_; -}; - -class MockAdmin : public Admin { -public: - MockAdmin(); - ~MockAdmin() override; - - // Server::Admin - MOCK_METHOD(bool, addHandler, - (const std::string& prefix, const std::string& help_text, HandlerCb callback, - bool removable, bool mutates_server_state)); - MOCK_METHOD(bool, removeHandler, (const std::string& prefix)); - MOCK_METHOD(Network::Socket&, socket, ()); - MOCK_METHOD(ConfigTracker&, getConfigTracker, ()); - MOCK_METHOD(void, startHttpListener, - (const std::string& access_log_path, const std::string& address_out_path, - Network::Address::InstanceConstSharedPtr address, - const Network::Socket::OptionsSharedPtr& socket_options, - Stats::ScopePtr&& listener_scope)); - MOCK_METHOD(Http::Code, request, - (absl::string_view path_and_query, absl::string_view method, - Http::ResponseHeaderMap& response_headers, std::string& body)); - MOCK_METHOD(void, addListenerToHandler, (Network::ConnectionHandler * handler)); - - NiceMock config_tracker_; -}; - class MockAdminStream : public AdminStream { public: MockAdminStream(); diff --git a/test/server/config_validation/BUILD b/test/server/config_validation/BUILD index 19942cb6d89e..086575831d1f 100644 --- a/test/server/config_validation/BUILD +++ b/test/server/config_validation/BUILD @@ -27,6 +27,7 @@ envoy_cc_test( "//include/envoy/upstream:resource_manager_interface", "//include/envoy/upstream:upstream_interface", "//source/common/api:api_lib", + "//source/common/singleton:manager_impl_lib", "//source/common/stats:stats_lib", "//source/extensions/transport_sockets/tls:context_lib", "//source/server/config_validation:cluster_manager_lib", @@ -39,7 +40,7 @@ envoy_cc_test( "//test/mocks/protobuf:protobuf_mocks", "//test/mocks/runtime:runtime_mocks", "//test/mocks/secret:secret_mocks", - "//test/mocks/server:server_mocks", + "//test/mocks/server:admin_mocks", "//test/mocks/thread_local:thread_local_mocks", "//test/mocks/upstream:upstream_mocks", "//test/test_common:simulated_time_system_lib", diff --git a/test/server/config_validation/cluster_manager_test.cc b/test/server/config_validation/cluster_manager_test.cc index cd6cfdbb9b56..a1475f197281 100644 --- a/test/server/config_validation/cluster_manager_test.cc +++ b/test/server/config_validation/cluster_manager_test.cc @@ -3,6 +3,7 @@ #include "envoy/upstream/upstream.h" #include "common/api/api_impl.h" +#include "common/grpc/context_impl.h" #include "common/http/context_impl.h" #include "common/singleton/manager_impl.h" @@ -18,7 +19,7 @@ #include "test/mocks/protobuf/mocks.h" #include "test/mocks/runtime/mocks.h" #include "test/mocks/secret/mocks.h" -#include "test/mocks/server/mocks.h" +#include "test/mocks/server/admin.h" #include "test/mocks/thread_local/mocks.h" #include "test/mocks/upstream/mocks.h" #include "test/test_common/simulated_time_system.h" From 3eb115bc2d3f352a04e42abedf5b33b2641e2ca3 Mon Sep 17 00:00:00 2001 From: alyssawilk Date: Thu, 25 Jun 2020 00:41:46 -0400 Subject: [PATCH 03/27] build: removing hard-coded extension from generate_extension_db.py (#11711) Risk Level: Low Testing: n/a Docs Changes: n/a Release Notes: n/a Signed-off-by: Alyssa Wilk Signed-off-by: chaoqinli --- docs/generate_extension_db.py | 5 ++++- source/extensions/extensions_build_config.bzl | 5 +---- source/server/BUILD | 2 -- test/extensions/filters/http/common/fuzz/BUILD | 1 + 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/generate_extension_db.py b/docs/generate_extension_db.py index 726a4cac1eb5..fe7b5aa70c98 100755 --- a/docs/generate_extension_db.py +++ b/docs/generate_extension_db.py @@ -55,8 +55,11 @@ def GetExtensionMetadata(target): extension_db = {} for extension, target in extensions_build_config.EXTENSIONS.items(): extension_db[extension] = GetExtensionMetadata(target) - # The TLS transport extension is not in source/extensions/extensions_build_config.bzl + # The TLS and generic upstream extensions are hard-coded into the build, so + # not in source/extensions/extensions_build_config.bzl extension_db['envoy.transport_sockets.tls'] = GetExtensionMetadata( '//source/extensions/transport_sockets/tls:config') + extension_db['envoy.upstreams.http.generic'] = GetExtensionMetadata( + '//source/extensions/upstreams/http/generic:config') pathlib.Path(output_path).write_text(json.dumps(extension_db)) diff --git a/source/extensions/extensions_build_config.bzl b/source/extensions/extensions_build_config.bzl index 2f11d428f0af..8c1e615a26a8 100644 --- a/source/extensions/extensions_build_config.bzl +++ b/source/extensions/extensions_build_config.bzl @@ -191,10 +191,7 @@ EXTENSIONS = { "envoy.internal_redirect_predicates.previous_routes": "//source/extensions/internal_redirect/previous_routes:config", "envoy.internal_redirect_predicates.safe_cross_scheme": "//source/extensions/internal_redirect/safe_cross_scheme:config", - # Http Upstreams - # TODO(alyssawilk) these are linked in the default build and shouldn't be here: fix tooling and remove. - - "envoy.upstreams.http.generic": "//source/extensions/upstreams/http/generic:config", + # Http Upstreams (excepting envoy.upstreams.http.generic which is hard-coded into the build so not registered here) "envoy.upstreams.http.http": "//source/extensions/upstreams/http/http:config", "envoy.upstreams.http.tcp": "//source/extensions/upstreams/http/tcp:config", diff --git a/source/server/BUILD b/source/server/BUILD index 36809ab90e85..bbb8dc655b76 100644 --- a/source/server/BUILD +++ b/source/server/BUILD @@ -329,8 +329,6 @@ envoy_cc_library( "//source/extensions/filters/network/http_connection_manager:config", "//source/extensions/transport_sockets:well_known_names", "//source/extensions/upstreams/http/generic:config", - "//source/extensions/upstreams/http/http:config", - "//source/extensions/upstreams/http/tcp:config", "@envoy_api//envoy/admin/v3:pkg_cc_proto", "@envoy_api//envoy/api/v2:pkg_cc_proto", "@envoy_api//envoy/api/v2/listener:pkg_cc_proto", diff --git a/test/extensions/filters/http/common/fuzz/BUILD b/test/extensions/filters/http/common/fuzz/BUILD index a31d18651968..e372825fc6c4 100644 --- a/test/extensions/filters/http/common/fuzz/BUILD +++ b/test/extensions/filters/http/common/fuzz/BUILD @@ -59,6 +59,7 @@ envoy_cc_fuzz_test( ":uber_filter_lib", "//source/common/config:utility_lib", "//source/common/protobuf:utility_lib", + "//source/extensions/upstreams/http/generic:config", "//test/config:utility_lib", "@envoy_api//envoy/service/auth/v3:pkg_cc_proto", "@envoy_api//envoy/service/auth/v2alpha:pkg_cc_proto", From 1bc6ad1926eea451d398e877503b209b1a5d1853 Mon Sep 17 00:00:00 2001 From: Sunjay Bhatia <5337253+sunjayBhatia@users.noreply.github.com> Date: Thu, 25 Jun 2020 08:12:12 -0400 Subject: [PATCH 04/27] Windows: test compilation refresh (#11719) * Windows: test compilation refresh - Remove TestHeaderMapImplBase constructor that takes a list of std::pair - MSVC erroneously treats this as ambiguous. It appears the explicit attribute of the LowerCaseString constructor is incorrectly discarded. We are able to reproduce this in a minimal example and see that MSVC is wrong here: https://godbolt.org/z/VjgsAi - To mitigate, remove LowerCaseString based constructor since it is only used in tests, tests always use std::string - Correct use of long in envoy_quic_alarm.cc, explicitly cast to int64_t (long on Windows is 32 bits) - `using std::string_literal::operator""s` is erroneously rejected by MSVC, throwing error C4455. - Instead, simply utilize the namespace and continue to use the operator as is - operator usage could be replaced by `std::string (const char* s, size_t n)` constructor - See https://developercommunity.visualstudio.com/content/problem/270349/warning-c4455-issued-when-using-standardized-liter.html and other related duplicate issues that have not yet been resolved. Signed-off-by: Sunjay Bhatia Co-authored-by: Sunjay Bhatia Signed-off-by: William A Rowe Jr Co-authored-by: William A Rowe Jr Signed-off-by: chaoqinli --- .../quic_listeners/quiche/envoy_quic_alarm.cc | 3 +- test/common/buffer/BUILD | 2 ++ test/common/http/header_map_impl_test.cc | 28 +++++++++---------- test/common/runtime/BUILD | 2 ++ test/exe/BUILD | 2 ++ .../reverse_bridge_integration_test.cc | 4 ++- test/test_common/utility.h | 7 ----- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/source/extensions/quic_listeners/quiche/envoy_quic_alarm.cc b/source/extensions/quic_listeners/quiche/envoy_quic_alarm.cc index 759e31a4d83f..e652b79a6120 100644 --- a/source/extensions/quic_listeners/quiche/envoy_quic_alarm.cc +++ b/source/extensions/quic_listeners/quiche/envoy_quic_alarm.cc @@ -19,7 +19,8 @@ void EnvoyQuicAlarm::SetImpl() { // in QUICHE, and we are working on the fix. Once QUICHE is fixed of expecting this behavior, we // no longer need to round up the duration. // TODO(antoniovicente) improve the timer behavior in such case. - timer_->enableHRTimer(std::chrono::microseconds(std::max(1l, duration.ToMicroseconds()))); + timer_->enableHRTimer( + std::chrono::microseconds(std::max(static_cast(1), duration.ToMicroseconds()))); } void EnvoyQuicAlarm::UpdateImpl() { diff --git a/test/common/buffer/BUILD b/test/common/buffer/BUILD index bd01534ca6ca..0e32ba806f14 100644 --- a/test/common/buffer/BUILD +++ b/test/common/buffer/BUILD @@ -74,6 +74,8 @@ envoy_cc_test( envoy_cc_test( name = "watermark_buffer_test", srcs = ["watermark_buffer_test.cc"], + # Fails on windows with cr/lf yaml file checkouts + tags = ["fails_on_windows"], deps = [ ":utility_lib", "//source/common/buffer:buffer_lib", diff --git a/test/common/http/header_map_impl_test.cc b/test/common/http/header_map_impl_test.cc index b283e214a0ab..7d3b59ee0ce2 100644 --- a/test/common/http/header_map_impl_test.cc +++ b/test/common/http/header_map_impl_test.cc @@ -902,16 +902,14 @@ TEST(HeaderMapImplTest, Lookup) { TEST(HeaderMapImplTest, Get) { { - auto headers = - TestRequestHeaderMapImpl({{Headers::get().Path, "/"}, {LowerCaseString("hello"), "world"}}); + auto headers = TestRequestHeaderMapImpl({{Headers::get().Path.get(), "/"}, {"hello", "world"}}); EXPECT_EQ("/", headers.get(LowerCaseString(":path"))->value().getStringView()); EXPECT_EQ("world", headers.get(LowerCaseString("hello"))->value().getStringView()); EXPECT_EQ(nullptr, headers.get(LowerCaseString("foo"))); } { - auto headers = - TestRequestHeaderMapImpl({{Headers::get().Path, "/"}, {LowerCaseString("hello"), "world"}}); + auto headers = TestRequestHeaderMapImpl({{Headers::get().Path.get(), "/"}, {"hello", "world"}}); // There is not HeaderMap method to set a header and copy both the key and value. const LowerCaseString path(":path"); headers.setReferenceKey(path, "/new_path"); @@ -933,7 +931,7 @@ TEST(HeaderMapImplTest, CreateHeaderMapFromIterator) { } TEST(HeaderMapImplTest, TestHeaderList) { - std::array keys{Headers::get().Path, LowerCaseString("hello")}; + std::array keys{Headers::get().Path.get(), "hello"}; std::array values{"/", "world"}; auto headers = TestRequestHeaderMapImpl({{keys[0], values[0]}, {keys[1], values[1]}}); @@ -1173,11 +1171,11 @@ TEST(HeaderMapImplTest, PseudoHeaderOrder) { // Starting with a normal header { - auto headers = TestRequestHeaderMapImpl({{Headers::get().ContentType, "text/plain"}, - {Headers::get().Method, "GET"}, - {Headers::get().Path, "/"}, - {LowerCaseString("hello"), "world"}, - {Headers::get().Host, "host"}}); + auto headers = TestRequestHeaderMapImpl({{Headers::get().ContentType.get(), "text/plain"}, + {Headers::get().Method.get(), "GET"}, + {Headers::get().Path.get(), "/"}, + {"hello", "world"}, + {Headers::get().Host.get(), "host"}}); InSequence seq; EXPECT_CALL(cb, Call(":method", "GET")); @@ -1197,11 +1195,11 @@ TEST(HeaderMapImplTest, PseudoHeaderOrder) { // Starting with a pseudo-header { - auto headers = TestRequestHeaderMapImpl({{Headers::get().Path, "/"}, - {Headers::get().ContentType, "text/plain"}, - {Headers::get().Method, "GET"}, - {LowerCaseString("hello"), "world"}, - {Headers::get().Host, "host"}}); + auto headers = TestRequestHeaderMapImpl({{Headers::get().Path.get(), "/"}, + {Headers::get().ContentType.get(), "text/plain"}, + {Headers::get().Method.get(), "GET"}, + {"hello", "world"}, + {Headers::get().Host.get(), "host"}}); InSequence seq; EXPECT_CALL(cb, Call(":path", "/")); diff --git a/test/common/runtime/BUILD b/test/common/runtime/BUILD index 47bb5e802978..d6ffd6dfb1a7 100644 --- a/test/common/runtime/BUILD +++ b/test/common/runtime/BUILD @@ -42,6 +42,8 @@ envoy_cc_test( name = "runtime_impl_test", srcs = ["runtime_impl_test.cc"], data = glob(["test_data/**"]) + ["filesystem_setup.sh"], + # Fails on windows with cr/lf yaml file checkouts + tags = ["fails_on_windows"], deps = [ "//source/common/config:runtime_utility_lib", "//source/common/runtime:runtime_lib", diff --git a/test/exe/BUILD b/test/exe/BUILD index 806820660bca..2b1d4b80aab5 100644 --- a/test/exe/BUILD +++ b/test/exe/BUILD @@ -63,6 +63,8 @@ envoy_cc_test( name = "main_common_test", srcs = ["main_common_test.cc"], data = ["//test/config/integration:google_com_proxy_port_0"], + # Fails on windows with cr/lf yaml file checkouts + tags = ["fails_on_windows"], deps = [ "//source/common/api:api_lib", "//source/exe:envoy_main_common_lib", diff --git a/test/extensions/filters/http/grpc_http1_reverse_bridge/reverse_bridge_integration_test.cc b/test/extensions/filters/http/grpc_http1_reverse_bridge/reverse_bridge_integration_test.cc index 0a9f090b1638..0dd77b0094d6 100644 --- a/test/extensions/filters/http/grpc_http1_reverse_bridge/reverse_bridge_integration_test.cc +++ b/test/extensions/filters/http/grpc_http1_reverse_bridge/reverse_bridge_integration_test.cc @@ -14,7 +14,9 @@ #include "gtest/gtest.h" using Envoy::Http::HeaderValueOf; -using std::string_literals::operator""s; + +// for ::operator""s (which Windows compiler does not support): +using namespace std::string_literals; namespace Envoy { namespace { diff --git a/test/test_common/utility.h b/test/test_common/utility.h index b45b229dd4e5..7bbdc5548c78 100644 --- a/test/test_common/utility.h +++ b/test/test_common/utility.h @@ -757,13 +757,6 @@ template class TestHeaderMapImplBase : public Inte } header_map_->verifyByteSizeInternalForTest(); } - TestHeaderMapImplBase( - const std::initializer_list>& values) { - for (auto& value : values) { - header_map_->addCopy(value.first, value.second); - } - header_map_->verifyByteSizeInternalForTest(); - } TestHeaderMapImplBase(const TestHeaderMapImplBase& rhs) : TestHeaderMapImplBase(*rhs.header_map_) {} TestHeaderMapImplBase(const HeaderMap& rhs) { From e80b2a5cd4cd79138362b1f0e4021913abfa3103 Mon Sep 17 00:00:00 2001 From: chaoqinli Date: Wed, 24 Jun 2020 21:43:35 +0000 Subject: [PATCH 05/27] Signed-off-by: chaoqinli some cleanup of use of std container Signed-off-by: chaoqinli --- source/common/common/callback_impl.h | 6 ++++-- source/common/router/scoped_rds.cc | 3 +-- source/common/router/scoped_rds.h | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/source/common/common/callback_impl.h b/source/common/common/callback_impl.h index 3e9b554df7e2..12f789c3b491 100644 --- a/source/common/common/callback_impl.h +++ b/source/common/common/callback_impl.h @@ -24,6 +24,7 @@ template class CallbackManager { */ CallbackHandle* add(Callback callback) { callbacks_.emplace_back(*this, callback); + callbacks_.back().it_ = (--callbacks_.end()); return &callbacks_.back(); } @@ -50,6 +51,7 @@ template class CallbackManager { CallbackManager& parent_; Callback cb_; + typename std::list::iterator it_; }; /** @@ -61,8 +63,8 @@ template class CallbackManager { [handle](const CallbackHolder& holder) -> bool { return handle == &holder; }) != callbacks_.end()); - callbacks_.remove_if( - [handle](const CallbackHolder& holder) -> bool { return handle == &holder; }); + auto it = static_cast(handle)->it_; + callbacks_.erase(it); } std::list callbacks_; diff --git a/source/common/router/scoped_rds.cc b/source/common/router/scoped_rds.cc index a1ecd85c3639..9a1c736a4a1d 100644 --- a/source/common/router/scoped_rds.cc +++ b/source/common/router/scoped_rds.cc @@ -84,8 +84,7 @@ InlineScopedRoutesConfigProvider::InlineScopedRoutesConfigProvider( ConfigProvider::ApiType::Delta), name_(std::move(name)), config_(std::make_shared(std::move(scope_key_builder))), - config_protos_(std::make_move_iterator(config_protos.begin()), - std::make_move_iterator(config_protos.end())), + config_protos_(move(config_protos)), rds_config_source_(std::move(rds_config_source)) {} ScopedRdsConfigSubscription::ScopedRdsConfigSubscription( diff --git a/source/common/router/scoped_rds.h b/source/common/router/scoped_rds.h index befa51a21dc2..07d3f8dfb047 100644 --- a/source/common/router/scoped_rds.h +++ b/source/common/router/scoped_rds.h @@ -54,10 +54,10 @@ class InlineScopedRoutesConfigProvider : public Envoy::Config::ImmutableConfigPr // Envoy::Config::ConfigProvider Envoy::Config::ConfigProvider::ConfigProtoVector getConfigProtos() const override { Envoy::Config::ConfigProvider::ConfigProtoVector out_protos; - std::for_each(config_protos_.begin(), config_protos_.end(), - [&out_protos](const std::unique_ptr& message) { - out_protos.push_back(message.get()); - }); + out_protos.reserve(config_protos_.size()); + for (const std::unique_ptr& message: config_protos_) { + out_protos.push_back(message.get()); + } return out_protos; } From dc16f653da8b03bbfbc2cf20ce63769409a922fa Mon Sep 17 00:00:00 2001 From: chaoqinli Date: Thu, 25 Jun 2020 13:50:15 +0000 Subject: [PATCH 06/27] make cast dynamic Signed-off-by: chaoqinli --- source/common/common/callback_impl.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/common/common/callback_impl.h b/source/common/common/callback_impl.h index 12f789c3b491..685afe99fd97 100644 --- a/source/common/common/callback_impl.h +++ b/source/common/common/callback_impl.h @@ -51,6 +51,8 @@ template class CallbackManager { CallbackManager& parent_; Callback cb_; + // the iterator of this callback holder inside callbacks_ list + // upon removal, use this iterator to delete callback holder in O(1) typename std::list::iterator it_; }; @@ -63,7 +65,7 @@ template class CallbackManager { [handle](const CallbackHolder& holder) -> bool { return handle == &holder; }) != callbacks_.end()); - auto it = static_cast(handle)->it_; + auto it = dynamic_cast(handle)->it_; callbacks_.erase(it); } From e95fc7c494bb450912075c694532c10942bd2ff0 Mon Sep 17 00:00:00 2001 From: chaoqinli Date: Wed, 24 Jun 2020 21:43:35 +0000 Subject: [PATCH 07/27] Signed-off-by: chaoqinli some cleanup of use of std container Signed-off-by: chaoqinli --- source/common/common/callback_impl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/common/common/callback_impl.h b/source/common/common/callback_impl.h index 685afe99fd97..bc157003b209 100644 --- a/source/common/common/callback_impl.h +++ b/source/common/common/callback_impl.h @@ -51,6 +51,7 @@ template class CallbackManager { CallbackManager& parent_; Callback cb_; + // the iterator of this callback holder inside callbacks_ list // upon removal, use this iterator to delete callback holder in O(1) typename std::list::iterator it_; @@ -65,6 +66,7 @@ template class CallbackManager { [handle](const CallbackHolder& holder) -> bool { return handle == &holder; }) != callbacks_.end()); + auto it = dynamic_cast(handle)->it_; callbacks_.erase(it); } From 89fc19ffe694a26c629e712575c1add1da48f7cb Mon Sep 17 00:00:00 2001 From: chaoqinli Date: Thu, 25 Jun 2020 13:50:15 +0000 Subject: [PATCH 08/27] make cast dynamic Signed-off-by: chaoqinli --- source/common/common/callback_impl.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/common/common/callback_impl.h b/source/common/common/callback_impl.h index bc157003b209..a5600ecf9ce3 100644 --- a/source/common/common/callback_impl.h +++ b/source/common/common/callback_impl.h @@ -51,7 +51,10 @@ template class CallbackManager { CallbackManager& parent_; Callback cb_; +<<<<<<< HEAD +======= +>>>>>>> 4dfa8d4f5... make cast dynamic // the iterator of this callback holder inside callbacks_ list // upon removal, use this iterator to delete callback holder in O(1) typename std::list::iterator it_; @@ -66,7 +69,10 @@ template class CallbackManager { [handle](const CallbackHolder& holder) -> bool { return handle == &holder; }) != callbacks_.end()); +<<<<<<< HEAD +======= +>>>>>>> 4dfa8d4f5... make cast dynamic auto it = dynamic_cast(handle)->it_; callbacks_.erase(it); } From 2c9a3b8992494cb9ed5dae10c10b4ef227c41e6d Mon Sep 17 00:00:00 2001 From: Christoph Pakulski Date: Thu, 25 Jun 2020 11:12:15 -0400 Subject: [PATCH 09/27] examples: fixed fault-injection delay demo (#11715) fault injection example did not work for delay option. After gdb debugging it was discovered that fault injection config requires delay part to be present. Without delay part Envoy assumes that Delay is disabled and does not scan RTDS for delay config updates. Risk Level: Low: Testing: Did manual testing as described in https://www.envoyproxy.io/docs/envoy/latest/start/sandboxes/fault_injection Docs Changes: No Release Notes: No Fixes: #11095 Signed-off-by: Christoph Pakulski Signed-off-by: chaoqinli --- examples/fault-injection/docker-compose.yaml | 3 +++ examples/fault-injection/envoy.yaml | 5 +++++ source/common/common/callback_impl.h | 8 +------- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/examples/fault-injection/docker-compose.yaml b/examples/fault-injection/docker-compose.yaml index fe8ec0c9d68f..97680c848450 100644 --- a/examples/fault-injection/docker-compose.yaml +++ b/examples/fault-injection/docker-compose.yaml @@ -13,6 +13,9 @@ services: ports: - 9211:9211 - 9901:9901 + # Run Envoy as root to grant access to /dev/stdout + environment: + ENVOY_UID: 0 backend: image: kennethreitz/httpbin@sha256:2c7abc4803080c22928265744410173b6fea3b898872c01c5fd0f0f9df4a59fb networks: diff --git a/examples/fault-injection/envoy.yaml b/examples/fault-injection/envoy.yaml index 9ba70be94ba9..661e5ad88f54 100644 --- a/examples/fault-injection/envoy.yaml +++ b/examples/fault-injection/envoy.yaml @@ -36,6 +36,11 @@ static_resources: percentage: numerator: 0 denominator: HUNDRED + delay: + fixed_delay: 3s + percentage: + numerator: 0 + denominator: HUNDRED - name: envoy.filters.http.router typed_config: {} clusters: diff --git a/source/common/common/callback_impl.h b/source/common/common/callback_impl.h index a5600ecf9ce3..7774099f16a1 100644 --- a/source/common/common/callback_impl.h +++ b/source/common/common/callback_impl.h @@ -51,10 +51,8 @@ template class CallbackManager { CallbackManager& parent_; Callback cb_; -<<<<<<< HEAD -======= ->>>>>>> 4dfa8d4f5... make cast dynamic + // the iterator of this callback holder inside callbacks_ list // upon removal, use this iterator to delete callback holder in O(1) typename std::list::iterator it_; @@ -69,10 +67,6 @@ template class CallbackManager { [handle](const CallbackHolder& holder) -> bool { return handle == &holder; }) != callbacks_.end()); -<<<<<<< HEAD - -======= ->>>>>>> 4dfa8d4f5... make cast dynamic auto it = dynamic_cast(handle)->it_; callbacks_.erase(it); } From eb5ed704fec7080a0f233a0f009809f99fd29818 Mon Sep 17 00:00:00 2001 From: chaoqinli Date: Thu, 25 Jun 2020 17:12:29 +0000 Subject: [PATCH 10/27] format Signed-off-by: chaoqinli --- source/common/router/scoped_rds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/common/router/scoped_rds.h b/source/common/router/scoped_rds.h index 07d3f8dfb047..b4612b02316f 100644 --- a/source/common/router/scoped_rds.h +++ b/source/common/router/scoped_rds.h @@ -55,7 +55,7 @@ class InlineScopedRoutesConfigProvider : public Envoy::Config::ImmutableConfigPr Envoy::Config::ConfigProvider::ConfigProtoVector getConfigProtos() const override { Envoy::Config::ConfigProvider::ConfigProtoVector out_protos; out_protos.reserve(config_protos_.size()); - for (const std::unique_ptr& message: config_protos_) { + for (const std::unique_ptr& message : config_protos_) { out_protos.push_back(message.get()); } return out_protos; From 1f211a32a1de036a90af473d22587fc30a0726f1 Mon Sep 17 00:00:00 2001 From: chaoqinli Date: Thu, 25 Jun 2020 18:28:18 +0000 Subject: [PATCH 11/27] format Signed-off-by: chaoqinli --- source/common/router/scoped_rds.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/common/router/scoped_rds.cc b/source/common/router/scoped_rds.cc index 9a1c736a4a1d..8d45b3da5c69 100644 --- a/source/common/router/scoped_rds.cc +++ b/source/common/router/scoped_rds.cc @@ -84,8 +84,7 @@ InlineScopedRoutesConfigProvider::InlineScopedRoutesConfigProvider( ConfigProvider::ApiType::Delta), name_(std::move(name)), config_(std::make_shared(std::move(scope_key_builder))), - config_protos_(move(config_protos)), - rds_config_source_(std::move(rds_config_source)) {} + config_protos_(move(config_protos)), rds_config_source_(std::move(rds_config_source)) {} ScopedRdsConfigSubscription::ScopedRdsConfigSubscription( const envoy::extensions::filters::network::http_connection_manager::v3::ScopedRds& scoped_rds, From a2e7ffd119d3ac800717598c365efa5b4bbe5da2 Mon Sep 17 00:00:00 2001 From: chaoqinli Date: Thu, 25 Jun 2020 18:51:09 +0000 Subject: [PATCH 12/27] format Signed-off-by: chaoqinli --- source/common/common/callback_impl.h | 1 - 1 file changed, 1 deletion(-) diff --git a/source/common/common/callback_impl.h b/source/common/common/callback_impl.h index 7774099f16a1..82f927d49826 100644 --- a/source/common/common/callback_impl.h +++ b/source/common/common/callback_impl.h @@ -52,7 +52,6 @@ template class CallbackManager { CallbackManager& parent_; Callback cb_; - // the iterator of this callback holder inside callbacks_ list // upon removal, use this iterator to delete callback holder in O(1) typename std::list::iterator it_; From 2d9a9fae6a916b21e9229e76bfa96c7aa8588db8 Mon Sep 17 00:00:00 2001 From: chaoqinli Date: Fri, 26 Jun 2020 01:36:32 +0000 Subject: [PATCH 13/27] rollback sth Signed-off-by: chaoqinli --- source/common/router/scoped_rds.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/common/router/scoped_rds.h b/source/common/router/scoped_rds.h index b4612b02316f..befa51a21dc2 100644 --- a/source/common/router/scoped_rds.h +++ b/source/common/router/scoped_rds.h @@ -54,10 +54,10 @@ class InlineScopedRoutesConfigProvider : public Envoy::Config::ImmutableConfigPr // Envoy::Config::ConfigProvider Envoy::Config::ConfigProvider::ConfigProtoVector getConfigProtos() const override { Envoy::Config::ConfigProvider::ConfigProtoVector out_protos; - out_protos.reserve(config_protos_.size()); - for (const std::unique_ptr& message : config_protos_) { - out_protos.push_back(message.get()); - } + std::for_each(config_protos_.begin(), config_protos_.end(), + [&out_protos](const std::unique_ptr& message) { + out_protos.push_back(message.get()); + }); return out_protos; } From 4c97b8dd6b6990a47bc730eda94ec56f2210a85e Mon Sep 17 00:00:00 2001 From: chaoqinli Date: Fri, 26 Jun 2020 04:03:17 +0000 Subject: [PATCH 14/27] rollback sth Signed-off-by: chaoqinli --- source/common/router/scoped_rds.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/common/router/scoped_rds.cc b/source/common/router/scoped_rds.cc index 8d45b3da5c69..a1ecd85c3639 100644 --- a/source/common/router/scoped_rds.cc +++ b/source/common/router/scoped_rds.cc @@ -84,7 +84,9 @@ InlineScopedRoutesConfigProvider::InlineScopedRoutesConfigProvider( ConfigProvider::ApiType::Delta), name_(std::move(name)), config_(std::make_shared(std::move(scope_key_builder))), - config_protos_(move(config_protos)), rds_config_source_(std::move(rds_config_source)) {} + config_protos_(std::make_move_iterator(config_protos.begin()), + std::make_move_iterator(config_protos.end())), + rds_config_source_(std::move(rds_config_source)) {} ScopedRdsConfigSubscription::ScopedRdsConfigSubscription( const envoy::extensions::filters::network::http_connection_manager::v3::ScopedRds& scoped_rds, From 4f1bd5fcd02f51749311d029830e3705cbf3b0e2 Mon Sep 17 00:00:00 2001 From: chaoqinli Date: Fri, 26 Jun 2020 14:34:33 +0000 Subject: [PATCH 15/27] rollback sth Signed-off-by: chaoqinli --- source/common/common/callback_impl.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/common/common/callback_impl.h b/source/common/common/callback_impl.h index 82f927d49826..58e781dac9e2 100644 --- a/source/common/common/callback_impl.h +++ b/source/common/common/callback_impl.h @@ -66,8 +66,10 @@ template class CallbackManager { [handle](const CallbackHolder& holder) -> bool { return handle == &holder; }) != callbacks_.end()); - auto it = dynamic_cast(handle)->it_; - callbacks_.erase(it); + // auto it = dynamic_cast(handle)->it_; + // callbacks_.erase(it); + callbacks_.remove_if( + [handle](const CallbackHolder& holder) -> bool { return handle == &holder; }); } std::list callbacks_; From d859a2f355f8367ab9bdcd004a0af47e0a29d7a8 Mon Sep 17 00:00:00 2001 From: chaoqinli Date: Fri, 26 Jun 2020 15:24:01 +0000 Subject: [PATCH 16/27] rollback sth Signed-off-by: chaoqinli --- source/common/common/callback_impl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/common/common/callback_impl.h b/source/common/common/callback_impl.h index 58e781dac9e2..7985b4f515cc 100644 --- a/source/common/common/callback_impl.h +++ b/source/common/common/callback_impl.h @@ -24,7 +24,7 @@ template class CallbackManager { */ CallbackHandle* add(Callback callback) { callbacks_.emplace_back(*this, callback); - callbacks_.back().it_ = (--callbacks_.end()); + // callbacks_.back().it_ = (--callbacks_.end()); return &callbacks_.back(); } @@ -54,7 +54,7 @@ template class CallbackManager { // the iterator of this callback holder inside callbacks_ list // upon removal, use this iterator to delete callback holder in O(1) - typename std::list::iterator it_; + // typename std::list::iterator it_; }; /** From 5739de5154709b65c2da6cb6e3b9bafbc7d26ccf Mon Sep 17 00:00:00 2001 From: chaoqinli Date: Fri, 26 Jun 2020 15:57:56 +0000 Subject: [PATCH 17/27] rollback sth Signed-off-by: chaoqinli --- source/common/common/callback_impl.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/source/common/common/callback_impl.h b/source/common/common/callback_impl.h index 7985b4f515cc..a35705a158e0 100644 --- a/source/common/common/callback_impl.h +++ b/source/common/common/callback_impl.h @@ -51,10 +51,6 @@ template class CallbackManager { CallbackManager& parent_; Callback cb_; - - // the iterator of this callback holder inside callbacks_ list - // upon removal, use this iterator to delete callback holder in O(1) - // typename std::list::iterator it_; }; /** From 7c4bf5a796a658691dcf1ca5a6ca1be2fe83235b Mon Sep 17 00:00:00 2001 From: chaoqinli Date: Fri, 26 Jun 2020 21:55:34 +0000 Subject: [PATCH 18/27] rollback sth Signed-off-by: chaoqinli --- source/common/common/callback_impl.h | 16 +++++++++++----- source/common/router/scoped_rds.cc | 4 +--- source/common/router/scoped_rds.h | 1 + 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/source/common/common/callback_impl.h b/source/common/common/callback_impl.h index a35705a158e0..8fc0bb8d6e3b 100644 --- a/source/common/common/callback_impl.h +++ b/source/common/common/callback_impl.h @@ -24,7 +24,7 @@ template class CallbackManager { */ CallbackHandle* add(Callback callback) { callbacks_.emplace_back(*this, callback); - // callbacks_.back().it_ = (--callbacks_.end()); + callbacks_.back().it_ = (--callbacks_.end()); return &callbacks_.back(); } @@ -51,6 +51,10 @@ template class CallbackManager { CallbackManager& parent_; Callback cb_; + + // the iterator of this callback holder inside callbacks_ list + // upon removal, use this iterator to delete callback holder in O(1) + typename std::list::iterator it_; }; /** @@ -58,17 +62,19 @@ template class CallbackManager { * @param handle supplies the callback handle to remove. */ void remove(CallbackHandle* handle) { + removed_.clear(); ASSERT(std::find_if(callbacks_.begin(), callbacks_.end(), [handle](const CallbackHolder& holder) -> bool { return handle == &holder; }) != callbacks_.end()); - // auto it = dynamic_cast(handle)->it_; - // callbacks_.erase(it); - callbacks_.remove_if( - [handle](const CallbackHolder& holder) -> bool { return handle == &holder; }); + auto it = dynamic_cast(handle)->it_; + // Transfer the ownership of this holder to removed_ list, + // which is cleared when the next callback holder call remove. + removed_.splice(removed_.begin(), callbacks_, it); } std::list callbacks_; + std::list removed_; }; } // namespace Common diff --git a/source/common/router/scoped_rds.cc b/source/common/router/scoped_rds.cc index a1ecd85c3639..8d45b3da5c69 100644 --- a/source/common/router/scoped_rds.cc +++ b/source/common/router/scoped_rds.cc @@ -84,9 +84,7 @@ InlineScopedRoutesConfigProvider::InlineScopedRoutesConfigProvider( ConfigProvider::ApiType::Delta), name_(std::move(name)), config_(std::make_shared(std::move(scope_key_builder))), - config_protos_(std::make_move_iterator(config_protos.begin()), - std::make_move_iterator(config_protos.end())), - rds_config_source_(std::move(rds_config_source)) {} + config_protos_(move(config_protos)), rds_config_source_(std::move(rds_config_source)) {} ScopedRdsConfigSubscription::ScopedRdsConfigSubscription( const envoy::extensions::filters::network::http_connection_manager::v3::ScopedRds& scoped_rds, diff --git a/source/common/router/scoped_rds.h b/source/common/router/scoped_rds.h index befa51a21dc2..9ab7fe984e8f 100644 --- a/source/common/router/scoped_rds.h +++ b/source/common/router/scoped_rds.h @@ -54,6 +54,7 @@ class InlineScopedRoutesConfigProvider : public Envoy::Config::ImmutableConfigPr // Envoy::Config::ConfigProvider Envoy::Config::ConfigProvider::ConfigProtoVector getConfigProtos() const override { Envoy::Config::ConfigProvider::ConfigProtoVector out_protos; + out_protos.reserve(config_protos_.size()); std::for_each(config_protos_.begin(), config_protos_.end(), [&out_protos](const std::unique_ptr& message) { out_protos.push_back(message.get()); From 6dc2de484da94073d4875894000e231ab837cb46 Mon Sep 17 00:00:00 2001 From: chaoqinli Date: Sat, 27 Jun 2020 04:43:00 +0000 Subject: [PATCH 19/27] rollback sth Signed-off-by: chaoqinli --- source/common/common/callback_impl.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/source/common/common/callback_impl.h b/source/common/common/callback_impl.h index 8fc0bb8d6e3b..68a9b44cfacc 100644 --- a/source/common/common/callback_impl.h +++ b/source/common/common/callback_impl.h @@ -62,19 +62,16 @@ template class CallbackManager { * @param handle supplies the callback handle to remove. */ void remove(CallbackHandle* handle) { - removed_.clear(); ASSERT(std::find_if(callbacks_.begin(), callbacks_.end(), [handle](const CallbackHolder& holder) -> bool { return handle == &holder; }) != callbacks_.end()); auto it = dynamic_cast(handle)->it_; - // Transfer the ownership of this holder to removed_ list, - // which is cleared when the next callback holder call remove. - removed_.splice(removed_.begin(), callbacks_, it); + callbacks_.erase(it); } std::list callbacks_; - std::list removed_; + // std::list removed_; }; } // namespace Common From 3e5ceaab5e5203dec5a82eb2471e25d29d11d0c1 Mon Sep 17 00:00:00 2001 From: chaoqinli Date: Sat, 27 Jun 2020 06:39:52 +0000 Subject: [PATCH 20/27] rollback sth Signed-off-by: chaoqinli --- source/common/common/callback_impl.h | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/source/common/common/callback_impl.h b/source/common/common/callback_impl.h index 68a9b44cfacc..cf52759e6d46 100644 --- a/source/common/common/callback_impl.h +++ b/source/common/common/callback_impl.h @@ -44,10 +44,10 @@ template class CallbackManager { private: struct CallbackHolder : public CallbackHandle { - CallbackHolder(CallbackManager& parent, Callback cb) : parent_(parent), cb_(cb) {} + CallbackHolder(CallbackManager& parent, Callback cb) : parent_(parent), cb_(move(cb)) {} // CallbackHandle - void remove() override { parent_.remove(this); } + void remove() override { parent_.remove(it_); } CallbackManager& parent_; Callback cb_; @@ -61,17 +61,9 @@ template class CallbackManager { * Remove a member update callback added via add(). * @param handle supplies the callback handle to remove. */ - void remove(CallbackHandle* handle) { - ASSERT(std::find_if(callbacks_.begin(), callbacks_.end(), - [handle](const CallbackHolder& holder) -> bool { - return handle == &holder; - }) != callbacks_.end()); - auto it = dynamic_cast(handle)->it_; - callbacks_.erase(it); - } + void remove(typename std::list::iterator& it) { callbacks_.erase(it); } std::list callbacks_; - // std::list removed_; }; } // namespace Common From ccd18e6bcc978a87bbd40f0b1e96f091ca0735c2 Mon Sep 17 00:00:00 2001 From: chaoqinli Date: Sat, 27 Jun 2020 17:59:59 +0000 Subject: [PATCH 21/27] increase memory upper bound Signed-off-by: chaoqinli --- source/common/common/callback_impl.h | 2 +- test/integration/stats_integration_test.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/common/common/callback_impl.h b/source/common/common/callback_impl.h index cf52759e6d46..7c11d025750f 100644 --- a/source/common/common/callback_impl.h +++ b/source/common/common/callback_impl.h @@ -44,7 +44,7 @@ template class CallbackManager { private: struct CallbackHolder : public CallbackHandle { - CallbackHolder(CallbackManager& parent, Callback cb) : parent_(parent), cb_(move(cb)) {} + CallbackHolder(CallbackManager& parent, Callback cb) : parent_(parent), cb_(cb) {} // CallbackHandle void remove() override { parent_.remove(it_); } diff --git a/test/integration/stats_integration_test.cc b/test/integration/stats_integration_test.cc index dd4fb2bfc722..aa744e83b5e8 100644 --- a/test/integration/stats_integration_test.cc +++ b/test/integration/stats_integration_test.cc @@ -286,7 +286,7 @@ TEST_P(ClusterMemoryTestRunner, MemoryLargeClusterSizeWithFakeSymbolTable) { // If you encounter a failure here, please see // https://github.com/envoyproxy/envoy/blob/master/source/docs/stats.md#stats-memory-tests // for details on how to fix. - EXPECT_MEMORY_EQ(m_per_cluster, 44491); + EXPECT_MEMORY_EQ(m_per_cluster, 44800); EXPECT_MEMORY_LE(m_per_cluster, 46000); // Round up to allow platform variations. } @@ -349,7 +349,7 @@ TEST_P(ClusterMemoryTestRunner, MemoryLargeClusterSizeWithRealSymbolTable) { // If you encounter a failure here, please see // https://github.com/envoyproxy/envoy/blob/master/source/docs/stats.md#stats-memory-tests // for details on how to fix. - EXPECT_MEMORY_EQ(m_per_cluster, 36603); + EXPECT_MEMORY_EQ(m_per_cluster, 37000); EXPECT_MEMORY_LE(m_per_cluster, 38000); // Round up to allow platform variations. } From 0d0a7d6076a9da034d6ca90bb6ee4e514bb17e20 Mon Sep 17 00:00:00 2001 From: chaoqinli Date: Sat, 27 Jun 2020 22:02:55 +0000 Subject: [PATCH 22/27] increase exact memory consumed Signed-off-by: chaoqinli --- test/integration/stats_integration_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/stats_integration_test.cc b/test/integration/stats_integration_test.cc index aa744e83b5e8..1957bfeb9d26 100644 --- a/test/integration/stats_integration_test.cc +++ b/test/integration/stats_integration_test.cc @@ -286,7 +286,7 @@ TEST_P(ClusterMemoryTestRunner, MemoryLargeClusterSizeWithFakeSymbolTable) { // If you encounter a failure here, please see // https://github.com/envoyproxy/envoy/blob/master/source/docs/stats.md#stats-memory-tests // for details on how to fix. - EXPECT_MEMORY_EQ(m_per_cluster, 44800); + EXPECT_MEMORY_EQ(m_per_cluster, 44715); EXPECT_MEMORY_LE(m_per_cluster, 46000); // Round up to allow platform variations. } @@ -349,7 +349,7 @@ TEST_P(ClusterMemoryTestRunner, MemoryLargeClusterSizeWithRealSymbolTable) { // If you encounter a failure here, please see // https://github.com/envoyproxy/envoy/blob/master/source/docs/stats.md#stats-memory-tests // for details on how to fix. - EXPECT_MEMORY_EQ(m_per_cluster, 37000); + EXPECT_MEMORY_EQ(m_per_cluster, 36827); EXPECT_MEMORY_LE(m_per_cluster, 38000); // Round up to allow platform variations. } From d75466a949d5c7ee8fc4814f0925ae938645a694 Mon Sep 17 00:00:00 2001 From: chaoqinli Date: Mon, 29 Jun 2020 15:16:03 +0000 Subject: [PATCH 23/27] add comment of stats memory test Signed-off-by: chaoqinli --- test/integration/stats_integration_test.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/integration/stats_integration_test.cc b/test/integration/stats_integration_test.cc index 1957bfeb9d26..6100b7d369fd 100644 --- a/test/integration/stats_integration_test.cc +++ b/test/integration/stats_integration_test.cc @@ -273,6 +273,7 @@ TEST_P(ClusterMemoryTestRunner, MemoryLargeClusterSizeWithFakeSymbolTable) { // 2020/05/13 10531 44425 44600 Refactor resource manager // 2020/05/20 11223 44491 44600 Add primary clusters tracking to cluster manager. // 2020/06/10 11561 44491 44811 Make upstreams pluggable + // 2020/06/29 11751 44715 46000 Improve time complexity of removing callback handle. // Note: when adjusting this value: EXPECT_MEMORY_EQ is active only in CI // 'release' builds, where we control the platform and tool-chain. So you @@ -336,6 +337,7 @@ TEST_P(ClusterMemoryTestRunner, MemoryLargeClusterSizeWithRealSymbolTable) { // 2020/05/13 10531 36537 36800 Refactor resource manager // 2020/05/20 11223 36603 36800 Add primary clusters tracking to cluster manager. // 2020/06/10 11561 36603 36923 Make upstreams pluggable + // 2020/06/29 11751 36827 38000 Improve time complexity of removing callback handle. // Note: when adjusting this value: EXPECT_MEMORY_EQ is active only in CI // 'release' builds, where we control the platform and tool-chain. So you From a850f6dd172f46f6ed5373e972bb19c24757bb94 Mon Sep 17 00:00:00 2001 From: chaoqinli Date: Tue, 30 Jun 2020 02:09:03 +0000 Subject: [PATCH 24/27] add comments, remove unrelated fixups Signed-off-by: chaoqinli --- source/common/common/callback_impl.h | 2 ++ source/common/router/scoped_rds.cc | 4 +++- source/common/router/scoped_rds.h | 1 - test/integration/stats_integration_test.cc | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/source/common/common/callback_impl.h b/source/common/common/callback_impl.h index 7c11d025750f..7b6f1c600db6 100644 --- a/source/common/common/callback_impl.h +++ b/source/common/common/callback_impl.h @@ -24,6 +24,8 @@ template class CallbackManager { */ CallbackHandle* add(Callback callback) { callbacks_.emplace_back(*this, callback); + // get the list iterator of added vallback handle, which will be used to remove itself from + // callbacks_ list. callbacks_.back().it_ = (--callbacks_.end()); return &callbacks_.back(); } diff --git a/source/common/router/scoped_rds.cc b/source/common/router/scoped_rds.cc index 8d45b3da5c69..a1ecd85c3639 100644 --- a/source/common/router/scoped_rds.cc +++ b/source/common/router/scoped_rds.cc @@ -84,7 +84,9 @@ InlineScopedRoutesConfigProvider::InlineScopedRoutesConfigProvider( ConfigProvider::ApiType::Delta), name_(std::move(name)), config_(std::make_shared(std::move(scope_key_builder))), - config_protos_(move(config_protos)), rds_config_source_(std::move(rds_config_source)) {} + config_protos_(std::make_move_iterator(config_protos.begin()), + std::make_move_iterator(config_protos.end())), + rds_config_source_(std::move(rds_config_source)) {} ScopedRdsConfigSubscription::ScopedRdsConfigSubscription( const envoy::extensions::filters::network::http_connection_manager::v3::ScopedRds& scoped_rds, diff --git a/source/common/router/scoped_rds.h b/source/common/router/scoped_rds.h index 9ab7fe984e8f..befa51a21dc2 100644 --- a/source/common/router/scoped_rds.h +++ b/source/common/router/scoped_rds.h @@ -54,7 +54,6 @@ class InlineScopedRoutesConfigProvider : public Envoy::Config::ImmutableConfigPr // Envoy::Config::ConfigProvider Envoy::Config::ConfigProvider::ConfigProtoVector getConfigProtos() const override { Envoy::Config::ConfigProvider::ConfigProtoVector out_protos; - out_protos.reserve(config_protos_.size()); std::for_each(config_protos_.begin(), config_protos_.end(), [&out_protos](const std::unique_ptr& message) { out_protos.push_back(message.get()); diff --git a/test/integration/stats_integration_test.cc b/test/integration/stats_integration_test.cc index 6100b7d369fd..a1d4a1bfd431 100644 --- a/test/integration/stats_integration_test.cc +++ b/test/integration/stats_integration_test.cc @@ -273,8 +273,8 @@ TEST_P(ClusterMemoryTestRunner, MemoryLargeClusterSizeWithFakeSymbolTable) { // 2020/05/13 10531 44425 44600 Refactor resource manager // 2020/05/20 11223 44491 44600 Add primary clusters tracking to cluster manager. // 2020/06/10 11561 44491 44811 Make upstreams pluggable - // 2020/06/29 11751 44715 46000 Improve time complexity of removing callback handle. - + // 2020/06/29 11751 44715 46000 Improve time complexity of removing callback handle + // in callback manager. // Note: when adjusting this value: EXPECT_MEMORY_EQ is active only in CI // 'release' builds, where we control the platform and tool-chain. So you // will need to find the correct value only after failing CI and looking From e2275064f570c189cc8eccaed03f4eca27e7c79e Mon Sep 17 00:00:00 2001 From: chaoqinli Date: Tue, 30 Jun 2020 02:13:54 +0000 Subject: [PATCH 25/27] add comments, remove unrelated fixups Signed-off-by: chaoqinli --- test/integration/stats_integration_test.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/integration/stats_integration_test.cc b/test/integration/stats_integration_test.cc index a1d4a1bfd431..da9afa0947c3 100644 --- a/test/integration/stats_integration_test.cc +++ b/test/integration/stats_integration_test.cc @@ -275,6 +275,7 @@ TEST_P(ClusterMemoryTestRunner, MemoryLargeClusterSizeWithFakeSymbolTable) { // 2020/06/10 11561 44491 44811 Make upstreams pluggable // 2020/06/29 11751 44715 46000 Improve time complexity of removing callback handle // in callback manager. + // Note: when adjusting this value: EXPECT_MEMORY_EQ is active only in CI // 'release' builds, where we control the platform and tool-chain. So you // will need to find the correct value only after failing CI and looking @@ -338,6 +339,7 @@ TEST_P(ClusterMemoryTestRunner, MemoryLargeClusterSizeWithRealSymbolTable) { // 2020/05/20 11223 36603 36800 Add primary clusters tracking to cluster manager. // 2020/06/10 11561 36603 36923 Make upstreams pluggable // 2020/06/29 11751 36827 38000 Improve time complexity of removing callback handle. + // in callback manager. // Note: when adjusting this value: EXPECT_MEMORY_EQ is active only in CI // 'release' builds, where we control the platform and tool-chain. So you From d11b19a0c975219c880ff4454fb6d339f9768220 Mon Sep 17 00:00:00 2001 From: chaoqinli Date: Tue, 30 Jun 2020 21:59:40 +0000 Subject: [PATCH 26/27] fix format Signed-off-by: chaoqinli --- source/common/config/config_provider_impl.h | 10 ++++------ source/common/router/scoped_rds.cc | 4 +++- source/common/router/scoped_rds.h | 1 - test/integration/stats_integration_test.cc | 15 ++------------- 4 files changed, 9 insertions(+), 21 deletions(-) diff --git a/source/common/config/config_provider_impl.h b/source/common/config/config_provider_impl.h index 2dbda54a9f20..157941124d29 100644 --- a/source/common/config/config_provider_impl.h +++ b/source/common/config/config_provider_impl.h @@ -16,8 +16,6 @@ #include "common/init/watcher_impl.h" #include "common/protobuf/protobuf.h" -#include "absl/container/flat_hash_set.h" - namespace Envoy { namespace Config { @@ -392,11 +390,11 @@ class ConfigProviderManagerImplBase : public ConfigProviderManager, public Singl protected: // Ordered set for deterministic config dump output. - using ConfigProviderSet = absl::flat_hash_set; - using ConfigProviderMap = absl::flat_hash_map, EnumClassHash>; + using ConfigProviderSet = std::set; + using ConfigProviderMap = std::unordered_map, EnumClassHash>; using ConfigSubscriptionMap = - absl::flat_hash_map>; + std::unordered_map>; ConfigProviderManagerImplBase(Server::Admin& admin, const std::string& config_name); diff --git a/source/common/router/scoped_rds.cc b/source/common/router/scoped_rds.cc index 202bfd50f89e..a1ecd85c3639 100644 --- a/source/common/router/scoped_rds.cc +++ b/source/common/router/scoped_rds.cc @@ -84,7 +84,9 @@ InlineScopedRoutesConfigProvider::InlineScopedRoutesConfigProvider( ConfigProvider::ApiType::Delta), name_(std::move(name)), config_(std::make_shared(std::move(scope_key_builder))), - config_protos_(std::move(config_protos)), rds_config_source_(std::move(rds_config_source)) {} + config_protos_(std::make_move_iterator(config_protos.begin()), + std::make_move_iterator(config_protos.end())), + rds_config_source_(std::move(rds_config_source)) {} ScopedRdsConfigSubscription::ScopedRdsConfigSubscription( const envoy::extensions::filters::network::http_connection_manager::v3::ScopedRds& scoped_rds, diff --git a/source/common/router/scoped_rds.h b/source/common/router/scoped_rds.h index 9ab7fe984e8f..befa51a21dc2 100644 --- a/source/common/router/scoped_rds.h +++ b/source/common/router/scoped_rds.h @@ -54,7 +54,6 @@ class InlineScopedRoutesConfigProvider : public Envoy::Config::ImmutableConfigPr // Envoy::Config::ConfigProvider Envoy::Config::ConfigProvider::ConfigProtoVector getConfigProtos() const override { Envoy::Config::ConfigProvider::ConfigProtoVector out_protos; - out_protos.reserve(config_protos_.size()); std::for_each(config_protos_.begin(), config_protos_.end(), [&out_protos](const std::unique_ptr& message) { out_protos.push_back(message.get()); diff --git a/test/integration/stats_integration_test.cc b/test/integration/stats_integration_test.cc index 7beca71c5632..f57afd00ed81 100644 --- a/test/integration/stats_integration_test.cc +++ b/test/integration/stats_integration_test.cc @@ -273,12 +273,9 @@ TEST_P(ClusterMemoryTestRunner, MemoryLargeClusterSizeWithFakeSymbolTable) { // 2020/05/13 10531 44425 44600 Refactor resource manager // 2020/05/20 11223 44491 44600 Add primary clusters tracking to cluster manager. // 2020/06/10 11561 44491 44811 Make upstreams pluggable -<<<<<<< HEAD + // 2020/04/23 10661 44425 46000 per-listener connection limits // 2020/06/29 11751 44715 46000 Improve time complexity of removing callback handle // in callback manager. -======= - // 2020/04/23 10661 44425 46000 per-listener connection limits ->>>>>>> a9ae3b47892170b398455a5975800faba08fcc17 // Note: when adjusting this value: EXPECT_MEMORY_EQ is active only in CI // 'release' builds, where we control the platform and tool-chain. So you @@ -342,12 +339,9 @@ TEST_P(ClusterMemoryTestRunner, MemoryLargeClusterSizeWithRealSymbolTable) { // 2020/05/13 10531 36537 36800 Refactor resource manager // 2020/05/20 11223 36603 36800 Add primary clusters tracking to cluster manager. // 2020/06/10 11561 36603 36923 Make upstreams pluggable -<<<<<<< HEAD + // 2020/04/23 10661 36537 37000 per-listener connection limits // 2020/06/29 11751 36827 38000 Improve time complexity of removing callback handle. // in callback manager. -======= - // 2020/04/23 10661 36537 37000 per-listener connection limits ->>>>>>> a9ae3b47892170b398455a5975800faba08fcc17 // Note: when adjusting this value: EXPECT_MEMORY_EQ is active only in CI // 'release' builds, where we control the platform and tool-chain. So you @@ -361,13 +355,8 @@ TEST_P(ClusterMemoryTestRunner, MemoryLargeClusterSizeWithRealSymbolTable) { // If you encounter a failure here, please see // https://github.com/envoyproxy/envoy/blob/master/source/docs/stats.md#stats-memory-tests // for details on how to fix. -<<<<<<< HEAD EXPECT_MEMORY_EQ(m_per_cluster, 36827); EXPECT_MEMORY_LE(m_per_cluster, 38000); // Round up to allow platform variations. -======= - EXPECT_MEMORY_EQ(m_per_cluster, 36603); - EXPECT_MEMORY_LE(m_per_cluster, 37000); ->>>>>>> a9ae3b47892170b398455a5975800faba08fcc17 } TEST_P(ClusterMemoryTestRunner, MemoryLargeHostSizeWithStats) { From b2ce9364c1ecc92aef7082a33cdc56769dd36d2c Mon Sep 17 00:00:00 2001 From: chaoqinli Date: Wed, 1 Jul 2020 03:30:17 +0000 Subject: [PATCH 27/27] fix format Signed-off-by: chaoqinli --- source/common/common/callback_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/common/common/callback_impl.h b/source/common/common/callback_impl.h index 7b6f1c600db6..d1d3ebdbe496 100644 --- a/source/common/common/callback_impl.h +++ b/source/common/common/callback_impl.h @@ -24,7 +24,7 @@ template class CallbackManager { */ CallbackHandle* add(Callback callback) { callbacks_.emplace_back(*this, callback); - // get the list iterator of added vallback handle, which will be used to remove itself from + // get the list iterator of added callback handle, which will be used to remove itself from // callbacks_ list. callbacks_.back().it_ = (--callbacks_.end()); return &callbacks_.back();