Skip to content

Commit

Permalink
Merge branch 'master' into health-check-transport-match
Browse files Browse the repository at this point in the history
Signed-off-by: Spencer Lewis <slewis@squareup.com>

* master:
  fault injection: add support for setting gRPC status (envoyproxy#10841)
  tests: tag tests that fail on Windows with fails_on_windows (envoyproxy#10940)
  Fix typo on Postgres Proxy documentation. (envoyproxy#10930)
  fuzz: improve header/data stop/continue modeling in HCM fuzzer. (envoyproxy#10931)
  gzip filter: allow setting zlib compressor's chunk size (envoyproxy#10508)
  http: replace vector/reserve with InlinedVector in codec helper (envoyproxy#10941)
  stats: add utilities to create stats from a vector of tokens, mixing dynamic and symbolic elements. (envoyproxy#10735)
  hcm: avoid invoking 100-continue handling on decode filter. (envoyproxy#10929)
  prometheus stats: Correctly group lines of the same metric name. (envoyproxy#10833)
  status: Fix ASAN error in Status payload handling (envoyproxy#10906)
  path: Fix merge slash for paths ending with slash and present query args (envoyproxy#10922)
  compressor filter: add benchmark (envoyproxy#10464)
  xray: expected_span_name is not captured by the lambda with MSVC (envoyproxy#10934)
  ci: update before purge in cleanup (envoyproxy#10938)
  tracer: Improve test coverage for x-ray (envoyproxy#10890)
  Revert "init: order dynamic resource initialization to make RTDS always be first (envoyproxy#10362)" (envoyproxy#10919)
  • Loading branch information
spenceral committed Apr 27, 2020
2 parents 7729241 + fd36665 commit f485e79
Show file tree
Hide file tree
Showing 157 changed files with 2,846 additions and 1,307 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

# Temporary script to remove tools from Azure pipelines agent to create more disk space room.

sudo apt-get -y update
sudo apt-get purge -y 'ghc-*' 'zulu-*-azure-jdk' 'libllvm*' 'mysql-*' 'dotnet-*' 'cpp-*'

dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -rn
10 changes: 9 additions & 1 deletion api/envoy/extensions/filters/http/fault/v3/fault.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
// Fault Injection :ref:`configuration overview <config_http_filters_fault_injection>`.
// [#extension: envoy.filters.http.fault]

// [#next-free-field: 6]
message FaultAbort {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.filter.http.fault.v2.FaultAbort";
Expand All @@ -41,6 +42,9 @@ message FaultAbort {
// HTTP status code to use to abort the HTTP request.
uint32 http_status = 2 [(validate.rules).uint32 = {lt: 600 gte: 200}];

// gRPC status code to use to abort the gRPC request.
uint32 grpc_status = 5;

// Fault aborts are controlled via an HTTP header (if applicable).
HeaderAbort header_abort = 4;
}
Expand All @@ -50,7 +54,7 @@ message FaultAbort {
type.v3.FractionalPercent percentage = 3;
}

// [#next-free-field: 14]
// [#next-free-field: 15]
message HTTPFault {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.filter.http.fault.v2.HTTPFault";
Expand Down Expand Up @@ -133,4 +137,8 @@ message HTTPFault {
// The runtime key to override the :ref:`default <config_http_filters_fault_injection_runtime>`
// runtime. The default is: fault.http.rate_limit.response_percent
string response_rate_limit_percent_runtime = 13;

// The runtime key to override the :ref:`default <config_http_filters_fault_injection_runtime>`
// runtime. The default is: fault.http.abort.grpc_status
string abort_grpc_status_runtime = 14;
}
7 changes: 6 additions & 1 deletion api/envoy/extensions/filters/http/gzip/v3/gzip.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
// Gzip :ref:`configuration overview <config_http_filters_gzip>`.
// [#extension: envoy.filters.http.gzip]

// [#next-free-field: 11]
// [#next-free-field: 12]
message Gzip {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.filter.http.gzip.v2.Gzip";
Expand Down Expand Up @@ -76,4 +76,9 @@ message Gzip {
// the fields `content_length`, `content_type`, `disable_on_etag_header` and
// `remove_accept_encoding_header` are ignored.
compressor.v3.Compressor compressor = 10;

// Value for Zlib's next output buffer. If not set, defaults to 4096.
// See https://www.zlib.net/manual.html for more details. Also see
// https://github.com/envoyproxy/envoy/issues/8448 for context on this filter's performance.
google.protobuf.UInt32Value chunk_size = 11 [(validate.rules).uint32 = {lte: 65536 gte: 4096}];
}
8 changes: 4 additions & 4 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ REPOSITORY_LOCATIONS = dict(
urls = ["https://commondatastorage.googleapis.com/chromium-boringssl-docs/fips/boringssl-66005f41fbc3529ffe8d007708756720529da20d.tar.xz"],
),
com_google_absl = dict(
sha256 = "2693730730247afb0e7cb2d41664ac2af3ad75c79944efd266be40ba944179b9",
strip_prefix = "abseil-cpp-06f0e767d13d4d68071c4fc51e25724e0fc8bc74",
# 2020-03-03
urls = ["https://github.com/abseil/abseil-cpp/archive/06f0e767d13d4d68071c4fc51e25724e0fc8bc74.tar.gz"],
sha256 = "14ee08e2089c2a9b6bf27e1d10abc5629c69c4d0bab4b78ec5b65a29ea1c2af7",
strip_prefix = "abseil-cpp-cf3a1998e9d41709d4141e2f13375993cba1130e",
# 2020-03-05
urls = ["https://github.com/abseil/abseil-cpp/archive/cf3a1998e9d41709d4141e2f13375993cba1130e.tar.gz"],
),
com_github_apache_thrift = dict(
sha256 = "7d59ac4fdcb2c58037ebd4a9da5f9a49e3e034bf75b3f26d9fe48ba3d8806e6b",
Expand Down
25 changes: 21 additions & 4 deletions docs/root/configuration/http/http_filters/fault_filter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,27 @@ x-envoy-fault-abort-request
In order for the header to work, :ref:`header_abort
<envoy_api_field_config.filter.http.fault.v2.FaultAbort.header_abort>` needs to be set.

x-envoy-fault-abort-grpc-request
gRPC status code to abort a request with. The header value should be a non-negative integer that specifies
the gRPC status code to return in response to a request. Its value range is [0, UInt32.Max] instead of [0, 16]
to allow testing even not well-defined gRPC status codes. When this header is set, the HTTP response status code
will be set to 200. In order for the header to work, :ref:`header_abort
<envoy_api_field_config.filter.http.fault.v2.FaultAbort.header_abort>` needs to be set. If both
*x-envoy-fault-abort-request* and *x-envoy-fault-abort-grpc-request* headers are set then
*x-envoy-fault-abort-grpc-request* header will be **ignored** and fault response http status code will be
set to *x-envoy-fault-abort-request* header value.

x-envoy-fault-abort-request-percentage
The percentage of requests that should be failed with a status code that's defined
by the value of *x-envoy-fault-abort-request* HTTP header. The header value should be an integer
that specifies the numerator of the percentage of request to apply aborts to and must be greater
or equal to 0 and its maximum value is capped by the value of the numerator of
by the value of *x-envoy-fault-abort-request* or *x-envoy-fault-abort-grpc-request* HTTP headers.
The header value should be an integer that specifies the numerator of the percentage of request to apply aborts
to and must be greater or equal to 0 and its maximum value is capped by the value of the numerator of
:ref:`percentage <envoy_api_field_config.filter.http.fault.v2.FaultAbort.percentage>` field.
Percentage's denominator is equal to default percentage's denominator
:ref:`percentage <envoy_api_field_config.filter.http.fault.v2.FaultAbort.percentage>` field.
In order for the header to work, :ref:`header_abort
<envoy_api_field_config.filter.http.fault.v2.FaultAbort.header_abort>` needs to be set and
*x-envoy-fault-abort-request* HTTP header needs to be a part of a request.
either *x-envoy-fault-abort-request* or *x-envoy-fault-abort-grpc-request* HTTP header needs to be a part of the request.

x-envoy-fault-delay-request
The duration to delay a request by. The header value should be an integer that specifies the number
Expand Down Expand Up @@ -144,6 +154,13 @@ fault.http.abort.http_status
available regardless of whether the filter is :ref:`configured for abort
<envoy_api_field_config.filter.http.fault.v2.HTTPFault.abort>`.

fault.http.abort.grpc_status
gRPC status code that will be used as the response status code of requests that will be
aborted if the headers match. Defaults to the gRPC status code specified in the config.
If this field is missing from both the runtime and the config, gRPC status code in the response
will be derived from *fault.http.abort.http_status* field. This runtime key is only available when
the filter is :ref:`configured for abort <envoy_api_field_config.filter.http.fault.v2.HTTPFault.abort>`.

fault.http.delay.fixed_delay_percent
% of requests that will be delayed if the headers match. Defaults to the
*delay_percent* specified in the config or 0 otherwise. This runtime key is only available when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Postgres proxy
================

The Postgres proxy filter decodes the wire protocol between a Postgres client (downstream) and a Postgres server
(upstream). The decoded information is currently used only to produce Postgres level statistics like sesions,
(upstream). The decoded information is currently used only to produce Postgres level statistics like sessions,
statements or transactions executed, among others. This current version does not decode SQL queries. Future versions may
add more statistics and more advanced capabilities. When the Postgres filter detects that a session is encrypted, the messages are ignored and no decoding takes
place. More information:
Expand Down
5 changes: 5 additions & 0 deletions docs/root/version_history/current.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,23 @@ Changes
* dynamic forward proxy: added :ref:`SNI based dynamic forward proxy <config_network_filters_sni_dynamic_forward_proxy>` support.
* fault: added support for controlling the percentage of requests that abort, delay and response rate limits faults
are applied to using :ref:`HTTP headers <config_http_filters_fault_injection_http_header>` to the HTTP fault filter.
* fault: added support for specifying grpc_status code in abort faults using
:ref:`HTTP header <config_http_filters_fault_injection_http_header>` or abort fault configuration in HTTP fault filter.
* filter: add `upstram_rq_time` stats to the GPRC stats filter.
Disabled by default and can be enabled via :ref:`enable_upstream_stats <envoy_v3_api_field_extensions.filters.http.grpc_stats.v3.FilterConfig.enable_upstream_stats>`.
* grpc-json: added support for streaming response using
`google.api.HttpBody <https://github.com/googleapis/googleapis/blob/master/google/api/httpbody.proto>`_.
* health checks: allow configuring health check transport sockets by specifying :ref:`transport socket match criteria <envoy_v3_api_field_config.core.v3.HealthCheck.transport_socket_match_criteria>`.
* gzip filter: added option to set zlib's next output buffer size.
* http: fixed a bug where in some cases slash was moved from path to query string when :ref:`merging of adjacent slashes<envoy_api_field_config.filter.network.http_connection_manager.v2.HttpConnectionManager.merge_slashes>` is enabled.
* http: fixed a bug where the upgrade header was not cleared on responses to non-upgrade requests.
Can be reverted temporarily by setting runtime feature `envoy.reloadable_features.fix_upgrade_response` to false.
* http: remove legacy connection pool code and their runtime features: `envoy.reloadable_features.new_http1_connection_pool_behavior` and
`envoy.reloadable_features.new_http2_connection_pool_behavior`.
* logger: added :ref:`--log-format-prefix-with-location <operations_cli>` command line option to prefix '%v' with file path and line number.
* network filters: added a :ref:`postgres proxy filter <config_network_filters_postgres_proxy>`.
* network filters: added a :ref:`rocketmq proxy filter <config_network_filters_rocketmq_proxy>`.
* prometheus stats: fix the sort order of output lines to comply with the standard.
* request_id: added to :ref:`always_set_request_id_in_response setting <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.always_set_request_id_in_response>`
to set :ref:`x-request-id <config_http_conn_man_headers_x-request-id>` header in response even if
tracing is not forced.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions include/envoy/runtime/runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,6 @@ class Loader {
public:
virtual ~Loader() = default;

using ReadyCallback = std::function<void()>;

/**
* Post-construction initialization. Runtime will be generally available after
* the constructor is finished, with the exception of dynamic RTDS layers,
Expand Down Expand Up @@ -288,12 +286,6 @@ class Loader {
* @param values the values to merge
*/
virtual void mergeValues(const std::unordered_map<std::string, std::string>& values) PURE;

/**
* Initiate all RTDS subscriptions. The `on_done` callback is invoked when all RTDS requests
* have either received and applied their responses or timed out.
*/
virtual void startRtdsSubscriptions(ReadyCallback on_done) PURE;
};

using LoaderPtr = std::unique_ptr<Loader>;
Expand Down
15 changes: 0 additions & 15 deletions include/envoy/upstream/cluster_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,6 @@ class ClusterManagerFactory;
/**
* Manages connection pools and load balancing for upstream clusters. The cluster manager is
* persistent and shared among multiple ongoing requests/connections.
* Cluster manager is initialized in two phases. In the first phase which begins at the construction
* all primary clusters (i.e. with endpoint assignments provisioned statically in bootstrap,
* discovered through DNS or file based CDS) are initialized.
* After the first phase has completed the server instance initializes services (i.e. RTDS) needed
* to successfully deploy the rest of dynamic configuration.
* In the second phase all secondary clusters (with endpoint assignments provisioned by xDS servers)
* are initialized and then the rest of the configuration provisioned through xDS.
*/
class ClusterManager {
public:
Expand All @@ -103,14 +96,6 @@ class ClusterManager {
*/
virtual void setInitializedCb(std::function<void()> callback) PURE;

/**
* Start initialization of secondary clusters and then dynamically configured clusters.
* The "initialized callback" set in the method above is invoked when secondary and
* dynamically provisioned clusters have finished initializing.
*/
virtual void
initializeSecondaryClusters(const envoy::config::bootstrap::v3::Bootstrap& bootstrap) PURE;

using ClusterInfoMap = std::unordered_map<std::string, std::reference_wrapper<const Cluster>>;

/**
Expand Down
1 change: 1 addition & 0 deletions source/common/grpc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ envoy_cc_library(
"//include/envoy/stats:stats_interface",
"//source/common/common:hash_lib",
"//source/common/stats:symbol_table_lib",
"//source/common/stats:utility_lib",
],
)

Expand Down
Loading

0 comments on commit f485e79

Please sign in to comment.