From 0273879aed4ef61f87cf65d537cfdfdc11db40b7 Mon Sep 17 00:00:00 2001 From: Hope Casey-Allen Date: Fri, 14 Jun 2019 10:43:09 -0700 Subject: [PATCH 01/33] Fix typo --- src/proto/grpc/channelz/channelz.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/proto/grpc/channelz/channelz.proto b/src/proto/grpc/channelz/channelz.proto index 20de23f7fa3..f0ebda07213 100644 --- a/src/proto/grpc/channelz/channelz.proto +++ b/src/proto/grpc/channelz/channelz.proto @@ -35,7 +35,7 @@ option java_outer_classname = "ChannelzProto"; // Channel is a logical grouping of channels, subchannels, and sockets. message Channel { - // The identifier for this channel. This should bet set. + // The identifier for this channel. This should be set. ChannelRef ref = 1; // Data specific to this channel. ChannelData data = 2; From 5294f49d11d27773904728614a78ee27ee0f10d7 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Fri, 23 Aug 2019 15:33:52 -0700 Subject: [PATCH 02/33] Init needs to be called in case of bad creds --- src/cpp/client/create_channel.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cpp/client/create_channel.cc b/src/cpp/client/create_channel.cc index ca7038b8893..c6041edcb36 100644 --- a/src/cpp/client/create_channel.cc +++ b/src/cpp/client/create_channel.cc @@ -38,7 +38,7 @@ std::shared_ptr CreateCustomChannelImpl( const std::shared_ptr& creds, const grpc::ChannelArguments& args) { grpc::GrpcLibraryCodegen - init_lib; // We need to call init in case of a bad creds. + init_lib; // We need to call init in case of bad creds. return creds ? creds->CreateChannelImpl(target, args) : grpc::CreateChannelInternal( "", @@ -69,6 +69,8 @@ std::shared_ptr CreateCustomChannelWithInterceptors( std::vector< std::unique_ptr> interceptor_creators) { + grpc::GrpcLibraryCodegen + init_lib; // We need to call init in case of bad creds. return creds ? creds->CreateChannelWithInterceptors( target, args, std::move(interceptor_creators)) : grpc::CreateChannelInternal( From 64b8ce5ef2e8987e6a4901bf8f152f3b62532a74 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 26 Aug 2019 10:46:47 -0400 Subject: [PATCH 03/33] enable grpc-dotnet client compression interop tests --- tools/run_tests/run_interop_tests.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index d35723c917e..0ec4478fcc8 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -207,14 +207,13 @@ class AspNetCoreLanguage: return {} def unimplemented_test_cases(self): - return _SKIP_COMPRESSION + \ - ['compute_engine_creds'] + \ + return ['compute_engine_creds'] + \ ['jwt_token_creds'] + \ _SKIP_GOOGLE_DEFAULT_CREDS + \ _SKIP_COMPUTE_ENGINE_CHANNEL_CREDS def unimplemented_test_cases_server(self): - return _SKIP_COMPRESSION + return _SKIP_SERVER_COMPRESSION def __str__(self): return 'aspnetcore' From 426450cd82b9cc0edc7983049791904e327d49e8 Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Fri, 2 Aug 2019 11:04:28 -0700 Subject: [PATCH 04/33] Implement dual testing --- BUILD | 2 +- bazel/grpc_python_deps.bzl | 9 ++ bazel/python_rules.bzl | 26 ++++++ .../grpcio_tests/tests/unit/BUILD.bazel | 4 +- third_party/py/BUILD.tpl | 49 +++++----- third_party/py/python_configure.bzl | 92 +++++++++++-------- third_party/py/remote.BUILD.tpl | 10 -- third_party/py/variety.tpl | 26 ++++++ tools/bazel.rc | 4 - 9 files changed, 142 insertions(+), 80 deletions(-) delete mode 100644 third_party/py/remote.BUILD.tpl create mode 100644 third_party/py/variety.tpl diff --git a/BUILD b/BUILD index f2a6f67f69f..74e1849629d 100644 --- a/BUILD +++ b/BUILD @@ -65,7 +65,7 @@ config_setting( config_setting( name = "python3", - values = {"python_path": "python3"}, + flag_values = {"@bazel_tools//tools/python:python_version": "PY3"}, ) config_setting( diff --git a/bazel/grpc_python_deps.bzl b/bazel/grpc_python_deps.bzl index 4e7cc1537fa..2a439bdf226 100644 --- a/bazel/grpc_python_deps.bzl +++ b/bazel/grpc_python_deps.bzl @@ -47,6 +47,15 @@ def grpc_python_deps(): remote = "https://github.com/bazelbuild/rules_python.git", ) + + if "rules_python" not in native.existing_rules(): + http_archive( + name = "rules_python", + url = "https://github.com/bazelbuild/rules_python/archive/9d68f24659e8ce8b736590ba1e4418af06ec2552.zip", + sha256 = "f7402f11691d657161f871e11968a984e5b48b023321935f5a55d7e56cf4758a", + strip_prefix = "rules_python-9d68f24659e8ce8b736590ba1e4418af06ec2552", + ) + python_configure(name = "local_config_python") native.bind( diff --git a/bazel/python_rules.bzl b/bazel/python_rules.bzl index 12f51f8b172..e7e9e597b05 100644 --- a/bazel/python_rules.bzl +++ b/bazel/python_rules.bzl @@ -178,3 +178,29 @@ def py_grpc_library( deps = [Label("//src/python/grpcio/grpc:grpcio")] + deps, **kwargs ) + + +def py2and3_test(name, + py_test = native.py_test, + **kwargs): + if "python_version" in kwargs: + fail("Cannot specify 'python_version' in py2and3_test.") + + names = [name + suffix for suffix in (".python2", ".python3")] + python_versions = ["PY2", "PY3"] + for case_name, python_version in zip(names, python_versions): + py_test( + name = case_name, + python_version = python_version, + **kwargs + ) + + suite_kwargs = {} + if "visibility" in kwargs: + suite_kwargs["visibility"] = kwargs["visibility"] + + native.test_suite( + name = name, + tests = names, + **suite_kwargs + ) diff --git a/src/python/grpcio_tests/tests/unit/BUILD.bazel b/src/python/grpcio_tests/tests/unit/BUILD.bazel index 49203b7fa16..587d8cb246f 100644 --- a/src/python/grpcio_tests/tests/unit/BUILD.bazel +++ b/src/python/grpcio_tests/tests/unit/BUILD.bazel @@ -1,3 +1,5 @@ +load("//bazel:python_rules.bzl", "py2and3_test") + package(default_visibility = ["//visibility:public"]) GRPCIO_TESTS_UNIT = [ @@ -80,7 +82,7 @@ py_library( ) [ - py_test( + py2and3_test( name=test_file_name[:-3], size="small", srcs=[test_file_name], diff --git a/third_party/py/BUILD.tpl b/third_party/py/BUILD.tpl index 2283c573bc3..8f010f85a03 100644 --- a/third_party/py/BUILD.tpl +++ b/third_party/py/BUILD.tpl @@ -2,35 +2,36 @@ package(default_visibility=["//visibility:public"]) -# To build Python C/C++ extension on Windows, we need to link to python import library pythonXY.lib -# See https://docs.python.org/3/extending/windows.html -cc_import( - name="python_lib", - interface_library=select({ - ":windows": ":python_import_lib", - # A placeholder for Unix platforms which makes --no_build happy. - "//conditions:default": "not-existing.lib", - }), - system_provided=1, -) - -cc_library( - name="python_headers", - hdrs=[":python_include"], - deps=select({ - ":windows": [":python_lib"], - "//conditions:default": [], - }), - includes=["python_include"], -) - config_setting( name="windows", values={"cpu": "x64_windows"}, visibility=["//visibility:public"], ) -%{PYTHON_INCLUDE_GENRULE} -%{PYTHON_IMPORT_LIB_GENRULE} +config_setting( + name="python2", + flag_values = {"@rules_python//python:python_version": "PY2"} +) + +config_setting( + name="python3", + flag_values = {"@rules_python//python:python_version": "PY3"} +) +cc_library( + name = "python_lib", + deps = select({ + ":python2": ["//_python2:_python2_lib"], + ":python3": ["//_python3:_python3_lib"], + "//conditions:default": ["not-existing.lib"], + }) +) +cc_library( + name = "python_headers", + deps = select({ + ":python2": ["//_python2:_python2_headers"], + ":python3": ["//_python3:_python3_headers"], + "//conditions:default": ["not-existing.headers"], + }) +) diff --git a/third_party/py/python_configure.bzl b/third_party/py/python_configure.bzl index e6fa5ed10e9..a2f0c7918d2 100644 --- a/third_party/py/python_configure.bzl +++ b/third_party/py/python_configure.bzl @@ -3,14 +3,15 @@ `python_configure` depends on the following environment variables: - * `PYTHON_BIN_PATH`: location of python binary. - * `PYTHON_LIB_PATH`: Location of python libraries. + * `PYTHON2_BIN_PATH`: location of python binary. + * `PYTHON2_LIB_PATH`: Location of python libraries. """ _BAZEL_SH = "BAZEL_SH" -_PYTHON_BIN_PATH = "PYTHON_BIN_PATH" -_PYTHON_LIB_PATH = "PYTHON_LIB_PATH" -_PYTHON_CONFIG_REPO = "PYTHON_CONFIG_REPO" +_PYTHON2_BIN_PATH = "PYTHON2_BIN_PATH" +_PYTHON2_LIB_PATH = "PYTHON2_LIB_PATH" +_PYTHON3_BIN_PATH = "PYTHON3_BIN_PATH" +_PYTHON3_LIB_PATH = "PYTHON3_LIB_PATH" def _tpl(repository_ctx, tpl, substitutions={}, out=None): @@ -136,9 +137,9 @@ def _symlink_genrule_for_dir(repository_ctx, "\n".join(outs)) -def _get_python_bin(repository_ctx): +def _get_python_bin(repository_ctx, bin_path_key, default_bin_path): """Gets the python bin path.""" - python_bin = repository_ctx.os.environ.get(_PYTHON_BIN_PATH, 'python') + python_bin = repository_ctx.os.environ.get(bin_path_key, default_bin_path) if not repository_ctx.path(python_bin).exists: # It's a command, use 'which' to find its path. python_bin_path = repository_ctx.which(python_bin) @@ -150,7 +151,7 @@ def _get_python_bin(repository_ctx): _fail("Cannot find python in PATH, please make sure " + "python is installed and add its directory in PATH, or --define " + "%s='/something/else'.\nPATH=%s" % - (_PYTHON_BIN_PATH, repository_ctx.os.environ.get("PATH", ""))) + (bin_path_key, repository_ctx.os.environ.get("PATH", ""))) def _get_bash_bin(repository_ctx): @@ -170,9 +171,9 @@ def _get_bash_bin(repository_ctx): (_BAZEL_SH, repository_ctx.os.environ.get("PATH", ""))) -def _get_python_lib(repository_ctx, python_bin): +def _get_python_lib(repository_ctx, python_bin, lib_path_key): """Gets the python lib path.""" - python_lib = repository_ctx.os.environ.get(_PYTHON_LIB_PATH) + python_lib = repository_ctx.os.environ.get(lib_path_key) if python_lib != None: return python_lib print_lib = ( @@ -202,13 +203,13 @@ def _check_python_lib(repository_ctx, python_lib): _fail("Invalid python library path: %s" % python_lib) -def _check_python_bin(repository_ctx, python_bin): +def _check_python_bin(repository_ctx, python_bin, bin_path_key): """Checks the python bin path.""" cmd = '[[ -x "%s" ]] && [[ ! -d "%s" ]]' % (python_bin, python_bin) result = repository_ctx.execute([_get_bash_bin(repository_ctx), "-c", cmd]) if result.return_code == 1: _fail("--define %s='%s' is not executable. Is it the python binary?" % - (_PYTHON_BIN_PATH, python_bin)) + (bin_path_key, python_bin)) def _get_python_include(repository_ctx, python_bin): @@ -222,11 +223,11 @@ def _get_python_include(repository_ctx, python_bin): error_msg="Problem getting python include path.", error_details=( "Is the Python binary path set up right? " + "(See ./configure or " - + _PYTHON_BIN_PATH + ".) " + "Is distutils installed?")) + + _PYTHON2_BIN_PATH + ".) " + "Is distutils installed?")) return result.stdout.splitlines()[0] -def _get_python_import_lib_name(repository_ctx, python_bin): +def _get_python_import_lib_name(repository_ctx, python_bin, bin_path_key): """Get Python import library name (pythonXY.lib) on Windows.""" result = _execute( repository_ctx, [ @@ -236,66 +237,77 @@ def _get_python_import_lib_name(repository_ctx, python_bin): ], error_msg="Problem getting python import library.", error_details=("Is the Python binary path set up right? " + - "(See ./configure or " + _PYTHON_BIN_PATH + ".) ")) + "(See ./configure or " + bin_path_key + ".) ")) return result.stdout.splitlines()[0] -def _create_local_python_repository(repository_ctx): +# TODO(rbellevi): Rename. +def _create_local_python_repository(repository_ctx, + variety_name, + bin_path_key, + default_bin_path, + lib_path_key): """Creates the repository containing files set up to build with Python.""" - python_bin = _get_python_bin(repository_ctx) - _check_python_bin(repository_ctx, python_bin) - python_lib = _get_python_lib(repository_ctx, python_bin) + python_bin = _get_python_bin(repository_ctx, bin_path_key, default_bin_path) + _check_python_bin(repository_ctx, python_bin, bin_path_key) + python_lib = _get_python_lib(repository_ctx, python_bin, lib_path_key) _check_python_lib(repository_ctx, python_lib) python_include = _get_python_include(repository_ctx, python_bin) python_include_rule = _symlink_genrule_for_dir( - repository_ctx, python_include, 'python_include', 'python_include') + repository_ctx, python_include, '{}_include'.format(variety_name), + '{}_include'.format(variety_name)) python_import_lib_genrule = "" # To build Python C/C++ extension on Windows, we need to link to python import library pythonXY.lib # See https://docs.python.org/3/extending/windows.html if _is_windows(repository_ctx): python_include = _normalize_path(python_include) - python_import_lib_name = _get_python_import_lib_name( + python_import_lib_name = _get_python_import_lib_name, bin_path_key( repository_ctx, python_bin) python_import_lib_src = python_include.rsplit( '/', 1)[0] + "/libs/" + python_import_lib_name python_import_lib_genrule = _symlink_genrule_for_dir( - repository_ctx, None, '', 'python_import_lib', + repository_ctx, None, '', '{}_import_lib'.format(variety_name), [python_import_lib_src], [python_import_lib_name]) _tpl( - repository_ctx, "BUILD", { + repository_ctx, "variety", { "%{PYTHON_INCLUDE_GENRULE}": python_include_rule, "%{PYTHON_IMPORT_LIB_GENRULE}": python_import_lib_genrule, - }) - - -def _create_remote_python_repository(repository_ctx, remote_config_repo): - """Creates pointers to a remotely configured repo set up to build with Python. - """ - _tpl(repository_ctx, "remote.BUILD", { - "%{REMOTE_PYTHON_REPO}": remote_config_repo, - }, "BUILD") + "%{VARIETY_NAME}": variety_name, + }, + out="{}/BUILD".format(variety_name)) +# TODO(rbellevi): Remove def _python_autoconf_impl(repository_ctx): """Implementation of the python_autoconf repository rule.""" - if _PYTHON_CONFIG_REPO in repository_ctx.os.environ: - _create_remote_python_repository( - repository_ctx, repository_ctx.os.environ[_PYTHON_CONFIG_REPO]) - else: - _create_local_python_repository(repository_ctx) + _create_local_python_repository(repository_ctx, + "_python2", + _PYTHON2_BIN_PATH, + "python", + _PYTHON2_LIB_PATH) + _create_local_python_repository(repository_ctx, + "_python3", + _PYTHON3_BIN_PATH, + "python3", + _PYTHON3_LIB_PATH) + _tpl(repository_ctx, "BUILD") python_configure = repository_rule( implementation=_python_autoconf_impl, environ=[ _BAZEL_SH, - _PYTHON_BIN_PATH, - _PYTHON_LIB_PATH, - _PYTHON_CONFIG_REPO, + _PYTHON2_BIN_PATH, + _PYTHON2_LIB_PATH, + _PYTHON3_BIN_PATH, + _PYTHON3_LIB_PATH, ], ) """Detects and configures the local Python. +It is expected that the system have both a working Python 2 and python 3 +installation + Add the following to your WORKSPACE FILE: ```python diff --git a/third_party/py/remote.BUILD.tpl b/third_party/py/remote.BUILD.tpl deleted file mode 100644 index 1bfe1f0bf65..00000000000 --- a/third_party/py/remote.BUILD.tpl +++ /dev/null @@ -1,10 +0,0 @@ -# Adapted with modifications from tensorflow/third_party/py/ - -package(default_visibility=["//visibility:public"]) - -alias( - name="python_headers", - actual="%{REMOTE_PYTHON_REPO}:python_headers", -) - - diff --git a/third_party/py/variety.tpl b/third_party/py/variety.tpl new file mode 100644 index 00000000000..0c466d6d8f0 --- /dev/null +++ b/third_party/py/variety.tpl @@ -0,0 +1,26 @@ +package(default_visibility=["//visibility:public"]) + +# To build Python C/C++ extension on Windows, we need to link to python import library pythonXY.lib +# See https://docs.python.org/3/extending/windows.html +cc_import( + name="%{VARIETY_NAME}_lib", + interface_library=select({ + "//:windows": ":%{VARIETY_NAME}_import_lib", + # A placeholder for Unix platforms which makes --no_build happy. + "//conditions:default": "not-existing.lib", + }), + system_provided=1, +) + +cc_library( + name="%{VARIETY_NAME}_headers", + hdrs=[":%{VARIETY_NAME}_include"], + deps=select({ + "//:windows": [":%{VARIETY_NAME}_lib"], + "//conditions:default": [], + }), + includes=["%{VARIETY_NAME}_include"], +) + +%{PYTHON_INCLUDE_GENRULE} +%{PYTHON_IMPORT_LIB_GENRULE} diff --git a/tools/bazel.rc b/tools/bazel.rc index b24f603ddda..fcbe9337b9f 100644 --- a/tools/bazel.rc +++ b/tools/bazel.rc @@ -82,7 +82,3 @@ build:basicprof --copt=-DNDEBUG build:basicprof --copt=-O2 build:basicprof --copt=-DGRPC_BASIC_PROFILER build:basicprof --copt=-DGRPC_TIMERS_RDTSC - -build:python3 --python_path=python3 -build:python3 --python_version=PY3 -build:python3 --action_env=PYTHON_BIN_PATH=python3 From b7667478cf18cfbfb907f71b31aa12e8c7f97371 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 25 Jun 2019 10:13:21 -0400 Subject: [PATCH 05/33] bump bazel version to 0.27 --- bazel/grpc_deps.bzl | 8 ++++---- templates/tools/dockerfile/bazel.include | 2 +- tools/bazel | 2 +- tools/dockerfile/test/bazel/Dockerfile | 2 +- tools/dockerfile/test/sanity/Dockerfile | 2 +- tools/remote_build/kokoro.bazelrc | 7 +++---- tools/remote_build/manual.bazelrc | 7 +++---- tools/remote_build/rbe_common.bazelrc | 2 +- 8 files changed, 15 insertions(+), 17 deletions(-) diff --git a/bazel/grpc_deps.bzl b/bazel/grpc_deps.bzl index 06323ff3f24..57021924725 100644 --- a/bazel/grpc_deps.bzl +++ b/bazel/grpc_deps.bzl @@ -176,11 +176,11 @@ def grpc_deps(): if "bazel_toolchains" not in native.existing_rules(): http_archive( name = "bazel_toolchains", - sha256 = "d968b414b32aa99c86977e1171645d31da2b52ac88060de3ac1e49932d5dcbf1", - strip_prefix = "bazel-toolchains-4bd5df80d77aa7f4fb943dfdfad5c9056a62fb47", + sha256 = "872955b658113924eb1a3594b04d43238da47f4f90c17b76e8785709490dc041", + strip_prefix = "bazel-toolchains-1083686fde6032378d52b4c98044922cebde364e", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/4bd5df80d77aa7f4fb943dfdfad5c9056a62fb47.tar.gz", - "https://github.com/bazelbuild/bazel-toolchains/archive/4bd5df80d77aa7f4fb943dfdfad5c9056a62fb47.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/1083686fde6032378d52b4c98044922cebde364e.tar.gz", + "https://github.com/bazelbuild/bazel-toolchains/archive/1083686fde6032378d52b4c98044922cebde364e.tar.gz", ], ) diff --git a/templates/tools/dockerfile/bazel.include b/templates/tools/dockerfile/bazel.include index adde6ed4787..12a22785623 100644 --- a/templates/tools/dockerfile/bazel.include +++ b/templates/tools/dockerfile/bazel.include @@ -2,7 +2,7 @@ # Bazel installation # Must be in sync with tools/bazel -ENV BAZEL_VERSION 0.26.0 +ENV BAZEL_VERSION 0.28.1 # The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper. ENV DISABLE_BAZEL_WRAPPER 1 diff --git a/tools/bazel b/tools/bazel index 4f08d18c656..4d1d57f60d9 100755 --- a/tools/bazel +++ b/tools/bazel @@ -32,7 +32,7 @@ then exec -a "$0" "${BAZEL_REAL}" "$@" fi -VERSION=0.26.0 +VERSION=0.28.1 echo "INFO: Running bazel wrapper (see //tools/bazel for details), bazel version $VERSION will be used instead of system-wide bazel installation." diff --git a/tools/dockerfile/test/bazel/Dockerfile b/tools/dockerfile/test/bazel/Dockerfile index 7e7903359e7..7141fb9c5f1 100644 --- a/tools/dockerfile/test/bazel/Dockerfile +++ b/tools/dockerfile/test/bazel/Dockerfile @@ -52,7 +52,7 @@ RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 t # Bazel installation # Must be in sync with tools/bazel -ENV BAZEL_VERSION 0.26.0 +ENV BAZEL_VERSION 0.28.1 # The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper. ENV DISABLE_BAZEL_WRAPPER 1 diff --git a/tools/dockerfile/test/sanity/Dockerfile b/tools/dockerfile/test/sanity/Dockerfile index ca786e264ed..e9c1b4bee12 100644 --- a/tools/dockerfile/test/sanity/Dockerfile +++ b/tools/dockerfile/test/sanity/Dockerfile @@ -98,7 +98,7 @@ ENV CLANG_TIDY=clang-tidy # Bazel installation # Must be in sync with tools/bazel -ENV BAZEL_VERSION 0.26.0 +ENV BAZEL_VERSION 0.28.1 # The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper. ENV DISABLE_BAZEL_WRAPPER 1 diff --git a/tools/remote_build/kokoro.bazelrc b/tools/remote_build/kokoro.bazelrc index 064e94b2e15..5c1b061bce3 100644 --- a/tools/remote_build/kokoro.bazelrc +++ b/tools/remote_build/kokoro.bazelrc @@ -16,13 +16,12 @@ import %workspace%/tools/remote_build/rbe_common.bazelrc -build --remote_cache=remotebuildexecution.googleapis.com -build --remote_executor=remotebuildexecution.googleapis.com -build --tls_enabled=true +build --remote_cache=grpcs://remotebuildexecution.googleapis.com +build --remote_executor=grpcs://remotebuildexecution.googleapis.com build --auth_enabled=true -build --bes_backend=buildeventservice.googleapis.com +build --bes_backend=grpcs://buildeventservice.googleapis.com build --bes_timeout=600s build --project_id=grpc-testing diff --git a/tools/remote_build/manual.bazelrc b/tools/remote_build/manual.bazelrc index fcd41f57521..c3c6af42877 100644 --- a/tools/remote_build/manual.bazelrc +++ b/tools/remote_build/manual.bazelrc @@ -17,9 +17,8 @@ import %workspace%/tools/remote_build/rbe_common.bazelrc -build --remote_cache=remotebuildexecution.googleapis.com -build --remote_executor=remotebuildexecution.googleapis.com -build --tls_enabled=true +build --remote_cache=grpcs://remotebuildexecution.googleapis.com +build --remote_executor=grpcs://remotebuildexecution.googleapis.com # Enable authentication. This will pick up application default credentials by # default. You can use --auth_credentials=some_file.json to use a service @@ -30,7 +29,7 @@ build --auth_enabled=true # Set flags for uploading to BES in order to view results in the Bazel Build # Results UI. -build --bes_backend="buildeventservice.googleapis.com" +build --bes_backend=grpcs://buildeventservice.googleapis.com build --bes_timeout=60s build --bes_results_url="https://source.cloud.google.com/results/invocations/" build --project_id=grpc-testing diff --git a/tools/remote_build/rbe_common.bazelrc b/tools/remote_build/rbe_common.bazelrc index 6baaf24732c..6236003fe17 100644 --- a/tools/remote_build/rbe_common.bazelrc +++ b/tools/remote_build/rbe_common.bazelrc @@ -87,4 +87,4 @@ build:ubsan --test_timeout=3600 # how to update the bazel toolchain for ubsan: # - check for the latest released version in https://github.com/bazelbuild/bazel-toolchains/tree/master/configs/experimental/ubuntu16_04_clang # - you might need to update the bazel_toolchains dependency in grpc_deps.bzl -build:ubsan --crosstool_top=@bazel_toolchains//configs/experimental/ubuntu16_04_clang/1.2/bazel_0.23.0/ubsan:toolchain +build:ubsan --crosstool_top=@bazel_toolchains//configs/experimental/ubuntu16_04_clang/1.2/bazel_0.28.0/ubsan:toolchain From 27990a5541db08d8cf63c433119b9744d8007b80 Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Tue, 27 Aug 2019 17:47:52 -0700 Subject: [PATCH 06/33] Explicitly add python versions to examples. --- examples/python/auth/BUILD.bazel | 3 +++ examples/python/cancellation/BUILD.bazel | 3 +++ examples/python/compression/BUILD.bazel | 3 +++ examples/python/debug/BUILD.bazel | 3 +++ examples/python/errors/BUILD.bazel | 1 + examples/python/multiprocessing/BUILD | 3 +++ examples/python/wait_for_ready/BUILD.bazel | 1 + 7 files changed, 17 insertions(+) diff --git a/examples/python/auth/BUILD.bazel b/examples/python/auth/BUILD.bazel index cc454fdfdfe..72620ee46c5 100644 --- a/examples/python/auth/BUILD.bazel +++ b/examples/python/auth/BUILD.bazel @@ -39,6 +39,7 @@ py_binary( "//examples:helloworld_py_pb2", "//examples:helloworld_py_pb2_grpc", ], + python_version = "PY3", ) py_binary( @@ -51,6 +52,7 @@ py_binary( "//examples:helloworld_py_pb2", "//examples:helloworld_py_pb2_grpc", ], + python_version = "PY3", ) py_test( @@ -63,4 +65,5 @@ py_test( ":customized_auth_server", ":_credentials", ], + python_version = "PY3", ) diff --git a/examples/python/cancellation/BUILD.bazel b/examples/python/cancellation/BUILD.bazel index 17b1b20168e..b4451f60711 100644 --- a/examples/python/cancellation/BUILD.bazel +++ b/examples/python/cancellation/BUILD.bazel @@ -45,6 +45,7 @@ py_binary( "//external:six" ], srcs_version = "PY2AND3", + python_version = "PY3", ) py_library( @@ -68,6 +69,7 @@ py_binary( "//:python3": [], }), srcs_version = "PY2AND3", + python_version = "PY3", ) py_test( @@ -78,4 +80,5 @@ py_test( ":server" ], size = "small", + python_version = "PY3", ) diff --git a/examples/python/compression/BUILD.bazel b/examples/python/compression/BUILD.bazel index 9d5f6bb83ed..4141eda2ffd 100644 --- a/examples/python/compression/BUILD.bazel +++ b/examples/python/compression/BUILD.bazel @@ -21,6 +21,7 @@ py_binary( "//examples:helloworld_py_pb2_grpc", ], srcs_version = "PY2AND3", + python_version = "PY3", ) py_binary( @@ -32,6 +33,7 @@ py_binary( "//examples:helloworld_py_pb2_grpc", ], srcs_version = "PY2AND3", + python_version = "PY3", ) py_test( @@ -43,4 +45,5 @@ py_test( ":server", ], size = "small", + python_version = "PY3", ) diff --git a/examples/python/debug/BUILD.bazel b/examples/python/debug/BUILD.bazel index 657ae860ae3..332991332f8 100644 --- a/examples/python/debug/BUILD.bazel +++ b/examples/python/debug/BUILD.bazel @@ -35,6 +35,7 @@ py_binary( "//examples:helloworld_py_pb2", "//examples:helloworld_py_pb2_grpc", ], + python_version = "PY3", ) py_binary( @@ -45,6 +46,7 @@ py_binary( "//src/python/grpcio/grpc:grpcio", "//src/python/grpcio_channelz/grpc_channelz/v1:grpc_channelz", ], + python_version = "PY3", ) py_test( @@ -59,4 +61,5 @@ py_test( ":send_message", ":get_stats", ], + python_version = "PY3", ) diff --git a/examples/python/errors/BUILD.bazel b/examples/python/errors/BUILD.bazel index 4b779ddfcf1..367bd81925f 100644 --- a/examples/python/errors/BUILD.bazel +++ b/examples/python/errors/BUILD.bazel @@ -55,4 +55,5 @@ py_test( "../../../src/python/grpcio_status", "../../../src/python/grpcio_tests", ], + python_version = "PY3", ) diff --git a/examples/python/multiprocessing/BUILD b/examples/python/multiprocessing/BUILD index 490aea0c1e6..2503970bc80 100644 --- a/examples/python/multiprocessing/BUILD +++ b/examples/python/multiprocessing/BUILD @@ -42,6 +42,7 @@ py_binary( ":prime_proto_pb2_grpc", ], srcs_version = "PY3", + python_version = "PY3", ) py_binary( @@ -57,6 +58,7 @@ py_binary( "//:python3": [], }), srcs_version = "PY3", + python_version = "PY3", ) py_test( @@ -67,4 +69,5 @@ py_test( ":server" ], size = "small", + python_version = "PY3", ) diff --git a/examples/python/wait_for_ready/BUILD.bazel b/examples/python/wait_for_ready/BUILD.bazel index f074ae7bb7f..9cbddd1a6e3 100644 --- a/examples/python/wait_for_ready/BUILD.bazel +++ b/examples/python/wait_for_ready/BUILD.bazel @@ -30,4 +30,5 @@ py_test( srcs = ["test/_wait_for_ready_example_test.py"], deps = [":wait_for_ready_example",], size = "small", + python_version = "PY3", ) From 1b69538d58f037732a4a359b878b8ae8e8d296f1 Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Tue, 27 Aug 2019 17:51:45 -0700 Subject: [PATCH 07/33] Switch all tests to py2and3_test --- src/python/grpcio_tests/tests/channelz/BUILD.bazel | 4 +++- src/python/grpcio_tests/tests/health_check/BUILD.bazel | 3 ++- src/python/grpcio_tests/tests/interop/BUILD.bazel | 5 +++-- src/python/grpcio_tests/tests/reflection/BUILD.bazel | 3 ++- src/python/grpcio_tests/tests/status/BUILD.bazel | 3 ++- src/python/grpcio_tests/tests/unit/_cython/BUILD.bazel | 3 ++- .../grpcio_tests/tests/unit/framework/foundation/BUILD.bazel | 3 ++- 7 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/python/grpcio_tests/tests/channelz/BUILD.bazel b/src/python/grpcio_tests/tests/channelz/BUILD.bazel index 63513616e77..f4d246847f7 100644 --- a/src/python/grpcio_tests/tests/channelz/BUILD.bazel +++ b/src/python/grpcio_tests/tests/channelz/BUILD.bazel @@ -1,6 +1,8 @@ package(default_visibility = ["//visibility:public"]) -py_test( +load("//bazel:python_rules.bzl", "py2and3_test") + +py2and3_test( name = "channelz_servicer_test", srcs = ["_channelz_servicer_test.py"], main = "_channelz_servicer_test.py", diff --git a/src/python/grpcio_tests/tests/health_check/BUILD.bazel b/src/python/grpcio_tests/tests/health_check/BUILD.bazel index 49f076be9a1..797b6a48e91 100644 --- a/src/python/grpcio_tests/tests/health_check/BUILD.bazel +++ b/src/python/grpcio_tests/tests/health_check/BUILD.bazel @@ -1,6 +1,7 @@ package(default_visibility = ["//visibility:public"]) +load("//bazel:python_rules.bzl", "py2and3_test") -py_test( +py2and3_test( name = "health_servicer_test", srcs = ["_health_servicer_test.py"], main = "_health_servicer_test.py", diff --git a/src/python/grpcio_tests/tests/interop/BUILD.bazel b/src/python/grpcio_tests/tests/interop/BUILD.bazel index 8ac3f7d52d5..4685852162b 100644 --- a/src/python/grpcio_tests/tests/interop/BUILD.bazel +++ b/src/python/grpcio_tests/tests/interop/BUILD.bazel @@ -1,4 +1,5 @@ load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("//bazel:python_rules.bzl", "py2and3_test") package(default_visibility = ["//visibility:public"]) @@ -80,7 +81,7 @@ py_library( ], ) -py_test( +py2and3_test( name = "_insecure_intraop_test", size = "small", srcs = ["_insecure_intraop_test.py"], @@ -99,7 +100,7 @@ py_test( ], ) -py_test( +py2and3_test( name = "_secure_intraop_test", size = "small", srcs = ["_secure_intraop_test.py"], diff --git a/src/python/grpcio_tests/tests/reflection/BUILD.bazel b/src/python/grpcio_tests/tests/reflection/BUILD.bazel index e9b56191df8..65a08c2a435 100644 --- a/src/python/grpcio_tests/tests/reflection/BUILD.bazel +++ b/src/python/grpcio_tests/tests/reflection/BUILD.bazel @@ -1,8 +1,9 @@ load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("//bazel:python_rules.bzl", "py2and3_test") package(default_visibility = ["//visibility:public"]) -py_test( +py2and3_test( name="_reflection_servicer_test", size="small", timeout="moderate", diff --git a/src/python/grpcio_tests/tests/status/BUILD.bazel b/src/python/grpcio_tests/tests/status/BUILD.bazel index b163fe3975e..0868de01acf 100644 --- a/src/python/grpcio_tests/tests/status/BUILD.bazel +++ b/src/python/grpcio_tests/tests/status/BUILD.bazel @@ -1,8 +1,9 @@ load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("//bazel:python_rules.bzl", "py2and3_test") package(default_visibility = ["//visibility:public"]) -py_test( +py2and3_test( name = "grpc_status_test", srcs = ["_grpc_status_test.py"], main = "_grpc_status_test.py", diff --git a/src/python/grpcio_tests/tests/unit/_cython/BUILD.bazel b/src/python/grpcio_tests/tests/unit/_cython/BUILD.bazel index 458a6b1fb8a..867649a6a50 100644 --- a/src/python/grpcio_tests/tests/unit/_cython/BUILD.bazel +++ b/src/python/grpcio_tests/tests/unit/_cython/BUILD.bazel @@ -1,4 +1,5 @@ load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("//bazel:python_rules.bzl", "py2and3_test") package(default_visibility = ["//visibility:public"]) @@ -23,7 +24,7 @@ py_library( ) [ - py_test( + py2and3_test( name=test_file_name[:-3], size="small", srcs=[test_file_name], diff --git a/src/python/grpcio_tests/tests/unit/framework/foundation/BUILD.bazel b/src/python/grpcio_tests/tests/unit/framework/foundation/BUILD.bazel index d69186e1fde..a93249301c4 100644 --- a/src/python/grpcio_tests/tests/unit/framework/foundation/BUILD.bazel +++ b/src/python/grpcio_tests/tests/unit/framework/foundation/BUILD.bazel @@ -1,11 +1,12 @@ package(default_visibility = ["//visibility:public"]) +load("//bazel:python_rules.bzl", "py2and3_test") py_library( name = "stream_testing", srcs = ["stream_testing.py"], ) -py_test( +py2and3_test( name = "logging_pool_test", srcs = ["_logging_pool_test.py"], main = "_logging_pool_test.py", From 6dfa96524df73c5dd00ad2bf1aef1279aeb8944d Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Tue, 27 Aug 2019 17:59:39 -0700 Subject: [PATCH 08/33] Fix failing CPP test --- bazel/grpc_build_system.bzl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bazel/grpc_build_system.bzl b/bazel/grpc_build_system.bzl index 23f90d0dc80..54398b66d82 100644 --- a/bazel/grpc_build_system.bzl +++ b/bazel/grpc_build_system.bzl @@ -262,13 +262,22 @@ def grpc_sh_binary(name, srcs, data = []): data = data, ) -def grpc_py_binary(name, srcs, data = [], deps = [], external_deps = [], testonly = False): +def grpc_py_binary(name, + srcs, + data = [], + deps = [], + external_deps = [], + testonly = False, + python_version = "PY2", + **kwargs): native.py_binary( name = name, srcs = srcs, testonly = testonly, data = data, deps = deps + _get_external_deps(external_deps), + python_version = python_version, + **kwargs, ) def grpc_package(name, visibility = "private", features = []): From 544ead769ddb7f2a579719953e310d088c92a376 Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Tue, 27 Aug 2019 18:02:02 -0700 Subject: [PATCH 09/33] Remove explicit Python 3 testing --- tools/internal_ci/linux/grpc_python_bazel_test_in_docker.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/internal_ci/linux/grpc_python_bazel_test_in_docker.sh b/tools/internal_ci/linux/grpc_python_bazel_test_in_docker.sh index f725eb7a3d7..4a48760aab1 100755 --- a/tools/internal_ci/linux/grpc_python_bazel_test_in_docker.sh +++ b/tools/internal_ci/linux/grpc_python_bazel_test_in_docker.sh @@ -26,9 +26,6 @@ ${name}') cd /var/local/git/grpc/test bazel test --spawn_strategy=standalone --genrule_strategy=standalone --test_output=errors //src/python/... bazel test --spawn_strategy=standalone --genrule_strategy=standalone --test_output=errors //examples/python/... -bazel clean --expunge -bazel test --config=python3 --spawn_strategy=standalone --genrule_strategy=standalone --test_output=errors //src/python/... -bazel test --config=python3 --spawn_strategy=standalone --genrule_strategy=standalone --test_output=errors //examples/python/... # TODO(https://github.com/grpc/grpc/issues/19854): Move this to a new Kokoro # job. From 3207e623282b07c70ad07d1c9b3fbc46d2d4c394 Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Tue, 27 Aug 2019 18:07:13 -0700 Subject: [PATCH 10/33] Finish todo --- third_party/py/python_configure.bzl | 1 - 1 file changed, 1 deletion(-) diff --git a/third_party/py/python_configure.bzl b/third_party/py/python_configure.bzl index a2f0c7918d2..123f0b11865 100644 --- a/third_party/py/python_configure.bzl +++ b/third_party/py/python_configure.bzl @@ -277,7 +277,6 @@ def _create_local_python_repository(repository_ctx, out="{}/BUILD".format(variety_name)) -# TODO(rbellevi): Remove def _python_autoconf_impl(repository_ctx): """Implementation of the python_autoconf repository rule.""" _create_local_python_repository(repository_ctx, From abc384164ae9414dbd35507b0d06c62b83c798b1 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 28 Aug 2019 05:52:38 -0400 Subject: [PATCH 11/33] fix kwargs syntax error --- bazel/grpc_build_system.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bazel/grpc_build_system.bzl b/bazel/grpc_build_system.bzl index 54398b66d82..c123a2e627d 100644 --- a/bazel/grpc_build_system.bzl +++ b/bazel/grpc_build_system.bzl @@ -277,7 +277,7 @@ def grpc_py_binary(name, data = data, deps = deps + _get_external_deps(external_deps), python_version = python_version, - **kwargs, + **kwargs ) def grpc_package(name, visibility = "private", features = []): From 1ee329187f9fdc6614a1ce1150f53dfc1bca79be Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 28 Aug 2019 08:34:39 -0400 Subject: [PATCH 12/33] enable compute_enging_creds and jwt_token_creds interop tests for managed dotnet client --- tools/run_tests/run_interop_tests.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index d35723c917e..066097dca59 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -208,8 +208,6 @@ class AspNetCoreLanguage: def unimplemented_test_cases(self): return _SKIP_COMPRESSION + \ - ['compute_engine_creds'] + \ - ['jwt_token_creds'] + \ _SKIP_GOOGLE_DEFAULT_CREDS + \ _SKIP_COMPUTE_ENGINE_CHANNEL_CREDS From c8430023a5c137289905e66191897ed88d7ea3e0 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Wed, 28 Aug 2019 09:05:59 -0700 Subject: [PATCH 13/33] Apply health check service name changes to existing subchannels. --- .../filters/client_channel/client_channel.cc | 90 ++++++++++++++++--- test/cpp/end2end/client_lb_end2end_test.cc | 43 ++++++++- 2 files changed, 119 insertions(+), 14 deletions(-) diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc index db5ddcb46b9..00d21987777 100644 --- a/src/core/ext/filters/client_channel/client_channel.cc +++ b/src/core/ext/filters/client_channel/client_channel.cc @@ -273,6 +273,12 @@ class ChannelData { bool received_first_resolver_result_ = false; // The number of SubchannelWrapper instances referencing a given Subchannel. Map subchannel_refcount_map_; + // The set of SubchannelWrappers that currently exist. + // No need to hold a ref, since the map is updated in the control-plane + // combiner when the SubchannelWrappers are created and destroyed. + // TODO(roth): We really want to use a set here, not a map. Since we don't + // currently have a set implementation, we use a map and ignore the value. + Map subchannel_wrappers_; // Pending ConnectedSubchannel updates for each SubchannelWrapper. // Updates are queued here in the control plane combiner and then applied // in the data plane combiner when the picker is updated. @@ -799,14 +805,14 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface { GRPC_CHANNEL_STACK_REF(chand_->owning_stack_, "SubchannelWrapper"); auto* subchannel_node = subchannel_->channelz_node(); if (subchannel_node != nullptr) { - intptr_t subchannel_uuid = subchannel_node->uuid(); auto it = chand_->subchannel_refcount_map_.find(subchannel_); if (it == chand_->subchannel_refcount_map_.end()) { - chand_->channelz_node_->AddChildSubchannel(subchannel_uuid); + chand_->channelz_node_->AddChildSubchannel(subchannel_node->uuid()); it = chand_->subchannel_refcount_map_.emplace(subchannel_, 0).first; } ++it->second; } + chand_->subchannel_wrappers_[this] = true; } ~SubchannelWrapper() { @@ -815,14 +821,14 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface { "chand=%p: destroying subchannel wrapper %p for subchannel %p", chand_, this, subchannel_); } + chand_->subchannel_wrappers_.erase(this); auto* subchannel_node = subchannel_->channelz_node(); if (subchannel_node != nullptr) { - intptr_t subchannel_uuid = subchannel_node->uuid(); auto it = chand_->subchannel_refcount_map_.find(subchannel_); GPR_ASSERT(it != chand_->subchannel_refcount_map_.end()); --it->second; if (it->second == 0) { - chand_->channelz_node_->RemoveChildSubchannel(subchannel_uuid); + chand_->channelz_node_->RemoveChildSubchannel(subchannel_node->uuid()); chand_->subchannel_refcount_map_.erase(it); } } @@ -844,8 +850,9 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface { UniquePtr watcher) override { auto& watcher_wrapper = watcher_map_[watcher.get()]; GPR_ASSERT(watcher_wrapper == nullptr); - watcher_wrapper = New( - std::move(watcher), Ref(DEBUG_LOCATION, "WatcherWrapper")); + watcher_wrapper = New(std::move(watcher), + Ref(DEBUG_LOCATION, "WatcherWrapper"), + initial_state); subchannel_->WatchConnectivityState( initial_state, UniquePtr(gpr_strdup(health_check_service_name_.get())), @@ -870,6 +877,40 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface { return subchannel_->channel_args(); } + void UpdateHealthCheckServiceName(UniquePtr health_check_service_name) { + if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) { + gpr_log(GPR_INFO, + "chand=%p: subchannel wrapper %p: updating health check service " + "name from \"%s\" to \"%s\"", + chand_, this, health_check_service_name_.get(), + health_check_service_name.get()); + } + for (auto& p : watcher_map_) { + WatcherWrapper*& watcher_wrapper = p.second; + // Cancel the current watcher and create a new one using the new + // health check service name. + // TODO(roth): If there is not already an existing health watch + // call for the new name, then the watcher will initially report + // state CONNECTING. If the LB policy is currently reporting + // state READY, this may cause it to switch to CONNECTING before + // switching back to READY. This could cause a small delay for + // RPCs being started on the channel. If/when this becomes a + // problem, we may be able to handle it by waiting for the new + // watcher to report READY before we use it to replace the old one. + WatcherWrapper* replacement = watcher_wrapper->MakeReplacement(); + subchannel_->CancelConnectivityStateWatch( + health_check_service_name_.get(), watcher_wrapper); + watcher_wrapper = replacement; + subchannel_->WatchConnectivityState( + replacement->last_seen_state(), + UniquePtr(gpr_strdup(health_check_service_name.get())), + OrphanablePtr( + replacement)); + } + // Save the new health check service name. + health_check_service_name_ = std::move(health_check_service_name); + } + // Caller must be holding the control-plane combiner. ConnectedSubchannel* connected_subchannel() const { return connected_subchannel_.get(); @@ -904,8 +945,11 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface { WatcherWrapper( UniquePtr watcher, - RefCountedPtr parent) - : watcher_(std::move(watcher)), parent_(std::move(parent)) {} + RefCountedPtr parent, + grpc_connectivity_state initial_state) + : watcher_(std::move(watcher)), + parent_(std::move(parent)), + last_seen_state_(initial_state) {} ~WatcherWrapper() { parent_.reset(DEBUG_LOCATION, "WatcherWrapper"); } @@ -928,9 +972,21 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface { } grpc_pollset_set* interested_parties() override { - return watcher_->interested_parties(); + SubchannelInterface::ConnectivityStateWatcherInterface* watcher = + watcher_.get(); + if (watcher_ == nullptr) watcher = replacement_->watcher_.get(); + return watcher->interested_parties(); } + WatcherWrapper* MakeReplacement() { + auto* replacement = + New(std::move(watcher_), parent_, last_seen_state_); + replacement_ = replacement; + return replacement; + } + + grpc_connectivity_state last_seen_state() const { return last_seen_state_; } + private: class Updater { public: @@ -954,12 +1010,17 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface { gpr_log(GPR_INFO, "chand=%p: processing connectivity change in combiner " "for subchannel wrapper %p subchannel %p " - "(connected_subchannel=%p state=%s)", + "(connected_subchannel=%p state=%s): watcher=%p", self->parent_->parent_->chand_, self->parent_->parent_.get(), self->parent_->parent_->subchannel_, self->connected_subchannel_.get(), - grpc_connectivity_state_name(self->state_)); + grpc_connectivity_state_name(self->state_), + self->parent_->watcher_.get()); } + // Ignore update if the parent WatcherWrapper has been replaced + // since this callback was scheduled. + if (self->parent_->watcher_ == nullptr) return; + self->parent_->last_seen_state_ = self->state_; self->parent_->parent_->MaybeUpdateConnectedSubchannel( std::move(self->connected_subchannel_)); self->parent_->watcher_->OnConnectivityStateChange(self->state_); @@ -974,6 +1035,8 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface { UniquePtr watcher_; RefCountedPtr parent_; + grpc_connectivity_state last_seen_state_; + WatcherWrapper* replacement_ = nullptr; }; void MaybeUpdateConnectedSubchannel( @@ -1655,6 +1718,11 @@ bool ChannelData::ProcessResolverResultLocked( } else { chand->health_check_service_name_.reset(); } + // Update health check service name used by existing subchannel wrappers. + for (const auto& p : chand->subchannel_wrappers_) { + p.first->UpdateHealthCheckServiceName( + UniquePtr(gpr_strdup(chand->health_check_service_name_.get()))); + } // Save service config. chand->saved_service_config_ = std::move(service_config); } diff --git a/test/cpp/end2end/client_lb_end2end_test.cc b/test/cpp/end2end/client_lb_end2end_test.cc index ceab7506729..a0af46570d4 100644 --- a/test/cpp/end2end/client_lb_end2end_test.cc +++ b/test/cpp/end2end/client_lb_end2end_test.cc @@ -42,6 +42,7 @@ #include "src/core/ext/filters/client_channel/parse_address.h" #include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h" #include "src/core/ext/filters/client_channel/server_address.h" +#include "src/core/ext/filters/client_channel/service_config.h" #include "src/core/lib/backoff/backoff.h" #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/gprpp/debug_location.h" @@ -144,9 +145,11 @@ class FakeResolverResponseGeneratorWrapper { response_generator_ = std::move(other.response_generator_); } - void SetNextResolution(const std::vector& ports) { + void SetNextResolution(const std::vector& ports, + const char* service_config_json = nullptr) { grpc_core::ExecCtx exec_ctx; - response_generator_->SetResponse(BuildFakeResults(ports)); + response_generator_->SetResponse( + BuildFakeResults(ports, service_config_json)); } void SetNextResolutionUponError(const std::vector& ports) { @@ -165,7 +168,8 @@ class FakeResolverResponseGeneratorWrapper { private: static grpc_core::Resolver::Result BuildFakeResults( - const std::vector& ports) { + const std::vector& ports, + const char* service_config_json = nullptr) { grpc_core::Resolver::Result result; for (const int& port : ports) { char* lb_uri_str; @@ -179,6 +183,11 @@ class FakeResolverResponseGeneratorWrapper { grpc_uri_destroy(lb_uri); gpr_free(lb_uri_str); } + if (service_config_json != nullptr) { + result.service_config = grpc_core::ServiceConfig::Create( + service_config_json, &result.service_config_error); + GPR_ASSERT(result.service_config != nullptr); + } return result; } @@ -1465,6 +1474,34 @@ TEST_F(ClientLbEnd2endTest, RoundRobinWithHealthCheckingServiceNamePerChannel) { EnableDefaultHealthCheckService(false); } +TEST_F(ClientLbEnd2endTest, + RoundRobinWithHealthCheckingServiceNameChangesAfterSubchannelsCreated) { + EnableDefaultHealthCheckService(true); + // Start server. + const int kNumServers = 1; + StartServers(kNumServers); + // Create a channel with health-checking enabled. + const char* kServiceConfigJson = + "{\"healthCheckConfig\": " + "{\"serviceName\": \"health_check_service_name\"}}"; + auto response_generator = BuildResolverResponseGenerator(); + auto channel = BuildChannel("round_robin", response_generator); + auto stub = BuildStub(channel); + std::vector ports = GetServersPorts(); + response_generator.SetNextResolution(ports, kServiceConfigJson); + servers_[0]->SetServingStatus("health_check_service_name", true); + EXPECT_TRUE(WaitForChannelReady(channel.get(), 1 /* timeout_seconds */)); + // Send an update on the channel to change it to use a health checking + // service name that is not being reported as healthy. + const char* kServiceConfigJson2 = + "{\"healthCheckConfig\": " + "{\"serviceName\": \"health_check_service_name2\"}}"; + response_generator.SetNextResolution(ports, kServiceConfigJson2); + EXPECT_TRUE(WaitForChannelNotReady(channel.get())); + // Clean up. + EnableDefaultHealthCheckService(false); +} + TEST_F(ClientLbEnd2endTest, ChannelIdleness) { // Start server. const int kNumServers = 1; From 6dfe27ab0823a1dcac2953afdbf404095d7a3320 Mon Sep 17 00:00:00 2001 From: Hope Casey-Allen Date: Tue, 27 Aug 2019 15:09:17 -0700 Subject: [PATCH 14/33] Fix race in bm_chttp2_transport --- test/cpp/microbenchmarks/BUILD | 8 ++++ .../microbenchmarks/bm_chttp2_transport.cc | 40 +++++++++++++++++-- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/test/cpp/microbenchmarks/BUILD b/test/cpp/microbenchmarks/BUILD index b8e9b14d4b4..fdae8246c31 100644 --- a/test/cpp/microbenchmarks/BUILD +++ b/test/cpp/microbenchmarks/BUILD @@ -27,6 +27,14 @@ grpc_cc_test( deps = ["//test/core/util:grpc_test_util"], ) +grpc_cc_binary( + name = "bm_chttp2_transport", + testonly = 1, + srcs = ["bm_chttp2_transport.cc"], + tags = ["no_windows"], + deps = [":helpers"], +) + grpc_cc_library( name = "helpers", testonly = 1, diff --git a/test/cpp/microbenchmarks/bm_chttp2_transport.cc b/test/cpp/microbenchmarks/bm_chttp2_transport.cc index da3357304ba..dc3d76ee38e 100644 --- a/test/cpp/microbenchmarks/bm_chttp2_transport.cc +++ b/test/cpp/microbenchmarks/bm_chttp2_transport.cc @@ -239,7 +239,7 @@ class Stream { grpc_transport_destroy_stream(stream->f_->transport(), static_cast(stream->stream_), stream->destroy_closure_); - gpr_event_set(&stream->done_, (void*)1); + gpr_event_set(&stream->done_, (void*)(1)); } Fixture* f_; @@ -254,6 +254,7 @@ class Stream { //////////////////////////////////////////////////////////////////////////////// // Benchmarks // +std::vector> done_events; static void BM_StreamCreateDestroy(benchmark::State& state) { TrackCounters track_counters; @@ -380,15 +381,24 @@ static void BM_TransportEmptyOp(benchmark::State& state) { reset_op(); op.cancel_stream = true; op_payload.cancel_stream.cancel_error = GRPC_ERROR_CANCELLED; + gpr_event* stream_cancel_done = new gpr_event; + gpr_event_init(stream_cancel_done); + std::unique_ptr stream_cancel_closure = + MakeClosure([&](grpc_error* error) { + GPR_ASSERT(error == GRPC_ERROR_NONE); + gpr_event_set(stream_cancel_done, (void*)(1)); + }); + op.on_complete = stream_cancel_closure.get(); s->Op(&op); + f.FlushExecCtx(); + gpr_event_wait(stream_cancel_done, gpr_inf_future(GPR_CLOCK_REALTIME)); + done_events.emplace_back(stream_cancel_done); s->DestroyThen(MakeOnceClosure([s](grpc_error* error) { delete s; })); f.FlushExecCtx(); track_counters.Finish(state); } BENCHMARK(BM_TransportEmptyOp); -std::vector> done_events; - static void BM_TransportStreamSend(benchmark::State& state) { TrackCounters track_counters; grpc_core::ExecCtx exec_ctx; @@ -424,7 +434,7 @@ static void BM_TransportStreamSend(benchmark::State& state) { std::unique_ptr c = MakeClosure([&](grpc_error* error) { if (!state.KeepRunning()) { - gpr_event_set(bm_done, (void*)1); + gpr_event_set(bm_done, (void*)(1)); return; } grpc_slice_buffer send_buffer; @@ -455,7 +465,18 @@ static void BM_TransportStreamSend(benchmark::State& state) { reset_op(); op.cancel_stream = true; op.payload->cancel_stream.cancel_error = GRPC_ERROR_CANCELLED; + gpr_event* stream_cancel_done = new gpr_event; + gpr_event_init(stream_cancel_done); + std::unique_ptr stream_cancel_closure = + MakeClosure([&](grpc_error* error) { + GPR_ASSERT(error == GRPC_ERROR_NONE); + gpr_event_set(stream_cancel_done, (void*)(1)); + }); + op.on_complete = stream_cancel_closure.get(); s->Op(&op); + f.FlushExecCtx(); + gpr_event_wait(stream_cancel_done, gpr_inf_future(GPR_CLOCK_REALTIME)); + done_events.emplace_back(stream_cancel_done); s->DestroyThen(MakeOnceClosure([s](grpc_error* error) { delete s; })); f.FlushExecCtx(); track_counters.Finish(state); @@ -629,7 +650,18 @@ static void BM_TransportStreamRecv(benchmark::State& state) { reset_op(); op.cancel_stream = true; op.payload->cancel_stream.cancel_error = GRPC_ERROR_CANCELLED; + gpr_event* stream_cancel_done = new gpr_event; + gpr_event_init(stream_cancel_done); + std::unique_ptr stream_cancel_closure = + MakeClosure([&](grpc_error* error) { + GPR_ASSERT(error == GRPC_ERROR_NONE); + gpr_event_set(stream_cancel_done, (void*)(1)); + }); + op.on_complete = stream_cancel_closure.get(); s->Op(&op); + f.FlushExecCtx(); + gpr_event_wait(stream_cancel_done, gpr_inf_future(GPR_CLOCK_REALTIME)); + done_events.emplace_back(stream_cancel_done); s->DestroyThen(MakeOnceClosure([s](grpc_error* error) { delete s; })); grpc_metadata_batch_destroy(&b); grpc_metadata_batch_destroy(&b_recv); From a451a3a94b09a78d4511dd13500bd9da96696d50 Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Wed, 28 Aug 2019 10:18:14 -0700 Subject: [PATCH 15/33] Rename function --- third_party/py/python_configure.bzl | 31 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/third_party/py/python_configure.bzl b/third_party/py/python_configure.bzl index 123f0b11865..70380e9dde9 100644 --- a/third_party/py/python_configure.bzl +++ b/third_party/py/python_configure.bzl @@ -241,12 +241,11 @@ def _get_python_import_lib_name(repository_ctx, python_bin, bin_path_key): return result.stdout.splitlines()[0] -# TODO(rbellevi): Rename. -def _create_local_python_repository(repository_ctx, - variety_name, - bin_path_key, - default_bin_path, - lib_path_key): +def _create_single_version_package(repository_ctx, + variety_name, + bin_path_key, + default_bin_path, + lib_path_key): """Creates the repository containing files set up to build with Python.""" python_bin = _get_python_bin(repository_ctx, bin_path_key, default_bin_path) _check_python_bin(repository_ctx, python_bin, bin_path_key) @@ -279,16 +278,16 @@ def _create_local_python_repository(repository_ctx, def _python_autoconf_impl(repository_ctx): """Implementation of the python_autoconf repository rule.""" - _create_local_python_repository(repository_ctx, - "_python2", - _PYTHON2_BIN_PATH, - "python", - _PYTHON2_LIB_PATH) - _create_local_python_repository(repository_ctx, - "_python3", - _PYTHON3_BIN_PATH, - "python3", - _PYTHON3_LIB_PATH) + _create_single_version_package(repository_ctx, + "_python2", + _PYTHON2_BIN_PATH, + "python", + _PYTHON2_LIB_PATH) + _create_single_version_package(repository_ctx, + "_python3", + _PYTHON3_BIN_PATH, + "python3", + _PYTHON3_LIB_PATH) _tpl(repository_ctx, "BUILD") From d3cd387e03e3cbf99f71c144e371aeade4ad7357 Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Wed, 28 Aug 2019 10:43:01 -0700 Subject: [PATCH 16/33] Bump rules_apple --- bazel/grpc_deps.bzl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bazel/grpc_deps.bzl b/bazel/grpc_deps.bzl index 57021924725..6bbb960b6c3 100644 --- a/bazel/grpc_deps.bzl +++ b/bazel/grpc_deps.bzl @@ -221,10 +221,11 @@ def grpc_deps(): ) if "build_bazel_rules_apple" not in native.existing_rules(): - git_repository( + http_archive( name = "build_bazel_rules_apple", - remote = "https://github.com/bazelbuild/rules_apple.git", - tag = "0.17.2", + url = "https://github.com/bazelbuild/rules_apple/archive/b869b0d3868d78a1d4ffd866ccb304fb68aa12c3.tar.gz", + strip_prefix = "rules_apple-b869b0d3868d78a1d4ffd866ccb304fb68aa12c3", + sha256 = "bdc8e66e70b8a75da23b79f1f8c6207356df07d041d96d2189add7ee0780cf4e", ) grpc_python_deps() From a1ca6a099d90aa0ff8002b75eeee00119d69f4f0 Mon Sep 17 00:00:00 2001 From: Juanli Shen Date: Wed, 28 Aug 2019 10:07:18 -0700 Subject: [PATCH 17/33] Refactor response building in xds test --- test/cpp/end2end/xds_end2end_test.cc | 390 ++++++++++++++------------- 1 file changed, 203 insertions(+), 187 deletions(-) diff --git a/test/cpp/end2end/xds_end2end_test.cc b/test/cpp/end2end/xds_end2end_test.cc index 480680c9a32..1c073de1b12 100644 --- a/test/cpp/end2end/xds_end2end_test.cc +++ b/test/cpp/end2end/xds_end2end_test.cc @@ -96,7 +96,6 @@ constexpr char kEdsTypeUrl[] = "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment"; constexpr char kDefaultLocalityRegion[] = "xds_default_locality_region"; constexpr char kDefaultLocalityZone[] = "xds_default_locality_zone"; -constexpr char kDefaultLocalitySubzone[] = "xds_default_locality_subzone"; constexpr char kLbDropType[] = "lb"; constexpr char kThrottleDropType[] = "throttle"; constexpr int kDefaultLocalityWeight = 3; @@ -260,6 +259,31 @@ class ClientStats { class EdsServiceImpl : public EdsService { public: + struct ResponseArgs { + struct Locality { + Locality(const grpc::string& sub_zone, std::vector ports, + int lb_weight = kDefaultLocalityWeight, int priority = 0) + : sub_zone(std::move(sub_zone)), + ports(std::move(ports)), + lb_weight(lb_weight), + priority(priority) {} + + const grpc::string sub_zone; + std::vector ports; + int lb_weight; + int priority; + }; + + ResponseArgs() = default; + explicit ResponseArgs(std::vector locality_list) + : locality_list(std::move(locality_list)) {} + + std::vector locality_list; + std::map drop_categories; + FractionalPercent::DenominatorType drop_denominator = + FractionalPercent::MILLION; + }; + using Stream = ServerReaderWriter; using ResponseDelayPair = std::pair; @@ -317,47 +341,35 @@ class EdsServiceImpl : public EdsService { gpr_log(GPR_INFO, "LB[%p]: shut down", this); } - // TODO(juanlishen): Put the args into a struct. - static DiscoveryResponse BuildResponse( - const std::vector>& backend_ports, - const std::vector& lb_weights = {}, - size_t first_locality_name_index = 0, - const std::map& drop_categories = {}, - const FractionalPercent::DenominatorType denominator = - FractionalPercent::MILLION) { + static DiscoveryResponse BuildResponse(const ResponseArgs& args) { ClusterLoadAssignment assignment; assignment.set_cluster_name("service name"); - for (size_t i = 0; i < backend_ports.size(); ++i) { + for (const auto& locality : args.locality_list) { auto* endpoints = assignment.add_endpoints(); - const int lb_weight = - lb_weights.empty() ? kDefaultLocalityWeight : lb_weights[i]; - endpoints->mutable_load_balancing_weight()->set_value(lb_weight); - endpoints->set_priority(0); + endpoints->mutable_load_balancing_weight()->set_value(locality.lb_weight); + endpoints->set_priority(locality.priority); endpoints->mutable_locality()->set_region(kDefaultLocalityRegion); endpoints->mutable_locality()->set_zone(kDefaultLocalityZone); - std::ostringstream sub_zone; - sub_zone << kDefaultLocalitySubzone << '_' - << first_locality_name_index + i; - endpoints->mutable_locality()->set_sub_zone(sub_zone.str()); - for (const int& backend_port : backend_ports[i]) { + endpoints->mutable_locality()->set_sub_zone(locality.sub_zone); + for (const int& port : locality.ports) { auto* lb_endpoints = endpoints->add_lb_endpoints(); auto* endpoint = lb_endpoints->mutable_endpoint(); auto* address = endpoint->mutable_address(); auto* socket_address = address->mutable_socket_address(); socket_address->set_address("127.0.0.1"); - socket_address->set_port_value(backend_port); + socket_address->set_port_value(port); } } - if (!drop_categories.empty()) { + if (!args.drop_categories.empty()) { auto* policy = assignment.mutable_policy(); - for (const auto& p : drop_categories) { + for (const auto& p : args.drop_categories) { const grpc::string& name = p.first; const uint32_t parts_per_million = p.second; auto* drop_overload = policy->add_drop_overloads(); drop_overload->set_category(name); auto* drop_percentage = drop_overload->mutable_drop_percentage(); drop_percentage->set_numerator(parts_per_million); - drop_percentage->set_denominator(denominator); + drop_percentage->set_denominator(args.drop_denominator); } } DiscoveryResponse response; @@ -729,24 +741,6 @@ class XdsEnd2endTest : public ::testing::Test { return backend_ports; } - const std::vector> GetBackendPortsInGroups( - size_t start_index = 0, size_t stop_index = 0, - size_t num_group = 1) const { - if (stop_index == 0) stop_index = backends_.size(); - size_t group_size = (stop_index - start_index) / num_group; - std::vector> backend_ports; - for (size_t i = 0; i < num_group; ++i) { - backend_ports.emplace_back(); - size_t group_start = group_size * i + start_index; - size_t group_stop = - i == num_group - 1 ? stop_index : group_start + group_size; - for (size_t j = group_start; j < group_stop; ++j) { - backend_ports[i].push_back(backends_[j]->port()); - } - } - return backend_ports; - } - void ScheduleResponseForBalancer(size_t i, const DiscoveryResponse& response, int delay_ms) { balancers_[i]->eds_service()->add_response(response, delay_ms); @@ -938,8 +932,10 @@ TEST_F(SingleBalancerTest, Vanilla) { SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); const size_t kNumRpcsPerAddress = 100; - ScheduleResponseForBalancer( - 0, EdsServiceImpl::BuildResponse(GetBackendPortsInGroups()), 0); + EdsServiceImpl::ResponseArgs args({ + {"locality0", GetBackendPorts()}, + }); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); // Make sure that trying to connect works without a call. channel_->GetState(true /* try_to_connect */); // We need to wait for all backends to come online. @@ -962,17 +958,18 @@ TEST_F(SingleBalancerTest, SameBackendListedMultipleTimes) { SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); // Same backend listed twice. - std::vector ports; - ports.push_back(backends_[0]->port()); - ports.push_back(backends_[0]->port()); + std::vector ports(2, backends_[0]->port()); + EdsServiceImpl::ResponseArgs args({ + {"locality0", ports}, + }); const size_t kNumRpcsPerAddress = 10; - ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse({ports}), 0); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); // We need to wait for the backend to come online. WaitForBackend(0); // Send kNumRpcsPerAddress RPCs per server. CheckRpcSendOk(kNumRpcsPerAddress * ports.size()); // Backend should have gotten 20 requests. - EXPECT_EQ(kNumRpcsPerAddress * 2, + EXPECT_EQ(kNumRpcsPerAddress * ports.size(), backends_[0]->backend_service()->request_count()); // And they should have come from a single client port, because of // subchannel sharing. @@ -985,8 +982,10 @@ TEST_F(SingleBalancerTest, SecureNaming) { SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannel({balancers_[0]->port()}); const size_t kNumRpcsPerAddress = 100; - ScheduleResponseForBalancer( - 0, EdsServiceImpl::BuildResponse(GetBackendPortsInGroups()), 0); + EdsServiceImpl::ResponseArgs args({ + {"locality0", GetBackendPorts()}, + }); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); // Make sure that trying to connect works without a call. channel_->GetState(true /* try_to_connect */); // We need to wait for all backends to come online. @@ -1031,11 +1030,17 @@ TEST_F(SingleBalancerTest, InitiallyEmptyServerlist) { const int kServerlistDelayMs = 500 * grpc_test_slowdown_factor(); const int kCallDeadlineMs = kServerlistDelayMs * 2; // First response is an empty serverlist, sent right away. - ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse({{}}), 0); - // Send non-empty serverlist only after kServerlistDelayMs - ScheduleResponseForBalancer( - 0, EdsServiceImpl::BuildResponse(GetBackendPortsInGroups()), - kServerlistDelayMs); + EdsServiceImpl::ResponseArgs::Locality empty_locality("locality0", {}); + EdsServiceImpl::ResponseArgs args({ + empty_locality, + }); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); + // Send non-empty serverlist only after kServerlistDelayMs. + args = EdsServiceImpl::ResponseArgs({ + {"locality0", GetBackendPorts()}, + }); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), + kServerlistDelayMs); const auto t0 = system_clock::now(); // Client will block: LB will initially send empty serverlist. CheckRpcSendOk(1, kCallDeadlineMs, true /* wait_for_ready */); @@ -1061,7 +1066,10 @@ TEST_F(SingleBalancerTest, AllServersUnreachableFailFast) { for (size_t i = 0; i < kNumUnreachableServers; ++i) { ports.push_back(grpc_pick_unused_port_or_die()); } - ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse({ports}), 0); + EdsServiceImpl::ResponseArgs args({ + {"locality0", ports}, + }); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); const Status status = SendRpc(); // The error shouldn't be DEADLINE_EXCEEDED. EXPECT_EQ(StatusCode::UNAVAILABLE, status.error_code()); @@ -1082,11 +1090,11 @@ TEST_F(SingleBalancerTest, LocalityMapWeightedRoundRobin) { const double kLocalityWeightRate1 = static_cast(kLocalityWeight1) / kTotalLocalityWeight; // EDS response contains 2 localities, each of which contains 1 backend. - ScheduleResponseForBalancer( - 0, - EdsServiceImpl::BuildResponse(GetBackendPortsInGroups(0, 2, 2), - {kLocalityWeight0, kLocalityWeight1}), - 0); + EdsServiceImpl::ResponseArgs args({ + {"locality0", GetBackendPorts(0, 1), kLocalityWeight0}, + {"locality1", GetBackendPorts(1, 2), kLocalityWeight1}, + }); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); // Wait for both backends to be ready. WaitForAllBackends(1, 0, 2); // Send kNumRpcs RPCs. @@ -1118,14 +1126,19 @@ TEST_F(SingleBalancerTest, LocalityMapStressTest) { const size_t kNumLocalities = 100; // The first EDS response contains kNumLocalities localities, each of which // contains backend 0. - const std::vector> locality_list_0(kNumLocalities, - {backends_[0]->port()}); + EdsServiceImpl::ResponseArgs args; + for (size_t i = 0; i < kNumLocalities; ++i) { + grpc::string name = "locality" + std::to_string(i); + EdsServiceImpl::ResponseArgs::Locality locality(name, + {backends_[0]->port()}); + args.locality_list.emplace_back(std::move(locality)); + } + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); // The second EDS response contains 1 locality, which contains backend 1. - const std::vector> locality_list_1 = - GetBackendPortsInGroups(1, 2); - ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(locality_list_0), - 0); - ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(locality_list_1), + args = EdsServiceImpl::ResponseArgs({ + {"locality0", GetBackendPorts(1, 2)}, + }); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 60 * 1000); // Wait until backend 0 is ready, before which kNumLocalities localities are // received and handled by the xds policy. @@ -1162,20 +1175,18 @@ TEST_F(SingleBalancerTest, LocalityMapUpdate) { for (int weight : kLocalityWeights1) { locality_weight_rate_1.push_back(weight / kTotalLocalityWeight1); } - ScheduleResponseForBalancer( - 0, - EdsServiceImpl::BuildResponse( - GetBackendPortsInGroups(0 /*start_index*/, 3 /*stop_index*/, - 3 /*num_group*/), - kLocalityWeights0), - 0); - ScheduleResponseForBalancer( - 0, - EdsServiceImpl::BuildResponse( - GetBackendPortsInGroups(1 /*start_index*/, 4 /*stop_index*/, - 3 /*num_group*/), - kLocalityWeights1, 1 /*first_locality_name_index*/), - 5000); + EdsServiceImpl::ResponseArgs args({ + {"locality0", GetBackendPorts(0, 1), 2}, + {"locality1", GetBackendPorts(1, 2), 3}, + {"locality2", GetBackendPorts(2, 3), 4}, + }); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); + args = EdsServiceImpl::ResponseArgs({ + {"locality1", GetBackendPorts(1, 2), 3}, + {"locality2", GetBackendPorts(2, 3), 2}, + {"locality3", GetBackendPorts(3, 4), 6}, + }); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 5000); // Wait for the first 3 backends to be ready. WaitForAllBackends(1, 0, 3); gpr_log(GPR_INFO, "========= BEFORE FIRST BATCH =========="); @@ -1244,13 +1255,12 @@ TEST_F(SingleBalancerTest, Drop) { const double KDropRateForLbAndThrottle = kDropRateForLb + (1 - kDropRateForLb) * kDropRateForThrottle; // The EDS response contains two drop categories. - ScheduleResponseForBalancer( - 0, - EdsServiceImpl::BuildResponse( - GetBackendPortsInGroups(), {}, 0, - {{kLbDropType, kDropPerMillionForLb}, - {kThrottleDropType, kDropPerMillionForThrottle}}), - 0); + EdsServiceImpl::ResponseArgs args({ + {"locality0", GetBackendPorts()}, + }); + args.drop_categories = {{kLbDropType, kDropPerMillionForLb}, + {kThrottleDropType, kDropPerMillionForThrottle}}; + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); WaitForAllBackends(); // Send kNumRpcs RPCs and count the drops. size_t num_drops = 0; @@ -1286,12 +1296,12 @@ TEST_F(SingleBalancerTest, DropPerHundred) { const uint32_t kDropPerHundredForLb = 10; const double kDropRateForLb = kDropPerHundredForLb / 100.0; // The EDS response contains one drop category. - ScheduleResponseForBalancer( - 0, - EdsServiceImpl::BuildResponse(GetBackendPortsInGroups(), {}, 0, - {{kLbDropType, kDropPerHundredForLb}}, - FractionalPercent::HUNDRED), - 0); + EdsServiceImpl::ResponseArgs args({ + {"locality0", GetBackendPorts()}, + }); + args.drop_categories = {{kLbDropType, kDropPerHundredForLb}}; + args.drop_denominator = FractionalPercent::HUNDRED; + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); WaitForAllBackends(); // Send kNumRpcs RPCs and count the drops. size_t num_drops = 0; @@ -1326,12 +1336,12 @@ TEST_F(SingleBalancerTest, DropPerTenThousand) { const uint32_t kDropPerTenThousandForLb = 1000; const double kDropRateForLb = kDropPerTenThousandForLb / 10000.0; // The EDS response contains one drop category. - ScheduleResponseForBalancer( - 0, - EdsServiceImpl::BuildResponse(GetBackendPortsInGroups(), {}, 0, - {{kLbDropType, kDropPerTenThousandForLb}}, - FractionalPercent::TEN_THOUSAND), - 0); + EdsServiceImpl::ResponseArgs args({ + {"locality0", GetBackendPorts()}, + }); + args.drop_categories = {{kLbDropType, kDropPerTenThousandForLb}}; + args.drop_denominator = FractionalPercent::TEN_THOUSAND; + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); WaitForAllBackends(); // Send kNumRpcs RPCs and count the drops. size_t num_drops = 0; @@ -1370,22 +1380,18 @@ TEST_F(SingleBalancerTest, DropUpdate) { const double KDropRateForLbAndThrottle = kDropRateForLb + (1 - kDropRateForLb) * kDropRateForThrottle; // The first EDS response contains one drop category. - ScheduleResponseForBalancer( - 0, - EdsServiceImpl::BuildResponse(GetBackendPortsInGroups(), {}, 0, - {{kLbDropType, kDropPerMillionForLb}}), - 0); + EdsServiceImpl::ResponseArgs args({ + {"locality0", GetBackendPorts()}, + }); + args.drop_categories = {{kLbDropType, kDropPerMillionForLb}}; + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); // The second EDS response contains two drop categories. // TODO(juanlishen): Change the EDS response sending to deterministic style // (e.g., by using condition variable) so that we can shorten the test // duration. - ScheduleResponseForBalancer( - 0, - EdsServiceImpl::BuildResponse( - GetBackendPortsInGroups(), {}, 0, - {{kLbDropType, kDropPerMillionForLb}, - {kThrottleDropType, kDropPerMillionForThrottle}}), - 10000); + args.drop_categories = {{kLbDropType, kDropPerMillionForLb}, + {kThrottleDropType, kDropPerMillionForThrottle}}; + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 10000); WaitForAllBackends(); // Send kNumRpcs RPCs and count the drops. size_t num_drops = 0; @@ -1465,13 +1471,12 @@ TEST_F(SingleBalancerTest, DropAll) { const uint32_t kDropPerMillionForLb = 100000; const uint32_t kDropPerMillionForThrottle = 1000000; // The EDS response contains two drop categories. - ScheduleResponseForBalancer( - 0, - EdsServiceImpl::BuildResponse( - GetBackendPortsInGroups(), {}, 0, - {{kLbDropType, kDropPerMillionForLb}, - {kThrottleDropType, kDropPerMillionForThrottle}}), - 0); + EdsServiceImpl::ResponseArgs args({ + {"locality0", GetBackendPorts()}, + }); + args.drop_categories = {{kLbDropType, kDropPerMillionForLb}, + {kThrottleDropType, kDropPerMillionForThrottle}}; + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); // Send kNumRpcs RPCs and all of them are dropped. for (size_t i = 0; i < kNumRpcs; ++i) { EchoResponse response; @@ -1493,11 +1498,11 @@ TEST_F(SingleBalancerTest, Fallback) { kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); // Send non-empty serverlist only after kServerlistDelayMs. - ScheduleResponseForBalancer( - 0, - EdsServiceImpl::BuildResponse( - GetBackendPortsInGroups(kNumBackendsInResolution /* start_index */)), - kServerlistDelayMs); + EdsServiceImpl::ResponseArgs args({ + {"locality0", GetBackendPorts(kNumBackendsInResolution)}, + }); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), + kServerlistDelayMs); // Wait until all the fallback backends are reachable. WaitForAllBackends(1 /* num_requests_multiple_of */, 0 /* start_index */, kNumBackendsInResolution /* stop_index */); @@ -1542,12 +1547,12 @@ TEST_F(SingleBalancerTest, FallbackUpdate) { kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); // Send non-empty serverlist only after kServerlistDelayMs. - ScheduleResponseForBalancer( - 0, - EdsServiceImpl::BuildResponse(GetBackendPortsInGroups( - kNumBackendsInResolution + - kNumBackendsInResolutionUpdate /* start_index */)), - kServerlistDelayMs); + EdsServiceImpl::ResponseArgs args({ + {"locality0", GetBackendPorts(kNumBackendsInResolution + + kNumBackendsInResolutionUpdate)}, + }); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), + kServerlistDelayMs); // Wait until all the fallback backends are reachable. WaitForAllBackends(1 /* num_requests_multiple_of */, 0 /* start_index */, kNumBackendsInResolution /* stop_index */); @@ -1645,8 +1650,10 @@ TEST_F(SingleBalancerTest, FallbackIfResponseReceivedButChildNotReady) { SetNextResolutionForLbChannelAllBalancers(); // Send a serverlist that only contains an unreachable backend before fallback // timeout. - ScheduleResponseForBalancer( - 0, EdsServiceImpl::BuildResponse({{grpc_pick_unused_port_or_die()}}), 0); + EdsServiceImpl::ResponseArgs args({ + {"locality0", {grpc_pick_unused_port_or_die()}}, + }); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); // Because no child policy is ready before fallback timeout, we enter fallback // mode. WaitForBackend(0); @@ -1659,11 +1666,11 @@ TEST_F(SingleBalancerTest, FallbackModeIsExitedWhenBalancerSaysToDropAllCalls) { // Enter fallback mode because the LB channel fails to connect. WaitForBackend(0); // Return a new balancer that sends a response to drop all calls. - ScheduleResponseForBalancer( - 0, - EdsServiceImpl::BuildResponse(GetBackendPortsInGroups(), {}, 0, - {{kLbDropType, 1000000}}), - 0); + EdsServiceImpl::ResponseArgs args({ + {"locality0", GetBackendPorts()}, + }); + args.drop_categories = {{kLbDropType, 1000000}}; + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); SetNextResolutionForLbChannelAllBalancers(); // Send RPCs until failure. gpr_timespec deadline = gpr_time_add( @@ -1683,8 +1690,10 @@ TEST_F(SingleBalancerTest, FallbackModeIsExitedAfterChildRready) { WaitForBackend(0); // Return a new balancer that sends a dead backend. ShutdownBackend(1); - ScheduleResponseForBalancer( - 0, EdsServiceImpl::BuildResponse({{backends_[1]->port()}}), 0); + EdsServiceImpl::ResponseArgs args({ + {"locality0", {backends_[1]->port()}}, + }); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); SetNextResolutionForLbChannelAllBalancers(); // The state (TRANSIENT_FAILURE) update from the child policy will be ignored // because we are still in fallback mode. @@ -1708,8 +1717,10 @@ TEST_F(SingleBalancerTest, FallbackModeIsExitedAfterChildRready) { TEST_F(SingleBalancerTest, BackendsRestart) { SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); - ScheduleResponseForBalancer( - 0, EdsServiceImpl::BuildResponse(GetBackendPortsInGroups()), 0); + EdsServiceImpl::ResponseArgs args({ + {"locality0", GetBackendPorts()}, + }); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); WaitForAllBackends(); // Stop backends. RPCs should fail. ShutdownAllBackends(); @@ -1728,12 +1739,14 @@ class UpdatesTest : public XdsEnd2endTest { TEST_F(UpdatesTest, UpdateBalancersButKeepUsingOriginalBalancer) { SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); - auto first_backend = GetBackendPortsInGroups(0, 1); - auto second_backend = GetBackendPortsInGroups(1, 2); - ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(first_backend), - 0); - ScheduleResponseForBalancer(1, EdsServiceImpl::BuildResponse(second_backend), - 0); + EdsServiceImpl::ResponseArgs args({ + {"locality0", {backends_[0]->port()}}, + }); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); + args = EdsServiceImpl::ResponseArgs({ + {"locality0", {backends_[1]->port()}}, + }); + ScheduleResponseForBalancer(1, EdsServiceImpl::BuildResponse(args), 0); // Wait until the first backend is ready. WaitForBackend(0); @@ -1781,12 +1794,14 @@ TEST_F(UpdatesTest, UpdateBalancersButKeepUsingOriginalBalancer) { TEST_F(UpdatesTest, UpdateBalancerName) { SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); - auto first_backend = GetBackendPortsInGroups(0, 1); - auto second_backend = GetBackendPortsInGroups(1, 2); - ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(first_backend), - 0); - ScheduleResponseForBalancer(1, EdsServiceImpl::BuildResponse(second_backend), - 0); + EdsServiceImpl::ResponseArgs args({ + {"locality0", {backends_[0]->port()}}, + }); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); + args = EdsServiceImpl::ResponseArgs({ + {"locality0", {backends_[1]->port()}}, + }); + ScheduleResponseForBalancer(1, EdsServiceImpl::BuildResponse(args), 0); // Wait until the first backend is ready. WaitForBackend(0); @@ -1852,12 +1867,14 @@ TEST_F(UpdatesTest, UpdateBalancerName) { TEST_F(UpdatesTest, UpdateBalancersRepeated) { SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannelAllBalancers(); - auto first_backend = GetBackendPortsInGroups(0, 1); - auto second_backend = GetBackendPortsInGroups(1, 2); - ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(first_backend), - 0); - ScheduleResponseForBalancer(1, EdsServiceImpl::BuildResponse(second_backend), - 0); + EdsServiceImpl::ResponseArgs args({ + {"locality0", {backends_[0]->port()}}, + }); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); + args = EdsServiceImpl::ResponseArgs({ + {"locality0", {backends_[1]->port()}}, + }); + ScheduleResponseForBalancer(1, EdsServiceImpl::BuildResponse(args), 0); // Wait until the first backend is ready. WaitForBackend(0); @@ -1920,12 +1937,14 @@ TEST_F(UpdatesTest, UpdateBalancersRepeated) { TEST_F(UpdatesTest, UpdateBalancersDeadUpdate) { SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolutionForLbChannel({balancers_[0]->port()}); - auto first_backend = GetBackendPortsInGroups(0, 1); - auto second_backend = GetBackendPortsInGroups(1, 2); - ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(first_backend), - 0); - ScheduleResponseForBalancer(1, EdsServiceImpl::BuildResponse(second_backend), - 0); + EdsServiceImpl::ResponseArgs args({ + {"locality0", {backends_[0]->port()}}, + }); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); + args = EdsServiceImpl::ResponseArgs({ + {"locality0", {backends_[1]->port()}}, + }); + ScheduleResponseForBalancer(1, EdsServiceImpl::BuildResponse(args), 0); // Start servers and send 10 RPCs per server. gpr_log(GPR_INFO, "========= BEFORE FIRST BATCH =========="); @@ -2007,10 +2026,10 @@ TEST_F(SingleBalancerWithClientLoadReportingTest, Vanilla) { const size_t kNumRpcsPerAddress = 100; // TODO(juanlishen): Partition the backends after multiple localities is // tested. - ScheduleResponseForBalancer(0, - EdsServiceImpl::BuildResponse( - GetBackendPortsInGroups(0, backends_.size())), - 0); + EdsServiceImpl::ResponseArgs args({ + {"locality0", GetBackendPorts()}, + }); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); // Wait until all backends are ready. int num_ok = 0; int num_failure = 0; @@ -2046,11 +2065,10 @@ TEST_F(SingleBalancerWithClientLoadReportingTest, BalancerRestart) { const size_t kNumBackendsFirstPass = backends_.size() / 2; const size_t kNumBackendsSecondPass = backends_.size() - kNumBackendsFirstPass; - ScheduleResponseForBalancer( - 0, - EdsServiceImpl::BuildResponse( - GetBackendPortsInGroups(0, kNumBackendsFirstPass)), - 0); + EdsServiceImpl::ResponseArgs args({ + {"locality0", GetBackendPorts(0, kNumBackendsFirstPass)}, + }); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); // Wait until all backends returned by the balancer are ready. int num_ok = 0; int num_failure = 0; @@ -2077,11 +2095,10 @@ TEST_F(SingleBalancerWithClientLoadReportingTest, BalancerRestart) { } // Now restart the balancer, this time pointing to the new backends. balancers_[0]->Start(server_host_); - ScheduleResponseForBalancer( - 0, - EdsServiceImpl::BuildResponse( - GetBackendPortsInGroups(kNumBackendsFirstPass)), - 0); + args = EdsServiceImpl::ResponseArgs({ + {"locality0", GetBackendPorts(kNumBackendsFirstPass)}, + }); + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); // Wait for queries to start going to one of the new backends. // This tells us that we're now using the new serverlist. std::tie(num_ok, num_failure, num_drops) = @@ -2116,13 +2133,12 @@ TEST_F(SingleBalancerWithClientLoadReportingAndDropTest, Vanilla) { const double KDropRateForLbAndThrottle = kDropRateForLb + (1 - kDropRateForLb) * kDropRateForThrottle; // The EDS response contains two drop categories. - ScheduleResponseForBalancer( - 0, - EdsServiceImpl::BuildResponse( - GetBackendPortsInGroups(), {}, 0, - {{kLbDropType, kDropPerMillionForLb}, - {kThrottleDropType, kDropPerMillionForThrottle}}), - 0); + EdsServiceImpl::ResponseArgs args({ + {"locality0", GetBackendPorts()}, + }); + args.drop_categories = {{kLbDropType, kDropPerMillionForLb}, + {kThrottleDropType, kDropPerMillionForThrottle}}; + ScheduleResponseForBalancer(0, EdsServiceImpl::BuildResponse(args), 0); int num_ok = 0; int num_failure = 0; int num_drops = 0; From 21c542447784e698ae388ce12087c27fea70535d Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Wed, 28 Aug 2019 12:48:06 -0700 Subject: [PATCH 18/33] Add API for accessing per-call backend metric data in LB policies. --- .gitmodules | 3 + BUILD | 30 + BUILD.gn | 8 + CMakeLists.txt | 105 ++- Makefile | 118 ++- build.yaml | 15 + config.m4 | 29 +- config.w32 | 32 +- gRPC-Core.podspec | 84 +- grpc.gemspec | 56 +- grpc.gyp | 84 +- package.xml | 56 +- .../filters/client_channel/backend_metric.cc | 78 ++ .../filters/client_channel/backend_metric.h | 36 + .../filters/client_channel/client_channel.cc | 19 + .../ext/filters/client_channel/lb_policy.h | 26 + .../envoy/api/v2/auth/cert.upb.c | 37 +- .../envoy/api/v2/auth/cert.upb.h | 83 +- .../ext/upb-generated/envoy/api/v2/cds.upb.c | 67 +- .../ext/upb-generated/envoy/api/v2/cds.upb.h | 81 +- .../envoy/api/v2/cluster/filter.upb.c | 34 + .../envoy/api/v2/cluster/filter.upb.h | 69 ++ .../api/v2/cluster/outlier_detection.upb.c | 32 +- .../api/v2/cluster/outlier_detection.upb.h | 87 ++- .../envoy/api/v2/core/base.upb.c | 32 + .../envoy/api/v2/core/base.upb.h | 98 +++ .../envoy/api/v2/core/config_source.upb.c | 15 +- .../envoy/api/v2/core/config_source.upb.h | 32 +- .../envoy/api/v2/core/http_uri.upb.c | 35 + .../envoy/api/v2/core/http_uri.upb.h | 80 ++ .../envoy/api/v2/core/protocol.upb.c | 12 +- .../envoy/api/v2/core/protocol.upb.h | 69 ++ .../udpa/data/orca/v1/orca_load_report.upb.c | 58 ++ .../udpa/data/orca/v1/orca_load_report.upb.h | 144 ++++ src/core/lib/gprpp/map.h | 11 +- src/core/lib/transport/static_metadata.cc | 734 +++++++++--------- src/core/lib/transport/static_metadata.h | 176 +++-- src/proto/grpc/lb/v2/BUILD | 7 + src/proto/grpc/lb/v2/eds_for_test.proto | 8 +- src/proto/grpc/lb/v2/lrs_for_test.proto | 9 +- .../lb/v2/orca_load_report_for_test.proto | 58 ++ src/python/grpcio/grpc_core_dependencies.py | 28 +- test/core/end2end/fuzzers/hpack.dictionary | 1 + test/core/util/test_lb_policies.cc | 2 +- test/core/util/test_lb_policies.h | 5 +- test/cpp/end2end/BUILD | 1 + test/cpp/end2end/client_lb_end2end_test.cc | 97 ++- third_party/envoy-api | 2 +- third_party/udpa | 1 + tools/codegen/core/gen_static_metadata.py | 2 + tools/codegen/core/gen_upb_api.sh | 6 +- tools/doxygen/Doxyfile.core.internal | 8 + tools/run_tests/sanity/check_submodules.sh | 3 +- 53 files changed, 2224 insertions(+), 779 deletions(-) create mode 100644 src/core/ext/filters/client_channel/backend_metric.cc create mode 100644 src/core/ext/filters/client_channel/backend_metric.h create mode 100644 src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c create mode 100644 src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h create mode 100644 src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c create mode 100644 src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h create mode 100644 src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c create mode 100644 src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h create mode 100644 src/proto/grpc/lb/v2/orca_load_report_for_test.proto create mode 160000 third_party/udpa diff --git a/.gitmodules b/.gitmodules index 6443f8362aa..2b085e15059 100644 --- a/.gitmodules +++ b/.gitmodules @@ -54,3 +54,6 @@ [submodule "third_party/upb"] path = third_party/upb url = https://github.com/protocolbuffers/upb.git +[submodule "third_party/udpa"] + path = third_party/udpa + url = https://github.com/cncf/udpa.git diff --git a/BUILD b/BUILD index f2a6f67f69f..9198dd61282 100644 --- a/BUILD +++ b/BUILD @@ -1009,6 +1009,7 @@ grpc_cc_library( name = "grpc_client_channel", srcs = [ "src/core/ext/filters/client_channel/backup_poller.cc", + "src/core/ext/filters/client_channel/backend_metric.cc", "src/core/ext/filters/client_channel/channel_connectivity.cc", "src/core/ext/filters/client_channel/client_channel.cc", "src/core/ext/filters/client_channel/client_channel_channelz.cc", @@ -1037,6 +1038,7 @@ grpc_cc_library( ], hdrs = [ "src/core/ext/filters/client_channel/backup_poller.h", + "src/core/ext/filters/client_channel/backend_metric.h", "src/core/ext/filters/client_channel/client_channel.h", "src/core/ext/filters/client_channel/client_channel_channelz.h", "src/core/ext/filters/client_channel/client_channel_factory.h", @@ -1066,6 +1068,7 @@ grpc_cc_library( ], language = "c++", deps = [ + "envoy_orca_upb", "gpr_base", "grpc_base", "grpc_client_authority_filter", @@ -2278,6 +2281,7 @@ grpc_cc_library( "src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c", "src/core/ext/upb-generated/envoy/api/v2/cds.upb.c", "src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c", "src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c", "src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c", "src/core/ext/upb-generated/envoy/api/v2/eds.upb.c", @@ -2290,6 +2294,7 @@ grpc_cc_library( "src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h", "src/core/ext/upb-generated/envoy/api/v2/cds.upb.h", "src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h", "src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h", "src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h", "src/core/ext/upb-generated/envoy/api/v2/eds.upb.h", @@ -2318,6 +2323,7 @@ grpc_cc_library( "src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c", "src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c", "src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c", "src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c", ], hdrs = [ @@ -2326,6 +2332,7 @@ grpc_cc_library( "src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h", "src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h", "src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h", "src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h", ], external_deps = [ @@ -2378,6 +2385,29 @@ grpc_cc_library( ], ) +# Once upb code-gen issue is resolved, replace envoy_orca_upb with this. +# grpc_upb_proto_library( +# name = "envoy_orca_upb", +# deps = ["@envoy_api//udpa/data/orca/v1:orca_load_report"] +# ) + +grpc_cc_library( + name = "envoy_orca_upb", + srcs = [ + "src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c", + ], + hdrs = [ + "src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h", + ], + external_deps = [ + "upb_lib", + ], + language = "c++", + deps = [ + ":proto_gen_validate_upb", + ], +) + # Once upb code-gen issue is resolved, replace grpc_health_upb with this. # grpc_upb_proto_library( # name = "grpc_health_upb", diff --git a/BUILD.gn b/BUILD.gn index eea022eac51..771e968f366 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -208,6 +208,8 @@ config("grpc_config") { "include/grpc/status.h", "include/grpc/support/workaround_list.h", "src/core/ext/filters/census/grpc_context.cc", + "src/core/ext/filters/client_channel/backend_metric.cc", + "src/core/ext/filters/client_channel/backend_metric.h", "src/core/ext/filters/client_channel/backup_poller.cc", "src/core/ext/filters/client_channel/backup_poller.h", "src/core/ext/filters/client_channel/channel_connectivity.cc", @@ -388,6 +390,8 @@ config("grpc_config") { "src/core/ext/upb-generated/envoy/api/v2/cds.upb.h", "src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c", "src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h", "src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c", "src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h", "src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c", @@ -400,6 +404,8 @@ config("grpc_config") { "src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h", "src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c", "src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h", + "src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c", + "src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h", "src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c", "src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h", "src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c", @@ -450,6 +456,8 @@ config("grpc_config") { "src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h", "src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c", "src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h", + "src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c", + "src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h", "src/core/ext/upb-generated/validate/validate.upb.c", "src/core/ext/upb-generated/validate/validate.upb.h", "src/core/lib/avl/avl.cc", diff --git a/CMakeLists.txt b/CMakeLists.txt index f1552a56c1f..c5cdfff7f56 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1266,6 +1266,7 @@ add_library(grpc src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc src/core/ext/transport/chttp2/client/authority.cc src/core/ext/transport/chttp2/client/chttp2_connector.cc + src/core/ext/filters/client_channel/backend_metric.cc src/core/ext/filters/client_channel/backup_poller.cc src/core/ext/filters/client_channel/channel_connectivity.cc src/core/ext/filters/client_channel/client_channel.cc @@ -1294,6 +1295,19 @@ add_library(grpc src/core/ext/filters/client_channel/subchannel_pool_interface.cc src/core/ext/filters/deadline/deadline_filter.cc src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c + src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c + src/core/ext/upb-generated/gogoproto/gogo.upb.c + src/core/ext/upb-generated/validate/validate.upb.c + src/core/ext/upb-generated/google/api/annotations.upb.c + src/core/ext/upb-generated/google/api/http.upb.c + src/core/ext/upb-generated/google/protobuf/any.upb.c + src/core/ext/upb-generated/google/protobuf/descriptor.upb.c + src/core/ext/upb-generated/google/protobuf/duration.upb.c + src/core/ext/upb-generated/google/protobuf/empty.upb.c + src/core/ext/upb-generated/google/protobuf/struct.upb.c + src/core/ext/upb-generated/google/protobuf/timestamp.upb.c + src/core/ext/upb-generated/google/protobuf/wrappers.upb.c + src/core/ext/upb-generated/google/rpc/status.upb.c src/core/tsi/fake_transport_security.cc src/core/tsi/local_transport_security.cc src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc @@ -1313,16 +1327,6 @@ add_library(grpc src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c - src/core/ext/upb-generated/google/api/annotations.upb.c - src/core/ext/upb-generated/google/api/http.upb.c - src/core/ext/upb-generated/google/protobuf/any.upb.c - src/core/ext/upb-generated/google/protobuf/descriptor.upb.c - src/core/ext/upb-generated/google/protobuf/duration.upb.c - src/core/ext/upb-generated/google/protobuf/empty.upb.c - src/core/ext/upb-generated/google/protobuf/struct.upb.c - src/core/ext/upb-generated/google/protobuf/timestamp.upb.c - src/core/ext/upb-generated/google/protobuf/wrappers.upb.c - src/core/ext/upb-generated/google/rpc/status.upb.c src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc src/core/ext/filters/client_channel/lb_policy/xds/xds.cc src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc @@ -1331,6 +1335,7 @@ add_library(grpc src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c src/core/ext/upb-generated/envoy/api/v2/cds.upb.c src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c + src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c src/core/ext/upb-generated/envoy/api/v2/eds.upb.c @@ -1343,11 +1348,10 @@ add_library(grpc src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c src/core/ext/upb-generated/envoy/type/percent.upb.c src/core/ext/upb-generated/envoy/type/range.upb.c - src/core/ext/upb-generated/gogoproto/gogo.upb.c - src/core/ext/upb-generated/validate/validate.upb.c src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc @@ -1667,6 +1671,7 @@ add_library(grpc_cronet src/core/ext/filters/http/http_filters_plugin.cc src/core/ext/filters/http/message_compress/message_compress_filter.cc src/core/ext/filters/http/server/http_server_filter.cc + src/core/ext/filters/client_channel/backend_metric.cc src/core/ext/filters/client_channel/backup_poller.cc src/core/ext/filters/client_channel/channel_connectivity.cc src/core/ext/filters/client_channel/client_channel.cc @@ -1701,6 +1706,19 @@ add_library(grpc_cronet third_party/upb/upb/port.c third_party/upb/upb/table.c third_party/upb/upb/upb.c + src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c + src/core/ext/upb-generated/gogoproto/gogo.upb.c + src/core/ext/upb-generated/validate/validate.upb.c + src/core/ext/upb-generated/google/api/annotations.upb.c + src/core/ext/upb-generated/google/api/http.upb.c + src/core/ext/upb-generated/google/protobuf/any.upb.c + src/core/ext/upb-generated/google/protobuf/descriptor.upb.c + src/core/ext/upb-generated/google/protobuf/duration.upb.c + src/core/ext/upb-generated/google/protobuf/empty.upb.c + src/core/ext/upb-generated/google/protobuf/struct.upb.c + src/core/ext/upb-generated/google/protobuf/timestamp.upb.c + src/core/ext/upb-generated/google/protobuf/wrappers.upb.c + src/core/ext/upb-generated/google/rpc/status.upb.c src/core/lib/http/httpcli_security_connector.cc src/core/lib/security/context/security_context.cc src/core/lib/security/credentials/alts/alts_credentials.cc @@ -2059,6 +2077,7 @@ add_library(grpc_test_util src/core/lib/transport/transport_op_string.cc src/core/lib/uri/uri_parser.cc src/core/lib/debug/trace.cc + src/core/ext/filters/client_channel/backend_metric.cc src/core/ext/filters/client_channel/backup_poller.cc src/core/ext/filters/client_channel/channel_connectivity.cc src/core/ext/filters/client_channel/client_channel.cc @@ -2093,6 +2112,19 @@ add_library(grpc_test_util third_party/upb/upb/port.c third_party/upb/upb/table.c third_party/upb/upb/upb.c + src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c + src/core/ext/upb-generated/gogoproto/gogo.upb.c + src/core/ext/upb-generated/validate/validate.upb.c + src/core/ext/upb-generated/google/api/annotations.upb.c + src/core/ext/upb-generated/google/api/http.upb.c + src/core/ext/upb-generated/google/protobuf/any.upb.c + src/core/ext/upb-generated/google/protobuf/descriptor.upb.c + src/core/ext/upb-generated/google/protobuf/duration.upb.c + src/core/ext/upb-generated/google/protobuf/empty.upb.c + src/core/ext/upb-generated/google/protobuf/struct.upb.c + src/core/ext/upb-generated/google/protobuf/timestamp.upb.c + src/core/ext/upb-generated/google/protobuf/wrappers.upb.c + src/core/ext/upb-generated/google/rpc/status.upb.c src/core/ext/transport/chttp2/transport/bin_decoder.cc src/core/ext/transport/chttp2/transport/bin_encoder.cc src/core/ext/transport/chttp2/transport/chttp2_plugin.cc @@ -2399,6 +2431,7 @@ add_library(grpc_test_util_unsecure src/core/lib/transport/transport_op_string.cc src/core/lib/uri/uri_parser.cc src/core/lib/debug/trace.cc + src/core/ext/filters/client_channel/backend_metric.cc src/core/ext/filters/client_channel/backup_poller.cc src/core/ext/filters/client_channel/channel_connectivity.cc src/core/ext/filters/client_channel/client_channel.cc @@ -2433,6 +2466,19 @@ add_library(grpc_test_util_unsecure third_party/upb/upb/port.c third_party/upb/upb/table.c third_party/upb/upb/upb.c + src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c + src/core/ext/upb-generated/gogoproto/gogo.upb.c + src/core/ext/upb-generated/validate/validate.upb.c + src/core/ext/upb-generated/google/api/annotations.upb.c + src/core/ext/upb-generated/google/api/http.upb.c + src/core/ext/upb-generated/google/protobuf/any.upb.c + src/core/ext/upb-generated/google/protobuf/descriptor.upb.c + src/core/ext/upb-generated/google/protobuf/duration.upb.c + src/core/ext/upb-generated/google/protobuf/empty.upb.c + src/core/ext/upb-generated/google/protobuf/struct.upb.c + src/core/ext/upb-generated/google/protobuf/timestamp.upb.c + src/core/ext/upb-generated/google/protobuf/wrappers.upb.c + src/core/ext/upb-generated/google/rpc/status.upb.c src/core/ext/transport/chttp2/transport/bin_decoder.cc src/core/ext/transport/chttp2/transport/bin_encoder.cc src/core/ext/transport/chttp2/transport/chttp2_plugin.cc @@ -2750,6 +2796,7 @@ add_library(grpc_unsecure src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc src/core/ext/transport/chttp2/client/authority.cc src/core/ext/transport/chttp2/client/chttp2_connector.cc + src/core/ext/filters/client_channel/backend_metric.cc src/core/ext/filters/client_channel/backup_poller.cc src/core/ext/filters/client_channel/channel_connectivity.cc src/core/ext/filters/client_channel/client_channel.cc @@ -2784,6 +2831,19 @@ add_library(grpc_unsecure third_party/upb/upb/port.c third_party/upb/upb/table.c third_party/upb/upb/upb.c + src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c + src/core/ext/upb-generated/gogoproto/gogo.upb.c + src/core/ext/upb-generated/validate/validate.upb.c + src/core/ext/upb-generated/google/api/annotations.upb.c + src/core/ext/upb-generated/google/api/http.upb.c + src/core/ext/upb-generated/google/protobuf/any.upb.c + src/core/ext/upb-generated/google/protobuf/descriptor.upb.c + src/core/ext/upb-generated/google/protobuf/duration.upb.c + src/core/ext/upb-generated/google/protobuf/empty.upb.c + src/core/ext/upb-generated/google/protobuf/struct.upb.c + src/core/ext/upb-generated/google/protobuf/timestamp.upb.c + src/core/ext/upb-generated/google/protobuf/wrappers.upb.c + src/core/ext/upb-generated/google/rpc/status.upb.c src/core/ext/transport/inproc/inproc_plugin.cc src/core/ext/transport/inproc/inproc_transport.cc src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc @@ -2807,16 +2867,6 @@ add_library(grpc_unsecure src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c - src/core/ext/upb-generated/google/api/annotations.upb.c - src/core/ext/upb-generated/google/api/http.upb.c - src/core/ext/upb-generated/google/protobuf/any.upb.c - src/core/ext/upb-generated/google/protobuf/descriptor.upb.c - src/core/ext/upb-generated/google/protobuf/duration.upb.c - src/core/ext/upb-generated/google/protobuf/empty.upb.c - src/core/ext/upb-generated/google/protobuf/struct.upb.c - src/core/ext/upb-generated/google/protobuf/timestamp.upb.c - src/core/ext/upb-generated/google/protobuf/wrappers.upb.c - src/core/ext/upb-generated/google/rpc/status.upb.c src/core/ext/filters/client_channel/lb_policy/xds/xds.cc src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.cc src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc @@ -2824,6 +2874,7 @@ add_library(grpc_unsecure src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c src/core/ext/upb-generated/envoy/api/v2/cds.upb.c src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c + src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c src/core/ext/upb-generated/envoy/api/v2/eds.upb.c @@ -2836,11 +2887,10 @@ add_library(grpc_unsecure src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c + src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c src/core/ext/upb-generated/envoy/type/percent.upb.c src/core/ext/upb-generated/envoy/type/range.upb.c - src/core/ext/upb-generated/gogoproto/gogo.upb.c - src/core/ext/upb-generated/validate/validate.upb.c src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc src/core/ext/filters/census/grpc_context.cc @@ -13128,11 +13178,18 @@ endif (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS) add_executable(client_lb_end2end_test + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/orca_load_report_for_test.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/orca_load_report_for_test.grpc.pb.cc + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/orca_load_report_for_test.pb.h + ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/lb/v2/orca_load_report_for_test.grpc.pb.h test/cpp/end2end/client_lb_end2end_test.cc third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googlemock/src/gmock-all.cc ) +protobuf_generate_grpc_cpp( + src/proto/grpc/lb/v2/orca_load_report_for_test.proto +) target_include_directories(client_lb_end2end_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/Makefile b/Makefile index 5189f704297..4ebf5b36cf8 100644 --- a/Makefile +++ b/Makefile @@ -2745,6 +2745,22 @@ $(GENDIR)/src/proto/grpc/lb/v2/lrs_for_test.grpc.pb.cc: src/proto/grpc/lb/v2/lrs $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< endif +ifeq ($(NO_PROTOC),true) +$(GENDIR)/src/proto/grpc/lb/v2/orca_load_report_for_test.pb.cc: protoc_dep_error +$(GENDIR)/src/proto/grpc/lb/v2/orca_load_report_for_test.grpc.pb.cc: protoc_dep_error +else + +$(GENDIR)/src/proto/grpc/lb/v2/orca_load_report_for_test.pb.cc: src/proto/grpc/lb/v2/orca_load_report_for_test.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) + $(E) "[PROTOC] Generating protobuf CC file from $<" + $(Q) mkdir -p `dirname $@` + $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --cpp_out=$(GENDIR) $< + +$(GENDIR)/src/proto/grpc/lb/v2/orca_load_report_for_test.grpc.pb.cc: src/proto/grpc/lb/v2/orca_load_report_for_test.proto $(GENDIR)/src/proto/grpc/lb/v2/orca_load_report_for_test.pb.cc $(PROTOBUF_DEP) $(PROTOC_PLUGINS) + $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<" + $(Q) mkdir -p `dirname $@` + $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< +endif + ifeq ($(NO_PROTOC),true) $(GENDIR)/src/proto/grpc/reflection/v1alpha/reflection.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.cc: protoc_dep_error @@ -3803,6 +3819,7 @@ LIBGRPC_SRC = \ src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \ src/core/ext/transport/chttp2/client/authority.cc \ src/core/ext/transport/chttp2/client/chttp2_connector.cc \ + src/core/ext/filters/client_channel/backend_metric.cc \ src/core/ext/filters/client_channel/backup_poller.cc \ src/core/ext/filters/client_channel/channel_connectivity.cc \ src/core/ext/filters/client_channel/client_channel.cc \ @@ -3831,6 +3848,19 @@ LIBGRPC_SRC = \ src/core/ext/filters/client_channel/subchannel_pool_interface.cc \ src/core/ext/filters/deadline/deadline_filter.cc \ src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ + src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c \ + src/core/ext/upb-generated/gogoproto/gogo.upb.c \ + src/core/ext/upb-generated/validate/validate.upb.c \ + src/core/ext/upb-generated/google/api/annotations.upb.c \ + src/core/ext/upb-generated/google/api/http.upb.c \ + src/core/ext/upb-generated/google/protobuf/any.upb.c \ + src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \ + src/core/ext/upb-generated/google/protobuf/duration.upb.c \ + src/core/ext/upb-generated/google/protobuf/empty.upb.c \ + src/core/ext/upb-generated/google/protobuf/struct.upb.c \ + src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \ + src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \ + src/core/ext/upb-generated/google/rpc/status.upb.c \ src/core/tsi/fake_transport_security.cc \ src/core/tsi/local_transport_security.cc \ src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc \ @@ -3850,16 +3880,6 @@ LIBGRPC_SRC = \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc \ src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c \ - src/core/ext/upb-generated/google/api/annotations.upb.c \ - src/core/ext/upb-generated/google/api/http.upb.c \ - src/core/ext/upb-generated/google/protobuf/any.upb.c \ - src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \ - src/core/ext/upb-generated/google/protobuf/duration.upb.c \ - src/core/ext/upb-generated/google/protobuf/empty.upb.c \ - src/core/ext/upb-generated/google/protobuf/struct.upb.c \ - src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \ - src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \ - src/core/ext/upb-generated/google/rpc/status.upb.c \ src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc \ @@ -3868,6 +3888,7 @@ LIBGRPC_SRC = \ src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c \ src/core/ext/upb-generated/envoy/api/v2/cds.upb.c \ src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c \ src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c \ src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c \ src/core/ext/upb-generated/envoy/api/v2/eds.upb.c \ @@ -3880,11 +3901,10 @@ LIBGRPC_SRC = \ src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c \ src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c \ src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c \ src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c \ src/core/ext/upb-generated/envoy/type/percent.upb.c \ src/core/ext/upb-generated/envoy/type/range.upb.c \ - src/core/ext/upb-generated/gogoproto/gogo.upb.c \ - src/core/ext/upb-generated/validate/validate.upb.c \ src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \ src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \ src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \ @@ -4193,6 +4213,7 @@ LIBGRPC_CRONET_SRC = \ src/core/ext/filters/http/http_filters_plugin.cc \ src/core/ext/filters/http/message_compress/message_compress_filter.cc \ src/core/ext/filters/http/server/http_server_filter.cc \ + src/core/ext/filters/client_channel/backend_metric.cc \ src/core/ext/filters/client_channel/backup_poller.cc \ src/core/ext/filters/client_channel/channel_connectivity.cc \ src/core/ext/filters/client_channel/client_channel.cc \ @@ -4227,6 +4248,19 @@ LIBGRPC_CRONET_SRC = \ third_party/upb/upb/port.c \ third_party/upb/upb/table.c \ third_party/upb/upb/upb.c \ + src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c \ + src/core/ext/upb-generated/gogoproto/gogo.upb.c \ + src/core/ext/upb-generated/validate/validate.upb.c \ + src/core/ext/upb-generated/google/api/annotations.upb.c \ + src/core/ext/upb-generated/google/api/http.upb.c \ + src/core/ext/upb-generated/google/protobuf/any.upb.c \ + src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \ + src/core/ext/upb-generated/google/protobuf/duration.upb.c \ + src/core/ext/upb-generated/google/protobuf/empty.upb.c \ + src/core/ext/upb-generated/google/protobuf/struct.upb.c \ + src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \ + src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \ + src/core/ext/upb-generated/google/rpc/status.upb.c \ src/core/lib/http/httpcli_security_connector.cc \ src/core/lib/security/context/security_context.cc \ src/core/lib/security/credentials/alts/alts_credentials.cc \ @@ -4573,6 +4607,7 @@ LIBGRPC_TEST_UTIL_SRC = \ src/core/lib/transport/transport_op_string.cc \ src/core/lib/uri/uri_parser.cc \ src/core/lib/debug/trace.cc \ + src/core/ext/filters/client_channel/backend_metric.cc \ src/core/ext/filters/client_channel/backup_poller.cc \ src/core/ext/filters/client_channel/channel_connectivity.cc \ src/core/ext/filters/client_channel/client_channel.cc \ @@ -4607,6 +4642,19 @@ LIBGRPC_TEST_UTIL_SRC = \ third_party/upb/upb/port.c \ third_party/upb/upb/table.c \ third_party/upb/upb/upb.c \ + src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c \ + src/core/ext/upb-generated/gogoproto/gogo.upb.c \ + src/core/ext/upb-generated/validate/validate.upb.c \ + src/core/ext/upb-generated/google/api/annotations.upb.c \ + src/core/ext/upb-generated/google/api/http.upb.c \ + src/core/ext/upb-generated/google/protobuf/any.upb.c \ + src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \ + src/core/ext/upb-generated/google/protobuf/duration.upb.c \ + src/core/ext/upb-generated/google/protobuf/empty.upb.c \ + src/core/ext/upb-generated/google/protobuf/struct.upb.c \ + src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \ + src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \ + src/core/ext/upb-generated/google/rpc/status.upb.c \ src/core/ext/transport/chttp2/transport/bin_decoder.cc \ src/core/ext/transport/chttp2/transport/bin_encoder.cc \ src/core/ext/transport/chttp2/transport/chttp2_plugin.cc \ @@ -4895,6 +4943,7 @@ LIBGRPC_TEST_UTIL_UNSECURE_SRC = \ src/core/lib/transport/transport_op_string.cc \ src/core/lib/uri/uri_parser.cc \ src/core/lib/debug/trace.cc \ + src/core/ext/filters/client_channel/backend_metric.cc \ src/core/ext/filters/client_channel/backup_poller.cc \ src/core/ext/filters/client_channel/channel_connectivity.cc \ src/core/ext/filters/client_channel/client_channel.cc \ @@ -4929,6 +4978,19 @@ LIBGRPC_TEST_UTIL_UNSECURE_SRC = \ third_party/upb/upb/port.c \ third_party/upb/upb/table.c \ third_party/upb/upb/upb.c \ + src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c \ + src/core/ext/upb-generated/gogoproto/gogo.upb.c \ + src/core/ext/upb-generated/validate/validate.upb.c \ + src/core/ext/upb-generated/google/api/annotations.upb.c \ + src/core/ext/upb-generated/google/api/http.upb.c \ + src/core/ext/upb-generated/google/protobuf/any.upb.c \ + src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \ + src/core/ext/upb-generated/google/protobuf/duration.upb.c \ + src/core/ext/upb-generated/google/protobuf/empty.upb.c \ + src/core/ext/upb-generated/google/protobuf/struct.upb.c \ + src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \ + src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \ + src/core/ext/upb-generated/google/rpc/status.upb.c \ src/core/ext/transport/chttp2/transport/bin_decoder.cc \ src/core/ext/transport/chttp2/transport/bin_encoder.cc \ src/core/ext/transport/chttp2/transport/chttp2_plugin.cc \ @@ -5215,6 +5277,7 @@ LIBGRPC_UNSECURE_SRC = \ src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \ src/core/ext/transport/chttp2/client/authority.cc \ src/core/ext/transport/chttp2/client/chttp2_connector.cc \ + src/core/ext/filters/client_channel/backend_metric.cc \ src/core/ext/filters/client_channel/backup_poller.cc \ src/core/ext/filters/client_channel/channel_connectivity.cc \ src/core/ext/filters/client_channel/client_channel.cc \ @@ -5249,6 +5312,19 @@ LIBGRPC_UNSECURE_SRC = \ third_party/upb/upb/port.c \ third_party/upb/upb/table.c \ third_party/upb/upb/upb.c \ + src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c \ + src/core/ext/upb-generated/gogoproto/gogo.upb.c \ + src/core/ext/upb-generated/validate/validate.upb.c \ + src/core/ext/upb-generated/google/api/annotations.upb.c \ + src/core/ext/upb-generated/google/api/http.upb.c \ + src/core/ext/upb-generated/google/protobuf/any.upb.c \ + src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \ + src/core/ext/upb-generated/google/protobuf/duration.upb.c \ + src/core/ext/upb-generated/google/protobuf/empty.upb.c \ + src/core/ext/upb-generated/google/protobuf/struct.upb.c \ + src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \ + src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \ + src/core/ext/upb-generated/google/rpc/status.upb.c \ src/core/ext/transport/inproc/inproc_plugin.cc \ src/core/ext/transport/inproc/inproc_transport.cc \ src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \ @@ -5272,16 +5348,6 @@ LIBGRPC_UNSECURE_SRC = \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc \ src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c \ - src/core/ext/upb-generated/google/api/annotations.upb.c \ - src/core/ext/upb-generated/google/api/http.upb.c \ - src/core/ext/upb-generated/google/protobuf/any.upb.c \ - src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \ - src/core/ext/upb-generated/google/protobuf/duration.upb.c \ - src/core/ext/upb-generated/google/protobuf/empty.upb.c \ - src/core/ext/upb-generated/google/protobuf/struct.upb.c \ - src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \ - src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \ - src/core/ext/upb-generated/google/rpc/status.upb.c \ src/core/ext/filters/client_channel/lb_policy/xds/xds.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc \ @@ -5289,6 +5355,7 @@ LIBGRPC_UNSECURE_SRC = \ src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c \ src/core/ext/upb-generated/envoy/api/v2/cds.upb.c \ src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c \ src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c \ src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c \ src/core/ext/upb-generated/envoy/api/v2/eds.upb.c \ @@ -5301,11 +5368,10 @@ LIBGRPC_UNSECURE_SRC = \ src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c \ src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c \ src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c \ src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c \ src/core/ext/upb-generated/envoy/type/percent.upb.c \ src/core/ext/upb-generated/envoy/type/range.upb.c \ - src/core/ext/upb-generated/gogoproto/gogo.upb.c \ - src/core/ext/upb-generated/validate/validate.upb.c \ src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \ src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \ src/core/ext/filters/census/grpc_context.cc \ @@ -15696,6 +15762,7 @@ endif CLIENT_LB_END2END_TEST_SRC = \ + $(GENDIR)/src/proto/grpc/lb/v2/orca_load_report_for_test.pb.cc $(GENDIR)/src/proto/grpc/lb/v2/orca_load_report_for_test.grpc.pb.cc \ test/cpp/end2end/client_lb_end2end_test.cc \ CLIENT_LB_END2END_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(CLIENT_LB_END2END_TEST_SRC)))) @@ -15727,6 +15794,8 @@ endif endif +$(OBJDIR)/$(CONFIG)/src/proto/grpc/lb/v2/orca_load_report_for_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a + $(OBJDIR)/$(CONFIG)/test/cpp/end2end/client_lb_end2end_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a deps_client_lb_end2end_test: $(CLIENT_LB_END2END_TEST_OBJS:.o=.dep) @@ -15736,6 +15805,7 @@ ifneq ($(NO_DEPS),true) -include $(CLIENT_LB_END2END_TEST_OBJS:.o=.dep) endif endif +$(OBJDIR)/$(CONFIG)/test/cpp/end2end/client_lb_end2end_test.o: $(GENDIR)/src/proto/grpc/lb/v2/orca_load_report_for_test.pb.cc $(GENDIR)/src/proto/grpc/lb/v2/orca_load_report_for_test.grpc.pb.cc CODEGEN_TEST_FULL_SRC = \ diff --git a/build.yaml b/build.yaml index cbdbf8a60bc..9c546246ab0 100644 --- a/build.yaml +++ b/build.yaml @@ -113,6 +113,7 @@ filegroups: - src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h - src/core/ext/upb-generated/envoy/api/v2/cds.upb.h - src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h + - src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h - src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h - src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h - src/core/ext/upb-generated/envoy/api/v2/eds.upb.h @@ -124,6 +125,7 @@ filegroups: - src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c - src/core/ext/upb-generated/envoy/api/v2/cds.upb.c - src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c + - src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c - src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c - src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c - src/core/ext/upb-generated/envoy/api/v2/eds.upb.c @@ -143,6 +145,7 @@ filegroups: - src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h - src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h - src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h + - src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h - src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h src: - src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c @@ -150,11 +153,19 @@ filegroups: - src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c - src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c - src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c + - src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c - src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c uses: - envoy_type_upb - google_api_upb - proto_gen_validate_upb +- name: envoy_orca_upb + headers: + - src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h + src: + - src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c + uses: + - proto_gen_validate_upb - name: envoy_type_upb headers: - src/core/ext/upb-generated/envoy/type/percent.upb.h @@ -945,6 +956,7 @@ filegroups: - grpc_base - name: grpc_client_channel headers: + - src/core/ext/filters/client_channel/backend_metric.h - src/core/ext/filters/client_channel/backup_poller.h - src/core/ext/filters/client_channel/client_channel.h - src/core/ext/filters/client_channel/client_channel_channelz.h @@ -973,6 +985,7 @@ filegroups: - src/core/ext/filters/client_channel/subchannel_interface.h - src/core/ext/filters/client_channel/subchannel_pool_interface.h src: + - src/core/ext/filters/client_channel/backend_metric.cc - src/core/ext/filters/client_channel/backup_poller.cc - src/core/ext/filters/client_channel/channel_connectivity.cc - src/core/ext/filters/client_channel/client_channel.cc @@ -1004,6 +1017,7 @@ filegroups: - grpc_base - grpc_deadline_filter - grpc_health_upb + - envoy_orca_upb - name: grpc_client_idle_filter src: - src/core/ext/filters/client_idle/client_idle_filter.cc @@ -4741,6 +4755,7 @@ targets: build: test language: c++ src: + - src/proto/grpc/lb/v2/orca_load_report_for_test.proto - test/cpp/end2end/client_lb_end2end_test.cc deps: - grpc++_test_util diff --git a/config.m4 b/config.m4 index 79f69aa36e4..effefa9b561 100644 --- a/config.m4 +++ b/config.m4 @@ -349,6 +349,7 @@ if test "$PHP_GRPC" != "no"; then src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc \ src/core/ext/transport/chttp2/client/authority.cc \ src/core/ext/transport/chttp2/client/chttp2_connector.cc \ + src/core/ext/filters/client_channel/backend_metric.cc \ src/core/ext/filters/client_channel/backup_poller.cc \ src/core/ext/filters/client_channel/channel_connectivity.cc \ src/core/ext/filters/client_channel/client_channel.cc \ @@ -377,6 +378,19 @@ if test "$PHP_GRPC" != "no"; then src/core/ext/filters/client_channel/subchannel_pool_interface.cc \ src/core/ext/filters/deadline/deadline_filter.cc \ src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ + src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c \ + src/core/ext/upb-generated/gogoproto/gogo.upb.c \ + src/core/ext/upb-generated/validate/validate.upb.c \ + src/core/ext/upb-generated/google/api/annotations.upb.c \ + src/core/ext/upb-generated/google/api/http.upb.c \ + src/core/ext/upb-generated/google/protobuf/any.upb.c \ + src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \ + src/core/ext/upb-generated/google/protobuf/duration.upb.c \ + src/core/ext/upb-generated/google/protobuf/empty.upb.c \ + src/core/ext/upb-generated/google/protobuf/struct.upb.c \ + src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \ + src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \ + src/core/ext/upb-generated/google/rpc/status.upb.c \ src/core/tsi/fake_transport_security.cc \ src/core/tsi/local_transport_security.cc \ src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc \ @@ -396,16 +410,6 @@ if test "$PHP_GRPC" != "no"; then src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc \ src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc \ src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c \ - src/core/ext/upb-generated/google/api/annotations.upb.c \ - src/core/ext/upb-generated/google/api/http.upb.c \ - src/core/ext/upb-generated/google/protobuf/any.upb.c \ - src/core/ext/upb-generated/google/protobuf/descriptor.upb.c \ - src/core/ext/upb-generated/google/protobuf/duration.upb.c \ - src/core/ext/upb-generated/google/protobuf/empty.upb.c \ - src/core/ext/upb-generated/google/protobuf/struct.upb.c \ - src/core/ext/upb-generated/google/protobuf/timestamp.upb.c \ - src/core/ext/upb-generated/google/protobuf/wrappers.upb.c \ - src/core/ext/upb-generated/google/rpc/status.upb.c \ src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds.cc \ src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc \ @@ -414,6 +418,7 @@ if test "$PHP_GRPC" != "no"; then src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c \ src/core/ext/upb-generated/envoy/api/v2/cds.upb.c \ src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c \ src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c \ src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c \ src/core/ext/upb-generated/envoy/api/v2/eds.upb.c \ @@ -426,11 +431,10 @@ if test "$PHP_GRPC" != "no"; then src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c \ src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c \ src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c \ + src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c \ src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c \ src/core/ext/upb-generated/envoy/type/percent.upb.c \ src/core/ext/upb-generated/envoy/type/range.upb.c \ - src/core/ext/upb-generated/gogoproto/gogo.upb.c \ - src/core/ext/upb-generated/validate/validate.upb.c \ src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc \ src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc \ src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc \ @@ -766,6 +770,7 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/src/proto/grpc/gcp) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/src/proto/grpc/health/v1) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/src/proto/grpc/lb/v1) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/udpa/data/orca/v1) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/validate) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/avl) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/backoff) diff --git a/config.w32 b/config.w32 index 994363a0f1f..13b5f1350f0 100644 --- a/config.w32 +++ b/config.w32 @@ -323,6 +323,7 @@ if (PHP_GRPC != "no") { "src\\core\\ext\\transport\\chttp2\\client\\insecure\\channel_create_posix.cc " + "src\\core\\ext\\transport\\chttp2\\client\\authority.cc " + "src\\core\\ext\\transport\\chttp2\\client\\chttp2_connector.cc " + + "src\\core\\ext\\filters\\client_channel\\backend_metric.cc " + "src\\core\\ext\\filters\\client_channel\\backup_poller.cc " + "src\\core\\ext\\filters\\client_channel\\channel_connectivity.cc " + "src\\core\\ext\\filters\\client_channel\\client_channel.cc " + @@ -351,6 +352,19 @@ if (PHP_GRPC != "no") { "src\\core\\ext\\filters\\client_channel\\subchannel_pool_interface.cc " + "src\\core\\ext\\filters\\deadline\\deadline_filter.cc " + "src\\core\\ext\\upb-generated\\src\\proto\\grpc\\health\\v1\\health.upb.c " + + "src\\core\\ext\\upb-generated\\udpa\\data\\orca\\v1\\orca_load_report.upb.c " + + "src\\core\\ext\\upb-generated\\gogoproto\\gogo.upb.c " + + "src\\core\\ext\\upb-generated\\validate\\validate.upb.c " + + "src\\core\\ext\\upb-generated\\google\\api\\annotations.upb.c " + + "src\\core\\ext\\upb-generated\\google\\api\\http.upb.c " + + "src\\core\\ext\\upb-generated\\google\\protobuf\\any.upb.c " + + "src\\core\\ext\\upb-generated\\google\\protobuf\\descriptor.upb.c " + + "src\\core\\ext\\upb-generated\\google\\protobuf\\duration.upb.c " + + "src\\core\\ext\\upb-generated\\google\\protobuf\\empty.upb.c " + + "src\\core\\ext\\upb-generated\\google\\protobuf\\struct.upb.c " + + "src\\core\\ext\\upb-generated\\google\\protobuf\\timestamp.upb.c " + + "src\\core\\ext\\upb-generated\\google\\protobuf\\wrappers.upb.c " + + "src\\core\\ext\\upb-generated\\google\\rpc\\status.upb.c " + "src\\core\\tsi\\fake_transport_security.cc " + "src\\core\\tsi\\local_transport_security.cc " + "src\\core\\tsi\\ssl\\session_cache\\ssl_session_boringssl.cc " + @@ -370,16 +384,6 @@ if (PHP_GRPC != "no") { "src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\grpclb_client_stats.cc " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\grpclb\\load_balancer_api.cc " + "src\\core\\ext\\upb-generated\\src\\proto\\grpc\\lb\\v1\\load_balancer.upb.c " + - "src\\core\\ext\\upb-generated\\google\\api\\annotations.upb.c " + - "src\\core\\ext\\upb-generated\\google\\api\\http.upb.c " + - "src\\core\\ext\\upb-generated\\google\\protobuf\\any.upb.c " + - "src\\core\\ext\\upb-generated\\google\\protobuf\\descriptor.upb.c " + - "src\\core\\ext\\upb-generated\\google\\protobuf\\duration.upb.c " + - "src\\core\\ext\\upb-generated\\google\\protobuf\\empty.upb.c " + - "src\\core\\ext\\upb-generated\\google\\protobuf\\struct.upb.c " + - "src\\core\\ext\\upb-generated\\google\\protobuf\\timestamp.upb.c " + - "src\\core\\ext\\upb-generated\\google\\protobuf\\wrappers.upb.c " + - "src\\core\\ext\\upb-generated\\google\\rpc\\status.upb.c " + "src\\core\\ext\\filters\\client_channel\\resolver\\fake\\fake_resolver.cc " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\xds\\xds.cc " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\xds\\xds_channel_secure.cc " + @@ -388,6 +392,7 @@ if (PHP_GRPC != "no") { "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\auth\\cert.upb.c " + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\cds.upb.c " + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\cluster\\circuit_breaker.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\cluster\\filter.upb.c " + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\cluster\\outlier_detection.upb.c " + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\discovery.upb.c " + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\eds.upb.c " + @@ -400,11 +405,10 @@ if (PHP_GRPC != "no") { "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\config_source.upb.c " + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\grpc_service.upb.c " + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\health_check.upb.c " + + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\http_uri.upb.c " + "src\\core\\ext\\upb-generated\\envoy\\api\\v2\\core\\protocol.upb.c " + "src\\core\\ext\\upb-generated\\envoy\\type\\percent.upb.c " + "src\\core\\ext\\upb-generated\\envoy\\type\\range.upb.c " + - "src\\core\\ext\\upb-generated\\gogoproto\\gogo.upb.c " + - "src\\core\\ext\\upb-generated\\validate\\validate.upb.c " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\pick_first\\pick_first.cc " + "src\\core\\ext\\filters\\client_channel\\lb_policy\\round_robin\\round_robin.cc " + "src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\dns_resolver_ares.cc " + @@ -785,6 +789,10 @@ if (PHP_GRPC != "no") { FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\health\\v1"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\lb"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\src\\proto\\grpc\\lb\\v1"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\udpa"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\udpa\\data"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\udpa\\data\\orca"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\udpa\\data\\orca\\v1"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\validate"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\avl"); diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index e6f926ca166..658a3ad6158 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -352,6 +352,7 @@ Pod::Spec.new do |s| 'src/core/tsi/transport_security_interface.h', 'src/core/ext/transport/chttp2/client/authority.h', 'src/core/ext/transport/chttp2/client/chttp2_connector.h', + 'src/core/ext/filters/client_channel/backend_metric.h', 'src/core/ext/filters/client_channel/backup_poller.h', 'src/core/ext/filters/client_channel/client_channel.h', 'src/core/ext/filters/client_channel/client_channel_channelz.h', @@ -381,6 +382,19 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/subchannel_pool_interface.h', 'src/core/ext/filters/deadline/deadline_filter.h', 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h', + 'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h', + 'src/core/ext/upb-generated/gogoproto/gogo.upb.h', + 'src/core/ext/upb-generated/validate/validate.upb.h', + 'src/core/ext/upb-generated/google/api/annotations.upb.h', + 'src/core/ext/upb-generated/google/api/http.upb.h', + 'src/core/ext/upb-generated/google/protobuf/any.upb.h', + 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.h', + 'src/core/ext/upb-generated/google/protobuf/duration.upb.h', + 'src/core/ext/upb-generated/google/protobuf/empty.upb.h', + 'src/core/ext/upb-generated/google/protobuf/struct.upb.h', + 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.h', + 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.h', + 'src/core/ext/upb-generated/google/rpc/status.upb.h', 'src/core/tsi/fake_transport_security.h', 'src/core/tsi/local_transport_security.h', 'src/core/tsi/ssl/session_cache/ssl_session.h', @@ -540,16 +554,6 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h', 'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h', - 'src/core/ext/upb-generated/google/api/annotations.upb.h', - 'src/core/ext/upb-generated/google/api/http.upb.h', - 'src/core/ext/upb-generated/google/protobuf/any.upb.h', - 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.h', - 'src/core/ext/upb-generated/google/protobuf/duration.upb.h', - 'src/core/ext/upb-generated/google/protobuf/empty.upb.h', - 'src/core/ext/upb-generated/google/protobuf/struct.upb.h', - 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.h', - 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.h', - 'src/core/ext/upb-generated/google/rpc/status.upb.h', 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h', @@ -557,6 +561,7 @@ Pod::Spec.new do |s| 'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h', 'src/core/ext/upb-generated/envoy/api/v2/cds.upb.h', 'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h', 'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h', 'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h', 'src/core/ext/upb-generated/envoy/api/v2/eds.upb.h', @@ -569,11 +574,10 @@ Pod::Spec.new do |s| 'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h', 'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h', 'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h', 'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h', 'src/core/ext/upb-generated/envoy/type/percent.upb.h', 'src/core/ext/upb-generated/envoy/type/range.upb.h', - 'src/core/ext/upb-generated/gogoproto/gogo.upb.h', - 'src/core/ext/upb-generated/validate/validate.upb.h', 'src/core/ext/filters/client_channel/lb_policy/subchannel_list.h', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h', @@ -847,6 +851,7 @@ Pod::Spec.new do |s| 'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc', 'src/core/ext/transport/chttp2/client/authority.cc', 'src/core/ext/transport/chttp2/client/chttp2_connector.cc', + 'src/core/ext/filters/client_channel/backend_metric.cc', 'src/core/ext/filters/client_channel/backup_poller.cc', 'src/core/ext/filters/client_channel/channel_connectivity.cc', 'src/core/ext/filters/client_channel/client_channel.cc', @@ -875,6 +880,19 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/subchannel_pool_interface.cc', 'src/core/ext/filters/deadline/deadline_filter.cc', 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c', + 'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c', + 'src/core/ext/upb-generated/gogoproto/gogo.upb.c', + 'src/core/ext/upb-generated/validate/validate.upb.c', + 'src/core/ext/upb-generated/google/api/annotations.upb.c', + 'src/core/ext/upb-generated/google/api/http.upb.c', + 'src/core/ext/upb-generated/google/protobuf/any.upb.c', + 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c', + 'src/core/ext/upb-generated/google/protobuf/duration.upb.c', + 'src/core/ext/upb-generated/google/protobuf/empty.upb.c', + 'src/core/ext/upb-generated/google/protobuf/struct.upb.c', + 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c', + 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c', + 'src/core/ext/upb-generated/google/rpc/status.upb.c', 'src/core/tsi/fake_transport_security.cc', 'src/core/tsi/local_transport_security.cc', 'src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc', @@ -894,16 +912,6 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc', 'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c', - 'src/core/ext/upb-generated/google/api/annotations.upb.c', - 'src/core/ext/upb-generated/google/api/http.upb.c', - 'src/core/ext/upb-generated/google/protobuf/any.upb.c', - 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c', - 'src/core/ext/upb-generated/google/protobuf/duration.upb.c', - 'src/core/ext/upb-generated/google/protobuf/empty.upb.c', - 'src/core/ext/upb-generated/google/protobuf/struct.upb.c', - 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c', - 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c', - 'src/core/ext/upb-generated/google/rpc/status.upb.c', 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc', @@ -912,6 +920,7 @@ Pod::Spec.new do |s| 'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/cds.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/eds.upb.c', @@ -924,11 +933,10 @@ Pod::Spec.new do |s| 'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c', 'src/core/ext/upb-generated/envoy/type/percent.upb.c', 'src/core/ext/upb-generated/envoy/type/range.upb.c', - 'src/core/ext/upb-generated/gogoproto/gogo.upb.c', - 'src/core/ext/upb-generated/validate/validate.upb.c', 'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc', 'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc', @@ -1078,6 +1086,7 @@ Pod::Spec.new do |s| 'src/core/tsi/transport_security_interface.h', 'src/core/ext/transport/chttp2/client/authority.h', 'src/core/ext/transport/chttp2/client/chttp2_connector.h', + 'src/core/ext/filters/client_channel/backend_metric.h', 'src/core/ext/filters/client_channel/backup_poller.h', 'src/core/ext/filters/client_channel/client_channel.h', 'src/core/ext/filters/client_channel/client_channel_channelz.h', @@ -1107,6 +1116,19 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/subchannel_pool_interface.h', 'src/core/ext/filters/deadline/deadline_filter.h', 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h', + 'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h', + 'src/core/ext/upb-generated/gogoproto/gogo.upb.h', + 'src/core/ext/upb-generated/validate/validate.upb.h', + 'src/core/ext/upb-generated/google/api/annotations.upb.h', + 'src/core/ext/upb-generated/google/api/http.upb.h', + 'src/core/ext/upb-generated/google/protobuf/any.upb.h', + 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.h', + 'src/core/ext/upb-generated/google/protobuf/duration.upb.h', + 'src/core/ext/upb-generated/google/protobuf/empty.upb.h', + 'src/core/ext/upb-generated/google/protobuf/struct.upb.h', + 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.h', + 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.h', + 'src/core/ext/upb-generated/google/rpc/status.upb.h', 'src/core/tsi/fake_transport_security.h', 'src/core/tsi/local_transport_security.h', 'src/core/tsi/ssl/session_cache/ssl_session.h', @@ -1266,16 +1288,6 @@ Pod::Spec.new do |s| 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h', 'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h', - 'src/core/ext/upb-generated/google/api/annotations.upb.h', - 'src/core/ext/upb-generated/google/api/http.upb.h', - 'src/core/ext/upb-generated/google/protobuf/any.upb.h', - 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.h', - 'src/core/ext/upb-generated/google/protobuf/duration.upb.h', - 'src/core/ext/upb-generated/google/protobuf/empty.upb.h', - 'src/core/ext/upb-generated/google/protobuf/struct.upb.h', - 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.h', - 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.h', - 'src/core/ext/upb-generated/google/rpc/status.upb.h', 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.h', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h', @@ -1283,6 +1295,7 @@ Pod::Spec.new do |s| 'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h', 'src/core/ext/upb-generated/envoy/api/v2/cds.upb.h', 'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h', 'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h', 'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h', 'src/core/ext/upb-generated/envoy/api/v2/eds.upb.h', @@ -1295,11 +1308,10 @@ Pod::Spec.new do |s| 'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h', 'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h', 'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h', + 'src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h', 'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h', 'src/core/ext/upb-generated/envoy/type/percent.upb.h', 'src/core/ext/upb-generated/envoy/type/range.upb.h', - 'src/core/ext/upb-generated/gogoproto/gogo.upb.h', - 'src/core/ext/upb-generated/validate/validate.upb.h', 'src/core/ext/filters/client_channel/lb_policy/subchannel_list.h', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h', diff --git a/grpc.gemspec b/grpc.gemspec index 5a29165c92d..1b705016cee 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -282,6 +282,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/tsi/transport_security_interface.h ) s.files += %w( src/core/ext/transport/chttp2/client/authority.h ) s.files += %w( src/core/ext/transport/chttp2/client/chttp2_connector.h ) + s.files += %w( src/core/ext/filters/client_channel/backend_metric.h ) s.files += %w( src/core/ext/filters/client_channel/backup_poller.h ) s.files += %w( src/core/ext/filters/client_channel/client_channel.h ) s.files += %w( src/core/ext/filters/client_channel/client_channel_channelz.h ) @@ -311,6 +312,19 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/filters/client_channel/subchannel_pool_interface.h ) s.files += %w( src/core/ext/filters/deadline/deadline_filter.h ) s.files += %w( src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h ) + s.files += %w( src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h ) + s.files += %w( src/core/ext/upb-generated/gogoproto/gogo.upb.h ) + s.files += %w( src/core/ext/upb-generated/validate/validate.upb.h ) + s.files += %w( src/core/ext/upb-generated/google/api/annotations.upb.h ) + s.files += %w( src/core/ext/upb-generated/google/api/http.upb.h ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/any.upb.h ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/descriptor.upb.h ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/duration.upb.h ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/empty.upb.h ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/struct.upb.h ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/timestamp.upb.h ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/wrappers.upb.h ) + s.files += %w( src/core/ext/upb-generated/google/rpc/status.upb.h ) s.files += %w( src/core/tsi/fake_transport_security.h ) s.files += %w( src/core/tsi/local_transport_security.h ) s.files += %w( src/core/tsi/ssl/session_cache/ssl_session.h ) @@ -470,16 +484,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h ) s.files += %w( src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h ) - s.files += %w( src/core/ext/upb-generated/google/api/annotations.upb.h ) - s.files += %w( src/core/ext/upb-generated/google/api/http.upb.h ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/any.upb.h ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/descriptor.upb.h ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/duration.upb.h ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/empty.upb.h ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/struct.upb.h ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/timestamp.upb.h ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/wrappers.upb.h ) - s.files += %w( src/core/ext/upb-generated/google/rpc/status.upb.h ) s.files += %w( src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.h ) @@ -487,6 +491,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h ) s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cds.upb.h ) s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h ) s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h ) s.files += %w( src/core/ext/upb-generated/envoy/api/v2/discovery.upb.h ) s.files += %w( src/core/ext/upb-generated/envoy/api/v2/eds.upb.h ) @@ -499,11 +504,10 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h ) s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h ) s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h ) s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h ) s.files += %w( src/core/ext/upb-generated/envoy/type/percent.upb.h ) s.files += %w( src/core/ext/upb-generated/envoy/type/range.upb.h ) - s.files += %w( src/core/ext/upb-generated/gogoproto/gogo.upb.h ) - s.files += %w( src/core/ext/upb-generated/validate/validate.upb.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/subchannel_list.h ) s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h ) s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h ) @@ -777,6 +781,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc ) s.files += %w( src/core/ext/transport/chttp2/client/authority.cc ) s.files += %w( src/core/ext/transport/chttp2/client/chttp2_connector.cc ) + s.files += %w( src/core/ext/filters/client_channel/backend_metric.cc ) s.files += %w( src/core/ext/filters/client_channel/backup_poller.cc ) s.files += %w( src/core/ext/filters/client_channel/channel_connectivity.cc ) s.files += %w( src/core/ext/filters/client_channel/client_channel.cc ) @@ -805,6 +810,19 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/filters/client_channel/subchannel_pool_interface.cc ) s.files += %w( src/core/ext/filters/deadline/deadline_filter.cc ) s.files += %w( src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c ) + s.files += %w( src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c ) + s.files += %w( src/core/ext/upb-generated/gogoproto/gogo.upb.c ) + s.files += %w( src/core/ext/upb-generated/validate/validate.upb.c ) + s.files += %w( src/core/ext/upb-generated/google/api/annotations.upb.c ) + s.files += %w( src/core/ext/upb-generated/google/api/http.upb.c ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/any.upb.c ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/descriptor.upb.c ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/duration.upb.c ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/empty.upb.c ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/struct.upb.c ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/timestamp.upb.c ) + s.files += %w( src/core/ext/upb-generated/google/protobuf/wrappers.upb.c ) + s.files += %w( src/core/ext/upb-generated/google/rpc/status.upb.c ) s.files += %w( src/core/tsi/fake_transport_security.cc ) s.files += %w( src/core/tsi/local_transport_security.cc ) s.files += %w( src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc ) @@ -824,16 +842,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc ) s.files += %w( src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c ) - s.files += %w( src/core/ext/upb-generated/google/api/annotations.upb.c ) - s.files += %w( src/core/ext/upb-generated/google/api/http.upb.c ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/any.upb.c ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/descriptor.upb.c ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/duration.upb.c ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/empty.upb.c ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/struct.upb.c ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/timestamp.upb.c ) - s.files += %w( src/core/ext/upb-generated/google/protobuf/wrappers.upb.c ) - s.files += %w( src/core/ext/upb-generated/google/rpc/status.upb.c ) s.files += %w( src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds.cc ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc ) @@ -842,6 +850,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c ) s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cds.upb.c ) s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c ) s.files += %w( src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c ) s.files += %w( src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c ) s.files += %w( src/core/ext/upb-generated/envoy/api/v2/eds.upb.c ) @@ -854,11 +863,10 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c ) s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c ) s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c ) + s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c ) s.files += %w( src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c ) s.files += %w( src/core/ext/upb-generated/envoy/type/percent.upb.c ) s.files += %w( src/core/ext/upb-generated/envoy/type/range.upb.c ) - s.files += %w( src/core/ext/upb-generated/gogoproto/gogo.upb.c ) - s.files += %w( src/core/ext/upb-generated/validate/validate.upb.c ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc ) s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc ) diff --git a/grpc.gyp b/grpc.gyp index 3b86e613131..64481e22df3 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -553,6 +553,7 @@ 'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc', 'src/core/ext/transport/chttp2/client/authority.cc', 'src/core/ext/transport/chttp2/client/chttp2_connector.cc', + 'src/core/ext/filters/client_channel/backend_metric.cc', 'src/core/ext/filters/client_channel/backup_poller.cc', 'src/core/ext/filters/client_channel/channel_connectivity.cc', 'src/core/ext/filters/client_channel/client_channel.cc', @@ -581,6 +582,19 @@ 'src/core/ext/filters/client_channel/subchannel_pool_interface.cc', 'src/core/ext/filters/deadline/deadline_filter.cc', 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c', + 'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c', + 'src/core/ext/upb-generated/gogoproto/gogo.upb.c', + 'src/core/ext/upb-generated/validate/validate.upb.c', + 'src/core/ext/upb-generated/google/api/annotations.upb.c', + 'src/core/ext/upb-generated/google/api/http.upb.c', + 'src/core/ext/upb-generated/google/protobuf/any.upb.c', + 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c', + 'src/core/ext/upb-generated/google/protobuf/duration.upb.c', + 'src/core/ext/upb-generated/google/protobuf/empty.upb.c', + 'src/core/ext/upb-generated/google/protobuf/struct.upb.c', + 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c', + 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c', + 'src/core/ext/upb-generated/google/rpc/status.upb.c', 'src/core/tsi/fake_transport_security.cc', 'src/core/tsi/local_transport_security.cc', 'src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc', @@ -600,16 +614,6 @@ 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc', 'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c', - 'src/core/ext/upb-generated/google/api/annotations.upb.c', - 'src/core/ext/upb-generated/google/api/http.upb.c', - 'src/core/ext/upb-generated/google/protobuf/any.upb.c', - 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c', - 'src/core/ext/upb-generated/google/protobuf/duration.upb.c', - 'src/core/ext/upb-generated/google/protobuf/empty.upb.c', - 'src/core/ext/upb-generated/google/protobuf/struct.upb.c', - 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c', - 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c', - 'src/core/ext/upb-generated/google/rpc/status.upb.c', 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc', @@ -618,6 +622,7 @@ 'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/cds.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/eds.upb.c', @@ -630,11 +635,10 @@ 'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c', 'src/core/ext/upb-generated/envoy/type/percent.upb.c', 'src/core/ext/upb-generated/envoy/type/range.upb.c', - 'src/core/ext/upb-generated/gogoproto/gogo.upb.c', - 'src/core/ext/upb-generated/validate/validate.upb.c', 'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc', 'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc', @@ -857,6 +861,7 @@ 'src/core/lib/transport/transport_op_string.cc', 'src/core/lib/uri/uri_parser.cc', 'src/core/lib/debug/trace.cc', + 'src/core/ext/filters/client_channel/backend_metric.cc', 'src/core/ext/filters/client_channel/backup_poller.cc', 'src/core/ext/filters/client_channel/channel_connectivity.cc', 'src/core/ext/filters/client_channel/client_channel.cc', @@ -891,6 +896,19 @@ 'third_party/upb/upb/port.c', 'third_party/upb/upb/table.c', 'third_party/upb/upb/upb.c', + 'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c', + 'src/core/ext/upb-generated/gogoproto/gogo.upb.c', + 'src/core/ext/upb-generated/validate/validate.upb.c', + 'src/core/ext/upb-generated/google/api/annotations.upb.c', + 'src/core/ext/upb-generated/google/api/http.upb.c', + 'src/core/ext/upb-generated/google/protobuf/any.upb.c', + 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c', + 'src/core/ext/upb-generated/google/protobuf/duration.upb.c', + 'src/core/ext/upb-generated/google/protobuf/empty.upb.c', + 'src/core/ext/upb-generated/google/protobuf/struct.upb.c', + 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c', + 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c', + 'src/core/ext/upb-generated/google/rpc/status.upb.c', 'src/core/ext/transport/chttp2/transport/bin_decoder.cc', 'src/core/ext/transport/chttp2/transport/bin_encoder.cc', 'src/core/ext/transport/chttp2/transport/chttp2_plugin.cc', @@ -1112,6 +1130,7 @@ 'src/core/lib/transport/transport_op_string.cc', 'src/core/lib/uri/uri_parser.cc', 'src/core/lib/debug/trace.cc', + 'src/core/ext/filters/client_channel/backend_metric.cc', 'src/core/ext/filters/client_channel/backup_poller.cc', 'src/core/ext/filters/client_channel/channel_connectivity.cc', 'src/core/ext/filters/client_channel/client_channel.cc', @@ -1146,6 +1165,19 @@ 'third_party/upb/upb/port.c', 'third_party/upb/upb/table.c', 'third_party/upb/upb/upb.c', + 'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c', + 'src/core/ext/upb-generated/gogoproto/gogo.upb.c', + 'src/core/ext/upb-generated/validate/validate.upb.c', + 'src/core/ext/upb-generated/google/api/annotations.upb.c', + 'src/core/ext/upb-generated/google/api/http.upb.c', + 'src/core/ext/upb-generated/google/protobuf/any.upb.c', + 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c', + 'src/core/ext/upb-generated/google/protobuf/duration.upb.c', + 'src/core/ext/upb-generated/google/protobuf/empty.upb.c', + 'src/core/ext/upb-generated/google/protobuf/struct.upb.c', + 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c', + 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c', + 'src/core/ext/upb-generated/google/rpc/status.upb.c', 'src/core/ext/transport/chttp2/transport/bin_decoder.cc', 'src/core/ext/transport/chttp2/transport/bin_encoder.cc', 'src/core/ext/transport/chttp2/transport/chttp2_plugin.cc', @@ -1378,6 +1410,7 @@ 'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc', 'src/core/ext/transport/chttp2/client/authority.cc', 'src/core/ext/transport/chttp2/client/chttp2_connector.cc', + 'src/core/ext/filters/client_channel/backend_metric.cc', 'src/core/ext/filters/client_channel/backup_poller.cc', 'src/core/ext/filters/client_channel/channel_connectivity.cc', 'src/core/ext/filters/client_channel/client_channel.cc', @@ -1412,6 +1445,19 @@ 'third_party/upb/upb/port.c', 'third_party/upb/upb/table.c', 'third_party/upb/upb/upb.c', + 'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c', + 'src/core/ext/upb-generated/gogoproto/gogo.upb.c', + 'src/core/ext/upb-generated/validate/validate.upb.c', + 'src/core/ext/upb-generated/google/api/annotations.upb.c', + 'src/core/ext/upb-generated/google/api/http.upb.c', + 'src/core/ext/upb-generated/google/protobuf/any.upb.c', + 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c', + 'src/core/ext/upb-generated/google/protobuf/duration.upb.c', + 'src/core/ext/upb-generated/google/protobuf/empty.upb.c', + 'src/core/ext/upb-generated/google/protobuf/struct.upb.c', + 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c', + 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c', + 'src/core/ext/upb-generated/google/rpc/status.upb.c', 'src/core/ext/transport/inproc/inproc_plugin.cc', 'src/core/ext/transport/inproc/inproc_transport.cc', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc', @@ -1435,16 +1481,6 @@ 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc', 'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c', - 'src/core/ext/upb-generated/google/api/annotations.upb.c', - 'src/core/ext/upb-generated/google/api/http.upb.c', - 'src/core/ext/upb-generated/google/protobuf/any.upb.c', - 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c', - 'src/core/ext/upb-generated/google/protobuf/duration.upb.c', - 'src/core/ext/upb-generated/google/protobuf/empty.upb.c', - 'src/core/ext/upb-generated/google/protobuf/struct.upb.c', - 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c', - 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c', - 'src/core/ext/upb-generated/google/rpc/status.upb.c', 'src/core/ext/filters/client_channel/lb_policy/xds/xds.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_client_stats.cc', @@ -1452,6 +1488,7 @@ 'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/cds.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/eds.upb.c', @@ -1464,11 +1501,10 @@ 'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c', 'src/core/ext/upb-generated/envoy/type/percent.upb.c', 'src/core/ext/upb-generated/envoy/type/range.upb.c', - 'src/core/ext/upb-generated/gogoproto/gogo.upb.c', - 'src/core/ext/upb-generated/validate/validate.upb.c', 'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc', 'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc', 'src/core/ext/filters/census/grpc_context.cc', diff --git a/package.xml b/package.xml index 196c6a6d7db..385a57c77ea 100644 --- a/package.xml +++ b/package.xml @@ -287,6 +287,7 @@ + @@ -316,6 +317,19 @@ + + + + + + + + + + + + + @@ -475,16 +489,6 @@ - - - - - - - - - - @@ -492,6 +496,7 @@ + @@ -504,11 +509,10 @@ + - - @@ -782,6 +786,7 @@ + @@ -810,6 +815,19 @@ + + + + + + + + + + + + + @@ -829,16 +847,6 @@ - - - - - - - - - - @@ -847,6 +855,7 @@ + @@ -859,11 +868,10 @@ + - - diff --git a/src/core/ext/filters/client_channel/backend_metric.cc b/src/core/ext/filters/client_channel/backend_metric.cc new file mode 100644 index 00000000000..0d6aa2f6e2c --- /dev/null +++ b/src/core/ext/filters/client_channel/backend_metric.cc @@ -0,0 +1,78 @@ +// +// Copyright 2019 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#include + +#include "src/core/ext/filters/client_channel/backend_metric.h" + +#include "src/core/lib/gprpp/string_view.h" +#include "udpa/data/orca/v1/orca_load_report.upb.h" + +namespace grpc_core { + +namespace { + +template +Map ParseMap( + udpa_data_orca_v1_OrcaLoadReport* msg, + EntryType** (*entry_func)(udpa_data_orca_v1_OrcaLoadReport*, size_t*), + upb_strview (*key_func)(const EntryType*), + double (*value_func)(const EntryType*), Arena* arena) { + Map result; + size_t size; + const auto* const* entries = entry_func(msg, &size); + for (size_t i = 0; i < size; ++i) { + upb_strview key_view = key_func(entries[i]); + char* key = static_cast(arena->Alloc(key_view.size + 1)); + memcpy(key, key_view.data, key_view.size); + result[StringView(key, key_view.size)] = value_func(entries[i]); + } + return result; +} + +} // namespace + +const LoadBalancingPolicy::BackendMetricData* ParseBackendMetricData( + const grpc_slice& serialized_load_report, Arena* arena) { + upb::Arena upb_arena; + udpa_data_orca_v1_OrcaLoadReport* msg = + udpa_data_orca_v1_OrcaLoadReport_parse( + reinterpret_cast( + GRPC_SLICE_START_PTR(serialized_load_report)), + GRPC_SLICE_LENGTH(serialized_load_report), upb_arena.ptr()); + if (msg == nullptr) return nullptr; + LoadBalancingPolicy::BackendMetricData* backend_metric_data = + arena->New(); + backend_metric_data->cpu_utilization = + udpa_data_orca_v1_OrcaLoadReport_cpu_utilization(msg); + backend_metric_data->mem_utilization = + udpa_data_orca_v1_OrcaLoadReport_mem_utilization(msg); + backend_metric_data->requests_per_second = + udpa_data_orca_v1_OrcaLoadReport_rps(msg); + backend_metric_data->request_cost = + ParseMap( + msg, udpa_data_orca_v1_OrcaLoadReport_mutable_request_cost, + udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_key, + udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_value, arena); + backend_metric_data->utilization = + ParseMap( + msg, udpa_data_orca_v1_OrcaLoadReport_mutable_utilization, + udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_key, + udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_value, arena); + return backend_metric_data; +} + +} // namespace grpc_core diff --git a/src/core/ext/filters/client_channel/backend_metric.h b/src/core/ext/filters/client_channel/backend_metric.h new file mode 100644 index 00000000000..d92b76c8d32 --- /dev/null +++ b/src/core/ext/filters/client_channel/backend_metric.h @@ -0,0 +1,36 @@ +// +// Copyright 2019 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_BACKEND_METRIC_H +#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_BACKEND_METRIC_H + +#include + +#include + +#include "src/core/ext/filters/client_channel/lb_policy.h" +#include "src/core/lib/gprpp/arena.h" + +namespace grpc_core { + +// Parses the serialized load report and allocates a BackendMetricData +// object on the arena. +const LoadBalancingPolicy::BackendMetricData* ParseBackendMetricData( + const grpc_slice& serialized_load_report, Arena* arena); + +} // namespace grpc_core + +#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_BACKEND_METRIC_H */ diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc index db5ddcb46b9..2482614e8c9 100644 --- a/src/core/ext/filters/client_channel/client_channel.cc +++ b/src/core/ext/filters/client_channel/client_channel.cc @@ -31,6 +31,7 @@ #include #include +#include "src/core/ext/filters/client_channel/backend_metric.h" #include "src/core/ext/filters/client_channel/backup_poller.h" #include "src/core/ext/filters/client_channel/global_subchannel_pool.h" #include "src/core/ext/filters/client_channel/http_connect_handshaker.h" @@ -374,6 +375,19 @@ class CallData { void* Alloc(size_t size) override { return calld_->arena_->Alloc(size); } + const LoadBalancingPolicy::BackendMetricData* GetBackendMetricData() + override { + if (calld_->backend_metric_data_ == nullptr) { + grpc_linked_mdelem* md = calld_->recv_trailing_metadata_->idx.named + .x_endpoint_load_metrics_bin; + if (md != nullptr) { + calld_->backend_metric_data_ = + ParseBackendMetricData(GRPC_MDVALUE(md->md), calld_->arena_); + } + } + return calld_->backend_metric_data_; + } + private: CallData* calld_; }; @@ -706,6 +720,7 @@ class CallData { bool service_config_applied_ = false; QueuedPickCanceller* pick_canceller_ = nullptr; LbCallState lb_call_state_; + const LoadBalancingPolicy::BackendMetricData* backend_metric_data_ = nullptr; RefCountedPtr connected_subchannel_; void (*lb_recv_trailing_metadata_ready_)( void* user_data, grpc_error* error, @@ -1927,6 +1942,10 @@ CallData::CallData(grpc_call_element* elem, const ChannelData& chand, CallData::~CallData() { grpc_slice_unref_internal(path_); GRPC_ERROR_UNREF(cancel_error_); + if (backend_metric_data_ != nullptr) { + backend_metric_data_ + ->LoadBalancingPolicy::BackendMetricData::~BackendMetricData(); + } // Make sure there are no remaining pending batches. for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) { GPR_ASSERT(pending_batches_[i].batch == nullptr); diff --git a/src/core/ext/filters/client_channel/lb_policy.h b/src/core/ext/filters/client_channel/lb_policy.h index 7df581288cc..093d5fc30b8 100644 --- a/src/core/ext/filters/client_channel/lb_policy.h +++ b/src/core/ext/filters/client_channel/lb_policy.h @@ -25,6 +25,7 @@ #include "src/core/ext/filters/client_channel/service_config.h" #include "src/core/ext/filters/client_channel/subchannel_interface.h" #include "src/core/lib/gprpp/abstract.h" +#include "src/core/lib/gprpp/map.h" #include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/string_view.h" @@ -77,6 +78,26 @@ extern DebugOnlyTraceFlag grpc_trace_lb_policy_refcount; // interested_parties() hooks from the API. class LoadBalancingPolicy : public InternallyRefCounted { public: + // Represents backend metrics reported by the backend to the client. + struct BackendMetricData { + /// CPU utilization expressed as a fraction of available CPU resources. + double cpu_utilization; + /// Memory utilization expressed as a fraction of available memory + /// resources. + double mem_utilization; + /// Total requests per second being served by the backend. This + /// should include all services that a backend is responsible for. + uint64_t requests_per_second; + /// Application-specific requests cost metrics. Metric names are + /// determined by the application. Each value is an absolute cost + /// (e.g. 3487 bytes of storage) associated with the request. + Map request_cost; + /// Application-specific resource utilization metrics. Metric names + /// are determined by the application. Each value is expressed as a + /// fraction of total resources available. + Map utilization; + }; + /// Interface for accessing per-call state. /// Implemented by the client channel and used by the SubchannelPicker. class CallState { @@ -90,6 +111,10 @@ class LoadBalancingPolicy : public InternallyRefCounted { /// for allocations that need to be made on a per-call basis. virtual void* Alloc(size_t size) GRPC_ABSTRACT; + /// Returns the backend metric data returned by the server for the call, + /// or null if no backend metric data was returned. + virtual const BackendMetricData* GetBackendMetricData() GRPC_ABSTRACT; + GRPC_ABSTRACT_BASE_CLASS }; @@ -175,6 +200,7 @@ class LoadBalancingPolicy : public InternallyRefCounted { /// modified by the callback. The callback does not take ownership, /// however, so any data that needs to be used after returning must /// be copied. + /// call_state can be used to obtain backend metric data. // TODO(roth): Replace grpc_error with something better before we allow // people outside of gRPC team to use this API. void (*recv_trailing_metadata_ready)( diff --git a/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c b/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c index 844ad3d147f..f1deb309a60 100644 --- a/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c +++ b/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c @@ -11,6 +11,8 @@ #include "envoy/api/v2/auth/cert.upb.h" #include "envoy/api/v2/core/base.upb.h" #include "envoy/api/v2/core/config_source.upb.h" +#include "google/protobuf/any.upb.h" +#include "google/protobuf/struct.upb.h" #include "google/protobuf/wrappers.upb.h" #include "validate/validate.upb.h" #include "gogoproto/gogo.upb.h" @@ -30,22 +32,41 @@ const upb_msglayout envoy_api_v2_auth_TlsParameters_msginit = { UPB_SIZE(24, 32), 4, false, }; -static const upb_msglayout *const envoy_api_v2_auth_TlsCertificate_submsgs[5] = { +static const upb_msglayout *const envoy_api_v2_auth_PrivateKeyProvider_submsgs[2] = { + &google_protobuf_Any_msginit, + &google_protobuf_Struct_msginit, +}; + +static const upb_msglayout_field envoy_api_v2_auth_PrivateKeyProvider__fields[3] = { + {1, UPB_SIZE(0, 0), 0, 0, 9, 1}, + {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, 1}, + {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1}, +}; + +const upb_msglayout envoy_api_v2_auth_PrivateKeyProvider_msginit = { + &envoy_api_v2_auth_PrivateKeyProvider_submsgs[0], + &envoy_api_v2_auth_PrivateKeyProvider__fields[0], + UPB_SIZE(16, 32), 3, false, +}; + +static const upb_msglayout *const envoy_api_v2_auth_TlsCertificate_submsgs[6] = { + &envoy_api_v2_auth_PrivateKeyProvider_msginit, &envoy_api_v2_core_DataSource_msginit, }; -static const upb_msglayout_field envoy_api_v2_auth_TlsCertificate__fields[5] = { - {1, UPB_SIZE(0, 0), 0, 0, 11, 1}, - {2, UPB_SIZE(4, 8), 0, 0, 11, 1}, - {3, UPB_SIZE(8, 16), 0, 0, 11, 1}, - {4, UPB_SIZE(12, 24), 0, 0, 11, 1}, - {5, UPB_SIZE(16, 32), 0, 0, 11, 3}, +static const upb_msglayout_field envoy_api_v2_auth_TlsCertificate__fields[6] = { + {1, UPB_SIZE(0, 0), 0, 1, 11, 1}, + {2, UPB_SIZE(4, 8), 0, 1, 11, 1}, + {3, UPB_SIZE(8, 16), 0, 1, 11, 1}, + {4, UPB_SIZE(12, 24), 0, 1, 11, 1}, + {5, UPB_SIZE(20, 40), 0, 1, 11, 3}, + {6, UPB_SIZE(16, 32), 0, 0, 11, 1}, }; const upb_msglayout envoy_api_v2_auth_TlsCertificate_msginit = { &envoy_api_v2_auth_TlsCertificate_submsgs[0], &envoy_api_v2_auth_TlsCertificate__fields[0], - UPB_SIZE(20, 40), 5, false, + UPB_SIZE(24, 48), 6, false, }; static const upb_msglayout *const envoy_api_v2_auth_TlsSessionTicketKeys_submsgs[1] = { diff --git a/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h b/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h index 89aeaee2fd7..252d9d76e9e 100644 --- a/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h +++ b/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.h @@ -21,6 +21,7 @@ extern "C" { #endif struct envoy_api_v2_auth_TlsParameters; +struct envoy_api_v2_auth_PrivateKeyProvider; struct envoy_api_v2_auth_TlsCertificate; struct envoy_api_v2_auth_TlsSessionTicketKeys; struct envoy_api_v2_auth_CertificateValidationContext; @@ -31,6 +32,7 @@ struct envoy_api_v2_auth_DownstreamTlsContext; struct envoy_api_v2_auth_SdsSecretConfig; struct envoy_api_v2_auth_Secret; typedef struct envoy_api_v2_auth_TlsParameters envoy_api_v2_auth_TlsParameters; +typedef struct envoy_api_v2_auth_PrivateKeyProvider envoy_api_v2_auth_PrivateKeyProvider; typedef struct envoy_api_v2_auth_TlsCertificate envoy_api_v2_auth_TlsCertificate; typedef struct envoy_api_v2_auth_TlsSessionTicketKeys envoy_api_v2_auth_TlsSessionTicketKeys; typedef struct envoy_api_v2_auth_CertificateValidationContext envoy_api_v2_auth_CertificateValidationContext; @@ -41,6 +43,7 @@ typedef struct envoy_api_v2_auth_DownstreamTlsContext envoy_api_v2_auth_Downstre typedef struct envoy_api_v2_auth_SdsSecretConfig envoy_api_v2_auth_SdsSecretConfig; typedef struct envoy_api_v2_auth_Secret envoy_api_v2_auth_Secret; extern const upb_msglayout envoy_api_v2_auth_TlsParameters_msginit; +extern const upb_msglayout envoy_api_v2_auth_PrivateKeyProvider_msginit; extern const upb_msglayout envoy_api_v2_auth_TlsCertificate_msginit; extern const upb_msglayout envoy_api_v2_auth_TlsSessionTicketKeys_msginit; extern const upb_msglayout envoy_api_v2_auth_CertificateValidationContext_msginit; @@ -52,11 +55,15 @@ extern const upb_msglayout envoy_api_v2_auth_SdsSecretConfig_msginit; extern const upb_msglayout envoy_api_v2_auth_Secret_msginit; struct envoy_api_v2_core_ConfigSource; struct envoy_api_v2_core_DataSource; +struct google_protobuf_Any; struct google_protobuf_BoolValue; +struct google_protobuf_Struct; struct google_protobuf_UInt32Value; extern const upb_msglayout envoy_api_v2_core_ConfigSource_msginit; extern const upb_msglayout envoy_api_v2_core_DataSource_msginit; +extern const upb_msglayout google_protobuf_Any_msginit; extern const upb_msglayout google_protobuf_BoolValue_msginit; +extern const upb_msglayout google_protobuf_Struct_msginit; extern const upb_msglayout google_protobuf_UInt32Value_msginit; typedef enum { @@ -114,6 +121,61 @@ UPB_INLINE bool envoy_api_v2_auth_TlsParameters_add_ecdh_curves(envoy_api_v2_aut msg, UPB_SIZE(20, 24), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val, arena); } +/* envoy.api.v2.auth.PrivateKeyProvider */ + +UPB_INLINE envoy_api_v2_auth_PrivateKeyProvider *envoy_api_v2_auth_PrivateKeyProvider_new(upb_arena *arena) { + return (envoy_api_v2_auth_PrivateKeyProvider *)upb_msg_new(&envoy_api_v2_auth_PrivateKeyProvider_msginit, arena); +} +UPB_INLINE envoy_api_v2_auth_PrivateKeyProvider *envoy_api_v2_auth_PrivateKeyProvider_parse(const char *buf, size_t size, + upb_arena *arena) { + envoy_api_v2_auth_PrivateKeyProvider *ret = envoy_api_v2_auth_PrivateKeyProvider_new(arena); + return (ret && upb_decode(buf, size, ret, &envoy_api_v2_auth_PrivateKeyProvider_msginit, arena)) ? ret : NULL; +} +UPB_INLINE char *envoy_api_v2_auth_PrivateKeyProvider_serialize(const envoy_api_v2_auth_PrivateKeyProvider *msg, upb_arena *arena, size_t *len) { + return upb_encode(msg, &envoy_api_v2_auth_PrivateKeyProvider_msginit, arena, len); +} + +typedef enum { + envoy_api_v2_auth_PrivateKeyProvider_config_type_config = 2, + envoy_api_v2_auth_PrivateKeyProvider_config_type_typed_config = 3, + envoy_api_v2_auth_PrivateKeyProvider_config_type_NOT_SET = 0 +} envoy_api_v2_auth_PrivateKeyProvider_config_type_oneofcases; +UPB_INLINE envoy_api_v2_auth_PrivateKeyProvider_config_type_oneofcases envoy_api_v2_auth_PrivateKeyProvider_config_type_case(const envoy_api_v2_auth_PrivateKeyProvider* msg) { return (envoy_api_v2_auth_PrivateKeyProvider_config_type_oneofcases)UPB_FIELD_AT(msg, int32_t, UPB_SIZE(12, 24)); } + +UPB_INLINE upb_strview envoy_api_v2_auth_PrivateKeyProvider_provider_name(const envoy_api_v2_auth_PrivateKeyProvider *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)); } +UPB_INLINE bool envoy_api_v2_auth_PrivateKeyProvider_has_config(const envoy_api_v2_auth_PrivateKeyProvider *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(12, 24), 2); } +UPB_INLINE const struct google_protobuf_Struct* envoy_api_v2_auth_PrivateKeyProvider_config(const envoy_api_v2_auth_PrivateKeyProvider *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Struct*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 2, NULL); } +UPB_INLINE bool envoy_api_v2_auth_PrivateKeyProvider_has_typed_config(const envoy_api_v2_auth_PrivateKeyProvider *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(12, 24), 3); } +UPB_INLINE const struct google_protobuf_Any* envoy_api_v2_auth_PrivateKeyProvider_typed_config(const envoy_api_v2_auth_PrivateKeyProvider *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); } + +UPB_INLINE void envoy_api_v2_auth_PrivateKeyProvider_set_provider_name(envoy_api_v2_auth_PrivateKeyProvider *msg, upb_strview value) { + UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)) = value; +} +UPB_INLINE void envoy_api_v2_auth_PrivateKeyProvider_set_config(envoy_api_v2_auth_PrivateKeyProvider *msg, struct google_protobuf_Struct* value) { + UPB_WRITE_ONEOF(msg, struct google_protobuf_Struct*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 2); +} +UPB_INLINE struct google_protobuf_Struct* envoy_api_v2_auth_PrivateKeyProvider_mutable_config(envoy_api_v2_auth_PrivateKeyProvider *msg, upb_arena *arena) { + struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_api_v2_auth_PrivateKeyProvider_config(msg); + if (sub == NULL) { + sub = (struct google_protobuf_Struct*)upb_msg_new(&google_protobuf_Struct_msginit, arena); + if (!sub) return NULL; + envoy_api_v2_auth_PrivateKeyProvider_set_config(msg, sub); + } + return sub; +} +UPB_INLINE void envoy_api_v2_auth_PrivateKeyProvider_set_typed_config(envoy_api_v2_auth_PrivateKeyProvider *msg, struct google_protobuf_Any* value) { + UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3); +} +UPB_INLINE struct google_protobuf_Any* envoy_api_v2_auth_PrivateKeyProvider_mutable_typed_config(envoy_api_v2_auth_PrivateKeyProvider *msg, upb_arena *arena) { + struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_api_v2_auth_PrivateKeyProvider_typed_config(msg); + if (sub == NULL) { + sub = (struct google_protobuf_Any*)upb_msg_new(&google_protobuf_Any_msginit, arena); + if (!sub) return NULL; + envoy_api_v2_auth_PrivateKeyProvider_set_typed_config(msg, sub); + } + return sub; +} + /* envoy.api.v2.auth.TlsCertificate */ UPB_INLINE envoy_api_v2_auth_TlsCertificate *envoy_api_v2_auth_TlsCertificate_new(upb_arena *arena) { @@ -132,7 +194,8 @@ UPB_INLINE const struct envoy_api_v2_core_DataSource* envoy_api_v2_auth_TlsCerti UPB_INLINE const struct envoy_api_v2_core_DataSource* envoy_api_v2_auth_TlsCertificate_private_key(const envoy_api_v2_auth_TlsCertificate *msg) { return UPB_FIELD_AT(msg, const struct envoy_api_v2_core_DataSource*, UPB_SIZE(4, 8)); } UPB_INLINE const struct envoy_api_v2_core_DataSource* envoy_api_v2_auth_TlsCertificate_password(const envoy_api_v2_auth_TlsCertificate *msg) { return UPB_FIELD_AT(msg, const struct envoy_api_v2_core_DataSource*, UPB_SIZE(8, 16)); } UPB_INLINE const struct envoy_api_v2_core_DataSource* envoy_api_v2_auth_TlsCertificate_ocsp_staple(const envoy_api_v2_auth_TlsCertificate *msg) { return UPB_FIELD_AT(msg, const struct envoy_api_v2_core_DataSource*, UPB_SIZE(12, 24)); } -UPB_INLINE const struct envoy_api_v2_core_DataSource* const* envoy_api_v2_auth_TlsCertificate_signed_certificate_timestamp(const envoy_api_v2_auth_TlsCertificate *msg, size_t *len) { return (const struct envoy_api_v2_core_DataSource* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); } +UPB_INLINE const struct envoy_api_v2_core_DataSource* const* envoy_api_v2_auth_TlsCertificate_signed_certificate_timestamp(const envoy_api_v2_auth_TlsCertificate *msg, size_t *len) { return (const struct envoy_api_v2_core_DataSource* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); } +UPB_INLINE const envoy_api_v2_auth_PrivateKeyProvider* envoy_api_v2_auth_TlsCertificate_private_key_provider(const envoy_api_v2_auth_TlsCertificate *msg) { return UPB_FIELD_AT(msg, const envoy_api_v2_auth_PrivateKeyProvider*, UPB_SIZE(16, 32)); } UPB_INLINE void envoy_api_v2_auth_TlsCertificate_set_certificate_chain(envoy_api_v2_auth_TlsCertificate *msg, struct envoy_api_v2_core_DataSource* value) { UPB_FIELD_AT(msg, struct envoy_api_v2_core_DataSource*, UPB_SIZE(0, 0)) = value; @@ -183,18 +246,30 @@ UPB_INLINE struct envoy_api_v2_core_DataSource* envoy_api_v2_auth_TlsCertificate return sub; } UPB_INLINE struct envoy_api_v2_core_DataSource** envoy_api_v2_auth_TlsCertificate_mutable_signed_certificate_timestamp(envoy_api_v2_auth_TlsCertificate *msg, size_t *len) { - return (struct envoy_api_v2_core_DataSource**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len); + return (struct envoy_api_v2_core_DataSource**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len); } UPB_INLINE struct envoy_api_v2_core_DataSource** envoy_api_v2_auth_TlsCertificate_resize_signed_certificate_timestamp(envoy_api_v2_auth_TlsCertificate *msg, size_t len, upb_arena *arena) { - return (struct envoy_api_v2_core_DataSource**)_upb_array_resize_accessor(msg, UPB_SIZE(16, 32), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena); + return (struct envoy_api_v2_core_DataSource**)_upb_array_resize_accessor(msg, UPB_SIZE(20, 40), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena); } UPB_INLINE struct envoy_api_v2_core_DataSource* envoy_api_v2_auth_TlsCertificate_add_signed_certificate_timestamp(envoy_api_v2_auth_TlsCertificate *msg, upb_arena *arena) { struct envoy_api_v2_core_DataSource* sub = (struct envoy_api_v2_core_DataSource*)upb_msg_new(&envoy_api_v2_core_DataSource_msginit, arena); bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(16, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + msg, UPB_SIZE(20, 40), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); if (!ok) return NULL; return sub; } +UPB_INLINE void envoy_api_v2_auth_TlsCertificate_set_private_key_provider(envoy_api_v2_auth_TlsCertificate *msg, envoy_api_v2_auth_PrivateKeyProvider* value) { + UPB_FIELD_AT(msg, envoy_api_v2_auth_PrivateKeyProvider*, UPB_SIZE(16, 32)) = value; +} +UPB_INLINE struct envoy_api_v2_auth_PrivateKeyProvider* envoy_api_v2_auth_TlsCertificate_mutable_private_key_provider(envoy_api_v2_auth_TlsCertificate *msg, upb_arena *arena) { + struct envoy_api_v2_auth_PrivateKeyProvider* sub = (struct envoy_api_v2_auth_PrivateKeyProvider*)envoy_api_v2_auth_TlsCertificate_private_key_provider(msg); + if (sub == NULL) { + sub = (struct envoy_api_v2_auth_PrivateKeyProvider*)upb_msg_new(&envoy_api_v2_auth_PrivateKeyProvider_msginit, arena); + if (!sub) return NULL; + envoy_api_v2_auth_TlsCertificate_set_private_key_provider(msg, sub); + } + return sub; +} /* envoy.api.v2.auth.TlsSessionTicketKeys */ diff --git a/src/core/ext/upb-generated/envoy/api/v2/cds.upb.c b/src/core/ext/upb-generated/envoy/api/v2/cds.upb.c index f5a7b9195e1..9a0b48a99cc 100644 --- a/src/core/ext/upb-generated/envoy/api/v2/cds.upb.c +++ b/src/core/ext/upb-generated/envoy/api/v2/cds.upb.c @@ -17,6 +17,7 @@ #include "envoy/api/v2/core/health_check.upb.h" #include "envoy/api/v2/core/protocol.upb.h" #include "envoy/api/v2/cluster/circuit_breaker.upb.h" +#include "envoy/api/v2/cluster/filter.upb.h" #include "envoy/api/v2/cluster/outlier_detection.upb.h" #include "envoy/api/v2/eds.upb.h" #include "envoy/type/percent.upb.h" @@ -30,7 +31,7 @@ #include "upb/port_def.inc" -static const upb_msglayout *const envoy_api_v2_Cluster_submsgs[28] = { +static const upb_msglayout *const envoy_api_v2_Cluster_submsgs[29] = { &envoy_api_v2_Cluster_CommonLbConfig_msginit, &envoy_api_v2_Cluster_CustomClusterType_msginit, &envoy_api_v2_Cluster_EdsClusterConfig_msginit, @@ -44,6 +45,7 @@ static const upb_msglayout *const envoy_api_v2_Cluster_submsgs[28] = { &envoy_api_v2_UpstreamConnectionOptions_msginit, &envoy_api_v2_auth_UpstreamTlsContext_msginit, &envoy_api_v2_cluster_CircuitBreakers_msginit, + &envoy_api_v2_cluster_Filter_msginit, &envoy_api_v2_cluster_OutlierDetection_msginit, &envoy_api_v2_core_Address_msginit, &envoy_api_v2_core_BindConfig_msginit, @@ -57,49 +59,51 @@ static const upb_msglayout *const envoy_api_v2_Cluster_submsgs[28] = { &google_protobuf_UInt32Value_msginit, }; -static const upb_msglayout_field envoy_api_v2_Cluster__fields[36] = { +static const upb_msglayout_field envoy_api_v2_Cluster__fields[38] = { {1, UPB_SIZE(28, 32), 0, 0, 9, 1}, - {2, UPB_SIZE(144, 256), UPB_SIZE(-153, -265), 0, 14, 1}, + {2, UPB_SIZE(144, 264), UPB_SIZE(-153, -273), 0, 14, 1}, {3, UPB_SIZE(44, 64), 0, 2, 11, 1}, - {4, UPB_SIZE(48, 72), 0, 22, 11, 1}, - {5, UPB_SIZE(52, 80), 0, 23, 11, 1}, + {4, UPB_SIZE(48, 72), 0, 23, 11, 1}, + {5, UPB_SIZE(52, 80), 0, 24, 11, 1}, {6, UPB_SIZE(0, 0), 0, 0, 14, 1}, - {7, UPB_SIZE(120, 216), 0, 14, 11, 3}, - {8, UPB_SIZE(124, 224), 0, 16, 11, 3}, - {9, UPB_SIZE(56, 88), 0, 23, 11, 1}, + {7, UPB_SIZE(120, 216), 0, 15, 11, 3}, + {8, UPB_SIZE(124, 224), 0, 17, 11, 3}, + {9, UPB_SIZE(56, 88), 0, 24, 11, 1}, {10, UPB_SIZE(60, 96), 0, 12, 11, 1}, {11, UPB_SIZE(64, 104), 0, 11, 11, 1}, - {13, UPB_SIZE(68, 112), 0, 17, 11, 1}, - {14, UPB_SIZE(72, 120), 0, 18, 11, 1}, - {16, UPB_SIZE(76, 128), 0, 22, 11, 1}, + {13, UPB_SIZE(68, 112), 0, 18, 11, 1}, + {14, UPB_SIZE(72, 120), 0, 19, 11, 1}, + {16, UPB_SIZE(76, 128), 0, 23, 11, 1}, {17, UPB_SIZE(8, 8), 0, 0, 14, 1}, - {18, UPB_SIZE(128, 232), 0, 14, 11, 3}, - {19, UPB_SIZE(80, 136), 0, 13, 11, 1}, - {20, UPB_SIZE(84, 144), 0, 22, 11, 1}, - {21, UPB_SIZE(88, 152), 0, 15, 11, 1}, + {18, UPB_SIZE(128, 232), 0, 15, 11, 3}, + {19, UPB_SIZE(80, 136), 0, 14, 11, 1}, + {20, UPB_SIZE(84, 144), 0, 23, 11, 1}, + {21, UPB_SIZE(88, 152), 0, 16, 11, 1}, {22, UPB_SIZE(92, 160), 0, 4, 11, 1}, - {23, UPB_SIZE(156, 272), UPB_SIZE(-161, -281), 7, 11, 1}, - {24, UPB_SIZE(96, 168), 0, 21, 11, 1}, - {25, UPB_SIZE(100, 176), 0, 20, 11, 1}, + {23, UPB_SIZE(156, 280), UPB_SIZE(-161, -289), 7, 11, 1}, + {24, UPB_SIZE(96, 168), 0, 22, 11, 1}, + {25, UPB_SIZE(100, 176), 0, 21, 11, 1}, {26, UPB_SIZE(16, 16), 0, 0, 14, 1}, {27, UPB_SIZE(104, 184), 0, 0, 11, 1}, {28, UPB_SIZE(36, 48), 0, 0, 9, 1}, - {29, UPB_SIZE(108, 192), 0, 19, 11, 1}, + {29, UPB_SIZE(108, 192), 0, 20, 11, 1}, {30, UPB_SIZE(112, 200), 0, 10, 11, 1}, {31, UPB_SIZE(24, 24), 0, 0, 8, 1}, {32, UPB_SIZE(25, 25), 0, 0, 8, 1}, {33, UPB_SIZE(116, 208), 0, 9, 11, 1}, - {34, UPB_SIZE(156, 272), UPB_SIZE(-161, -281), 6, 11, 1}, + {34, UPB_SIZE(156, 280), UPB_SIZE(-161, -289), 6, 11, 1}, {35, UPB_SIZE(132, 240), 0, 3, 11, 3}, {36, UPB_SIZE(136, 248), 0, 8, 11, 3}, - {37, UPB_SIZE(156, 272), UPB_SIZE(-161, -281), 5, 11, 1}, - {38, UPB_SIZE(144, 256), UPB_SIZE(-153, -265), 1, 11, 1}, + {37, UPB_SIZE(156, 280), UPB_SIZE(-161, -289), 5, 11, 1}, + {38, UPB_SIZE(144, 264), UPB_SIZE(-153, -273), 1, 11, 1}, + {39, UPB_SIZE(26, 26), 0, 0, 8, 1}, + {40, UPB_SIZE(140, 256), 0, 13, 11, 3}, }; const upb_msglayout envoy_api_v2_Cluster_msginit = { &envoy_api_v2_Cluster_submsgs[0], &envoy_api_v2_Cluster__fields[0], - UPB_SIZE(168, 288), 36, false, + UPB_SIZE(168, 304), 38, false, }; static const upb_msglayout *const envoy_api_v2_Cluster_CustomClusterType_submsgs[1] = { @@ -167,29 +171,31 @@ static const upb_msglayout *const envoy_api_v2_Cluster_LbSubsetConfig_submsgs[2] &google_protobuf_Struct_msginit, }; -static const upb_msglayout_field envoy_api_v2_Cluster_LbSubsetConfig__fields[6] = { +static const upb_msglayout_field envoy_api_v2_Cluster_LbSubsetConfig__fields[7] = { {1, UPB_SIZE(0, 0), 0, 0, 14, 1}, {2, UPB_SIZE(12, 16), 0, 1, 11, 1}, {3, UPB_SIZE(16, 24), 0, 0, 11, 3}, {4, UPB_SIZE(8, 8), 0, 0, 8, 1}, {5, UPB_SIZE(9, 9), 0, 0, 8, 1}, {6, UPB_SIZE(10, 10), 0, 0, 8, 1}, + {7, UPB_SIZE(11, 11), 0, 0, 8, 1}, }; const upb_msglayout envoy_api_v2_Cluster_LbSubsetConfig_msginit = { &envoy_api_v2_Cluster_LbSubsetConfig_submsgs[0], &envoy_api_v2_Cluster_LbSubsetConfig__fields[0], - UPB_SIZE(24, 32), 6, false, + UPB_SIZE(24, 32), 7, false, }; -static const upb_msglayout_field envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector__fields[1] = { - {1, UPB_SIZE(0, 0), 0, 0, 9, 3}, +static const upb_msglayout_field envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector__fields[2] = { + {1, UPB_SIZE(8, 8), 0, 0, 9, 3}, + {2, UPB_SIZE(0, 0), 0, 0, 14, 1}, }; const upb_msglayout envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_msginit = { NULL, &envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector__fields[0], - UPB_SIZE(4, 8), 1, false, + UPB_SIZE(16, 16), 2, false, }; static const upb_msglayout *const envoy_api_v2_Cluster_LeastRequestLbConfig_submsgs[1] = { @@ -239,18 +245,19 @@ static const upb_msglayout *const envoy_api_v2_Cluster_CommonLbConfig_submsgs[4] &google_protobuf_Duration_msginit, }; -static const upb_msglayout_field envoy_api_v2_Cluster_CommonLbConfig__fields[5] = { +static const upb_msglayout_field envoy_api_v2_Cluster_CommonLbConfig__fields[6] = { {1, UPB_SIZE(4, 8), 0, 2, 11, 1}, {2, UPB_SIZE(12, 24), UPB_SIZE(-17, -33), 1, 11, 1}, {3, UPB_SIZE(12, 24), UPB_SIZE(-17, -33), 0, 11, 1}, {4, UPB_SIZE(8, 16), 0, 3, 11, 1}, {5, UPB_SIZE(0, 0), 0, 0, 8, 1}, + {6, UPB_SIZE(1, 1), 0, 0, 8, 1}, }; const upb_msglayout envoy_api_v2_Cluster_CommonLbConfig_msginit = { &envoy_api_v2_Cluster_CommonLbConfig_submsgs[0], &envoy_api_v2_Cluster_CommonLbConfig__fields[0], - UPB_SIZE(20, 40), 5, false, + UPB_SIZE(20, 40), 6, false, }; static const upb_msglayout *const envoy_api_v2_Cluster_CommonLbConfig_ZoneAwareLbConfig_submsgs[2] = { diff --git a/src/core/ext/upb-generated/envoy/api/v2/cds.upb.h b/src/core/ext/upb-generated/envoy/api/v2/cds.upb.h index 2fecf727bcb..5bc331902ee 100644 --- a/src/core/ext/upb-generated/envoy/api/v2/cds.upb.h +++ b/src/core/ext/upb-generated/envoy/api/v2/cds.upb.h @@ -68,6 +68,7 @@ extern const upb_msglayout envoy_api_v2_UpstreamConnectionOptions_msginit; struct envoy_api_v2_ClusterLoadAssignment; struct envoy_api_v2_auth_UpstreamTlsContext; struct envoy_api_v2_cluster_CircuitBreakers; +struct envoy_api_v2_cluster_Filter; struct envoy_api_v2_cluster_OutlierDetection; struct envoy_api_v2_core_Address; struct envoy_api_v2_core_BindConfig; @@ -88,6 +89,7 @@ struct google_protobuf_UInt64Value; extern const upb_msglayout envoy_api_v2_ClusterLoadAssignment_msginit; extern const upb_msglayout envoy_api_v2_auth_UpstreamTlsContext_msginit; extern const upb_msglayout envoy_api_v2_cluster_CircuitBreakers_msginit; +extern const upb_msglayout envoy_api_v2_cluster_Filter_msginit; extern const upb_msglayout envoy_api_v2_cluster_OutlierDetection_msginit; extern const upb_msglayout envoy_api_v2_core_Address_msginit; extern const upb_msglayout envoy_api_v2_core_BindConfig_msginit; @@ -141,6 +143,13 @@ typedef enum { envoy_api_v2_Cluster_LbSubsetConfig_DEFAULT_SUBSET = 2 } envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetFallbackPolicy; +typedef enum { + envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_NOT_DEFINED = 0, + envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_NO_FALLBACK = 1, + envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_ANY_ENDPOINT = 2, + envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_DEFAULT_SUBSET = 3 +} envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_LbSubsetSelectorFallbackPolicy; + typedef enum { envoy_api_v2_Cluster_RingHashLbConfig_XX_HASH = 0, envoy_api_v2_Cluster_RingHashLbConfig_MURMUR_HASH_2 = 1 @@ -166,7 +175,7 @@ typedef enum { envoy_api_v2_Cluster_cluster_discovery_type_cluster_type = 38, envoy_api_v2_Cluster_cluster_discovery_type_NOT_SET = 0 } envoy_api_v2_Cluster_cluster_discovery_type_oneofcases; -UPB_INLINE envoy_api_v2_Cluster_cluster_discovery_type_oneofcases envoy_api_v2_Cluster_cluster_discovery_type_case(const envoy_api_v2_Cluster* msg) { return (envoy_api_v2_Cluster_cluster_discovery_type_oneofcases)UPB_FIELD_AT(msg, int32_t, UPB_SIZE(152, 264)); } +UPB_INLINE envoy_api_v2_Cluster_cluster_discovery_type_oneofcases envoy_api_v2_Cluster_cluster_discovery_type_case(const envoy_api_v2_Cluster* msg) { return (envoy_api_v2_Cluster_cluster_discovery_type_oneofcases)UPB_FIELD_AT(msg, int32_t, UPB_SIZE(152, 272)); } typedef enum { envoy_api_v2_Cluster_lb_config_ring_hash_lb_config = 23, @@ -174,11 +183,11 @@ typedef enum { envoy_api_v2_Cluster_lb_config_least_request_lb_config = 37, envoy_api_v2_Cluster_lb_config_NOT_SET = 0 } envoy_api_v2_Cluster_lb_config_oneofcases; -UPB_INLINE envoy_api_v2_Cluster_lb_config_oneofcases envoy_api_v2_Cluster_lb_config_case(const envoy_api_v2_Cluster* msg) { return (envoy_api_v2_Cluster_lb_config_oneofcases)UPB_FIELD_AT(msg, int32_t, UPB_SIZE(160, 280)); } +UPB_INLINE envoy_api_v2_Cluster_lb_config_oneofcases envoy_api_v2_Cluster_lb_config_case(const envoy_api_v2_Cluster* msg) { return (envoy_api_v2_Cluster_lb_config_oneofcases)UPB_FIELD_AT(msg, int32_t, UPB_SIZE(160, 288)); } UPB_INLINE upb_strview envoy_api_v2_Cluster_name(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(28, 32)); } -UPB_INLINE bool envoy_api_v2_Cluster_has_type(const envoy_api_v2_Cluster *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(152, 264), 2); } -UPB_INLINE int32_t envoy_api_v2_Cluster_type(const envoy_api_v2_Cluster *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(144, 256), UPB_SIZE(152, 264), 2, envoy_api_v2_Cluster_STATIC); } +UPB_INLINE bool envoy_api_v2_Cluster_has_type(const envoy_api_v2_Cluster *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(152, 272), 2); } +UPB_INLINE int32_t envoy_api_v2_Cluster_type(const envoy_api_v2_Cluster *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(144, 264), UPB_SIZE(152, 272), 2, envoy_api_v2_Cluster_STATIC); } UPB_INLINE const envoy_api_v2_Cluster_EdsClusterConfig* envoy_api_v2_Cluster_eds_cluster_config(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, const envoy_api_v2_Cluster_EdsClusterConfig*, UPB_SIZE(44, 64)); } UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_Cluster_connect_timeout(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(48, 72)); } UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_Cluster_per_connection_buffer_limit_bytes(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(52, 80)); } @@ -197,8 +206,8 @@ UPB_INLINE const struct envoy_api_v2_cluster_OutlierDetection* envoy_api_v2_Clus UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_Cluster_cleanup_interval(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(84, 144)); } UPB_INLINE const struct envoy_api_v2_core_BindConfig* envoy_api_v2_Cluster_upstream_bind_config(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, const struct envoy_api_v2_core_BindConfig*, UPB_SIZE(88, 152)); } UPB_INLINE const envoy_api_v2_Cluster_LbSubsetConfig* envoy_api_v2_Cluster_lb_subset_config(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, const envoy_api_v2_Cluster_LbSubsetConfig*, UPB_SIZE(92, 160)); } -UPB_INLINE bool envoy_api_v2_Cluster_has_ring_hash_lb_config(const envoy_api_v2_Cluster *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(160, 280), 23); } -UPB_INLINE const envoy_api_v2_Cluster_RingHashLbConfig* envoy_api_v2_Cluster_ring_hash_lb_config(const envoy_api_v2_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_api_v2_Cluster_RingHashLbConfig*, UPB_SIZE(156, 272), UPB_SIZE(160, 280), 23, NULL); } +UPB_INLINE bool envoy_api_v2_Cluster_has_ring_hash_lb_config(const envoy_api_v2_Cluster *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(160, 288), 23); } +UPB_INLINE const envoy_api_v2_Cluster_RingHashLbConfig* envoy_api_v2_Cluster_ring_hash_lb_config(const envoy_api_v2_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_api_v2_Cluster_RingHashLbConfig*, UPB_SIZE(156, 280), UPB_SIZE(160, 288), 23, NULL); } UPB_INLINE const struct envoy_api_v2_core_TransportSocket* envoy_api_v2_Cluster_transport_socket(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, const struct envoy_api_v2_core_TransportSocket*, UPB_SIZE(96, 168)); } UPB_INLINE const struct envoy_api_v2_core_Metadata* envoy_api_v2_Cluster_metadata(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, const struct envoy_api_v2_core_Metadata*, UPB_SIZE(100, 176)); } UPB_INLINE int32_t envoy_api_v2_Cluster_protocol_selection(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(16, 16)); } @@ -209,20 +218,22 @@ UPB_INLINE const envoy_api_v2_UpstreamConnectionOptions* envoy_api_v2_Cluster_up UPB_INLINE bool envoy_api_v2_Cluster_close_connections_on_host_health_failure(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(24, 24)); } UPB_INLINE bool envoy_api_v2_Cluster_drain_connections_on_host_removal(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(25, 25)); } UPB_INLINE const struct envoy_api_v2_ClusterLoadAssignment* envoy_api_v2_Cluster_load_assignment(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, const struct envoy_api_v2_ClusterLoadAssignment*, UPB_SIZE(116, 208)); } -UPB_INLINE bool envoy_api_v2_Cluster_has_original_dst_lb_config(const envoy_api_v2_Cluster *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(160, 280), 34); } -UPB_INLINE const envoy_api_v2_Cluster_OriginalDstLbConfig* envoy_api_v2_Cluster_original_dst_lb_config(const envoy_api_v2_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_api_v2_Cluster_OriginalDstLbConfig*, UPB_SIZE(156, 272), UPB_SIZE(160, 280), 34, NULL); } +UPB_INLINE bool envoy_api_v2_Cluster_has_original_dst_lb_config(const envoy_api_v2_Cluster *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(160, 288), 34); } +UPB_INLINE const envoy_api_v2_Cluster_OriginalDstLbConfig* envoy_api_v2_Cluster_original_dst_lb_config(const envoy_api_v2_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_api_v2_Cluster_OriginalDstLbConfig*, UPB_SIZE(156, 280), UPB_SIZE(160, 288), 34, NULL); } UPB_INLINE const envoy_api_v2_Cluster_ExtensionProtocolOptionsEntry* const* envoy_api_v2_Cluster_extension_protocol_options(const envoy_api_v2_Cluster *msg, size_t *len) { return (const envoy_api_v2_Cluster_ExtensionProtocolOptionsEntry* const*)_upb_array_accessor(msg, UPB_SIZE(132, 240), len); } UPB_INLINE const envoy_api_v2_Cluster_TypedExtensionProtocolOptionsEntry* const* envoy_api_v2_Cluster_typed_extension_protocol_options(const envoy_api_v2_Cluster *msg, size_t *len) { return (const envoy_api_v2_Cluster_TypedExtensionProtocolOptionsEntry* const*)_upb_array_accessor(msg, UPB_SIZE(136, 248), len); } -UPB_INLINE bool envoy_api_v2_Cluster_has_least_request_lb_config(const envoy_api_v2_Cluster *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(160, 280), 37); } -UPB_INLINE const envoy_api_v2_Cluster_LeastRequestLbConfig* envoy_api_v2_Cluster_least_request_lb_config(const envoy_api_v2_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_api_v2_Cluster_LeastRequestLbConfig*, UPB_SIZE(156, 272), UPB_SIZE(160, 280), 37, NULL); } -UPB_INLINE bool envoy_api_v2_Cluster_has_cluster_type(const envoy_api_v2_Cluster *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(152, 264), 38); } -UPB_INLINE const envoy_api_v2_Cluster_CustomClusterType* envoy_api_v2_Cluster_cluster_type(const envoy_api_v2_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_api_v2_Cluster_CustomClusterType*, UPB_SIZE(144, 256), UPB_SIZE(152, 264), 38, NULL); } +UPB_INLINE bool envoy_api_v2_Cluster_has_least_request_lb_config(const envoy_api_v2_Cluster *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(160, 288), 37); } +UPB_INLINE const envoy_api_v2_Cluster_LeastRequestLbConfig* envoy_api_v2_Cluster_least_request_lb_config(const envoy_api_v2_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_api_v2_Cluster_LeastRequestLbConfig*, UPB_SIZE(156, 280), UPB_SIZE(160, 288), 37, NULL); } +UPB_INLINE bool envoy_api_v2_Cluster_has_cluster_type(const envoy_api_v2_Cluster *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(152, 272), 38); } +UPB_INLINE const envoy_api_v2_Cluster_CustomClusterType* envoy_api_v2_Cluster_cluster_type(const envoy_api_v2_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_api_v2_Cluster_CustomClusterType*, UPB_SIZE(144, 264), UPB_SIZE(152, 272), 38, NULL); } +UPB_INLINE bool envoy_api_v2_Cluster_respect_dns_ttl(const envoy_api_v2_Cluster *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(26, 26)); } +UPB_INLINE const struct envoy_api_v2_cluster_Filter* const* envoy_api_v2_Cluster_filters(const envoy_api_v2_Cluster *msg, size_t *len) { return (const struct envoy_api_v2_cluster_Filter* const*)_upb_array_accessor(msg, UPB_SIZE(140, 256), len); } UPB_INLINE void envoy_api_v2_Cluster_set_name(envoy_api_v2_Cluster *msg, upb_strview value) { UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(28, 32)) = value; } UPB_INLINE void envoy_api_v2_Cluster_set_type(envoy_api_v2_Cluster *msg, int32_t value) { - UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(144, 256), value, UPB_SIZE(152, 264), 2); + UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(144, 264), value, UPB_SIZE(152, 272), 2); } UPB_INLINE void envoy_api_v2_Cluster_set_eds_cluster_config(envoy_api_v2_Cluster *msg, envoy_api_v2_Cluster_EdsClusterConfig* value) { UPB_FIELD_AT(msg, envoy_api_v2_Cluster_EdsClusterConfig*, UPB_SIZE(44, 64)) = value; @@ -426,7 +437,7 @@ UPB_INLINE struct envoy_api_v2_Cluster_LbSubsetConfig* envoy_api_v2_Cluster_muta return sub; } UPB_INLINE void envoy_api_v2_Cluster_set_ring_hash_lb_config(envoy_api_v2_Cluster *msg, envoy_api_v2_Cluster_RingHashLbConfig* value) { - UPB_WRITE_ONEOF(msg, envoy_api_v2_Cluster_RingHashLbConfig*, UPB_SIZE(156, 272), value, UPB_SIZE(160, 280), 23); + UPB_WRITE_ONEOF(msg, envoy_api_v2_Cluster_RingHashLbConfig*, UPB_SIZE(156, 280), value, UPB_SIZE(160, 288), 23); } UPB_INLINE struct envoy_api_v2_Cluster_RingHashLbConfig* envoy_api_v2_Cluster_mutable_ring_hash_lb_config(envoy_api_v2_Cluster *msg, upb_arena *arena) { struct envoy_api_v2_Cluster_RingHashLbConfig* sub = (struct envoy_api_v2_Cluster_RingHashLbConfig*)envoy_api_v2_Cluster_ring_hash_lb_config(msg); @@ -522,7 +533,7 @@ UPB_INLINE struct envoy_api_v2_ClusterLoadAssignment* envoy_api_v2_Cluster_mutab return sub; } UPB_INLINE void envoy_api_v2_Cluster_set_original_dst_lb_config(envoy_api_v2_Cluster *msg, envoy_api_v2_Cluster_OriginalDstLbConfig* value) { - UPB_WRITE_ONEOF(msg, envoy_api_v2_Cluster_OriginalDstLbConfig*, UPB_SIZE(156, 272), value, UPB_SIZE(160, 280), 34); + UPB_WRITE_ONEOF(msg, envoy_api_v2_Cluster_OriginalDstLbConfig*, UPB_SIZE(156, 280), value, UPB_SIZE(160, 288), 34); } UPB_INLINE struct envoy_api_v2_Cluster_OriginalDstLbConfig* envoy_api_v2_Cluster_mutable_original_dst_lb_config(envoy_api_v2_Cluster *msg, upb_arena *arena) { struct envoy_api_v2_Cluster_OriginalDstLbConfig* sub = (struct envoy_api_v2_Cluster_OriginalDstLbConfig*)envoy_api_v2_Cluster_original_dst_lb_config(msg); @@ -560,7 +571,7 @@ UPB_INLINE struct envoy_api_v2_Cluster_TypedExtensionProtocolOptionsEntry* envoy return sub; } UPB_INLINE void envoy_api_v2_Cluster_set_least_request_lb_config(envoy_api_v2_Cluster *msg, envoy_api_v2_Cluster_LeastRequestLbConfig* value) { - UPB_WRITE_ONEOF(msg, envoy_api_v2_Cluster_LeastRequestLbConfig*, UPB_SIZE(156, 272), value, UPB_SIZE(160, 280), 37); + UPB_WRITE_ONEOF(msg, envoy_api_v2_Cluster_LeastRequestLbConfig*, UPB_SIZE(156, 280), value, UPB_SIZE(160, 288), 37); } UPB_INLINE struct envoy_api_v2_Cluster_LeastRequestLbConfig* envoy_api_v2_Cluster_mutable_least_request_lb_config(envoy_api_v2_Cluster *msg, upb_arena *arena) { struct envoy_api_v2_Cluster_LeastRequestLbConfig* sub = (struct envoy_api_v2_Cluster_LeastRequestLbConfig*)envoy_api_v2_Cluster_least_request_lb_config(msg); @@ -572,7 +583,7 @@ UPB_INLINE struct envoy_api_v2_Cluster_LeastRequestLbConfig* envoy_api_v2_Cluste return sub; } UPB_INLINE void envoy_api_v2_Cluster_set_cluster_type(envoy_api_v2_Cluster *msg, envoy_api_v2_Cluster_CustomClusterType* value) { - UPB_WRITE_ONEOF(msg, envoy_api_v2_Cluster_CustomClusterType*, UPB_SIZE(144, 256), value, UPB_SIZE(152, 264), 38); + UPB_WRITE_ONEOF(msg, envoy_api_v2_Cluster_CustomClusterType*, UPB_SIZE(144, 264), value, UPB_SIZE(152, 272), 38); } UPB_INLINE struct envoy_api_v2_Cluster_CustomClusterType* envoy_api_v2_Cluster_mutable_cluster_type(envoy_api_v2_Cluster *msg, upb_arena *arena) { struct envoy_api_v2_Cluster_CustomClusterType* sub = (struct envoy_api_v2_Cluster_CustomClusterType*)envoy_api_v2_Cluster_cluster_type(msg); @@ -583,6 +594,22 @@ UPB_INLINE struct envoy_api_v2_Cluster_CustomClusterType* envoy_api_v2_Cluster_m } return sub; } +UPB_INLINE void envoy_api_v2_Cluster_set_respect_dns_ttl(envoy_api_v2_Cluster *msg, bool value) { + UPB_FIELD_AT(msg, bool, UPB_SIZE(26, 26)) = value; +} +UPB_INLINE struct envoy_api_v2_cluster_Filter** envoy_api_v2_Cluster_mutable_filters(envoy_api_v2_Cluster *msg, size_t *len) { + return (struct envoy_api_v2_cluster_Filter**)_upb_array_mutable_accessor(msg, UPB_SIZE(140, 256), len); +} +UPB_INLINE struct envoy_api_v2_cluster_Filter** envoy_api_v2_Cluster_resize_filters(envoy_api_v2_Cluster *msg, size_t len, upb_arena *arena) { + return (struct envoy_api_v2_cluster_Filter**)_upb_array_resize_accessor(msg, UPB_SIZE(140, 256), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena); +} +UPB_INLINE struct envoy_api_v2_cluster_Filter* envoy_api_v2_Cluster_add_filters(envoy_api_v2_Cluster *msg, upb_arena *arena) { + struct envoy_api_v2_cluster_Filter* sub = (struct envoy_api_v2_cluster_Filter*)upb_msg_new(&envoy_api_v2_cluster_Filter_msginit, arena); + bool ok = _upb_array_append_accessor( + msg, UPB_SIZE(140, 256), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + if (!ok) return NULL; + return sub; +} /* envoy.api.v2.Cluster.CustomClusterType */ @@ -736,6 +763,7 @@ UPB_INLINE const envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector* const* en UPB_INLINE bool envoy_api_v2_Cluster_LbSubsetConfig_locality_weight_aware(const envoy_api_v2_Cluster_LbSubsetConfig *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(8, 8)); } UPB_INLINE bool envoy_api_v2_Cluster_LbSubsetConfig_scale_locality_weight(const envoy_api_v2_Cluster_LbSubsetConfig *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(9, 9)); } UPB_INLINE bool envoy_api_v2_Cluster_LbSubsetConfig_panic_mode_any(const envoy_api_v2_Cluster_LbSubsetConfig *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(10, 10)); } +UPB_INLINE bool envoy_api_v2_Cluster_LbSubsetConfig_list_as_any(const envoy_api_v2_Cluster_LbSubsetConfig *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(11, 11)); } UPB_INLINE void envoy_api_v2_Cluster_LbSubsetConfig_set_fallback_policy(envoy_api_v2_Cluster_LbSubsetConfig *msg, int32_t value) { UPB_FIELD_AT(msg, int32_t, UPB_SIZE(0, 0)) = value; @@ -774,6 +802,9 @@ UPB_INLINE void envoy_api_v2_Cluster_LbSubsetConfig_set_scale_locality_weight(en UPB_INLINE void envoy_api_v2_Cluster_LbSubsetConfig_set_panic_mode_any(envoy_api_v2_Cluster_LbSubsetConfig *msg, bool value) { UPB_FIELD_AT(msg, bool, UPB_SIZE(10, 10)) = value; } +UPB_INLINE void envoy_api_v2_Cluster_LbSubsetConfig_set_list_as_any(envoy_api_v2_Cluster_LbSubsetConfig *msg, bool value) { + UPB_FIELD_AT(msg, bool, UPB_SIZE(11, 11)) = value; +} /* envoy.api.v2.Cluster.LbSubsetConfig.LbSubsetSelector */ @@ -789,17 +820,21 @@ UPB_INLINE char *envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_serialize( return upb_encode(msg, &envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, arena, len); } -UPB_INLINE upb_strview const* envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_keys(const envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); } +UPB_INLINE upb_strview const* envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_keys(const envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(8, 8), len); } +UPB_INLINE int32_t envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_fallback_policy(const envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(0, 0)); } UPB_INLINE upb_strview* envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_mutable_keys(envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector *msg, size_t *len) { - return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len); + return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 8), len); } UPB_INLINE upb_strview* envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_resize_keys(envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector *msg, size_t len, upb_arena *arena) { - return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_SIZE(8, 16), UPB_TYPE_STRING, arena); + return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(8, 8), len, UPB_SIZE(8, 16), UPB_TYPE_STRING, arena); } UPB_INLINE bool envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_add_keys(envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector *msg, upb_strview val, upb_arena *arena) { return _upb_array_append_accessor( - msg, UPB_SIZE(0, 0), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val, arena); + msg, UPB_SIZE(8, 8), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val, arena); +} +UPB_INLINE void envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector_set_fallback_policy(envoy_api_v2_Cluster_LbSubsetConfig_LbSubsetSelector *msg, int32_t value) { + UPB_FIELD_AT(msg, int32_t, UPB_SIZE(0, 0)) = value; } /* envoy.api.v2.Cluster.LeastRequestLbConfig */ @@ -925,6 +960,7 @@ UPB_INLINE bool envoy_api_v2_Cluster_CommonLbConfig_has_locality_weighted_lb_con UPB_INLINE const envoy_api_v2_Cluster_CommonLbConfig_LocalityWeightedLbConfig* envoy_api_v2_Cluster_CommonLbConfig_locality_weighted_lb_config(const envoy_api_v2_Cluster_CommonLbConfig *msg) { return UPB_READ_ONEOF(msg, const envoy_api_v2_Cluster_CommonLbConfig_LocalityWeightedLbConfig*, UPB_SIZE(12, 24), UPB_SIZE(16, 32), 3, NULL); } UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_Cluster_CommonLbConfig_update_merge_window(const envoy_api_v2_Cluster_CommonLbConfig *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(8, 16)); } UPB_INLINE bool envoy_api_v2_Cluster_CommonLbConfig_ignore_new_hosts_until_first_hc(const envoy_api_v2_Cluster_CommonLbConfig *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(0, 0)); } +UPB_INLINE bool envoy_api_v2_Cluster_CommonLbConfig_close_connections_on_host_set_change(const envoy_api_v2_Cluster_CommonLbConfig *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(1, 1)); } UPB_INLINE void envoy_api_v2_Cluster_CommonLbConfig_set_healthy_panic_threshold(envoy_api_v2_Cluster_CommonLbConfig *msg, struct envoy_type_Percent* value) { UPB_FIELD_AT(msg, struct envoy_type_Percent*, UPB_SIZE(4, 8)) = value; @@ -977,6 +1013,9 @@ UPB_INLINE struct google_protobuf_Duration* envoy_api_v2_Cluster_CommonLbConfig_ UPB_INLINE void envoy_api_v2_Cluster_CommonLbConfig_set_ignore_new_hosts_until_first_hc(envoy_api_v2_Cluster_CommonLbConfig *msg, bool value) { UPB_FIELD_AT(msg, bool, UPB_SIZE(0, 0)) = value; } +UPB_INLINE void envoy_api_v2_Cluster_CommonLbConfig_set_close_connections_on_host_set_change(envoy_api_v2_Cluster_CommonLbConfig *msg, bool value) { + UPB_FIELD_AT(msg, bool, UPB_SIZE(1, 1)) = value; +} /* envoy.api.v2.Cluster.CommonLbConfig.ZoneAwareLbConfig */ diff --git a/src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c b/src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c new file mode 100644 index 00000000000..7cd040e39cc --- /dev/null +++ b/src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c @@ -0,0 +1,34 @@ +/* This file was generated by upbc (the upb compiler) from the input + * file: + * + * envoy/api/v2/cluster/filter.proto + * + * Do not edit -- your changes will be discarded when the file is + * regenerated. */ + +#include +#include "upb/msg.h" +#include "envoy/api/v2/cluster/filter.upb.h" +#include "google/protobuf/any.upb.h" +#include "validate/validate.upb.h" +#include "gogoproto/gogo.upb.h" + +#include "upb/port_def.inc" + +static const upb_msglayout *const envoy_api_v2_cluster_Filter_submsgs[1] = { + &google_protobuf_Any_msginit, +}; + +static const upb_msglayout_field envoy_api_v2_cluster_Filter__fields[2] = { + {1, UPB_SIZE(0, 0), 0, 0, 9, 1}, + {2, UPB_SIZE(8, 16), 0, 0, 11, 1}, +}; + +const upb_msglayout envoy_api_v2_cluster_Filter_msginit = { + &envoy_api_v2_cluster_Filter_submsgs[0], + &envoy_api_v2_cluster_Filter__fields[0], + UPB_SIZE(16, 32), 2, false, +}; + +#include "upb/port_undef.inc" + diff --git a/src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h b/src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h new file mode 100644 index 00000000000..bd8746cc428 --- /dev/null +++ b/src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h @@ -0,0 +1,69 @@ +/* This file was generated by upbc (the upb compiler) from the input + * file: + * + * envoy/api/v2/cluster/filter.proto + * + * Do not edit -- your changes will be discarded when the file is + * regenerated. */ + +#ifndef ENVOY_API_V2_CLUSTER_FILTER_PROTO_UPB_H_ +#define ENVOY_API_V2_CLUSTER_FILTER_PROTO_UPB_H_ + +#include "upb/generated_util.h" +#include "upb/msg.h" +#include "upb/decode.h" +#include "upb/encode.h" + +#include "upb/port_def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +struct envoy_api_v2_cluster_Filter; +typedef struct envoy_api_v2_cluster_Filter envoy_api_v2_cluster_Filter; +extern const upb_msglayout envoy_api_v2_cluster_Filter_msginit; +struct google_protobuf_Any; +extern const upb_msglayout google_protobuf_Any_msginit; + + +/* envoy.api.v2.cluster.Filter */ + +UPB_INLINE envoy_api_v2_cluster_Filter *envoy_api_v2_cluster_Filter_new(upb_arena *arena) { + return (envoy_api_v2_cluster_Filter *)upb_msg_new(&envoy_api_v2_cluster_Filter_msginit, arena); +} +UPB_INLINE envoy_api_v2_cluster_Filter *envoy_api_v2_cluster_Filter_parse(const char *buf, size_t size, + upb_arena *arena) { + envoy_api_v2_cluster_Filter *ret = envoy_api_v2_cluster_Filter_new(arena); + return (ret && upb_decode(buf, size, ret, &envoy_api_v2_cluster_Filter_msginit, arena)) ? ret : NULL; +} +UPB_INLINE char *envoy_api_v2_cluster_Filter_serialize(const envoy_api_v2_cluster_Filter *msg, upb_arena *arena, size_t *len) { + return upb_encode(msg, &envoy_api_v2_cluster_Filter_msginit, arena, len); +} + +UPB_INLINE upb_strview envoy_api_v2_cluster_Filter_name(const envoy_api_v2_cluster_Filter *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)); } +UPB_INLINE const struct google_protobuf_Any* envoy_api_v2_cluster_Filter_typed_config(const envoy_api_v2_cluster_Filter *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16)); } + +UPB_INLINE void envoy_api_v2_cluster_Filter_set_name(envoy_api_v2_cluster_Filter *msg, upb_strview value) { + UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)) = value; +} +UPB_INLINE void envoy_api_v2_cluster_Filter_set_typed_config(envoy_api_v2_cluster_Filter *msg, struct google_protobuf_Any* value) { + UPB_FIELD_AT(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16)) = value; +} +UPB_INLINE struct google_protobuf_Any* envoy_api_v2_cluster_Filter_mutable_typed_config(envoy_api_v2_cluster_Filter *msg, upb_arena *arena) { + struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_api_v2_cluster_Filter_typed_config(msg); + if (sub == NULL) { + sub = (struct google_protobuf_Any*)upb_msg_new(&google_protobuf_Any_msginit, arena); + if (!sub) return NULL; + envoy_api_v2_cluster_Filter_set_typed_config(msg, sub); + } + return sub; +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port_undef.inc" + +#endif /* ENVOY_API_V2_CLUSTER_FILTER_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c b/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c index 7158a8b8809..cc3a226529f 100644 --- a/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c +++ b/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c @@ -16,29 +16,33 @@ #include "upb/port_def.inc" -static const upb_msglayout *const envoy_api_v2_cluster_OutlierDetection_submsgs[11] = { +static const upb_msglayout *const envoy_api_v2_cluster_OutlierDetection_submsgs[14] = { &google_protobuf_Duration_msginit, &google_protobuf_UInt32Value_msginit, }; -static const upb_msglayout_field envoy_api_v2_cluster_OutlierDetection__fields[11] = { - {1, UPB_SIZE(0, 0), 0, 1, 11, 1}, - {2, UPB_SIZE(4, 8), 0, 0, 11, 1}, - {3, UPB_SIZE(8, 16), 0, 0, 11, 1}, - {4, UPB_SIZE(12, 24), 0, 1, 11, 1}, - {5, UPB_SIZE(16, 32), 0, 1, 11, 1}, - {6, UPB_SIZE(20, 40), 0, 1, 11, 1}, - {7, UPB_SIZE(24, 48), 0, 1, 11, 1}, - {8, UPB_SIZE(28, 56), 0, 1, 11, 1}, - {9, UPB_SIZE(32, 64), 0, 1, 11, 1}, - {10, UPB_SIZE(36, 72), 0, 1, 11, 1}, - {11, UPB_SIZE(40, 80), 0, 1, 11, 1}, +static const upb_msglayout_field envoy_api_v2_cluster_OutlierDetection__fields[15] = { + {1, UPB_SIZE(4, 8), 0, 1, 11, 1}, + {2, UPB_SIZE(8, 16), 0, 0, 11, 1}, + {3, UPB_SIZE(12, 24), 0, 0, 11, 1}, + {4, UPB_SIZE(16, 32), 0, 1, 11, 1}, + {5, UPB_SIZE(20, 40), 0, 1, 11, 1}, + {6, UPB_SIZE(24, 48), 0, 1, 11, 1}, + {7, UPB_SIZE(28, 56), 0, 1, 11, 1}, + {8, UPB_SIZE(32, 64), 0, 1, 11, 1}, + {9, UPB_SIZE(36, 72), 0, 1, 11, 1}, + {10, UPB_SIZE(40, 80), 0, 1, 11, 1}, + {11, UPB_SIZE(44, 88), 0, 1, 11, 1}, + {12, UPB_SIZE(0, 0), 0, 0, 8, 1}, + {13, UPB_SIZE(48, 96), 0, 1, 11, 1}, + {14, UPB_SIZE(52, 104), 0, 1, 11, 1}, + {15, UPB_SIZE(56, 112), 0, 1, 11, 1}, }; const upb_msglayout envoy_api_v2_cluster_OutlierDetection_msginit = { &envoy_api_v2_cluster_OutlierDetection_submsgs[0], &envoy_api_v2_cluster_OutlierDetection__fields[0], - UPB_SIZE(44, 88), 11, false, + UPB_SIZE(60, 120), 15, false, }; #include "upb/port_undef.inc" diff --git a/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h b/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h index cb290de1c0e..ef5592b53fd 100644 --- a/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h +++ b/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h @@ -43,20 +43,24 @@ UPB_INLINE char *envoy_api_v2_cluster_OutlierDetection_serialize(const envoy_api return upb_encode(msg, &envoy_api_v2_cluster_OutlierDetection_msginit, arena, len); } -UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_consecutive_5xx(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(0, 0)); } -UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_cluster_OutlierDetection_interval(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(4, 8)); } -UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_cluster_OutlierDetection_base_ejection_time(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(8, 16)); } -UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_max_ejection_percent(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(12, 24)); } -UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_enforcing_consecutive_5xx(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(16, 32)); } -UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_enforcing_success_rate(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(20, 40)); } -UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_success_rate_minimum_hosts(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(24, 48)); } -UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_success_rate_request_volume(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(28, 56)); } -UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_success_rate_stdev_factor(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(32, 64)); } -UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_consecutive_gateway_failure(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(36, 72)); } -UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_enforcing_consecutive_gateway_failure(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(40, 80)); } +UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_consecutive_5xx(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(4, 8)); } +UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_cluster_OutlierDetection_interval(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(8, 16)); } +UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_cluster_OutlierDetection_base_ejection_time(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(12, 24)); } +UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_max_ejection_percent(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(16, 32)); } +UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_enforcing_consecutive_5xx(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(20, 40)); } +UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_enforcing_success_rate(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(24, 48)); } +UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_success_rate_minimum_hosts(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(28, 56)); } +UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_success_rate_request_volume(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(32, 64)); } +UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_success_rate_stdev_factor(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(36, 72)); } +UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_consecutive_gateway_failure(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(40, 80)); } +UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_enforcing_consecutive_gateway_failure(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(44, 88)); } +UPB_INLINE bool envoy_api_v2_cluster_OutlierDetection_split_external_local_origin_errors(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(0, 0)); } +UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_consecutive_local_origin_failure(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(48, 96)); } +UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_enforcing_consecutive_local_origin_failure(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(52, 104)); } +UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_enforcing_local_origin_success_rate(const envoy_api_v2_cluster_OutlierDetection *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(56, 112)); } UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_consecutive_5xx(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(0, 0)) = value; + UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(4, 8)) = value; } UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_mutable_consecutive_5xx(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_cluster_OutlierDetection_consecutive_5xx(msg); @@ -68,7 +72,7 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetec return sub; } UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_interval(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_Duration* value) { - UPB_FIELD_AT(msg, struct google_protobuf_Duration*, UPB_SIZE(4, 8)) = value; + UPB_FIELD_AT(msg, struct google_protobuf_Duration*, UPB_SIZE(8, 16)) = value; } UPB_INLINE struct google_protobuf_Duration* envoy_api_v2_cluster_OutlierDetection_mutable_interval(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_api_v2_cluster_OutlierDetection_interval(msg); @@ -80,7 +84,7 @@ UPB_INLINE struct google_protobuf_Duration* envoy_api_v2_cluster_OutlierDetectio return sub; } UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_base_ejection_time(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_Duration* value) { - UPB_FIELD_AT(msg, struct google_protobuf_Duration*, UPB_SIZE(8, 16)) = value; + UPB_FIELD_AT(msg, struct google_protobuf_Duration*, UPB_SIZE(12, 24)) = value; } UPB_INLINE struct google_protobuf_Duration* envoy_api_v2_cluster_OutlierDetection_mutable_base_ejection_time(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_api_v2_cluster_OutlierDetection_base_ejection_time(msg); @@ -92,7 +96,7 @@ UPB_INLINE struct google_protobuf_Duration* envoy_api_v2_cluster_OutlierDetectio return sub; } UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_max_ejection_percent(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(12, 24)) = value; + UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(16, 32)) = value; } UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_mutable_max_ejection_percent(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_cluster_OutlierDetection_max_ejection_percent(msg); @@ -104,7 +108,7 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetec return sub; } UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_enforcing_consecutive_5xx(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(16, 32)) = value; + UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(20, 40)) = value; } UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_mutable_enforcing_consecutive_5xx(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_cluster_OutlierDetection_enforcing_consecutive_5xx(msg); @@ -116,7 +120,7 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetec return sub; } UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_enforcing_success_rate(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(20, 40)) = value; + UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(24, 48)) = value; } UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_mutable_enforcing_success_rate(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_cluster_OutlierDetection_enforcing_success_rate(msg); @@ -128,7 +132,7 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetec return sub; } UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_success_rate_minimum_hosts(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(24, 48)) = value; + UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(28, 56)) = value; } UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_mutable_success_rate_minimum_hosts(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_cluster_OutlierDetection_success_rate_minimum_hosts(msg); @@ -140,7 +144,7 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetec return sub; } UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_success_rate_request_volume(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(28, 56)) = value; + UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(32, 64)) = value; } UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_mutable_success_rate_request_volume(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_cluster_OutlierDetection_success_rate_request_volume(msg); @@ -152,7 +156,7 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetec return sub; } UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_success_rate_stdev_factor(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(32, 64)) = value; + UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(36, 72)) = value; } UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_mutable_success_rate_stdev_factor(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_cluster_OutlierDetection_success_rate_stdev_factor(msg); @@ -164,7 +168,7 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetec return sub; } UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_consecutive_gateway_failure(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(36, 72)) = value; + UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(40, 80)) = value; } UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_mutable_consecutive_gateway_failure(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_cluster_OutlierDetection_consecutive_gateway_failure(msg); @@ -176,7 +180,7 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetec return sub; } UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_enforcing_consecutive_gateway_failure(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { - UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(40, 80)) = value; + UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(44, 88)) = value; } UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_mutable_enforcing_consecutive_gateway_failure(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) { struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_cluster_OutlierDetection_enforcing_consecutive_gateway_failure(msg); @@ -187,6 +191,45 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetec } return sub; } +UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_split_external_local_origin_errors(envoy_api_v2_cluster_OutlierDetection *msg, bool value) { + UPB_FIELD_AT(msg, bool, UPB_SIZE(0, 0)) = value; +} +UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_consecutive_local_origin_failure(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { + UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(48, 96)) = value; +} +UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_mutable_consecutive_local_origin_failure(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) { + struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_cluster_OutlierDetection_consecutive_local_origin_failure(msg); + if (sub == NULL) { + sub = (struct google_protobuf_UInt32Value*)upb_msg_new(&google_protobuf_UInt32Value_msginit, arena); + if (!sub) return NULL; + envoy_api_v2_cluster_OutlierDetection_set_consecutive_local_origin_failure(msg, sub); + } + return sub; +} +UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_enforcing_consecutive_local_origin_failure(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { + UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(52, 104)) = value; +} +UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_mutable_enforcing_consecutive_local_origin_failure(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) { + struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_cluster_OutlierDetection_enforcing_consecutive_local_origin_failure(msg); + if (sub == NULL) { + sub = (struct google_protobuf_UInt32Value*)upb_msg_new(&google_protobuf_UInt32Value_msginit, arena); + if (!sub) return NULL; + envoy_api_v2_cluster_OutlierDetection_set_enforcing_consecutive_local_origin_failure(msg, sub); + } + return sub; +} +UPB_INLINE void envoy_api_v2_cluster_OutlierDetection_set_enforcing_local_origin_success_rate(envoy_api_v2_cluster_OutlierDetection *msg, struct google_protobuf_UInt32Value* value) { + UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(56, 112)) = value; +} +UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_cluster_OutlierDetection_mutable_enforcing_local_origin_success_rate(envoy_api_v2_cluster_OutlierDetection *msg, upb_arena *arena) { + struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_cluster_OutlierDetection_enforcing_local_origin_success_rate(msg); + if (sub == NULL) { + sub = (struct google_protobuf_UInt32Value*)upb_msg_new(&google_protobuf_UInt32Value_msginit, arena); + if (!sub) return NULL; + envoy_api_v2_cluster_OutlierDetection_set_enforcing_local_origin_success_rate(msg, sub); + } + return sub; +} #ifdef __cplusplus } /* extern "C" */ diff --git a/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c b/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c index 725b17d7e31..9ecfe106a87 100644 --- a/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c +++ b/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c @@ -9,6 +9,7 @@ #include #include "upb/msg.h" #include "envoy/api/v2/core/base.upb.h" +#include "envoy/api/v2/core/http_uri.upb.h" #include "google/protobuf/any.upb.h" #include "google/protobuf/struct.upb.h" #include "google/protobuf/wrappers.upb.h" @@ -142,6 +143,37 @@ const upb_msglayout envoy_api_v2_core_DataSource_msginit = { UPB_SIZE(16, 32), 3, false, }; +static const upb_msglayout *const envoy_api_v2_core_RemoteDataSource_submsgs[1] = { + &envoy_api_v2_core_HttpUri_msginit, +}; + +static const upb_msglayout_field envoy_api_v2_core_RemoteDataSource__fields[2] = { + {1, UPB_SIZE(8, 16), 0, 0, 11, 1}, + {2, UPB_SIZE(0, 0), 0, 0, 9, 1}, +}; + +const upb_msglayout envoy_api_v2_core_RemoteDataSource_msginit = { + &envoy_api_v2_core_RemoteDataSource_submsgs[0], + &envoy_api_v2_core_RemoteDataSource__fields[0], + UPB_SIZE(16, 32), 2, false, +}; + +static const upb_msglayout *const envoy_api_v2_core_AsyncDataSource_submsgs[2] = { + &envoy_api_v2_core_DataSource_msginit, + &envoy_api_v2_core_RemoteDataSource_msginit, +}; + +static const upb_msglayout_field envoy_api_v2_core_AsyncDataSource__fields[2] = { + {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1}, + {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1}, +}; + +const upb_msglayout envoy_api_v2_core_AsyncDataSource_msginit = { + &envoy_api_v2_core_AsyncDataSource_submsgs[0], + &envoy_api_v2_core_AsyncDataSource__fields[0], + UPB_SIZE(8, 16), 2, false, +}; + static const upb_msglayout *const envoy_api_v2_core_TransportSocket_submsgs[2] = { &google_protobuf_Any_msginit, &google_protobuf_Struct_msginit, diff --git a/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h b/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h index 58e6e5e3f7b..d4c14b1511f 100644 --- a/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h +++ b/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h @@ -29,6 +29,8 @@ struct envoy_api_v2_core_HeaderValue; struct envoy_api_v2_core_HeaderValueOption; struct envoy_api_v2_core_HeaderMap; struct envoy_api_v2_core_DataSource; +struct envoy_api_v2_core_RemoteDataSource; +struct envoy_api_v2_core_AsyncDataSource; struct envoy_api_v2_core_TransportSocket; struct envoy_api_v2_core_SocketOption; struct envoy_api_v2_core_RuntimeFractionalPercent; @@ -42,6 +44,8 @@ typedef struct envoy_api_v2_core_HeaderValue envoy_api_v2_core_HeaderValue; typedef struct envoy_api_v2_core_HeaderValueOption envoy_api_v2_core_HeaderValueOption; typedef struct envoy_api_v2_core_HeaderMap envoy_api_v2_core_HeaderMap; typedef struct envoy_api_v2_core_DataSource envoy_api_v2_core_DataSource; +typedef struct envoy_api_v2_core_RemoteDataSource envoy_api_v2_core_RemoteDataSource; +typedef struct envoy_api_v2_core_AsyncDataSource envoy_api_v2_core_AsyncDataSource; typedef struct envoy_api_v2_core_TransportSocket envoy_api_v2_core_TransportSocket; typedef struct envoy_api_v2_core_SocketOption envoy_api_v2_core_SocketOption; typedef struct envoy_api_v2_core_RuntimeFractionalPercent envoy_api_v2_core_RuntimeFractionalPercent; @@ -55,14 +59,18 @@ extern const upb_msglayout envoy_api_v2_core_HeaderValue_msginit; extern const upb_msglayout envoy_api_v2_core_HeaderValueOption_msginit; extern const upb_msglayout envoy_api_v2_core_HeaderMap_msginit; extern const upb_msglayout envoy_api_v2_core_DataSource_msginit; +extern const upb_msglayout envoy_api_v2_core_RemoteDataSource_msginit; +extern const upb_msglayout envoy_api_v2_core_AsyncDataSource_msginit; extern const upb_msglayout envoy_api_v2_core_TransportSocket_msginit; extern const upb_msglayout envoy_api_v2_core_SocketOption_msginit; extern const upb_msglayout envoy_api_v2_core_RuntimeFractionalPercent_msginit; extern const upb_msglayout envoy_api_v2_core_ControlPlane_msginit; +struct envoy_api_v2_core_HttpUri; struct envoy_type_FractionalPercent; struct google_protobuf_Any; struct google_protobuf_BoolValue; struct google_protobuf_Struct; +extern const upb_msglayout envoy_api_v2_core_HttpUri_msginit; extern const upb_msglayout envoy_type_FractionalPercent_msginit; extern const upb_msglayout google_protobuf_Any_msginit; extern const upb_msglayout google_protobuf_BoolValue_msginit; @@ -92,6 +100,12 @@ typedef enum { envoy_api_v2_core_SocketOption_STATE_LISTENING = 2 } envoy_api_v2_core_SocketOption_SocketState; +typedef enum { + envoy_api_v2_core_UNSPECIFIED = 0, + envoy_api_v2_core_INBOUND = 1, + envoy_api_v2_core_OUTBOUND = 2 +} envoy_api_v2_core_TrafficDirection; + /* envoy.api.v2.core.Locality */ @@ -397,6 +411,90 @@ UPB_INLINE void envoy_api_v2_core_DataSource_set_inline_string(envoy_api_v2_core UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 3); } +/* envoy.api.v2.core.RemoteDataSource */ + +UPB_INLINE envoy_api_v2_core_RemoteDataSource *envoy_api_v2_core_RemoteDataSource_new(upb_arena *arena) { + return (envoy_api_v2_core_RemoteDataSource *)upb_msg_new(&envoy_api_v2_core_RemoteDataSource_msginit, arena); +} +UPB_INLINE envoy_api_v2_core_RemoteDataSource *envoy_api_v2_core_RemoteDataSource_parse(const char *buf, size_t size, + upb_arena *arena) { + envoy_api_v2_core_RemoteDataSource *ret = envoy_api_v2_core_RemoteDataSource_new(arena); + return (ret && upb_decode(buf, size, ret, &envoy_api_v2_core_RemoteDataSource_msginit, arena)) ? ret : NULL; +} +UPB_INLINE char *envoy_api_v2_core_RemoteDataSource_serialize(const envoy_api_v2_core_RemoteDataSource *msg, upb_arena *arena, size_t *len) { + return upb_encode(msg, &envoy_api_v2_core_RemoteDataSource_msginit, arena, len); +} + +UPB_INLINE const struct envoy_api_v2_core_HttpUri* envoy_api_v2_core_RemoteDataSource_http_uri(const envoy_api_v2_core_RemoteDataSource *msg) { return UPB_FIELD_AT(msg, const struct envoy_api_v2_core_HttpUri*, UPB_SIZE(8, 16)); } +UPB_INLINE upb_strview envoy_api_v2_core_RemoteDataSource_sha256(const envoy_api_v2_core_RemoteDataSource *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)); } + +UPB_INLINE void envoy_api_v2_core_RemoteDataSource_set_http_uri(envoy_api_v2_core_RemoteDataSource *msg, struct envoy_api_v2_core_HttpUri* value) { + UPB_FIELD_AT(msg, struct envoy_api_v2_core_HttpUri*, UPB_SIZE(8, 16)) = value; +} +UPB_INLINE struct envoy_api_v2_core_HttpUri* envoy_api_v2_core_RemoteDataSource_mutable_http_uri(envoy_api_v2_core_RemoteDataSource *msg, upb_arena *arena) { + struct envoy_api_v2_core_HttpUri* sub = (struct envoy_api_v2_core_HttpUri*)envoy_api_v2_core_RemoteDataSource_http_uri(msg); + if (sub == NULL) { + sub = (struct envoy_api_v2_core_HttpUri*)upb_msg_new(&envoy_api_v2_core_HttpUri_msginit, arena); + if (!sub) return NULL; + envoy_api_v2_core_RemoteDataSource_set_http_uri(msg, sub); + } + return sub; +} +UPB_INLINE void envoy_api_v2_core_RemoteDataSource_set_sha256(envoy_api_v2_core_RemoteDataSource *msg, upb_strview value) { + UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)) = value; +} + +/* envoy.api.v2.core.AsyncDataSource */ + +UPB_INLINE envoy_api_v2_core_AsyncDataSource *envoy_api_v2_core_AsyncDataSource_new(upb_arena *arena) { + return (envoy_api_v2_core_AsyncDataSource *)upb_msg_new(&envoy_api_v2_core_AsyncDataSource_msginit, arena); +} +UPB_INLINE envoy_api_v2_core_AsyncDataSource *envoy_api_v2_core_AsyncDataSource_parse(const char *buf, size_t size, + upb_arena *arena) { + envoy_api_v2_core_AsyncDataSource *ret = envoy_api_v2_core_AsyncDataSource_new(arena); + return (ret && upb_decode(buf, size, ret, &envoy_api_v2_core_AsyncDataSource_msginit, arena)) ? ret : NULL; +} +UPB_INLINE char *envoy_api_v2_core_AsyncDataSource_serialize(const envoy_api_v2_core_AsyncDataSource *msg, upb_arena *arena, size_t *len) { + return upb_encode(msg, &envoy_api_v2_core_AsyncDataSource_msginit, arena, len); +} + +typedef enum { + envoy_api_v2_core_AsyncDataSource_specifier_local = 1, + envoy_api_v2_core_AsyncDataSource_specifier_remote = 2, + envoy_api_v2_core_AsyncDataSource_specifier_NOT_SET = 0 +} envoy_api_v2_core_AsyncDataSource_specifier_oneofcases; +UPB_INLINE envoy_api_v2_core_AsyncDataSource_specifier_oneofcases envoy_api_v2_core_AsyncDataSource_specifier_case(const envoy_api_v2_core_AsyncDataSource* msg) { return (envoy_api_v2_core_AsyncDataSource_specifier_oneofcases)UPB_FIELD_AT(msg, int32_t, UPB_SIZE(4, 8)); } + +UPB_INLINE bool envoy_api_v2_core_AsyncDataSource_has_local(const envoy_api_v2_core_AsyncDataSource *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(4, 8), 1); } +UPB_INLINE const envoy_api_v2_core_DataSource* envoy_api_v2_core_AsyncDataSource_local(const envoy_api_v2_core_AsyncDataSource *msg) { return UPB_READ_ONEOF(msg, const envoy_api_v2_core_DataSource*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); } +UPB_INLINE bool envoy_api_v2_core_AsyncDataSource_has_remote(const envoy_api_v2_core_AsyncDataSource *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(4, 8), 2); } +UPB_INLINE const envoy_api_v2_core_RemoteDataSource* envoy_api_v2_core_AsyncDataSource_remote(const envoy_api_v2_core_AsyncDataSource *msg) { return UPB_READ_ONEOF(msg, const envoy_api_v2_core_RemoteDataSource*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); } + +UPB_INLINE void envoy_api_v2_core_AsyncDataSource_set_local(envoy_api_v2_core_AsyncDataSource *msg, envoy_api_v2_core_DataSource* value) { + UPB_WRITE_ONEOF(msg, envoy_api_v2_core_DataSource*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1); +} +UPB_INLINE struct envoy_api_v2_core_DataSource* envoy_api_v2_core_AsyncDataSource_mutable_local(envoy_api_v2_core_AsyncDataSource *msg, upb_arena *arena) { + struct envoy_api_v2_core_DataSource* sub = (struct envoy_api_v2_core_DataSource*)envoy_api_v2_core_AsyncDataSource_local(msg); + if (sub == NULL) { + sub = (struct envoy_api_v2_core_DataSource*)upb_msg_new(&envoy_api_v2_core_DataSource_msginit, arena); + if (!sub) return NULL; + envoy_api_v2_core_AsyncDataSource_set_local(msg, sub); + } + return sub; +} +UPB_INLINE void envoy_api_v2_core_AsyncDataSource_set_remote(envoy_api_v2_core_AsyncDataSource *msg, envoy_api_v2_core_RemoteDataSource* value) { + UPB_WRITE_ONEOF(msg, envoy_api_v2_core_RemoteDataSource*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2); +} +UPB_INLINE struct envoy_api_v2_core_RemoteDataSource* envoy_api_v2_core_AsyncDataSource_mutable_remote(envoy_api_v2_core_AsyncDataSource *msg, upb_arena *arena) { + struct envoy_api_v2_core_RemoteDataSource* sub = (struct envoy_api_v2_core_RemoteDataSource*)envoy_api_v2_core_AsyncDataSource_remote(msg); + if (sub == NULL) { + sub = (struct envoy_api_v2_core_RemoteDataSource*)upb_msg_new(&envoy_api_v2_core_RemoteDataSource_msginit, arena); + if (!sub) return NULL; + envoy_api_v2_core_AsyncDataSource_set_remote(msg, sub); + } + return sub; +} + /* envoy.api.v2.core.TransportSocket */ UPB_INLINE envoy_api_v2_core_TransportSocket *envoy_api_v2_core_TransportSocket_new(upb_arena *arena) { diff --git a/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c b/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c index 5fe2a189ce0..afe940435c6 100644 --- a/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c +++ b/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c @@ -23,19 +23,20 @@ static const upb_msglayout *const envoy_api_v2_core_ApiConfigSource_submsgs[4] = &google_protobuf_Duration_msginit, }; -static const upb_msglayout_field envoy_api_v2_core_ApiConfigSource__fields[6] = { +static const upb_msglayout_field envoy_api_v2_core_ApiConfigSource__fields[7] = { {1, UPB_SIZE(0, 0), 0, 0, 14, 1}, - {2, UPB_SIZE(20, 32), 0, 0, 9, 3}, - {3, UPB_SIZE(8, 8), 0, 2, 11, 1}, - {4, UPB_SIZE(24, 40), 0, 0, 11, 3}, - {5, UPB_SIZE(12, 16), 0, 2, 11, 1}, - {6, UPB_SIZE(16, 24), 0, 1, 11, 1}, + {2, UPB_SIZE(24, 40), 0, 0, 9, 3}, + {3, UPB_SIZE(12, 16), 0, 2, 11, 1}, + {4, UPB_SIZE(28, 48), 0, 0, 11, 3}, + {5, UPB_SIZE(16, 24), 0, 2, 11, 1}, + {6, UPB_SIZE(20, 32), 0, 1, 11, 1}, + {7, UPB_SIZE(8, 8), 0, 0, 8, 1}, }; const upb_msglayout envoy_api_v2_core_ApiConfigSource_msginit = { &envoy_api_v2_core_ApiConfigSource_submsgs[0], &envoy_api_v2_core_ApiConfigSource__fields[0], - UPB_SIZE(32, 48), 6, false, + UPB_SIZE(32, 56), 7, false, }; const upb_msglayout envoy_api_v2_core_AggregatedConfigSource_msginit = { diff --git a/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h b/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h index 27f4779c17f..4c2e832e698 100644 --- a/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h +++ b/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h @@ -64,27 +64,28 @@ UPB_INLINE char *envoy_api_v2_core_ApiConfigSource_serialize(const envoy_api_v2_ } UPB_INLINE int32_t envoy_api_v2_core_ApiConfigSource_api_type(const envoy_api_v2_core_ApiConfigSource *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(0, 0)); } -UPB_INLINE upb_strview const* envoy_api_v2_core_ApiConfigSource_cluster_names(const envoy_api_v2_core_ApiConfigSource *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(20, 32), len); } -UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_core_ApiConfigSource_refresh_delay(const envoy_api_v2_core_ApiConfigSource *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(8, 8)); } -UPB_INLINE const struct envoy_api_v2_core_GrpcService* const* envoy_api_v2_core_ApiConfigSource_grpc_services(const envoy_api_v2_core_ApiConfigSource *msg, size_t *len) { return (const struct envoy_api_v2_core_GrpcService* const*)_upb_array_accessor(msg, UPB_SIZE(24, 40), len); } -UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_core_ApiConfigSource_request_timeout(const envoy_api_v2_core_ApiConfigSource *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(12, 16)); } -UPB_INLINE const envoy_api_v2_core_RateLimitSettings* envoy_api_v2_core_ApiConfigSource_rate_limit_settings(const envoy_api_v2_core_ApiConfigSource *msg) { return UPB_FIELD_AT(msg, const envoy_api_v2_core_RateLimitSettings*, UPB_SIZE(16, 24)); } +UPB_INLINE upb_strview const* envoy_api_v2_core_ApiConfigSource_cluster_names(const envoy_api_v2_core_ApiConfigSource *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(24, 40), len); } +UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_core_ApiConfigSource_refresh_delay(const envoy_api_v2_core_ApiConfigSource *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(12, 16)); } +UPB_INLINE const struct envoy_api_v2_core_GrpcService* const* envoy_api_v2_core_ApiConfigSource_grpc_services(const envoy_api_v2_core_ApiConfigSource *msg, size_t *len) { return (const struct envoy_api_v2_core_GrpcService* const*)_upb_array_accessor(msg, UPB_SIZE(28, 48), len); } +UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_core_ApiConfigSource_request_timeout(const envoy_api_v2_core_ApiConfigSource *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(16, 24)); } +UPB_INLINE const envoy_api_v2_core_RateLimitSettings* envoy_api_v2_core_ApiConfigSource_rate_limit_settings(const envoy_api_v2_core_ApiConfigSource *msg) { return UPB_FIELD_AT(msg, const envoy_api_v2_core_RateLimitSettings*, UPB_SIZE(20, 32)); } +UPB_INLINE bool envoy_api_v2_core_ApiConfigSource_set_node_on_first_message_only(const envoy_api_v2_core_ApiConfigSource *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(8, 8)); } UPB_INLINE void envoy_api_v2_core_ApiConfigSource_set_api_type(envoy_api_v2_core_ApiConfigSource *msg, int32_t value) { UPB_FIELD_AT(msg, int32_t, UPB_SIZE(0, 0)) = value; } UPB_INLINE upb_strview* envoy_api_v2_core_ApiConfigSource_mutable_cluster_names(envoy_api_v2_core_ApiConfigSource *msg, size_t *len) { - return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 32), len); + return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 40), len); } UPB_INLINE upb_strview* envoy_api_v2_core_ApiConfigSource_resize_cluster_names(envoy_api_v2_core_ApiConfigSource *msg, size_t len, upb_arena *arena) { - return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(20, 32), len, UPB_SIZE(8, 16), UPB_TYPE_STRING, arena); + return (upb_strview*)_upb_array_resize_accessor(msg, UPB_SIZE(24, 40), len, UPB_SIZE(8, 16), UPB_TYPE_STRING, arena); } UPB_INLINE bool envoy_api_v2_core_ApiConfigSource_add_cluster_names(envoy_api_v2_core_ApiConfigSource *msg, upb_strview val, upb_arena *arena) { return _upb_array_append_accessor( - msg, UPB_SIZE(20, 32), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val, arena); + msg, UPB_SIZE(24, 40), UPB_SIZE(8, 16), UPB_TYPE_STRING, &val, arena); } UPB_INLINE void envoy_api_v2_core_ApiConfigSource_set_refresh_delay(envoy_api_v2_core_ApiConfigSource *msg, struct google_protobuf_Duration* value) { - UPB_FIELD_AT(msg, struct google_protobuf_Duration*, UPB_SIZE(8, 8)) = value; + UPB_FIELD_AT(msg, struct google_protobuf_Duration*, UPB_SIZE(12, 16)) = value; } UPB_INLINE struct google_protobuf_Duration* envoy_api_v2_core_ApiConfigSource_mutable_refresh_delay(envoy_api_v2_core_ApiConfigSource *msg, upb_arena *arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_api_v2_core_ApiConfigSource_refresh_delay(msg); @@ -96,20 +97,20 @@ UPB_INLINE struct google_protobuf_Duration* envoy_api_v2_core_ApiConfigSource_mu return sub; } UPB_INLINE struct envoy_api_v2_core_GrpcService** envoy_api_v2_core_ApiConfigSource_mutable_grpc_services(envoy_api_v2_core_ApiConfigSource *msg, size_t *len) { - return (struct envoy_api_v2_core_GrpcService**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 40), len); + return (struct envoy_api_v2_core_GrpcService**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 48), len); } UPB_INLINE struct envoy_api_v2_core_GrpcService** envoy_api_v2_core_ApiConfigSource_resize_grpc_services(envoy_api_v2_core_ApiConfigSource *msg, size_t len, upb_arena *arena) { - return (struct envoy_api_v2_core_GrpcService**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 40), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena); + return (struct envoy_api_v2_core_GrpcService**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 48), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena); } UPB_INLINE struct envoy_api_v2_core_GrpcService* envoy_api_v2_core_ApiConfigSource_add_grpc_services(envoy_api_v2_core_ApiConfigSource *msg, upb_arena *arena) { struct envoy_api_v2_core_GrpcService* sub = (struct envoy_api_v2_core_GrpcService*)upb_msg_new(&envoy_api_v2_core_GrpcService_msginit, arena); bool ok = _upb_array_append_accessor( - msg, UPB_SIZE(24, 40), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + msg, UPB_SIZE(28, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); if (!ok) return NULL; return sub; } UPB_INLINE void envoy_api_v2_core_ApiConfigSource_set_request_timeout(envoy_api_v2_core_ApiConfigSource *msg, struct google_protobuf_Duration* value) { - UPB_FIELD_AT(msg, struct google_protobuf_Duration*, UPB_SIZE(12, 16)) = value; + UPB_FIELD_AT(msg, struct google_protobuf_Duration*, UPB_SIZE(16, 24)) = value; } UPB_INLINE struct google_protobuf_Duration* envoy_api_v2_core_ApiConfigSource_mutable_request_timeout(envoy_api_v2_core_ApiConfigSource *msg, upb_arena *arena) { struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_api_v2_core_ApiConfigSource_request_timeout(msg); @@ -121,7 +122,7 @@ UPB_INLINE struct google_protobuf_Duration* envoy_api_v2_core_ApiConfigSource_mu return sub; } UPB_INLINE void envoy_api_v2_core_ApiConfigSource_set_rate_limit_settings(envoy_api_v2_core_ApiConfigSource *msg, envoy_api_v2_core_RateLimitSettings* value) { - UPB_FIELD_AT(msg, envoy_api_v2_core_RateLimitSettings*, UPB_SIZE(16, 24)) = value; + UPB_FIELD_AT(msg, envoy_api_v2_core_RateLimitSettings*, UPB_SIZE(20, 32)) = value; } UPB_INLINE struct envoy_api_v2_core_RateLimitSettings* envoy_api_v2_core_ApiConfigSource_mutable_rate_limit_settings(envoy_api_v2_core_ApiConfigSource *msg, upb_arena *arena) { struct envoy_api_v2_core_RateLimitSettings* sub = (struct envoy_api_v2_core_RateLimitSettings*)envoy_api_v2_core_ApiConfigSource_rate_limit_settings(msg); @@ -132,6 +133,9 @@ UPB_INLINE struct envoy_api_v2_core_RateLimitSettings* envoy_api_v2_core_ApiConf } return sub; } +UPB_INLINE void envoy_api_v2_core_ApiConfigSource_set_set_node_on_first_message_only(envoy_api_v2_core_ApiConfigSource *msg, bool value) { + UPB_FIELD_AT(msg, bool, UPB_SIZE(8, 8)) = value; +} /* envoy.api.v2.core.AggregatedConfigSource */ diff --git a/src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c b/src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c new file mode 100644 index 00000000000..f7999c7cd0d --- /dev/null +++ b/src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c @@ -0,0 +1,35 @@ +/* This file was generated by upbc (the upb compiler) from the input + * file: + * + * envoy/api/v2/core/http_uri.proto + * + * Do not edit -- your changes will be discarded when the file is + * regenerated. */ + +#include +#include "upb/msg.h" +#include "envoy/api/v2/core/http_uri.upb.h" +#include "google/protobuf/duration.upb.h" +#include "gogoproto/gogo.upb.h" +#include "validate/validate.upb.h" + +#include "upb/port_def.inc" + +static const upb_msglayout *const envoy_api_v2_core_HttpUri_submsgs[1] = { + &google_protobuf_Duration_msginit, +}; + +static const upb_msglayout_field envoy_api_v2_core_HttpUri__fields[3] = { + {1, UPB_SIZE(0, 0), 0, 0, 9, 1}, + {2, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 9, 1}, + {3, UPB_SIZE(8, 16), 0, 0, 11, 1}, +}; + +const upb_msglayout envoy_api_v2_core_HttpUri_msginit = { + &envoy_api_v2_core_HttpUri_submsgs[0], + &envoy_api_v2_core_HttpUri__fields[0], + UPB_SIZE(24, 48), 3, false, +}; + +#include "upb/port_undef.inc" + diff --git a/src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h b/src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h new file mode 100644 index 00000000000..f0dc22b7a20 --- /dev/null +++ b/src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h @@ -0,0 +1,80 @@ +/* This file was generated by upbc (the upb compiler) from the input + * file: + * + * envoy/api/v2/core/http_uri.proto + * + * Do not edit -- your changes will be discarded when the file is + * regenerated. */ + +#ifndef ENVOY_API_V2_CORE_HTTP_URI_PROTO_UPB_H_ +#define ENVOY_API_V2_CORE_HTTP_URI_PROTO_UPB_H_ + +#include "upb/generated_util.h" +#include "upb/msg.h" +#include "upb/decode.h" +#include "upb/encode.h" + +#include "upb/port_def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +struct envoy_api_v2_core_HttpUri; +typedef struct envoy_api_v2_core_HttpUri envoy_api_v2_core_HttpUri; +extern const upb_msglayout envoy_api_v2_core_HttpUri_msginit; +struct google_protobuf_Duration; +extern const upb_msglayout google_protobuf_Duration_msginit; + + +/* envoy.api.v2.core.HttpUri */ + +UPB_INLINE envoy_api_v2_core_HttpUri *envoy_api_v2_core_HttpUri_new(upb_arena *arena) { + return (envoy_api_v2_core_HttpUri *)upb_msg_new(&envoy_api_v2_core_HttpUri_msginit, arena); +} +UPB_INLINE envoy_api_v2_core_HttpUri *envoy_api_v2_core_HttpUri_parse(const char *buf, size_t size, + upb_arena *arena) { + envoy_api_v2_core_HttpUri *ret = envoy_api_v2_core_HttpUri_new(arena); + return (ret && upb_decode(buf, size, ret, &envoy_api_v2_core_HttpUri_msginit, arena)) ? ret : NULL; +} +UPB_INLINE char *envoy_api_v2_core_HttpUri_serialize(const envoy_api_v2_core_HttpUri *msg, upb_arena *arena, size_t *len) { + return upb_encode(msg, &envoy_api_v2_core_HttpUri_msginit, arena, len); +} + +typedef enum { + envoy_api_v2_core_HttpUri_http_upstream_type_cluster = 2, + envoy_api_v2_core_HttpUri_http_upstream_type_NOT_SET = 0 +} envoy_api_v2_core_HttpUri_http_upstream_type_oneofcases; +UPB_INLINE envoy_api_v2_core_HttpUri_http_upstream_type_oneofcases envoy_api_v2_core_HttpUri_http_upstream_type_case(const envoy_api_v2_core_HttpUri* msg) { return (envoy_api_v2_core_HttpUri_http_upstream_type_oneofcases)UPB_FIELD_AT(msg, int32_t, UPB_SIZE(20, 40)); } + +UPB_INLINE upb_strview envoy_api_v2_core_HttpUri_uri(const envoy_api_v2_core_HttpUri *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)); } +UPB_INLINE bool envoy_api_v2_core_HttpUri_has_cluster(const envoy_api_v2_core_HttpUri *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(20, 40), 2); } +UPB_INLINE upb_strview envoy_api_v2_core_HttpUri_cluster(const envoy_api_v2_core_HttpUri *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 2, upb_strview_make("", strlen(""))); } +UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_core_HttpUri_timeout(const envoy_api_v2_core_HttpUri *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(8, 16)); } + +UPB_INLINE void envoy_api_v2_core_HttpUri_set_uri(envoy_api_v2_core_HttpUri *msg, upb_strview value) { + UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)) = value; +} +UPB_INLINE void envoy_api_v2_core_HttpUri_set_cluster(envoy_api_v2_core_HttpUri *msg, upb_strview value) { + UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 2); +} +UPB_INLINE void envoy_api_v2_core_HttpUri_set_timeout(envoy_api_v2_core_HttpUri *msg, struct google_protobuf_Duration* value) { + UPB_FIELD_AT(msg, struct google_protobuf_Duration*, UPB_SIZE(8, 16)) = value; +} +UPB_INLINE struct google_protobuf_Duration* envoy_api_v2_core_HttpUri_mutable_timeout(envoy_api_v2_core_HttpUri *msg, upb_arena *arena) { + struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_api_v2_core_HttpUri_timeout(msg); + if (sub == NULL) { + sub = (struct google_protobuf_Duration*)upb_msg_new(&google_protobuf_Duration_msginit, arena); + if (!sub) return NULL; + envoy_api_v2_core_HttpUri_set_timeout(msg, sub); + } + return sub; +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port_undef.inc" + +#endif /* ENVOY_API_V2_CORE_HTTP_URI_PROTO_UPB_H_ */ diff --git a/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c b/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c index 896cfe25638..48878df6a69 100644 --- a/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c +++ b/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c @@ -52,23 +52,29 @@ const upb_msglayout envoy_api_v2_core_Http1ProtocolOptions_msginit = { UPB_SIZE(16, 32), 3, false, }; -static const upb_msglayout *const envoy_api_v2_core_Http2ProtocolOptions_submsgs[4] = { +static const upb_msglayout *const envoy_api_v2_core_Http2ProtocolOptions_submsgs[9] = { &google_protobuf_UInt32Value_msginit, }; -static const upb_msglayout_field envoy_api_v2_core_Http2ProtocolOptions__fields[6] = { +static const upb_msglayout_field envoy_api_v2_core_Http2ProtocolOptions__fields[12] = { {1, UPB_SIZE(4, 8), 0, 0, 11, 1}, {2, UPB_SIZE(8, 16), 0, 0, 11, 1}, {3, UPB_SIZE(12, 24), 0, 0, 11, 1}, {4, UPB_SIZE(16, 32), 0, 0, 11, 1}, {5, UPB_SIZE(0, 0), 0, 0, 8, 1}, {6, UPB_SIZE(1, 1), 0, 0, 8, 1}, + {7, UPB_SIZE(20, 40), 0, 0, 11, 1}, + {8, UPB_SIZE(24, 48), 0, 0, 11, 1}, + {9, UPB_SIZE(28, 56), 0, 0, 11, 1}, + {10, UPB_SIZE(32, 64), 0, 0, 11, 1}, + {11, UPB_SIZE(36, 72), 0, 0, 11, 1}, + {12, UPB_SIZE(2, 2), 0, 0, 8, 1}, }; const upb_msglayout envoy_api_v2_core_Http2ProtocolOptions_msginit = { &envoy_api_v2_core_Http2ProtocolOptions_submsgs[0], &envoy_api_v2_core_Http2ProtocolOptions__fields[0], - UPB_SIZE(20, 40), 6, false, + UPB_SIZE(40, 80), 12, false, }; static const upb_msglayout *const envoy_api_v2_core_GrpcProtocolOptions_submsgs[1] = { diff --git a/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h b/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h index 039b221ef2a..a82cfc16f2f 100644 --- a/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h +++ b/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h @@ -145,6 +145,12 @@ UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_core_Http2Prot UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_core_Http2ProtocolOptions_initial_connection_window_size(const envoy_api_v2_core_Http2ProtocolOptions *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(16, 32)); } UPB_INLINE bool envoy_api_v2_core_Http2ProtocolOptions_allow_connect(const envoy_api_v2_core_Http2ProtocolOptions *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(0, 0)); } UPB_INLINE bool envoy_api_v2_core_Http2ProtocolOptions_allow_metadata(const envoy_api_v2_core_Http2ProtocolOptions *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(1, 1)); } +UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_core_Http2ProtocolOptions_max_outbound_frames(const envoy_api_v2_core_Http2ProtocolOptions *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(20, 40)); } +UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_core_Http2ProtocolOptions_max_outbound_control_frames(const envoy_api_v2_core_Http2ProtocolOptions *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(24, 48)); } +UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_core_Http2ProtocolOptions_max_consecutive_inbound_frames_with_empty_payload(const envoy_api_v2_core_Http2ProtocolOptions *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(28, 56)); } +UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_core_Http2ProtocolOptions_max_inbound_priority_frames_per_stream(const envoy_api_v2_core_Http2ProtocolOptions *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(32, 64)); } +UPB_INLINE const struct google_protobuf_UInt32Value* envoy_api_v2_core_Http2ProtocolOptions_max_inbound_window_update_frames_per_data_frame_sent(const envoy_api_v2_core_Http2ProtocolOptions *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_UInt32Value*, UPB_SIZE(36, 72)); } +UPB_INLINE bool envoy_api_v2_core_Http2ProtocolOptions_stream_error_on_invalid_http_messaging(const envoy_api_v2_core_Http2ProtocolOptions *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(2, 2)); } UPB_INLINE void envoy_api_v2_core_Http2ProtocolOptions_set_hpack_table_size(envoy_api_v2_core_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) { UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(4, 8)) = value; @@ -200,6 +206,69 @@ UPB_INLINE void envoy_api_v2_core_Http2ProtocolOptions_set_allow_connect(envoy_a UPB_INLINE void envoy_api_v2_core_Http2ProtocolOptions_set_allow_metadata(envoy_api_v2_core_Http2ProtocolOptions *msg, bool value) { UPB_FIELD_AT(msg, bool, UPB_SIZE(1, 1)) = value; } +UPB_INLINE void envoy_api_v2_core_Http2ProtocolOptions_set_max_outbound_frames(envoy_api_v2_core_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) { + UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(20, 40)) = value; +} +UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_core_Http2ProtocolOptions_mutable_max_outbound_frames(envoy_api_v2_core_Http2ProtocolOptions *msg, upb_arena *arena) { + struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_core_Http2ProtocolOptions_max_outbound_frames(msg); + if (sub == NULL) { + sub = (struct google_protobuf_UInt32Value*)upb_msg_new(&google_protobuf_UInt32Value_msginit, arena); + if (!sub) return NULL; + envoy_api_v2_core_Http2ProtocolOptions_set_max_outbound_frames(msg, sub); + } + return sub; +} +UPB_INLINE void envoy_api_v2_core_Http2ProtocolOptions_set_max_outbound_control_frames(envoy_api_v2_core_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) { + UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(24, 48)) = value; +} +UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_core_Http2ProtocolOptions_mutable_max_outbound_control_frames(envoy_api_v2_core_Http2ProtocolOptions *msg, upb_arena *arena) { + struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_core_Http2ProtocolOptions_max_outbound_control_frames(msg); + if (sub == NULL) { + sub = (struct google_protobuf_UInt32Value*)upb_msg_new(&google_protobuf_UInt32Value_msginit, arena); + if (!sub) return NULL; + envoy_api_v2_core_Http2ProtocolOptions_set_max_outbound_control_frames(msg, sub); + } + return sub; +} +UPB_INLINE void envoy_api_v2_core_Http2ProtocolOptions_set_max_consecutive_inbound_frames_with_empty_payload(envoy_api_v2_core_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) { + UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(28, 56)) = value; +} +UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_core_Http2ProtocolOptions_mutable_max_consecutive_inbound_frames_with_empty_payload(envoy_api_v2_core_Http2ProtocolOptions *msg, upb_arena *arena) { + struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_core_Http2ProtocolOptions_max_consecutive_inbound_frames_with_empty_payload(msg); + if (sub == NULL) { + sub = (struct google_protobuf_UInt32Value*)upb_msg_new(&google_protobuf_UInt32Value_msginit, arena); + if (!sub) return NULL; + envoy_api_v2_core_Http2ProtocolOptions_set_max_consecutive_inbound_frames_with_empty_payload(msg, sub); + } + return sub; +} +UPB_INLINE void envoy_api_v2_core_Http2ProtocolOptions_set_max_inbound_priority_frames_per_stream(envoy_api_v2_core_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) { + UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(32, 64)) = value; +} +UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_core_Http2ProtocolOptions_mutable_max_inbound_priority_frames_per_stream(envoy_api_v2_core_Http2ProtocolOptions *msg, upb_arena *arena) { + struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_core_Http2ProtocolOptions_max_inbound_priority_frames_per_stream(msg); + if (sub == NULL) { + sub = (struct google_protobuf_UInt32Value*)upb_msg_new(&google_protobuf_UInt32Value_msginit, arena); + if (!sub) return NULL; + envoy_api_v2_core_Http2ProtocolOptions_set_max_inbound_priority_frames_per_stream(msg, sub); + } + return sub; +} +UPB_INLINE void envoy_api_v2_core_Http2ProtocolOptions_set_max_inbound_window_update_frames_per_data_frame_sent(envoy_api_v2_core_Http2ProtocolOptions *msg, struct google_protobuf_UInt32Value* value) { + UPB_FIELD_AT(msg, struct google_protobuf_UInt32Value*, UPB_SIZE(36, 72)) = value; +} +UPB_INLINE struct google_protobuf_UInt32Value* envoy_api_v2_core_Http2ProtocolOptions_mutable_max_inbound_window_update_frames_per_data_frame_sent(envoy_api_v2_core_Http2ProtocolOptions *msg, upb_arena *arena) { + struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_api_v2_core_Http2ProtocolOptions_max_inbound_window_update_frames_per_data_frame_sent(msg); + if (sub == NULL) { + sub = (struct google_protobuf_UInt32Value*)upb_msg_new(&google_protobuf_UInt32Value_msginit, arena); + if (!sub) return NULL; + envoy_api_v2_core_Http2ProtocolOptions_set_max_inbound_window_update_frames_per_data_frame_sent(msg, sub); + } + return sub; +} +UPB_INLINE void envoy_api_v2_core_Http2ProtocolOptions_set_stream_error_on_invalid_http_messaging(envoy_api_v2_core_Http2ProtocolOptions *msg, bool value) { + UPB_FIELD_AT(msg, bool, UPB_SIZE(2, 2)) = value; +} /* envoy.api.v2.core.GrpcProtocolOptions */ diff --git a/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c b/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c new file mode 100644 index 00000000000..05a1c8098a6 --- /dev/null +++ b/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c @@ -0,0 +1,58 @@ +/* This file was generated by upbc (the upb compiler) from the input + * file: + * + * udpa/data/orca/v1/orca_load_report.proto + * + * Do not edit -- your changes will be discarded when the file is + * regenerated. */ + +#include +#include "upb/msg.h" +#include "udpa/data/orca/v1/orca_load_report.upb.h" +#include "validate/validate.upb.h" + +#include "upb/port_def.inc" + +static const upb_msglayout *const udpa_data_orca_v1_OrcaLoadReport_submsgs[2] = { + &udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_msginit, + &udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_msginit, +}; + +static const upb_msglayout_field udpa_data_orca_v1_OrcaLoadReport__fields[5] = { + {1, UPB_SIZE(0, 0), 0, 0, 1, 1}, + {2, UPB_SIZE(8, 8), 0, 0, 1, 1}, + {3, UPB_SIZE(16, 16), 0, 0, 4, 1}, + {4, UPB_SIZE(24, 24), 0, 0, 11, 3}, + {5, UPB_SIZE(28, 32), 0, 1, 11, 3}, +}; + +const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_msginit = { + &udpa_data_orca_v1_OrcaLoadReport_submsgs[0], + &udpa_data_orca_v1_OrcaLoadReport__fields[0], + UPB_SIZE(32, 40), 5, false, +}; + +static const upb_msglayout_field udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry__fields[2] = { + {1, UPB_SIZE(8, 8), 0, 0, 9, 1}, + {2, UPB_SIZE(0, 0), 0, 0, 1, 1}, +}; + +const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_msginit = { + NULL, + &udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry__fields[0], + UPB_SIZE(16, 32), 2, false, +}; + +static const upb_msglayout_field udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry__fields[2] = { + {1, UPB_SIZE(8, 8), 0, 0, 9, 1}, + {2, UPB_SIZE(0, 0), 0, 0, 1, 1}, +}; + +const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_msginit = { + NULL, + &udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry__fields[0], + UPB_SIZE(16, 32), 2, false, +}; + +#include "upb/port_undef.inc" + diff --git a/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h b/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h new file mode 100644 index 00000000000..279578b5ae4 --- /dev/null +++ b/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h @@ -0,0 +1,144 @@ +/* This file was generated by upbc (the upb compiler) from the input + * file: + * + * udpa/data/orca/v1/orca_load_report.proto + * + * Do not edit -- your changes will be discarded when the file is + * regenerated. */ + +#ifndef UDPA_DATA_ORCA_V1_ORCA_LOAD_REPORT_PROTO_UPB_H_ +#define UDPA_DATA_ORCA_V1_ORCA_LOAD_REPORT_PROTO_UPB_H_ + +#include "upb/generated_util.h" +#include "upb/msg.h" +#include "upb/decode.h" +#include "upb/encode.h" + +#include "upb/port_def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +struct udpa_data_orca_v1_OrcaLoadReport; +struct udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry; +struct udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry; +typedef struct udpa_data_orca_v1_OrcaLoadReport udpa_data_orca_v1_OrcaLoadReport; +typedef struct udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry; +typedef struct udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry; +extern const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_msginit; +extern const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_msginit; +extern const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_msginit; + + +/* udpa.data.orca.v1.OrcaLoadReport */ + +UPB_INLINE udpa_data_orca_v1_OrcaLoadReport *udpa_data_orca_v1_OrcaLoadReport_new(upb_arena *arena) { + return (udpa_data_orca_v1_OrcaLoadReport *)upb_msg_new(&udpa_data_orca_v1_OrcaLoadReport_msginit, arena); +} +UPB_INLINE udpa_data_orca_v1_OrcaLoadReport *udpa_data_orca_v1_OrcaLoadReport_parse(const char *buf, size_t size, + upb_arena *arena) { + udpa_data_orca_v1_OrcaLoadReport *ret = udpa_data_orca_v1_OrcaLoadReport_new(arena); + return (ret && upb_decode(buf, size, ret, &udpa_data_orca_v1_OrcaLoadReport_msginit, arena)) ? ret : NULL; +} +UPB_INLINE char *udpa_data_orca_v1_OrcaLoadReport_serialize(const udpa_data_orca_v1_OrcaLoadReport *msg, upb_arena *arena, size_t *len) { + return upb_encode(msg, &udpa_data_orca_v1_OrcaLoadReport_msginit, arena, len); +} + +UPB_INLINE double udpa_data_orca_v1_OrcaLoadReport_cpu_utilization(const udpa_data_orca_v1_OrcaLoadReport *msg) { return UPB_FIELD_AT(msg, double, UPB_SIZE(0, 0)); } +UPB_INLINE double udpa_data_orca_v1_OrcaLoadReport_mem_utilization(const udpa_data_orca_v1_OrcaLoadReport *msg) { return UPB_FIELD_AT(msg, double, UPB_SIZE(8, 8)); } +UPB_INLINE uint64_t udpa_data_orca_v1_OrcaLoadReport_rps(const udpa_data_orca_v1_OrcaLoadReport *msg) { return UPB_FIELD_AT(msg, uint64_t, UPB_SIZE(16, 16)); } +UPB_INLINE const udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry* const* udpa_data_orca_v1_OrcaLoadReport_request_cost(const udpa_data_orca_v1_OrcaLoadReport *msg, size_t *len) { return (const udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry* const*)_upb_array_accessor(msg, UPB_SIZE(24, 24), len); } +UPB_INLINE const udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry* const* udpa_data_orca_v1_OrcaLoadReport_utilization(const udpa_data_orca_v1_OrcaLoadReport *msg, size_t *len) { return (const udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry* const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); } + +UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_set_cpu_utilization(udpa_data_orca_v1_OrcaLoadReport *msg, double value) { + UPB_FIELD_AT(msg, double, UPB_SIZE(0, 0)) = value; +} +UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_set_mem_utilization(udpa_data_orca_v1_OrcaLoadReport *msg, double value) { + UPB_FIELD_AT(msg, double, UPB_SIZE(8, 8)) = value; +} +UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_set_rps(udpa_data_orca_v1_OrcaLoadReport *msg, uint64_t value) { + UPB_FIELD_AT(msg, uint64_t, UPB_SIZE(16, 16)) = value; +} +UPB_INLINE udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry** udpa_data_orca_v1_OrcaLoadReport_mutable_request_cost(udpa_data_orca_v1_OrcaLoadReport *msg, size_t *len) { + return (udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 24), len); +} +UPB_INLINE udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry** udpa_data_orca_v1_OrcaLoadReport_resize_request_cost(udpa_data_orca_v1_OrcaLoadReport *msg, size_t len, upb_arena *arena) { + return (udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 24), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena); +} +UPB_INLINE struct udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry* udpa_data_orca_v1_OrcaLoadReport_add_request_cost(udpa_data_orca_v1_OrcaLoadReport *msg, upb_arena *arena) { + struct udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry* sub = (struct udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry*)upb_msg_new(&udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_msginit, arena); + bool ok = _upb_array_append_accessor( + msg, UPB_SIZE(24, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + if (!ok) return NULL; + return sub; +} +UPB_INLINE udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry** udpa_data_orca_v1_OrcaLoadReport_mutable_utilization(udpa_data_orca_v1_OrcaLoadReport *msg, size_t *len) { + return (udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len); +} +UPB_INLINE udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry** udpa_data_orca_v1_OrcaLoadReport_resize_utilization(udpa_data_orca_v1_OrcaLoadReport *msg, size_t len, upb_arena *arena) { + return (udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry**)_upb_array_resize_accessor(msg, UPB_SIZE(28, 32), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena); +} +UPB_INLINE struct udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry* udpa_data_orca_v1_OrcaLoadReport_add_utilization(udpa_data_orca_v1_OrcaLoadReport *msg, upb_arena *arena) { + struct udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry* sub = (struct udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry*)upb_msg_new(&udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_msginit, arena); + bool ok = _upb_array_append_accessor( + msg, UPB_SIZE(28, 32), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena); + if (!ok) return NULL; + return sub; +} + +/* udpa.data.orca.v1.OrcaLoadReport.RequestCostEntry */ + +UPB_INLINE udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_new(upb_arena *arena) { + return (udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *)upb_msg_new(&udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_msginit, arena); +} +UPB_INLINE udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_parse(const char *buf, size_t size, + upb_arena *arena) { + udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *ret = udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_new(arena); + return (ret && upb_decode(buf, size, ret, &udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_msginit, arena)) ? ret : NULL; +} +UPB_INLINE char *udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_serialize(const udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *msg, upb_arena *arena, size_t *len) { + return upb_encode(msg, &udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_msginit, arena, len); +} + +UPB_INLINE upb_strview udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_key(const udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(8, 8)); } +UPB_INLINE double udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_value(const udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *msg) { return UPB_FIELD_AT(msg, double, UPB_SIZE(0, 0)); } + +UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_set_key(udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *msg, upb_strview value) { + UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(8, 8)) = value; +} +UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_set_value(udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *msg, double value) { + UPB_FIELD_AT(msg, double, UPB_SIZE(0, 0)) = value; +} + +/* udpa.data.orca.v1.OrcaLoadReport.UtilizationEntry */ + +UPB_INLINE udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_new(upb_arena *arena) { + return (udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *)upb_msg_new(&udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_msginit, arena); +} +UPB_INLINE udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_parse(const char *buf, size_t size, + upb_arena *arena) { + udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *ret = udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_new(arena); + return (ret && upb_decode(buf, size, ret, &udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_msginit, arena)) ? ret : NULL; +} +UPB_INLINE char *udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_serialize(const udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *msg, upb_arena *arena, size_t *len) { + return upb_encode(msg, &udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_msginit, arena, len); +} + +UPB_INLINE upb_strview udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_key(const udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(8, 8)); } +UPB_INLINE double udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_value(const udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *msg) { return UPB_FIELD_AT(msg, double, UPB_SIZE(0, 0)); } + +UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_set_key(udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *msg, upb_strview value) { + UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(8, 8)) = value; +} +UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_set_value(udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *msg, double value) { + UPB_FIELD_AT(msg, double, UPB_SIZE(0, 0)) = value; +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port_undef.inc" + +#endif /* UDPA_DATA_ORCA_V1_ORCA_LOAD_REPORT_PROTO_UPB_H_ */ diff --git a/src/core/lib/gprpp/map.h b/src/core/lib/gprpp/map.h index 134625775cf..6a41a97bec2 100644 --- a/src/core/lib/gprpp/map.h +++ b/src/core/lib/gprpp/map.h @@ -35,6 +35,7 @@ #include "src/core/lib/gprpp/memory.h" #include "src/core/lib/gprpp/pair.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" +#include "src/core/lib/gprpp/string_view.h" namespace grpc_core { @@ -42,8 +43,14 @@ struct StringLess { bool operator()(const char* a, const char* b) const { return strcmp(a, b) < 0; } - bool operator()(const UniquePtr& k1, const UniquePtr& k2) const { - return strcmp(k1.get(), k2.get()) < 0; + bool operator()(const UniquePtr& a, const UniquePtr& b) const { + return strcmp(a.get(), b.get()) < 0; + } + bool operator()(const StringView& a, const StringView& b) const { + const size_t min_size = std::min(a.size(), b.size()); + int c = strncmp(a.data(), b.data(), min_size); + if (c != 0) return c < 0; + return a.size() < b.size(); } }; diff --git a/src/core/lib/transport/static_metadata.cc b/src/core/lib/transport/static_metadata.cc index e43c17f1ca5..bd6ff09c80d 100644 --- a/src/core/lib/transport/static_metadata.cc +++ b/src/core/lib/transport/static_metadata.cc @@ -53,76 +53,77 @@ static constexpr uint8_t g_bytes[] = { 99, 45, 112, 114, 101, 118, 105, 111, 117, 115, 45, 114, 112, 99, 45, 97, 116, 116, 101, 109, 112, 116, 115, 103, 114, 112, 99, 45, 114, 101, 116, 114, 121, 45, 112, 117, 115, 104, 98, 97, 99, 107, 45, 109, 115, - 103, 114, 112, 99, 45, 116, 105, 109, 101, 111, 117, 116, 49, 50, 51, - 52, 103, 114, 112, 99, 46, 119, 97, 105, 116, 95, 102, 111, 114, 95, - 114, 101, 97, 100, 121, 103, 114, 112, 99, 46, 116, 105, 109, 101, 111, - 117, 116, 103, 114, 112, 99, 46, 109, 97, 120, 95, 114, 101, 113, 117, - 101, 115, 116, 95, 109, 101, 115, 115, 97, 103, 101, 95, 98, 121, 116, - 101, 115, 103, 114, 112, 99, 46, 109, 97, 120, 95, 114, 101, 115, 112, - 111, 110, 115, 101, 95, 109, 101, 115, 115, 97, 103, 101, 95, 98, 121, - 116, 101, 115, 47, 103, 114, 112, 99, 46, 108, 98, 46, 118, 49, 46, - 76, 111, 97, 100, 66, 97, 108, 97, 110, 99, 101, 114, 47, 66, 97, - 108, 97, 110, 99, 101, 76, 111, 97, 100, 47, 101, 110, 118, 111, 121, - 46, 115, 101, 114, 118, 105, 99, 101, 46, 108, 111, 97, 100, 95, 115, - 116, 97, 116, 115, 46, 118, 50, 46, 76, 111, 97, 100, 82, 101, 112, - 111, 114, 116, 105, 110, 103, 83, 101, 114, 118, 105, 99, 101, 47, 83, - 116, 114, 101, 97, 109, 76, 111, 97, 100, 83, 116, 97, 116, 115, 47, - 101, 110, 118, 111, 121, 46, 97, 112, 105, 46, 118, 50, 46, 69, 110, - 100, 112, 111, 105, 110, 116, 68, 105, 115, 99, 111, 118, 101, 114, 121, - 83, 101, 114, 118, 105, 99, 101, 47, 83, 116, 114, 101, 97, 109, 69, - 110, 100, 112, 111, 105, 110, 116, 115, 47, 103, 114, 112, 99, 46, 104, - 101, 97, 108, 116, 104, 46, 118, 49, 46, 72, 101, 97, 108, 116, 104, - 47, 87, 97, 116, 99, 104, 47, 101, 110, 118, 111, 121, 46, 115, 101, - 114, 118, 105, 99, 101, 46, 100, 105, 115, 99, 111, 118, 101, 114, 121, - 46, 118, 50, 46, 65, 103, 103, 114, 101, 103, 97, 116, 101, 100, 68, - 105, 115, 99, 111, 118, 101, 114, 121, 83, 101, 114, 118, 105, 99, 101, - 47, 83, 116, 114, 101, 97, 109, 65, 103, 103, 114, 101, 103, 97, 116, - 101, 100, 82, 101, 115, 111, 117, 114, 99, 101, 115, 100, 101, 102, 108, - 97, 116, 101, 103, 122, 105, 112, 115, 116, 114, 101, 97, 109, 47, 103, - 122, 105, 112, 71, 69, 84, 80, 79, 83, 84, 47, 47, 105, 110, 100, - 101, 120, 46, 104, 116, 109, 108, 104, 116, 116, 112, 104, 116, 116, 112, - 115, 50, 48, 48, 50, 48, 52, 50, 48, 54, 51, 48, 52, 52, 48, - 48, 52, 48, 52, 53, 48, 48, 97, 99, 99, 101, 112, 116, 45, 99, - 104, 97, 114, 115, 101, 116, 103, 122, 105, 112, 44, 32, 100, 101, 102, - 108, 97, 116, 101, 97, 99, 99, 101, 112, 116, 45, 108, 97, 110, 103, - 117, 97, 103, 101, 97, 99, 99, 101, 112, 116, 45, 114, 97, 110, 103, - 101, 115, 97, 99, 99, 101, 112, 116, 97, 99, 99, 101, 115, 115, 45, - 99, 111, 110, 116, 114, 111, 108, 45, 97, 108, 108, 111, 119, 45, 111, - 114, 105, 103, 105, 110, 97, 103, 101, 97, 108, 108, 111, 119, 97, 117, - 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 99, 97, 99, 104, - 101, 45, 99, 111, 110, 116, 114, 111, 108, 99, 111, 110, 116, 101, 110, - 116, 45, 100, 105, 115, 112, 111, 115, 105, 116, 105, 111, 110, 99, 111, - 110, 116, 101, 110, 116, 45, 108, 97, 110, 103, 117, 97, 103, 101, 99, - 111, 110, 116, 101, 110, 116, 45, 108, 101, 110, 103, 116, 104, 99, 111, - 110, 116, 101, 110, 116, 45, 108, 111, 99, 97, 116, 105, 111, 110, 99, - 111, 110, 116, 101, 110, 116, 45, 114, 97, 110, 103, 101, 99, 111, 111, - 107, 105, 101, 100, 97, 116, 101, 101, 116, 97, 103, 101, 120, 112, 101, - 99, 116, 101, 120, 112, 105, 114, 101, 115, 102, 114, 111, 109, 105, 102, - 45, 109, 97, 116, 99, 104, 105, 102, 45, 109, 111, 100, 105, 102, 105, - 101, 100, 45, 115, 105, 110, 99, 101, 105, 102, 45, 110, 111, 110, 101, - 45, 109, 97, 116, 99, 104, 105, 102, 45, 114, 97, 110, 103, 101, 105, - 102, 45, 117, 110, 109, 111, 100, 105, 102, 105, 101, 100, 45, 115, 105, - 110, 99, 101, 108, 97, 115, 116, 45, 109, 111, 100, 105, 102, 105, 101, - 100, 108, 105, 110, 107, 108, 111, 99, 97, 116, 105, 111, 110, 109, 97, - 120, 45, 102, 111, 114, 119, 97, 114, 100, 115, 112, 114, 111, 120, 121, - 45, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 112, 114, - 111, 120, 121, 45, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, - 111, 110, 114, 97, 110, 103, 101, 114, 101, 102, 101, 114, 101, 114, 114, - 101, 102, 114, 101, 115, 104, 114, 101, 116, 114, 121, 45, 97, 102, 116, - 101, 114, 115, 101, 114, 118, 101, 114, 115, 101, 116, 45, 99, 111, 111, - 107, 105, 101, 115, 116, 114, 105, 99, 116, 45, 116, 114, 97, 110, 115, - 112, 111, 114, 116, 45, 115, 101, 99, 117, 114, 105, 116, 121, 116, 114, - 97, 110, 115, 102, 101, 114, 45, 101, 110, 99, 111, 100, 105, 110, 103, - 118, 97, 114, 121, 118, 105, 97, 119, 119, 119, 45, 97, 117, 116, 104, - 101, 110, 116, 105, 99, 97, 116, 101, 48, 105, 100, 101, 110, 116, 105, - 116, 121, 116, 114, 97, 105, 108, 101, 114, 115, 97, 112, 112, 108, 105, - 99, 97, 116, 105, 111, 110, 47, 103, 114, 112, 99, 103, 114, 112, 99, - 80, 85, 84, 108, 98, 45, 99, 111, 115, 116, 45, 98, 105, 110, 105, - 100, 101, 110, 116, 105, 116, 121, 44, 100, 101, 102, 108, 97, 116, 101, - 105, 100, 101, 110, 116, 105, 116, 121, 44, 103, 122, 105, 112, 100, 101, - 102, 108, 97, 116, 101, 44, 103, 122, 105, 112, 105, 100, 101, 110, 116, - 105, 116, 121, 44, 100, 101, 102, 108, 97, 116, 101, 44, 103, 122, 105, - 112}; + 120, 45, 101, 110, 100, 112, 111, 105, 110, 116, 45, 108, 111, 97, 100, + 45, 109, 101, 116, 114, 105, 99, 115, 45, 98, 105, 110, 103, 114, 112, + 99, 45, 116, 105, 109, 101, 111, 117, 116, 49, 50, 51, 52, 103, 114, + 112, 99, 46, 119, 97, 105, 116, 95, 102, 111, 114, 95, 114, 101, 97, + 100, 121, 103, 114, 112, 99, 46, 116, 105, 109, 101, 111, 117, 116, 103, + 114, 112, 99, 46, 109, 97, 120, 95, 114, 101, 113, 117, 101, 115, 116, + 95, 109, 101, 115, 115, 97, 103, 101, 95, 98, 121, 116, 101, 115, 103, + 114, 112, 99, 46, 109, 97, 120, 95, 114, 101, 115, 112, 111, 110, 115, + 101, 95, 109, 101, 115, 115, 97, 103, 101, 95, 98, 121, 116, 101, 115, + 47, 103, 114, 112, 99, 46, 108, 98, 46, 118, 49, 46, 76, 111, 97, + 100, 66, 97, 108, 97, 110, 99, 101, 114, 47, 66, 97, 108, 97, 110, + 99, 101, 76, 111, 97, 100, 47, 101, 110, 118, 111, 121, 46, 115, 101, + 114, 118, 105, 99, 101, 46, 108, 111, 97, 100, 95, 115, 116, 97, 116, + 115, 46, 118, 50, 46, 76, 111, 97, 100, 82, 101, 112, 111, 114, 116, + 105, 110, 103, 83, 101, 114, 118, 105, 99, 101, 47, 83, 116, 114, 101, + 97, 109, 76, 111, 97, 100, 83, 116, 97, 116, 115, 47, 101, 110, 118, + 111, 121, 46, 97, 112, 105, 46, 118, 50, 46, 69, 110, 100, 112, 111, + 105, 110, 116, 68, 105, 115, 99, 111, 118, 101, 114, 121, 83, 101, 114, + 118, 105, 99, 101, 47, 83, 116, 114, 101, 97, 109, 69, 110, 100, 112, + 111, 105, 110, 116, 115, 47, 103, 114, 112, 99, 46, 104, 101, 97, 108, + 116, 104, 46, 118, 49, 46, 72, 101, 97, 108, 116, 104, 47, 87, 97, + 116, 99, 104, 47, 101, 110, 118, 111, 121, 46, 115, 101, 114, 118, 105, + 99, 101, 46, 100, 105, 115, 99, 111, 118, 101, 114, 121, 46, 118, 50, + 46, 65, 103, 103, 114, 101, 103, 97, 116, 101, 100, 68, 105, 115, 99, + 111, 118, 101, 114, 121, 83, 101, 114, 118, 105, 99, 101, 47, 83, 116, + 114, 101, 97, 109, 65, 103, 103, 114, 101, 103, 97, 116, 101, 100, 82, + 101, 115, 111, 117, 114, 99, 101, 115, 100, 101, 102, 108, 97, 116, 101, + 103, 122, 105, 112, 115, 116, 114, 101, 97, 109, 47, 103, 122, 105, 112, + 71, 69, 84, 80, 79, 83, 84, 47, 47, 105, 110, 100, 101, 120, 46, + 104, 116, 109, 108, 104, 116, 116, 112, 104, 116, 116, 112, 115, 50, 48, + 48, 50, 48, 52, 50, 48, 54, 51, 48, 52, 52, 48, 48, 52, 48, + 52, 53, 48, 48, 97, 99, 99, 101, 112, 116, 45, 99, 104, 97, 114, + 115, 101, 116, 103, 122, 105, 112, 44, 32, 100, 101, 102, 108, 97, 116, + 101, 97, 99, 99, 101, 112, 116, 45, 108, 97, 110, 103, 117, 97, 103, + 101, 97, 99, 99, 101, 112, 116, 45, 114, 97, 110, 103, 101, 115, 97, + 99, 99, 101, 112, 116, 97, 99, 99, 101, 115, 115, 45, 99, 111, 110, + 116, 114, 111, 108, 45, 97, 108, 108, 111, 119, 45, 111, 114, 105, 103, + 105, 110, 97, 103, 101, 97, 108, 108, 111, 119, 97, 117, 116, 104, 111, + 114, 105, 122, 97, 116, 105, 111, 110, 99, 97, 99, 104, 101, 45, 99, + 111, 110, 116, 114, 111, 108, 99, 111, 110, 116, 101, 110, 116, 45, 100, + 105, 115, 112, 111, 115, 105, 116, 105, 111, 110, 99, 111, 110, 116, 101, + 110, 116, 45, 108, 97, 110, 103, 117, 97, 103, 101, 99, 111, 110, 116, + 101, 110, 116, 45, 108, 101, 110, 103, 116, 104, 99, 111, 110, 116, 101, + 110, 116, 45, 108, 111, 99, 97, 116, 105, 111, 110, 99, 111, 110, 116, + 101, 110, 116, 45, 114, 97, 110, 103, 101, 99, 111, 111, 107, 105, 101, + 100, 97, 116, 101, 101, 116, 97, 103, 101, 120, 112, 101, 99, 116, 101, + 120, 112, 105, 114, 101, 115, 102, 114, 111, 109, 105, 102, 45, 109, 97, + 116, 99, 104, 105, 102, 45, 109, 111, 100, 105, 102, 105, 101, 100, 45, + 115, 105, 110, 99, 101, 105, 102, 45, 110, 111, 110, 101, 45, 109, 97, + 116, 99, 104, 105, 102, 45, 114, 97, 110, 103, 101, 105, 102, 45, 117, + 110, 109, 111, 100, 105, 102, 105, 101, 100, 45, 115, 105, 110, 99, 101, + 108, 97, 115, 116, 45, 109, 111, 100, 105, 102, 105, 101, 100, 108, 105, + 110, 107, 108, 111, 99, 97, 116, 105, 111, 110, 109, 97, 120, 45, 102, + 111, 114, 119, 97, 114, 100, 115, 112, 114, 111, 120, 121, 45, 97, 117, + 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 112, 114, 111, 120, 121, + 45, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 114, + 97, 110, 103, 101, 114, 101, 102, 101, 114, 101, 114, 114, 101, 102, 114, + 101, 115, 104, 114, 101, 116, 114, 121, 45, 97, 102, 116, 101, 114, 115, + 101, 114, 118, 101, 114, 115, 101, 116, 45, 99, 111, 111, 107, 105, 101, + 115, 116, 114, 105, 99, 116, 45, 116, 114, 97, 110, 115, 112, 111, 114, + 116, 45, 115, 101, 99, 117, 114, 105, 116, 121, 116, 114, 97, 110, 115, + 102, 101, 114, 45, 101, 110, 99, 111, 100, 105, 110, 103, 118, 97, 114, + 121, 118, 105, 97, 119, 119, 119, 45, 97, 117, 116, 104, 101, 110, 116, + 105, 99, 97, 116, 101, 48, 105, 100, 101, 110, 116, 105, 116, 121, 116, + 114, 97, 105, 108, 101, 114, 115, 97, 112, 112, 108, 105, 99, 97, 116, + 105, 111, 110, 47, 103, 114, 112, 99, 103, 114, 112, 99, 80, 85, 84, + 108, 98, 45, 99, 111, 115, 116, 45, 98, 105, 110, 105, 100, 101, 110, + 116, 105, 116, 121, 44, 100, 101, 102, 108, 97, 116, 101, 105, 100, 101, + 110, 116, 105, 116, 121, 44, 103, 122, 105, 112, 100, 101, 102, 108, 97, + 116, 101, 44, 103, 122, 105, 112, 105, 100, 101, 110, 116, 105, 116, 121, + 44, 100, 101, 102, 108, 97, 116, 101, 44, 103, 122, 105, 112}; grpc_slice_refcount grpc_core::StaticSliceRefcount::kStaticSubRefcount; @@ -187,6 +188,7 @@ struct StaticMetadataCtx { StaticSliceRefcount(102), StaticSliceRefcount(103), StaticSliceRefcount(104), StaticSliceRefcount(105), StaticSliceRefcount(106), StaticSliceRefcount(107), + StaticSliceRefcount(108), }; const StaticMetadataSlice slices[GRPC_STATIC_MDSTR_COUNT] = { @@ -214,488 +216,494 @@ struct StaticMetadataCtx { grpc_core::StaticMetadataSlice(&refcounts[20].base, 4, g_bytes + 278), grpc_core::StaticMetadataSlice(&refcounts[21].base, 26, g_bytes + 282), grpc_core::StaticMetadataSlice(&refcounts[22].base, 22, g_bytes + 308), - grpc_core::StaticMetadataSlice(&refcounts[23].base, 12, g_bytes + 330), - grpc_core::StaticMetadataSlice(&refcounts[24].base, 1, g_bytes + 342), - grpc_core::StaticMetadataSlice(&refcounts[25].base, 1, g_bytes + 343), - grpc_core::StaticMetadataSlice(&refcounts[26].base, 1, g_bytes + 344), - grpc_core::StaticMetadataSlice(&refcounts[27].base, 1, g_bytes + 345), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), - grpc_core::StaticMetadataSlice(&refcounts[29].base, 19, g_bytes + 346), - grpc_core::StaticMetadataSlice(&refcounts[30].base, 12, g_bytes + 365), - grpc_core::StaticMetadataSlice(&refcounts[31].base, 30, g_bytes + 377), - grpc_core::StaticMetadataSlice(&refcounts[32].base, 31, g_bytes + 407), - grpc_core::StaticMetadataSlice(&refcounts[33].base, 36, g_bytes + 438), - grpc_core::StaticMetadataSlice(&refcounts[34].base, 65, g_bytes + 474), - grpc_core::StaticMetadataSlice(&refcounts[35].base, 54, g_bytes + 539), - grpc_core::StaticMetadataSlice(&refcounts[36].base, 28, g_bytes + 593), - grpc_core::StaticMetadataSlice(&refcounts[37].base, 80, g_bytes + 621), - grpc_core::StaticMetadataSlice(&refcounts[38].base, 7, g_bytes + 701), - grpc_core::StaticMetadataSlice(&refcounts[39].base, 4, g_bytes + 708), - grpc_core::StaticMetadataSlice(&refcounts[40].base, 11, g_bytes + 712), - grpc_core::StaticMetadataSlice(&refcounts[41].base, 3, g_bytes + 723), - grpc_core::StaticMetadataSlice(&refcounts[42].base, 4, g_bytes + 726), - grpc_core::StaticMetadataSlice(&refcounts[43].base, 1, g_bytes + 730), - grpc_core::StaticMetadataSlice(&refcounts[44].base, 11, g_bytes + 731), - grpc_core::StaticMetadataSlice(&refcounts[45].base, 4, g_bytes + 742), - grpc_core::StaticMetadataSlice(&refcounts[46].base, 5, g_bytes + 746), - grpc_core::StaticMetadataSlice(&refcounts[47].base, 3, g_bytes + 751), - grpc_core::StaticMetadataSlice(&refcounts[48].base, 3, g_bytes + 754), - grpc_core::StaticMetadataSlice(&refcounts[49].base, 3, g_bytes + 757), - grpc_core::StaticMetadataSlice(&refcounts[50].base, 3, g_bytes + 760), - grpc_core::StaticMetadataSlice(&refcounts[51].base, 3, g_bytes + 763), - grpc_core::StaticMetadataSlice(&refcounts[52].base, 3, g_bytes + 766), - grpc_core::StaticMetadataSlice(&refcounts[53].base, 3, g_bytes + 769), - grpc_core::StaticMetadataSlice(&refcounts[54].base, 14, g_bytes + 772), - grpc_core::StaticMetadataSlice(&refcounts[55].base, 13, g_bytes + 786), - grpc_core::StaticMetadataSlice(&refcounts[56].base, 15, g_bytes + 799), - grpc_core::StaticMetadataSlice(&refcounts[57].base, 13, g_bytes + 814), - grpc_core::StaticMetadataSlice(&refcounts[58].base, 6, g_bytes + 827), - grpc_core::StaticMetadataSlice(&refcounts[59].base, 27, g_bytes + 833), - grpc_core::StaticMetadataSlice(&refcounts[60].base, 3, g_bytes + 860), - grpc_core::StaticMetadataSlice(&refcounts[61].base, 5, g_bytes + 863), - grpc_core::StaticMetadataSlice(&refcounts[62].base, 13, g_bytes + 868), - grpc_core::StaticMetadataSlice(&refcounts[63].base, 13, g_bytes + 881), - grpc_core::StaticMetadataSlice(&refcounts[64].base, 19, g_bytes + 894), - grpc_core::StaticMetadataSlice(&refcounts[65].base, 16, g_bytes + 913), - grpc_core::StaticMetadataSlice(&refcounts[66].base, 14, g_bytes + 929), - grpc_core::StaticMetadataSlice(&refcounts[67].base, 16, g_bytes + 943), - grpc_core::StaticMetadataSlice(&refcounts[68].base, 13, g_bytes + 959), - grpc_core::StaticMetadataSlice(&refcounts[69].base, 6, g_bytes + 972), - grpc_core::StaticMetadataSlice(&refcounts[70].base, 4, g_bytes + 978), - grpc_core::StaticMetadataSlice(&refcounts[71].base, 4, g_bytes + 982), - grpc_core::StaticMetadataSlice(&refcounts[72].base, 6, g_bytes + 986), - grpc_core::StaticMetadataSlice(&refcounts[73].base, 7, g_bytes + 992), - grpc_core::StaticMetadataSlice(&refcounts[74].base, 4, g_bytes + 999), - grpc_core::StaticMetadataSlice(&refcounts[75].base, 8, g_bytes + 1003), - grpc_core::StaticMetadataSlice(&refcounts[76].base, 17, g_bytes + 1011), - grpc_core::StaticMetadataSlice(&refcounts[77].base, 13, g_bytes + 1028), - grpc_core::StaticMetadataSlice(&refcounts[78].base, 8, g_bytes + 1041), - grpc_core::StaticMetadataSlice(&refcounts[79].base, 19, g_bytes + 1049), - grpc_core::StaticMetadataSlice(&refcounts[80].base, 13, g_bytes + 1068), - grpc_core::StaticMetadataSlice(&refcounts[81].base, 4, g_bytes + 1081), - grpc_core::StaticMetadataSlice(&refcounts[82].base, 8, g_bytes + 1085), - grpc_core::StaticMetadataSlice(&refcounts[83].base, 12, g_bytes + 1093), - grpc_core::StaticMetadataSlice(&refcounts[84].base, 18, g_bytes + 1105), - grpc_core::StaticMetadataSlice(&refcounts[85].base, 19, g_bytes + 1123), - grpc_core::StaticMetadataSlice(&refcounts[86].base, 5, g_bytes + 1142), - grpc_core::StaticMetadataSlice(&refcounts[87].base, 7, g_bytes + 1147), - grpc_core::StaticMetadataSlice(&refcounts[88].base, 7, g_bytes + 1154), - grpc_core::StaticMetadataSlice(&refcounts[89].base, 11, g_bytes + 1161), - grpc_core::StaticMetadataSlice(&refcounts[90].base, 6, g_bytes + 1172), - grpc_core::StaticMetadataSlice(&refcounts[91].base, 10, g_bytes + 1178), - grpc_core::StaticMetadataSlice(&refcounts[92].base, 25, g_bytes + 1188), - grpc_core::StaticMetadataSlice(&refcounts[93].base, 17, g_bytes + 1213), - grpc_core::StaticMetadataSlice(&refcounts[94].base, 4, g_bytes + 1230), - grpc_core::StaticMetadataSlice(&refcounts[95].base, 3, g_bytes + 1234), - grpc_core::StaticMetadataSlice(&refcounts[96].base, 16, g_bytes + 1237), - grpc_core::StaticMetadataSlice(&refcounts[97].base, 1, g_bytes + 1253), - grpc_core::StaticMetadataSlice(&refcounts[98].base, 8, g_bytes + 1254), - grpc_core::StaticMetadataSlice(&refcounts[99].base, 8, g_bytes + 1262), - grpc_core::StaticMetadataSlice(&refcounts[100].base, 16, g_bytes + 1270), - grpc_core::StaticMetadataSlice(&refcounts[101].base, 4, g_bytes + 1286), - grpc_core::StaticMetadataSlice(&refcounts[102].base, 3, g_bytes + 1290), - grpc_core::StaticMetadataSlice(&refcounts[103].base, 11, g_bytes + 1293), - grpc_core::StaticMetadataSlice(&refcounts[104].base, 16, g_bytes + 1304), - grpc_core::StaticMetadataSlice(&refcounts[105].base, 13, g_bytes + 1320), - grpc_core::StaticMetadataSlice(&refcounts[106].base, 12, g_bytes + 1333), - grpc_core::StaticMetadataSlice(&refcounts[107].base, 21, g_bytes + 1345), + grpc_core::StaticMetadataSlice(&refcounts[23].base, 27, g_bytes + 330), + grpc_core::StaticMetadataSlice(&refcounts[24].base, 12, g_bytes + 357), + grpc_core::StaticMetadataSlice(&refcounts[25].base, 1, g_bytes + 369), + grpc_core::StaticMetadataSlice(&refcounts[26].base, 1, g_bytes + 370), + grpc_core::StaticMetadataSlice(&refcounts[27].base, 1, g_bytes + 371), + grpc_core::StaticMetadataSlice(&refcounts[28].base, 1, g_bytes + 372), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), + grpc_core::StaticMetadataSlice(&refcounts[30].base, 19, g_bytes + 373), + grpc_core::StaticMetadataSlice(&refcounts[31].base, 12, g_bytes + 392), + grpc_core::StaticMetadataSlice(&refcounts[32].base, 30, g_bytes + 404), + grpc_core::StaticMetadataSlice(&refcounts[33].base, 31, g_bytes + 434), + grpc_core::StaticMetadataSlice(&refcounts[34].base, 36, g_bytes + 465), + grpc_core::StaticMetadataSlice(&refcounts[35].base, 65, g_bytes + 501), + grpc_core::StaticMetadataSlice(&refcounts[36].base, 54, g_bytes + 566), + grpc_core::StaticMetadataSlice(&refcounts[37].base, 28, g_bytes + 620), + grpc_core::StaticMetadataSlice(&refcounts[38].base, 80, g_bytes + 648), + grpc_core::StaticMetadataSlice(&refcounts[39].base, 7, g_bytes + 728), + grpc_core::StaticMetadataSlice(&refcounts[40].base, 4, g_bytes + 735), + grpc_core::StaticMetadataSlice(&refcounts[41].base, 11, g_bytes + 739), + grpc_core::StaticMetadataSlice(&refcounts[42].base, 3, g_bytes + 750), + grpc_core::StaticMetadataSlice(&refcounts[43].base, 4, g_bytes + 753), + grpc_core::StaticMetadataSlice(&refcounts[44].base, 1, g_bytes + 757), + grpc_core::StaticMetadataSlice(&refcounts[45].base, 11, g_bytes + 758), + grpc_core::StaticMetadataSlice(&refcounts[46].base, 4, g_bytes + 769), + grpc_core::StaticMetadataSlice(&refcounts[47].base, 5, g_bytes + 773), + grpc_core::StaticMetadataSlice(&refcounts[48].base, 3, g_bytes + 778), + grpc_core::StaticMetadataSlice(&refcounts[49].base, 3, g_bytes + 781), + grpc_core::StaticMetadataSlice(&refcounts[50].base, 3, g_bytes + 784), + grpc_core::StaticMetadataSlice(&refcounts[51].base, 3, g_bytes + 787), + grpc_core::StaticMetadataSlice(&refcounts[52].base, 3, g_bytes + 790), + grpc_core::StaticMetadataSlice(&refcounts[53].base, 3, g_bytes + 793), + grpc_core::StaticMetadataSlice(&refcounts[54].base, 3, g_bytes + 796), + grpc_core::StaticMetadataSlice(&refcounts[55].base, 14, g_bytes + 799), + grpc_core::StaticMetadataSlice(&refcounts[56].base, 13, g_bytes + 813), + grpc_core::StaticMetadataSlice(&refcounts[57].base, 15, g_bytes + 826), + grpc_core::StaticMetadataSlice(&refcounts[58].base, 13, g_bytes + 841), + grpc_core::StaticMetadataSlice(&refcounts[59].base, 6, g_bytes + 854), + grpc_core::StaticMetadataSlice(&refcounts[60].base, 27, g_bytes + 860), + grpc_core::StaticMetadataSlice(&refcounts[61].base, 3, g_bytes + 887), + grpc_core::StaticMetadataSlice(&refcounts[62].base, 5, g_bytes + 890), + grpc_core::StaticMetadataSlice(&refcounts[63].base, 13, g_bytes + 895), + grpc_core::StaticMetadataSlice(&refcounts[64].base, 13, g_bytes + 908), + grpc_core::StaticMetadataSlice(&refcounts[65].base, 19, g_bytes + 921), + grpc_core::StaticMetadataSlice(&refcounts[66].base, 16, g_bytes + 940), + grpc_core::StaticMetadataSlice(&refcounts[67].base, 14, g_bytes + 956), + grpc_core::StaticMetadataSlice(&refcounts[68].base, 16, g_bytes + 970), + grpc_core::StaticMetadataSlice(&refcounts[69].base, 13, g_bytes + 986), + grpc_core::StaticMetadataSlice(&refcounts[70].base, 6, g_bytes + 999), + grpc_core::StaticMetadataSlice(&refcounts[71].base, 4, g_bytes + 1005), + grpc_core::StaticMetadataSlice(&refcounts[72].base, 4, g_bytes + 1009), + grpc_core::StaticMetadataSlice(&refcounts[73].base, 6, g_bytes + 1013), + grpc_core::StaticMetadataSlice(&refcounts[74].base, 7, g_bytes + 1019), + grpc_core::StaticMetadataSlice(&refcounts[75].base, 4, g_bytes + 1026), + grpc_core::StaticMetadataSlice(&refcounts[76].base, 8, g_bytes + 1030), + grpc_core::StaticMetadataSlice(&refcounts[77].base, 17, g_bytes + 1038), + grpc_core::StaticMetadataSlice(&refcounts[78].base, 13, g_bytes + 1055), + grpc_core::StaticMetadataSlice(&refcounts[79].base, 8, g_bytes + 1068), + grpc_core::StaticMetadataSlice(&refcounts[80].base, 19, g_bytes + 1076), + grpc_core::StaticMetadataSlice(&refcounts[81].base, 13, g_bytes + 1095), + grpc_core::StaticMetadataSlice(&refcounts[82].base, 4, g_bytes + 1108), + grpc_core::StaticMetadataSlice(&refcounts[83].base, 8, g_bytes + 1112), + grpc_core::StaticMetadataSlice(&refcounts[84].base, 12, g_bytes + 1120), + grpc_core::StaticMetadataSlice(&refcounts[85].base, 18, g_bytes + 1132), + grpc_core::StaticMetadataSlice(&refcounts[86].base, 19, g_bytes + 1150), + grpc_core::StaticMetadataSlice(&refcounts[87].base, 5, g_bytes + 1169), + grpc_core::StaticMetadataSlice(&refcounts[88].base, 7, g_bytes + 1174), + grpc_core::StaticMetadataSlice(&refcounts[89].base, 7, g_bytes + 1181), + grpc_core::StaticMetadataSlice(&refcounts[90].base, 11, g_bytes + 1188), + grpc_core::StaticMetadataSlice(&refcounts[91].base, 6, g_bytes + 1199), + grpc_core::StaticMetadataSlice(&refcounts[92].base, 10, g_bytes + 1205), + grpc_core::StaticMetadataSlice(&refcounts[93].base, 25, g_bytes + 1215), + grpc_core::StaticMetadataSlice(&refcounts[94].base, 17, g_bytes + 1240), + grpc_core::StaticMetadataSlice(&refcounts[95].base, 4, g_bytes + 1257), + grpc_core::StaticMetadataSlice(&refcounts[96].base, 3, g_bytes + 1261), + grpc_core::StaticMetadataSlice(&refcounts[97].base, 16, g_bytes + 1264), + grpc_core::StaticMetadataSlice(&refcounts[98].base, 1, g_bytes + 1280), + grpc_core::StaticMetadataSlice(&refcounts[99].base, 8, g_bytes + 1281), + grpc_core::StaticMetadataSlice(&refcounts[100].base, 8, g_bytes + 1289), + grpc_core::StaticMetadataSlice(&refcounts[101].base, 16, g_bytes + 1297), + grpc_core::StaticMetadataSlice(&refcounts[102].base, 4, g_bytes + 1313), + grpc_core::StaticMetadataSlice(&refcounts[103].base, 3, g_bytes + 1317), + grpc_core::StaticMetadataSlice(&refcounts[104].base, 11, g_bytes + 1320), + grpc_core::StaticMetadataSlice(&refcounts[105].base, 16, g_bytes + 1331), + grpc_core::StaticMetadataSlice(&refcounts[106].base, 13, g_bytes + 1347), + grpc_core::StaticMetadataSlice(&refcounts[107].base, 12, g_bytes + 1360), + grpc_core::StaticMetadataSlice(&refcounts[108].base, 21, g_bytes + 1372), }; StaticMetadata static_mdelem_table[GRPC_STATIC_MDELEM_COUNT] = { StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[3].base, 10, g_bytes + 19), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 0), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[1].base, 7, g_bytes + 5), - grpc_core::StaticMetadataSlice(&refcounts[41].base, 3, g_bytes + 723), + grpc_core::StaticMetadataSlice(&refcounts[42].base, 3, g_bytes + 750), 1), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[1].base, 7, g_bytes + 5), - grpc_core::StaticMetadataSlice(&refcounts[42].base, 4, g_bytes + 726), + grpc_core::StaticMetadataSlice(&refcounts[43].base, 4, g_bytes + 753), 2), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[0].base, 5, g_bytes + 0), - grpc_core::StaticMetadataSlice(&refcounts[43].base, 1, g_bytes + 730), + grpc_core::StaticMetadataSlice(&refcounts[44].base, 1, g_bytes + 757), 3), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[0].base, 5, g_bytes + 0), - grpc_core::StaticMetadataSlice(&refcounts[44].base, 11, - g_bytes + 731), + grpc_core::StaticMetadataSlice(&refcounts[45].base, 11, + g_bytes + 758), 4), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[4].base, 7, g_bytes + 29), - grpc_core::StaticMetadataSlice(&refcounts[45].base, 4, g_bytes + 742), + grpc_core::StaticMetadataSlice(&refcounts[46].base, 4, g_bytes + 769), 5), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[4].base, 7, g_bytes + 29), - grpc_core::StaticMetadataSlice(&refcounts[46].base, 5, g_bytes + 746), + grpc_core::StaticMetadataSlice(&refcounts[47].base, 5, g_bytes + 773), 6), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12), - grpc_core::StaticMetadataSlice(&refcounts[47].base, 3, g_bytes + 751), + grpc_core::StaticMetadataSlice(&refcounts[48].base, 3, g_bytes + 778), 7), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12), - grpc_core::StaticMetadataSlice(&refcounts[48].base, 3, g_bytes + 754), + grpc_core::StaticMetadataSlice(&refcounts[49].base, 3, g_bytes + 781), 8), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12), - grpc_core::StaticMetadataSlice(&refcounts[49].base, 3, g_bytes + 757), + grpc_core::StaticMetadataSlice(&refcounts[50].base, 3, g_bytes + 784), 9), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12), - grpc_core::StaticMetadataSlice(&refcounts[50].base, 3, g_bytes + 760), + grpc_core::StaticMetadataSlice(&refcounts[51].base, 3, g_bytes + 787), 10), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12), - grpc_core::StaticMetadataSlice(&refcounts[51].base, 3, g_bytes + 763), + grpc_core::StaticMetadataSlice(&refcounts[52].base, 3, g_bytes + 790), 11), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12), - grpc_core::StaticMetadataSlice(&refcounts[52].base, 3, g_bytes + 766), + grpc_core::StaticMetadataSlice(&refcounts[53].base, 3, g_bytes + 793), 12), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12), - grpc_core::StaticMetadataSlice(&refcounts[53].base, 3, g_bytes + 769), + grpc_core::StaticMetadataSlice(&refcounts[54].base, 3, g_bytes + 796), 13), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[54].base, 14, - g_bytes + 772), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[55].base, 14, + g_bytes + 799), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 14), StaticMetadata(grpc_core::StaticMetadataSlice(&refcounts[16].base, 15, g_bytes + 186), - grpc_core::StaticMetadataSlice(&refcounts[55].base, 13, - g_bytes + 786), + grpc_core::StaticMetadataSlice(&refcounts[56].base, 13, + g_bytes + 813), 15), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[56].base, 15, - g_bytes + 799), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[57].base, 15, + g_bytes + 826), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 16), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[57].base, 13, - g_bytes + 814), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[58].base, 13, + g_bytes + 841), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 17), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[58].base, 6, g_bytes + 827), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[59].base, 6, g_bytes + 854), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 18), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[59].base, 27, - g_bytes + 833), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[60].base, 27, + g_bytes + 860), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 19), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[60].base, 3, g_bytes + 860), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[61].base, 3, g_bytes + 887), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 20), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[61].base, 5, g_bytes + 863), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[62].base, 5, g_bytes + 890), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 21), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[62].base, 13, - g_bytes + 868), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[63].base, 13, + g_bytes + 895), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 22), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[63].base, 13, - g_bytes + 881), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[64].base, 13, + g_bytes + 908), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 23), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[64].base, 19, - g_bytes + 894), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[65].base, 19, + g_bytes + 921), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 24), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[15].base, 16, g_bytes + 170), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 25), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[65].base, 16, - g_bytes + 913), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[66].base, 16, + g_bytes + 940), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 26), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[66].base, 14, - g_bytes + 929), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[67].base, 14, + g_bytes + 956), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 27), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[67].base, 16, - g_bytes + 943), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[68].base, 16, + g_bytes + 970), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 28), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[68].base, 13, - g_bytes + 959), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[69].base, 13, + g_bytes + 986), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 29), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[14].base, 12, g_bytes + 158), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 30), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[69].base, 6, g_bytes + 972), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[70].base, 6, g_bytes + 999), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 31), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[70].base, 4, g_bytes + 978), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[71].base, 4, + g_bytes + 1005), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 32), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[71].base, 4, g_bytes + 982), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[72].base, 4, + g_bytes + 1009), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 33), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[72].base, 6, g_bytes + 986), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[73].base, 6, + g_bytes + 1013), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 34), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[73].base, 7, g_bytes + 992), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[74].base, 7, + g_bytes + 1019), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 35), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[74].base, 4, g_bytes + 999), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[75].base, 4, + g_bytes + 1026), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 36), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[20].base, 4, g_bytes + 278), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 37), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[75].base, 8, - g_bytes + 1003), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[76].base, 8, + g_bytes + 1030), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 38), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[76].base, 17, - g_bytes + 1011), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[77].base, 17, + g_bytes + 1038), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 39), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[77].base, 13, - g_bytes + 1028), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[78].base, 13, + g_bytes + 1055), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 40), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[78].base, 8, - g_bytes + 1041), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[79].base, 8, + g_bytes + 1068), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 41), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[79].base, 19, - g_bytes + 1049), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[80].base, 19, + g_bytes + 1076), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 42), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[80].base, 13, - g_bytes + 1068), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[81].base, 13, + g_bytes + 1095), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 43), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[81].base, 4, - g_bytes + 1081), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[82].base, 4, + g_bytes + 1108), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 44), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[82].base, 8, - g_bytes + 1085), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[83].base, 8, + g_bytes + 1112), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 45), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[83].base, 12, - g_bytes + 1093), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[84].base, 12, + g_bytes + 1120), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 46), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[84].base, 18, - g_bytes + 1105), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[85].base, 18, + g_bytes + 1132), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 47), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[85].base, 19, - g_bytes + 1123), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[86].base, 19, + g_bytes + 1150), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 48), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[86].base, 5, - g_bytes + 1142), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[87].base, 5, + g_bytes + 1169), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 49), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[87].base, 7, - g_bytes + 1147), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[88].base, 7, + g_bytes + 1174), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 50), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[88].base, 7, - g_bytes + 1154), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[89].base, 7, + g_bytes + 1181), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 51), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[89].base, 11, - g_bytes + 1161), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[90].base, 11, + g_bytes + 1188), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 52), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[90].base, 6, - g_bytes + 1172), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[91].base, 6, + g_bytes + 1199), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 53), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[91].base, 10, - g_bytes + 1178), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[92].base, 10, + g_bytes + 1205), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 54), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[92].base, 25, - g_bytes + 1188), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[93].base, 25, + g_bytes + 1215), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 55), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[93].base, 17, - g_bytes + 1213), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[94].base, 17, + g_bytes + 1240), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 56), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[19].base, 10, g_bytes + 268), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 57), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[94].base, 4, - g_bytes + 1230), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[95].base, 4, + g_bytes + 1257), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 58), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[95].base, 3, - g_bytes + 1234), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[96].base, 3, + g_bytes + 1261), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 59), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[96].base, 16, - g_bytes + 1237), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[97].base, 16, + g_bytes + 1264), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 60), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[7].base, 11, g_bytes + 50), - grpc_core::StaticMetadataSlice(&refcounts[97].base, 1, - g_bytes + 1253), + grpc_core::StaticMetadataSlice(&refcounts[98].base, 1, + g_bytes + 1280), 61), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[7].base, 11, g_bytes + 50), - grpc_core::StaticMetadataSlice(&refcounts[24].base, 1, g_bytes + 342), + grpc_core::StaticMetadataSlice(&refcounts[25].base, 1, g_bytes + 369), 62), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[7].base, 11, g_bytes + 50), - grpc_core::StaticMetadataSlice(&refcounts[25].base, 1, g_bytes + 343), + grpc_core::StaticMetadataSlice(&refcounts[26].base, 1, g_bytes + 370), 63), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[9].base, 13, g_bytes + 77), - grpc_core::StaticMetadataSlice(&refcounts[98].base, 8, - g_bytes + 1254), + grpc_core::StaticMetadataSlice(&refcounts[99].base, 8, + g_bytes + 1281), 64), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[9].base, 13, g_bytes + 77), - grpc_core::StaticMetadataSlice(&refcounts[39].base, 4, g_bytes + 708), + grpc_core::StaticMetadataSlice(&refcounts[40].base, 4, g_bytes + 735), 65), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[9].base, 13, g_bytes + 77), - grpc_core::StaticMetadataSlice(&refcounts[38].base, 7, g_bytes + 701), + grpc_core::StaticMetadataSlice(&refcounts[39].base, 7, g_bytes + 728), 66), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[5].base, 2, g_bytes + 36), - grpc_core::StaticMetadataSlice(&refcounts[99].base, 8, - g_bytes + 1262), + grpc_core::StaticMetadataSlice(&refcounts[100].base, 8, + g_bytes + 1289), 67), StaticMetadata(grpc_core::StaticMetadataSlice(&refcounts[14].base, 12, g_bytes + 158), - grpc_core::StaticMetadataSlice(&refcounts[100].base, 16, - g_bytes + 1270), + grpc_core::StaticMetadataSlice(&refcounts[101].base, 16, + g_bytes + 1297), 68), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[4].base, 7, g_bytes + 29), - grpc_core::StaticMetadataSlice(&refcounts[101].base, 4, - g_bytes + 1286), + grpc_core::StaticMetadataSlice(&refcounts[102].base, 4, + g_bytes + 1313), 69), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[1].base, 7, g_bytes + 5), - grpc_core::StaticMetadataSlice(&refcounts[102].base, 3, - g_bytes + 1290), + grpc_core::StaticMetadataSlice(&refcounts[103].base, 3, + g_bytes + 1317), 70), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[16].base, 15, g_bytes + 186), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 71), StaticMetadata(grpc_core::StaticMetadataSlice(&refcounts[15].base, 16, g_bytes + 170), - grpc_core::StaticMetadataSlice(&refcounts[98].base, 8, - g_bytes + 1254), + grpc_core::StaticMetadataSlice(&refcounts[99].base, 8, + g_bytes + 1281), 72), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[15].base, 16, g_bytes + 170), - grpc_core::StaticMetadataSlice(&refcounts[39].base, 4, g_bytes + 708), + grpc_core::StaticMetadataSlice(&refcounts[40].base, 4, g_bytes + 735), 73), StaticMetadata( - grpc_core::StaticMetadataSlice(&refcounts[103].base, 11, - g_bytes + 1293), - grpc_core::StaticMetadataSlice(&refcounts[28].base, 0, g_bytes + 346), + grpc_core::StaticMetadataSlice(&refcounts[104].base, 11, + g_bytes + 1320), + grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373), 74), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90), - grpc_core::StaticMetadataSlice(&refcounts[98].base, 8, - g_bytes + 1254), + grpc_core::StaticMetadataSlice(&refcounts[99].base, 8, + g_bytes + 1281), 75), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90), - grpc_core::StaticMetadataSlice(&refcounts[38].base, 7, g_bytes + 701), + grpc_core::StaticMetadataSlice(&refcounts[39].base, 7, g_bytes + 728), 76), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90), - grpc_core::StaticMetadataSlice(&refcounts[104].base, 16, - g_bytes + 1304), + grpc_core::StaticMetadataSlice(&refcounts[105].base, 16, + g_bytes + 1331), 77), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90), - grpc_core::StaticMetadataSlice(&refcounts[39].base, 4, g_bytes + 708), + grpc_core::StaticMetadataSlice(&refcounts[40].base, 4, g_bytes + 735), 78), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90), - grpc_core::StaticMetadataSlice(&refcounts[105].base, 13, - g_bytes + 1320), + grpc_core::StaticMetadataSlice(&refcounts[106].base, 13, + g_bytes + 1347), 79), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90), - grpc_core::StaticMetadataSlice(&refcounts[106].base, 12, - g_bytes + 1333), + grpc_core::StaticMetadataSlice(&refcounts[107].base, 12, + g_bytes + 1360), 80), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90), - grpc_core::StaticMetadataSlice(&refcounts[107].base, 21, - g_bytes + 1345), + grpc_core::StaticMetadataSlice(&refcounts[108].base, 21, + g_bytes + 1372), 81), StaticMetadata(grpc_core::StaticMetadataSlice(&refcounts[16].base, 15, g_bytes + 186), - grpc_core::StaticMetadataSlice(&refcounts[98].base, 8, - g_bytes + 1254), + grpc_core::StaticMetadataSlice(&refcounts[99].base, 8, + g_bytes + 1281), 82), StaticMetadata( grpc_core::StaticMetadataSlice(&refcounts[16].base, 15, g_bytes + 186), - grpc_core::StaticMetadataSlice(&refcounts[39].base, 4, g_bytes + 708), + grpc_core::StaticMetadataSlice(&refcounts[40].base, 4, g_bytes + 735), 83), StaticMetadata(grpc_core::StaticMetadataSlice(&refcounts[16].base, 15, g_bytes + 186), - grpc_core::StaticMetadataSlice(&refcounts[105].base, 13, - g_bytes + 1320), + grpc_core::StaticMetadataSlice(&refcounts[106].base, 13, + g_bytes + 1347), 84), }; @@ -1181,17 +1189,17 @@ uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 6, 6, 8, 8, 2, 4, 4}; static const int8_t elems_r[] = { - 15, 10, -8, 0, 2, -43, -80, -44, 0, 4, -8, 0, 0, 0, 6, -1, - -8, 0, 0, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, -65, 0, -68, -69, -50, -72, -73, 0, 32, 31, - 30, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 17, - 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 4, 3, - 3, 7, 0, 0, 0, 0, 0, 0, -5, 0}; + 15, 10, -8, 0, 2, -43, -81, -44, 0, 4, -8, 0, 0, 0, 6, -1, + -8, 0, 0, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, -67, 0, -38, -50, -56, -76, 0, 46, 28, + 27, 26, 25, 24, 23, 23, 22, 21, 20, 19, 24, 16, 15, 14, 13, 15, + 14, 14, 13, 12, 11, 10, 9, 8, 7, 6, 6, 5, 4, 3, 2, 3, + 2, 2, 6, 0, 0, 0, 0, 0, 0, -6, 0}; static uint32_t elems_phash(uint32_t i) { - i -= 43; - uint32_t x = i % 106; - uint32_t y = i / 106; + i -= 44; + uint32_t x = i % 107; + uint32_t y = i / 107; uint32_t h = x; if (y < GPR_ARRAY_SIZE(elems_r)) { uint32_t delta = (uint32_t)elems_r[y]; @@ -1201,29 +1209,31 @@ static uint32_t elems_phash(uint32_t i) { } static const uint16_t elem_keys[] = { - 263, 264, 265, 266, 267, 268, 269, 1118, 1119, 1756, 149, 150, - 477, 478, 1648, 43, 44, 1010, 1011, 1540, 1767, 780, 781, 639, - 853, 1659, 2080, 2188, 5860, 6076, 6184, 6400, 6508, 6616, 6724, 6832, - 1783, 6940, 7048, 7156, 7264, 7372, 7480, 7588, 7696, 7804, 7912, 8020, - 8128, 8236, 8344, 6292, 8452, 8560, 8668, 8776, 8884, 8992, 9100, 9208, - 9316, 9424, 9532, 9640, 9748, 9856, 9964, 1178, 533, 10072, 10180, 210, - 10288, 1184, 1185, 1186, 1187, 1070, 10396, 1826, 11152, 0, 0, 0, - 1718, 0, 1833, 0, 0, 352, 0, 1612, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0}; + 266, 267, 268, 269, 270, 271, 272, 1129, 1130, 1773, 151, + 152, 482, 483, 1664, 44, 45, 1020, 1021, 1555, 1784, 788, + 789, 645, 861, 1675, 2100, 2209, 6024, 6569, 6787, 6896, 7005, + 7114, 7223, 7332, 1800, 7441, 7550, 7659, 7768, 7877, 8095, 8204, + 8313, 8422, 6678, 6460, 7986, 8531, 8640, 6351, 8749, 8858, 8967, + 9076, 9185, 9294, 9403, 9512, 9621, 6242, 9730, 9839, 9948, 10057, + 10166, 1189, 538, 10275, 10384, 212, 10493, 1195, 1196, 1197, 1198, + 1080, 10602, 1843, 11365, 0, 0, 0, 1734, 0, 1850, 0, + 0, 0, 356, 1627, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0}; static const uint8_t elem_idxs[] = { - 7, 8, 9, 10, 11, 12, 13, 76, 78, 71, 1, 2, 5, 6, 25, 3, - 4, 66, 65, 30, 83, 62, 63, 67, 61, 73, 57, 37, 14, 16, 17, 19, - 20, 21, 22, 23, 15, 24, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, - 38, 39, 40, 18, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 75, 69, 56, 58, 70, 59, 77, 79, 80, 81, 64, 60, 82, - 74, 255, 255, 255, 72, 255, 84, 255, 255, 0, 255, 68}; + 7, 8, 9, 10, 11, 12, 13, 76, 78, 71, 1, 2, 5, 6, 25, 3, + 4, 66, 65, 30, 83, 62, 63, 67, 61, 73, 57, 37, 14, 19, 21, 22, + 23, 24, 26, 27, 15, 28, 29, 31, 32, 33, 35, 36, 38, 39, 20, 18, + 34, 40, 41, 17, 42, 43, 44, 45, 46, 47, 48, 49, 50, 16, 51, 52, + 53, 54, 55, 75, 69, 56, 58, 70, 59, 77, 79, 80, 81, 64, 60, 82, + 74, 255, 255, 255, 72, 255, 84, 255, 255, 255, 0, 68}; grpc_mdelem grpc_static_mdelem_for_static_strings(intptr_t a, intptr_t b) { if (a == -1 || b == -1) return GRPC_MDNULL; - uint32_t k = static_cast(a * 108 + b); + uint32_t k = static_cast(a * 109 + b); uint32_t h = elems_phash(k); return h < GPR_ARRAY_SIZE(elem_keys) && elem_keys[h] == k && elem_idxs[h] != 255 diff --git a/src/core/lib/transport/static_metadata.h b/src/core/lib/transport/static_metadata.h index c465a2f37b7..391c6a7c4ab 100644 --- a/src/core/lib/transport/static_metadata.h +++ b/src/core/lib/transport/static_metadata.h @@ -36,7 +36,7 @@ static_assert( std::is_trivially_destructible::value, "grpc_core::StaticMetadataSlice must be trivially destructible."); -#define GRPC_STATIC_MDSTR_COUNT 108 +#define GRPC_STATIC_MDSTR_COUNT 109 void grpc_init_static_metadata_ctx(void); void grpc_destroy_static_metadata_ctx(void); @@ -102,185 +102,187 @@ inline const grpc_core::StaticMetadataSlice* grpc_static_slice_table() { #define GRPC_MDSTR_GRPC_PREVIOUS_RPC_ATTEMPTS (grpc_static_slice_table()[21]) /* "grpc-retry-pushback-ms" */ #define GRPC_MDSTR_GRPC_RETRY_PUSHBACK_MS (grpc_static_slice_table()[22]) +/* "x-endpoint-load-metrics-bin" */ +#define GRPC_MDSTR_X_ENDPOINT_LOAD_METRICS_BIN (grpc_static_slice_table()[23]) /* "grpc-timeout" */ -#define GRPC_MDSTR_GRPC_TIMEOUT (grpc_static_slice_table()[23]) +#define GRPC_MDSTR_GRPC_TIMEOUT (grpc_static_slice_table()[24]) /* "1" */ -#define GRPC_MDSTR_1 (grpc_static_slice_table()[24]) +#define GRPC_MDSTR_1 (grpc_static_slice_table()[25]) /* "2" */ -#define GRPC_MDSTR_2 (grpc_static_slice_table()[25]) +#define GRPC_MDSTR_2 (grpc_static_slice_table()[26]) /* "3" */ -#define GRPC_MDSTR_3 (grpc_static_slice_table()[26]) +#define GRPC_MDSTR_3 (grpc_static_slice_table()[27]) /* "4" */ -#define GRPC_MDSTR_4 (grpc_static_slice_table()[27]) +#define GRPC_MDSTR_4 (grpc_static_slice_table()[28]) /* "" */ -#define GRPC_MDSTR_EMPTY (grpc_static_slice_table()[28]) +#define GRPC_MDSTR_EMPTY (grpc_static_slice_table()[29]) /* "grpc.wait_for_ready" */ -#define GRPC_MDSTR_GRPC_DOT_WAIT_FOR_READY (grpc_static_slice_table()[29]) +#define GRPC_MDSTR_GRPC_DOT_WAIT_FOR_READY (grpc_static_slice_table()[30]) /* "grpc.timeout" */ -#define GRPC_MDSTR_GRPC_DOT_TIMEOUT (grpc_static_slice_table()[30]) +#define GRPC_MDSTR_GRPC_DOT_TIMEOUT (grpc_static_slice_table()[31]) /* "grpc.max_request_message_bytes" */ #define GRPC_MDSTR_GRPC_DOT_MAX_REQUEST_MESSAGE_BYTES \ - (grpc_static_slice_table()[31]) + (grpc_static_slice_table()[32]) /* "grpc.max_response_message_bytes" */ #define GRPC_MDSTR_GRPC_DOT_MAX_RESPONSE_MESSAGE_BYTES \ - (grpc_static_slice_table()[32]) + (grpc_static_slice_table()[33]) /* "/grpc.lb.v1.LoadBalancer/BalanceLoad" */ #define GRPC_MDSTR_SLASH_GRPC_DOT_LB_DOT_V1_DOT_LOADBALANCER_SLASH_BALANCELOAD \ - (grpc_static_slice_table()[33]) + (grpc_static_slice_table()[34]) /* "/envoy.service.load_stats.v2.LoadReportingService/StreamLoadStats" */ #define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_LOAD_STATS_DOT_V2_DOT_LOADREPORTINGSERVICE_SLASH_STREAMLOADSTATS \ - (grpc_static_slice_table()[34]) + (grpc_static_slice_table()[35]) /* "/envoy.api.v2.EndpointDiscoveryService/StreamEndpoints" */ #define GRPC_MDSTR_SLASH_ENVOY_DOT_API_DOT_V2_DOT_ENDPOINTDISCOVERYSERVICE_SLASH_STREAMENDPOINTS \ - (grpc_static_slice_table()[35]) + (grpc_static_slice_table()[36]) /* "/grpc.health.v1.Health/Watch" */ #define GRPC_MDSTR_SLASH_GRPC_DOT_HEALTH_DOT_V1_DOT_HEALTH_SLASH_WATCH \ - (grpc_static_slice_table()[36]) + (grpc_static_slice_table()[37]) /* "/envoy.service.discovery.v2.AggregatedDiscoveryService/StreamAggregatedResources" */ #define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_DISCOVERY_DOT_V2_DOT_AGGREGATEDDISCOVERYSERVICE_SLASH_STREAMAGGREGATEDRESOURCES \ - (grpc_static_slice_table()[37]) + (grpc_static_slice_table()[38]) /* "deflate" */ -#define GRPC_MDSTR_DEFLATE (grpc_static_slice_table()[38]) +#define GRPC_MDSTR_DEFLATE (grpc_static_slice_table()[39]) /* "gzip" */ -#define GRPC_MDSTR_GZIP (grpc_static_slice_table()[39]) +#define GRPC_MDSTR_GZIP (grpc_static_slice_table()[40]) /* "stream/gzip" */ -#define GRPC_MDSTR_STREAM_SLASH_GZIP (grpc_static_slice_table()[40]) +#define GRPC_MDSTR_STREAM_SLASH_GZIP (grpc_static_slice_table()[41]) /* "GET" */ -#define GRPC_MDSTR_GET (grpc_static_slice_table()[41]) +#define GRPC_MDSTR_GET (grpc_static_slice_table()[42]) /* "POST" */ -#define GRPC_MDSTR_POST (grpc_static_slice_table()[42]) +#define GRPC_MDSTR_POST (grpc_static_slice_table()[43]) /* "/" */ -#define GRPC_MDSTR_SLASH (grpc_static_slice_table()[43]) +#define GRPC_MDSTR_SLASH (grpc_static_slice_table()[44]) /* "/index.html" */ -#define GRPC_MDSTR_SLASH_INDEX_DOT_HTML (grpc_static_slice_table()[44]) +#define GRPC_MDSTR_SLASH_INDEX_DOT_HTML (grpc_static_slice_table()[45]) /* "http" */ -#define GRPC_MDSTR_HTTP (grpc_static_slice_table()[45]) +#define GRPC_MDSTR_HTTP (grpc_static_slice_table()[46]) /* "https" */ -#define GRPC_MDSTR_HTTPS (grpc_static_slice_table()[46]) +#define GRPC_MDSTR_HTTPS (grpc_static_slice_table()[47]) /* "200" */ -#define GRPC_MDSTR_200 (grpc_static_slice_table()[47]) +#define GRPC_MDSTR_200 (grpc_static_slice_table()[48]) /* "204" */ -#define GRPC_MDSTR_204 (grpc_static_slice_table()[48]) +#define GRPC_MDSTR_204 (grpc_static_slice_table()[49]) /* "206" */ -#define GRPC_MDSTR_206 (grpc_static_slice_table()[49]) +#define GRPC_MDSTR_206 (grpc_static_slice_table()[50]) /* "304" */ -#define GRPC_MDSTR_304 (grpc_static_slice_table()[50]) +#define GRPC_MDSTR_304 (grpc_static_slice_table()[51]) /* "400" */ -#define GRPC_MDSTR_400 (grpc_static_slice_table()[51]) +#define GRPC_MDSTR_400 (grpc_static_slice_table()[52]) /* "404" */ -#define GRPC_MDSTR_404 (grpc_static_slice_table()[52]) +#define GRPC_MDSTR_404 (grpc_static_slice_table()[53]) /* "500" */ -#define GRPC_MDSTR_500 (grpc_static_slice_table()[53]) +#define GRPC_MDSTR_500 (grpc_static_slice_table()[54]) /* "accept-charset" */ -#define GRPC_MDSTR_ACCEPT_CHARSET (grpc_static_slice_table()[54]) +#define GRPC_MDSTR_ACCEPT_CHARSET (grpc_static_slice_table()[55]) /* "gzip, deflate" */ -#define GRPC_MDSTR_GZIP_COMMA_DEFLATE (grpc_static_slice_table()[55]) +#define GRPC_MDSTR_GZIP_COMMA_DEFLATE (grpc_static_slice_table()[56]) /* "accept-language" */ -#define GRPC_MDSTR_ACCEPT_LANGUAGE (grpc_static_slice_table()[56]) +#define GRPC_MDSTR_ACCEPT_LANGUAGE (grpc_static_slice_table()[57]) /* "accept-ranges" */ -#define GRPC_MDSTR_ACCEPT_RANGES (grpc_static_slice_table()[57]) +#define GRPC_MDSTR_ACCEPT_RANGES (grpc_static_slice_table()[58]) /* "accept" */ -#define GRPC_MDSTR_ACCEPT (grpc_static_slice_table()[58]) +#define GRPC_MDSTR_ACCEPT (grpc_static_slice_table()[59]) /* "access-control-allow-origin" */ -#define GRPC_MDSTR_ACCESS_CONTROL_ALLOW_ORIGIN (grpc_static_slice_table()[59]) +#define GRPC_MDSTR_ACCESS_CONTROL_ALLOW_ORIGIN (grpc_static_slice_table()[60]) /* "age" */ -#define GRPC_MDSTR_AGE (grpc_static_slice_table()[60]) +#define GRPC_MDSTR_AGE (grpc_static_slice_table()[61]) /* "allow" */ -#define GRPC_MDSTR_ALLOW (grpc_static_slice_table()[61]) +#define GRPC_MDSTR_ALLOW (grpc_static_slice_table()[62]) /* "authorization" */ -#define GRPC_MDSTR_AUTHORIZATION (grpc_static_slice_table()[62]) +#define GRPC_MDSTR_AUTHORIZATION (grpc_static_slice_table()[63]) /* "cache-control" */ -#define GRPC_MDSTR_CACHE_CONTROL (grpc_static_slice_table()[63]) +#define GRPC_MDSTR_CACHE_CONTROL (grpc_static_slice_table()[64]) /* "content-disposition" */ -#define GRPC_MDSTR_CONTENT_DISPOSITION (grpc_static_slice_table()[64]) +#define GRPC_MDSTR_CONTENT_DISPOSITION (grpc_static_slice_table()[65]) /* "content-language" */ -#define GRPC_MDSTR_CONTENT_LANGUAGE (grpc_static_slice_table()[65]) +#define GRPC_MDSTR_CONTENT_LANGUAGE (grpc_static_slice_table()[66]) /* "content-length" */ -#define GRPC_MDSTR_CONTENT_LENGTH (grpc_static_slice_table()[66]) +#define GRPC_MDSTR_CONTENT_LENGTH (grpc_static_slice_table()[67]) /* "content-location" */ -#define GRPC_MDSTR_CONTENT_LOCATION (grpc_static_slice_table()[67]) +#define GRPC_MDSTR_CONTENT_LOCATION (grpc_static_slice_table()[68]) /* "content-range" */ -#define GRPC_MDSTR_CONTENT_RANGE (grpc_static_slice_table()[68]) +#define GRPC_MDSTR_CONTENT_RANGE (grpc_static_slice_table()[69]) /* "cookie" */ -#define GRPC_MDSTR_COOKIE (grpc_static_slice_table()[69]) +#define GRPC_MDSTR_COOKIE (grpc_static_slice_table()[70]) /* "date" */ -#define GRPC_MDSTR_DATE (grpc_static_slice_table()[70]) +#define GRPC_MDSTR_DATE (grpc_static_slice_table()[71]) /* "etag" */ -#define GRPC_MDSTR_ETAG (grpc_static_slice_table()[71]) +#define GRPC_MDSTR_ETAG (grpc_static_slice_table()[72]) /* "expect" */ -#define GRPC_MDSTR_EXPECT (grpc_static_slice_table()[72]) +#define GRPC_MDSTR_EXPECT (grpc_static_slice_table()[73]) /* "expires" */ -#define GRPC_MDSTR_EXPIRES (grpc_static_slice_table()[73]) +#define GRPC_MDSTR_EXPIRES (grpc_static_slice_table()[74]) /* "from" */ -#define GRPC_MDSTR_FROM (grpc_static_slice_table()[74]) +#define GRPC_MDSTR_FROM (grpc_static_slice_table()[75]) /* "if-match" */ -#define GRPC_MDSTR_IF_MATCH (grpc_static_slice_table()[75]) +#define GRPC_MDSTR_IF_MATCH (grpc_static_slice_table()[76]) /* "if-modified-since" */ -#define GRPC_MDSTR_IF_MODIFIED_SINCE (grpc_static_slice_table()[76]) +#define GRPC_MDSTR_IF_MODIFIED_SINCE (grpc_static_slice_table()[77]) /* "if-none-match" */ -#define GRPC_MDSTR_IF_NONE_MATCH (grpc_static_slice_table()[77]) +#define GRPC_MDSTR_IF_NONE_MATCH (grpc_static_slice_table()[78]) /* "if-range" */ -#define GRPC_MDSTR_IF_RANGE (grpc_static_slice_table()[78]) +#define GRPC_MDSTR_IF_RANGE (grpc_static_slice_table()[79]) /* "if-unmodified-since" */ -#define GRPC_MDSTR_IF_UNMODIFIED_SINCE (grpc_static_slice_table()[79]) +#define GRPC_MDSTR_IF_UNMODIFIED_SINCE (grpc_static_slice_table()[80]) /* "last-modified" */ -#define GRPC_MDSTR_LAST_MODIFIED (grpc_static_slice_table()[80]) +#define GRPC_MDSTR_LAST_MODIFIED (grpc_static_slice_table()[81]) /* "link" */ -#define GRPC_MDSTR_LINK (grpc_static_slice_table()[81]) +#define GRPC_MDSTR_LINK (grpc_static_slice_table()[82]) /* "location" */ -#define GRPC_MDSTR_LOCATION (grpc_static_slice_table()[82]) +#define GRPC_MDSTR_LOCATION (grpc_static_slice_table()[83]) /* "max-forwards" */ -#define GRPC_MDSTR_MAX_FORWARDS (grpc_static_slice_table()[83]) +#define GRPC_MDSTR_MAX_FORWARDS (grpc_static_slice_table()[84]) /* "proxy-authenticate" */ -#define GRPC_MDSTR_PROXY_AUTHENTICATE (grpc_static_slice_table()[84]) +#define GRPC_MDSTR_PROXY_AUTHENTICATE (grpc_static_slice_table()[85]) /* "proxy-authorization" */ -#define GRPC_MDSTR_PROXY_AUTHORIZATION (grpc_static_slice_table()[85]) +#define GRPC_MDSTR_PROXY_AUTHORIZATION (grpc_static_slice_table()[86]) /* "range" */ -#define GRPC_MDSTR_RANGE (grpc_static_slice_table()[86]) +#define GRPC_MDSTR_RANGE (grpc_static_slice_table()[87]) /* "referer" */ -#define GRPC_MDSTR_REFERER (grpc_static_slice_table()[87]) +#define GRPC_MDSTR_REFERER (grpc_static_slice_table()[88]) /* "refresh" */ -#define GRPC_MDSTR_REFRESH (grpc_static_slice_table()[88]) +#define GRPC_MDSTR_REFRESH (grpc_static_slice_table()[89]) /* "retry-after" */ -#define GRPC_MDSTR_RETRY_AFTER (grpc_static_slice_table()[89]) +#define GRPC_MDSTR_RETRY_AFTER (grpc_static_slice_table()[90]) /* "server" */ -#define GRPC_MDSTR_SERVER (grpc_static_slice_table()[90]) +#define GRPC_MDSTR_SERVER (grpc_static_slice_table()[91]) /* "set-cookie" */ -#define GRPC_MDSTR_SET_COOKIE (grpc_static_slice_table()[91]) +#define GRPC_MDSTR_SET_COOKIE (grpc_static_slice_table()[92]) /* "strict-transport-security" */ -#define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY (grpc_static_slice_table()[92]) +#define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY (grpc_static_slice_table()[93]) /* "transfer-encoding" */ -#define GRPC_MDSTR_TRANSFER_ENCODING (grpc_static_slice_table()[93]) +#define GRPC_MDSTR_TRANSFER_ENCODING (grpc_static_slice_table()[94]) /* "vary" */ -#define GRPC_MDSTR_VARY (grpc_static_slice_table()[94]) +#define GRPC_MDSTR_VARY (grpc_static_slice_table()[95]) /* "via" */ -#define GRPC_MDSTR_VIA (grpc_static_slice_table()[95]) +#define GRPC_MDSTR_VIA (grpc_static_slice_table()[96]) /* "www-authenticate" */ -#define GRPC_MDSTR_WWW_AUTHENTICATE (grpc_static_slice_table()[96]) +#define GRPC_MDSTR_WWW_AUTHENTICATE (grpc_static_slice_table()[97]) /* "0" */ -#define GRPC_MDSTR_0 (grpc_static_slice_table()[97]) +#define GRPC_MDSTR_0 (grpc_static_slice_table()[98]) /* "identity" */ -#define GRPC_MDSTR_IDENTITY (grpc_static_slice_table()[98]) +#define GRPC_MDSTR_IDENTITY (grpc_static_slice_table()[99]) /* "trailers" */ -#define GRPC_MDSTR_TRAILERS (grpc_static_slice_table()[99]) +#define GRPC_MDSTR_TRAILERS (grpc_static_slice_table()[100]) /* "application/grpc" */ -#define GRPC_MDSTR_APPLICATION_SLASH_GRPC (grpc_static_slice_table()[100]) +#define GRPC_MDSTR_APPLICATION_SLASH_GRPC (grpc_static_slice_table()[101]) /* "grpc" */ -#define GRPC_MDSTR_GRPC (grpc_static_slice_table()[101]) +#define GRPC_MDSTR_GRPC (grpc_static_slice_table()[102]) /* "PUT" */ -#define GRPC_MDSTR_PUT (grpc_static_slice_table()[102]) +#define GRPC_MDSTR_PUT (grpc_static_slice_table()[103]) /* "lb-cost-bin" */ -#define GRPC_MDSTR_LB_COST_BIN (grpc_static_slice_table()[103]) +#define GRPC_MDSTR_LB_COST_BIN (grpc_static_slice_table()[104]) /* "identity,deflate" */ -#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE (grpc_static_slice_table()[104]) +#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE (grpc_static_slice_table()[105]) /* "identity,gzip" */ -#define GRPC_MDSTR_IDENTITY_COMMA_GZIP (grpc_static_slice_table()[105]) +#define GRPC_MDSTR_IDENTITY_COMMA_GZIP (grpc_static_slice_table()[106]) /* "deflate,gzip" */ -#define GRPC_MDSTR_DEFLATE_COMMA_GZIP (grpc_static_slice_table()[106]) +#define GRPC_MDSTR_DEFLATE_COMMA_GZIP (grpc_static_slice_table()[107]) /* "identity,deflate,gzip" */ #define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE_COMMA_GZIP \ - (grpc_static_slice_table()[107]) + (grpc_static_slice_table()[108]) namespace grpc_core { struct StaticSliceRefcount; @@ -538,6 +540,7 @@ typedef enum { GRPC_BATCH_HOST, GRPC_BATCH_GRPC_PREVIOUS_RPC_ATTEMPTS, GRPC_BATCH_GRPC_RETRY_PUSHBACK_MS, + GRPC_BATCH_X_ENDPOINT_LOAD_METRICS_BIN, GRPC_BATCH_CALLOUTS_COUNT } grpc_metadata_batch_callouts_index; @@ -567,6 +570,7 @@ typedef union { struct grpc_linked_mdelem* host; struct grpc_linked_mdelem* grpc_previous_rpc_attempts; struct grpc_linked_mdelem* grpc_retry_pushback_ms; + struct grpc_linked_mdelem* x_endpoint_load_metrics_bin; } named; } grpc_metadata_batch_callouts; diff --git a/src/proto/grpc/lb/v2/BUILD b/src/proto/grpc/lb/v2/BUILD index e47f170e14b..25b3dd3644a 100644 --- a/src/proto/grpc/lb/v2/BUILD +++ b/src/proto/grpc/lb/v2/BUILD @@ -39,3 +39,10 @@ grpc_proto_library( well_known_protos = True, deps = ["eds_for_test_proto"], ) + +grpc_proto_library( + name = "orca_load_report_for_test_proto", + srcs = [ + "orca_load_report_for_test.proto", + ], +) diff --git a/src/proto/grpc/lb/v2/eds_for_test.proto b/src/proto/grpc/lb/v2/eds_for_test.proto index 3126095c92d..e5c4f606407 100644 --- a/src/proto/grpc/lb/v2/eds_for_test.proto +++ b/src/proto/grpc/lb/v2/eds_for_test.proto @@ -16,8 +16,12 @@ // the gRPC library; otherwise there can be duplicate definition problems if // users depend on both gRPC and Envoy. It can only be used by gRPC tests. // -// TODO(juanlishen): It's a workaround and should be removed once we have a -// clean solution to use protobuf and external proto files. +// TODO(juanlishen): This file is a hack to avoid a problem we're +// currently having where we can't depend on a proto file in an external +// repo due to bazel limitations. Once that's fixed, this should be +// removed. Until this, it should be used in the gRPC tests only, or else it +// will cause a conflict due to the same proto messages being defined in +// multiple files in the same binary. syntax = "proto3"; diff --git a/src/proto/grpc/lb/v2/lrs_for_test.proto b/src/proto/grpc/lb/v2/lrs_for_test.proto index 76c560a99cf..504b6e752ce 100644 --- a/src/proto/grpc/lb/v2/lrs_for_test.proto +++ b/src/proto/grpc/lb/v2/lrs_for_test.proto @@ -14,9 +14,12 @@ // This file contains the eds protocol and its dependency. // -// TODO(juanlishen): It's a workaround and should be removed once we have a -// clean solution to the circular dependency between the envoy data plane APIs -// and gRPC. We can't check in this file due to conflict with internal code. +// TODO(juanlishen): This file is a hack to avoid a problem we're +// currently having where we can't depend on a proto file in an external +// repo due to bazel limitations. Once that's fixed, this should be +// removed. Until this, it should be used in the gRPC tests only, or else it +// will cause a conflict due to the same proto messages being defined in +// multiple files in the same binary. syntax = "proto3"; diff --git a/src/proto/grpc/lb/v2/orca_load_report_for_test.proto b/src/proto/grpc/lb/v2/orca_load_report_for_test.proto new file mode 100644 index 00000000000..1feaedd6a40 --- /dev/null +++ b/src/proto/grpc/lb/v2/orca_load_report_for_test.proto @@ -0,0 +1,58 @@ +// Copyright 2019 The gRPC Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file contains a copy of the ORCA load reporting protos, with the +// validation options stripped out to avoid the extra dependency on +// protoc-gen-validate. +// +// TODO(juanlishen): This file is a hack to avoid a problem we're +// currently having where we can't depend on a proto file in an external +// repo due to bazel limitations. Once that's fixed, this should be +// removed. Until this, it should be used in the gRPC tests only, or else it +// will cause a conflict due to the same proto messages being defined in +// multiple files in the same binary. + +syntax = "proto3"; + +package udpa.data.orca.v1; + +option java_outer_classname = "OrcaLoadReportProto"; +option java_multiple_files = true; +option java_package = "io.envoyproxy.udpa.data.orca.v1"; +option go_package = "v1"; + +// See section `ORCA load report format` of the design document in +// :ref:`https://github.com/envoyproxy/envoy/issues/6614`. + +message OrcaLoadReport { + // CPU utilization expressed as a fraction of available CPU resources. This + // should be derived from the latest sample or measurement. + double cpu_utilization = 1; + + // Memory utilization expressed as a fraction of available memory + // resources. This should be derived from the latest sample or measurement. + double mem_utilization = 2; + + // Total RPS being served by an endpoint. This should cover all services that an endpoint is + // responsible for. + uint64 rps = 3; + + // Application specific requests costs. Each value is an absolute cost (e.g. 3487 bytes of + // storage) associated with the request. + map request_cost = 4; + + // Resource utilization values. Each value is expressed as a fraction of total resources + // available, derived from the latest sample or measurement. + map utilization = 5; +} diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 607235556e3..6eb8bc8c9c1 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -322,6 +322,7 @@ CORE_SOURCE_FILES = [ 'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc', 'src/core/ext/transport/chttp2/client/authority.cc', 'src/core/ext/transport/chttp2/client/chttp2_connector.cc', + 'src/core/ext/filters/client_channel/backend_metric.cc', 'src/core/ext/filters/client_channel/backup_poller.cc', 'src/core/ext/filters/client_channel/channel_connectivity.cc', 'src/core/ext/filters/client_channel/client_channel.cc', @@ -350,6 +351,19 @@ CORE_SOURCE_FILES = [ 'src/core/ext/filters/client_channel/subchannel_pool_interface.cc', 'src/core/ext/filters/deadline/deadline_filter.cc', 'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c', + 'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c', + 'src/core/ext/upb-generated/gogoproto/gogo.upb.c', + 'src/core/ext/upb-generated/validate/validate.upb.c', + 'src/core/ext/upb-generated/google/api/annotations.upb.c', + 'src/core/ext/upb-generated/google/api/http.upb.c', + 'src/core/ext/upb-generated/google/protobuf/any.upb.c', + 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c', + 'src/core/ext/upb-generated/google/protobuf/duration.upb.c', + 'src/core/ext/upb-generated/google/protobuf/empty.upb.c', + 'src/core/ext/upb-generated/google/protobuf/struct.upb.c', + 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c', + 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c', + 'src/core/ext/upb-generated/google/rpc/status.upb.c', 'src/core/tsi/fake_transport_security.cc', 'src/core/tsi/local_transport_security.cc', 'src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc', @@ -369,16 +383,6 @@ CORE_SOURCE_FILES = [ 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc', 'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc', 'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c', - 'src/core/ext/upb-generated/google/api/annotations.upb.c', - 'src/core/ext/upb-generated/google/api/http.upb.c', - 'src/core/ext/upb-generated/google/protobuf/any.upb.c', - 'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c', - 'src/core/ext/upb-generated/google/protobuf/duration.upb.c', - 'src/core/ext/upb-generated/google/protobuf/empty.upb.c', - 'src/core/ext/upb-generated/google/protobuf/struct.upb.c', - 'src/core/ext/upb-generated/google/protobuf/timestamp.upb.c', - 'src/core/ext/upb-generated/google/protobuf/wrappers.upb.c', - 'src/core/ext/upb-generated/google/rpc/status.upb.c', 'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds.cc', 'src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc', @@ -387,6 +391,7 @@ CORE_SOURCE_FILES = [ 'src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/cds.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/eds.upb.c', @@ -399,11 +404,10 @@ CORE_SOURCE_FILES = [ 'src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c', + 'src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c', 'src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c', 'src/core/ext/upb-generated/envoy/type/percent.upb.c', 'src/core/ext/upb-generated/envoy/type/range.upb.c', - 'src/core/ext/upb-generated/gogoproto/gogo.upb.c', - 'src/core/ext/upb-generated/validate/validate.upb.c', 'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc', 'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc', diff --git a/test/core/end2end/fuzzers/hpack.dictionary b/test/core/end2end/fuzzers/hpack.dictionary index 921018db7f8..bc621ca2a11 100644 --- a/test/core/end2end/fuzzers/hpack.dictionary +++ b/test/core/end2end/fuzzers/hpack.dictionary @@ -22,6 +22,7 @@ "\x04host" "\x1Agrpc-previous-rpc-attempts" "\x16grpc-retry-pushback-ms" +"\x1Bx-endpoint-load-metrics-bin" "\x0Cgrpc-timeout" "\x011" "\x012" diff --git a/test/core/util/test_lb_policies.cc b/test/core/util/test_lb_policies.cc index 6225740cde7..d4ce3a27e50 100644 --- a/test/core/util/test_lb_policies.cc +++ b/test/core/util/test_lb_policies.cc @@ -191,7 +191,7 @@ class InterceptRecvTrailingMetadataLoadBalancingPolicy gpr_log(GPR_INFO, "trailing metadata:"); InterceptRecvTrailingMetadataLoadBalancingPolicy::LogMetadata( recv_trailing_metadata); - self->cb_(self->user_data_); + self->cb_(self->user_data_, call_state->GetBackendMetricData()); self->~TrailingMetadataHandler(); } diff --git a/test/core/util/test_lb_policies.h b/test/core/util/test_lb_policies.h index 6d2693a0d59..3652515e57e 100644 --- a/test/core/util/test_lb_policies.h +++ b/test/core/util/test_lb_policies.h @@ -19,9 +19,12 @@ #ifndef GRPC_TEST_CORE_UTIL_TEST_LB_POLICIES_H #define GRPC_TEST_CORE_UTIL_TEST_LB_POLICIES_H +#include "src/core/ext/filters/client_channel/lb_policy.h" + namespace grpc_core { -typedef void (*InterceptRecvTrailingMetadataCallback)(void*); +typedef void (*InterceptRecvTrailingMetadataCallback)( + void*, const LoadBalancingPolicy::BackendMetricData*); // Registers an LB policy called "intercept_trailing_metadata_lb" that // invokes cb with argument user_data when trailing metadata is received diff --git a/test/cpp/end2end/BUILD b/test/cpp/end2end/BUILD index 5567170d371..1b487602a7a 100644 --- a/test/cpp/end2end/BUILD +++ b/test/cpp/end2end/BUILD @@ -433,6 +433,7 @@ grpc_cc_test( "//:gpr", "//:grpc", "//:grpc++", + "//src/proto/grpc/lb/v2:orca_load_report_for_test_proto", "//src/proto/grpc/testing:echo_messages_proto", "//src/proto/grpc/testing:echo_proto", "//src/proto/grpc/testing/duplicate:echo_duplicate_proto", diff --git a/test/cpp/end2end/client_lb_end2end_test.cc b/test/cpp/end2end/client_lb_end2end_test.cc index ceab7506729..69feb4a5d51 100644 --- a/test/cpp/end2end/client_lb_end2end_test.cc +++ b/test/cpp/end2end/client_lb_end2end_test.cc @@ -51,6 +51,7 @@ #include "src/cpp/client/secure_credentials.h" #include "src/cpp/server/secure_server_credentials.h" +#include "src/proto/grpc/lb/v2/orca_load_report_for_test.pb.h" #include "src/proto/grpc/testing/echo.grpc.pb.h" #include "test/core/util/port.h" #include "test/core/util/test_config.h" @@ -94,15 +95,21 @@ grpc_tcp_client_vtable delayed_connect = {tcp_client_connect_with_delay}; // every call to the Echo RPC. class MyTestServiceImpl : public TestServiceImpl { public: - MyTestServiceImpl() : request_count_(0) {} - Status Echo(ServerContext* context, const EchoRequest* request, EchoResponse* response) override { + const udpa::data::orca::v1::OrcaLoadReport* load_report = nullptr; { grpc::internal::MutexLock lock(&mu_); ++request_count_; + load_report = load_report_; } AddClient(context->peer()); + if (load_report != nullptr) { + // TODO(roth): Once we provide a more standard server-side API for + // populating this data, use that API here. + context->AddTrailingMetadata("x-endpoint-load-metrics-bin", + load_report->SerializeAsString()); + } return TestServiceImpl::Echo(context, request, response); } @@ -121,6 +128,11 @@ class MyTestServiceImpl : public TestServiceImpl { return clients_; } + void set_load_report(udpa::data::orca::v1::OrcaLoadReport* load_report) { + grpc::internal::MutexLock lock(&mu_); + load_report_ = load_report; + } + private: void AddClient(const grpc::string& client) { grpc::internal::MutexLock lock(&clients_mu_); @@ -128,7 +140,8 @@ class MyTestServiceImpl : public TestServiceImpl { } grpc::internal::Mutex mu_; - int request_count_; + int request_count_ = 0; + const udpa::data::orca::v1::OrcaLoadReport* load_report_ = nullptr; grpc::internal::Mutex clients_mu_; std::set clients_; }; @@ -1506,16 +1519,40 @@ class ClientLbInterceptTrailingMetadataTest : public ClientLbEnd2endTest { return trailers_intercepted_; } + const udpa::data::orca::v1::OrcaLoadReport* backend_load_report() { + grpc::internal::MutexLock lock(&mu_); + return load_report_.get(); + } + private: - static void ReportTrailerIntercepted(void* arg) { + static void ReportTrailerIntercepted( + void* arg, const grpc_core::LoadBalancingPolicy::BackendMetricData* + backend_metric_data) { ClientLbInterceptTrailingMetadataTest* self = static_cast(arg); grpc::internal::MutexLock lock(&self->mu_); self->trailers_intercepted_++; + if (backend_metric_data != nullptr) { + self->load_report_.reset(new udpa::data::orca::v1::OrcaLoadReport); + self->load_report_->set_cpu_utilization( + backend_metric_data->cpu_utilization); + self->load_report_->set_mem_utilization( + backend_metric_data->mem_utilization); + self->load_report_->set_rps(backend_metric_data->requests_per_second); + for (const auto& p : backend_metric_data->request_cost) { + grpc_core::UniquePtr name = p.first.dup(); + (*self->load_report_->mutable_request_cost())[name.get()] = p.second; + } + for (const auto& p : backend_metric_data->utilization) { + grpc_core::UniquePtr name = p.first.dup(); + (*self->load_report_->mutable_utilization())[name.get()] = p.second; + } + } } grpc::internal::Mutex mu_; int trailers_intercepted_ = 0; + std::unique_ptr load_report_; }; TEST_F(ClientLbInterceptTrailingMetadataTest, InterceptsRetriesDisabled) { @@ -1534,6 +1571,7 @@ TEST_F(ClientLbInterceptTrailingMetadataTest, InterceptsRetriesDisabled) { EXPECT_EQ("intercept_trailing_metadata_lb", channel->GetLoadBalancingPolicyName()); EXPECT_EQ(kNumRpcs, trailers_intercepted()); + EXPECT_EQ(nullptr, backend_load_report()); } TEST_F(ClientLbInterceptTrailingMetadataTest, InterceptsRetriesEnabled) { @@ -1568,6 +1606,57 @@ TEST_F(ClientLbInterceptTrailingMetadataTest, InterceptsRetriesEnabled) { EXPECT_EQ("intercept_trailing_metadata_lb", channel->GetLoadBalancingPolicyName()); EXPECT_EQ(kNumRpcs, trailers_intercepted()); + EXPECT_EQ(nullptr, backend_load_report()); +} + +TEST_F(ClientLbInterceptTrailingMetadataTest, BackendMetricData) { + const int kNumServers = 1; + const int kNumRpcs = 10; + StartServers(kNumServers); + udpa::data::orca::v1::OrcaLoadReport load_report; + load_report.set_cpu_utilization(0.5); + load_report.set_mem_utilization(0.75); + load_report.set_rps(25); + auto* request_cost = load_report.mutable_request_cost(); + (*request_cost)["foo"] = 0.8; + (*request_cost)["bar"] = 1.4; + auto* utilization = load_report.mutable_utilization(); + (*utilization)["baz"] = 1.1; + (*utilization)["quux"] = 0.9; + for (const auto& server : servers_) { + server->service_.set_load_report(&load_report); + } + auto response_generator = BuildResolverResponseGenerator(); + auto channel = + BuildChannel("intercept_trailing_metadata_lb", response_generator); + auto stub = BuildStub(channel); + response_generator.SetNextResolution(GetServersPorts()); + for (size_t i = 0; i < kNumRpcs; ++i) { + CheckRpcSendOk(stub, DEBUG_LOCATION); + auto* actual = backend_load_report(); + ASSERT_NE(actual, nullptr); + // TODO(roth): Change this to use EqualsProto() once that becomes + // available in OSS. + EXPECT_EQ(actual->cpu_utilization(), load_report.cpu_utilization()); + EXPECT_EQ(actual->mem_utilization(), load_report.mem_utilization()); + EXPECT_EQ(actual->rps(), load_report.rps()); + EXPECT_EQ(actual->request_cost().size(), load_report.request_cost().size()); + for (const auto& p : actual->request_cost()) { + auto it = load_report.request_cost().find(p.first); + ASSERT_NE(it, load_report.request_cost().end()); + EXPECT_EQ(it->second, p.second); + } + EXPECT_EQ(actual->utilization().size(), load_report.utilization().size()); + for (const auto& p : actual->utilization()) { + auto it = load_report.utilization().find(p.first); + ASSERT_NE(it, load_report.utilization().end()); + EXPECT_EQ(it->second, p.second); + } + } + // Check LB policy name for the channel. + EXPECT_EQ("intercept_trailing_metadata_lb", + channel->GetLoadBalancingPolicyName()); + EXPECT_EQ(kNumRpcs, trailers_intercepted()); } } // namespace diff --git a/third_party/envoy-api b/third_party/envoy-api index a83394157ad..c181f78882e 160000 --- a/third_party/envoy-api +++ b/third_party/envoy-api @@ -1 +1 @@ -Subproject commit a83394157ad97f4dadbc8ed81f56ad5b3a72e542 +Subproject commit c181f78882e54c0e5c63f332562ef6954ee7932f diff --git a/third_party/udpa b/third_party/udpa new file mode 160000 index 00000000000..94324803a49 --- /dev/null +++ b/third_party/udpa @@ -0,0 +1 @@ +Subproject commit 94324803a497c8f76dbc78df393ef629d3a9f3c3 diff --git a/tools/codegen/core/gen_static_metadata.py b/tools/codegen/core/gen_static_metadata.py index d79759f541c..4ac8f9dada7 100755 --- a/tools/codegen/core/gen_static_metadata.py +++ b/tools/codegen/core/gen_static_metadata.py @@ -56,6 +56,7 @@ CONFIG = [ '3', '4', '', + 'x-endpoint-load-metrics-bin', # channel arg keys 'grpc.wait_for_ready', 'grpc.timeout', @@ -177,6 +178,7 @@ METADATA_BATCH_CALLOUTS = [ 'host', 'grpc-previous-rpc-attempts', 'grpc-retry-pushback-ms', + 'x-endpoint-load-metrics-bin', ] COMPRESSION_ALGORITHMS = [ diff --git a/tools/codegen/core/gen_upb_api.sh b/tools/codegen/core/gen_upb_api.sh index 4a9239a2828..89e664e6134 100755 --- a/tools/codegen/core/gen_upb_api.sh +++ b/tools/codegen/core/gen_upb_api.sh @@ -41,12 +41,14 @@ proto_files=( \ "envoy/api/v2/auth/cert.proto" \ "envoy/api/v2/cds.proto" \ "envoy/api/v2/cluster/circuit_breaker.proto" \ + "envoy/api/v2/cluster/filter.proto" \ "envoy/api/v2/cluster/outlier_detection.proto" \ "envoy/api/v2/core/address.proto" \ "envoy/api/v2/core/base.proto" \ "envoy/api/v2/core/config_source.proto" \ "envoy/api/v2/core/grpc_service.proto" \ "envoy/api/v2/core/health_check.proto" \ + "envoy/api/v2/core/http_uri.proto" \ "envoy/api/v2/core/protocol.proto" \ "envoy/api/v2/discovery.proto" \ "envoy/api/v2/eds.proto" \ @@ -71,13 +73,15 @@ proto_files=( \ "src/proto/grpc/gcp/handshaker.proto" \ "src/proto/grpc/gcp/transport_security_common.proto" \ "src/proto/grpc/health/v1/health.proto" \ - "src/proto/grpc/health/v1/health.proto" \ "src/proto/grpc/lb/v1/load_balancer.proto" \ + "udpa/data/orca/v1/orca_load_report.proto" \ "validate/validate.proto") for i in "${proto_files[@]}" do + echo "Compiling: ${i}" $PROTOC \ + -I=$PWD/third_party/udpa \ -I=$PWD/third_party/envoy-api \ -I=$PWD/third_party/googleapis \ -I=$PWD/third_party/protobuf/src \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index e2900b2e701..ed6f88dde3c 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -875,6 +875,8 @@ src/core/README.md \ src/core/ext/README.md \ src/core/ext/filters/census/grpc_context.cc \ src/core/ext/filters/client_channel/README.md \ +src/core/ext/filters/client_channel/backend_metric.cc \ +src/core/ext/filters/client_channel/backend_metric.h \ src/core/ext/filters/client_channel/backup_poller.cc \ src/core/ext/filters/client_channel/backup_poller.h \ src/core/ext/filters/client_channel/channel_connectivity.cc \ @@ -1065,6 +1067,8 @@ src/core/ext/upb-generated/envoy/api/v2/cds.upb.c \ src/core/ext/upb-generated/envoy/api/v2/cds.upb.h \ src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c \ src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.h \ src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c \ src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h \ src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c \ @@ -1077,6 +1081,8 @@ src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c \ src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.h \ src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c \ src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h \ +src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c \ +src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.h \ src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c \ src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h \ src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c \ @@ -1127,6 +1133,8 @@ src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c \ src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h \ src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c \ src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h \ +src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c \ +src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h \ src/core/ext/upb-generated/validate/validate.upb.c \ src/core/ext/upb-generated/validate/validate.upb.h \ src/core/lib/README.md \ diff --git a/tools/run_tests/sanity/check_submodules.sh b/tools/run_tests/sanity/check_submodules.sh index 39f3e26266c..8ad552cd399 100755 --- a/tools/run_tests/sanity/check_submodules.sh +++ b/tools/run_tests/sanity/check_submodules.sh @@ -32,7 +32,7 @@ cat << EOF | awk '{ print $1 }' | sort > "$want_submodules" b29b21a81b32ec273f118f589f46d56ad3332420 third_party/boringssl (remotes/origin/chromium-stable) afc30d43eef92979b05776ec0963c9cede5fb80f third_party/boringssl-with-bazel (fips-20180716-116-gafc30d43e) e982924acee7f7313b4baa4ee5ec000c5e373c30 third_party/cares/cares (cares-1_15_0) - a83394157ad97f4dadbc8ed81f56ad5b3a72e542 third_party/envoy-api (heads/master) + c181f78882e54c0e5c63f332562ef6954ee7932f third_party/envoy-api (heads/master) 28f50e0fed19872e0fd50dd23ce2ee8cd759338e third_party/gflags (v2.2.0-5-g30dbc81) 80ed4d0bbf65d57cc267dfc63bd2584557f11f9b third_party/googleapis (common-protos-1_3_1-915-g80ed4d0bb) c9ccac7cb7345901884aabf5d1a786cfa6e2f397 third_party/googletest (6e2f397) @@ -40,6 +40,7 @@ cat << EOF | awk '{ print $1 }' | sort > "$want_submodules" 9245d481eb3e890f708ff2d7dadf2a10c04748ba third_party/libcxxabi (heads/release_60) 09745575a923640154bcf307fba8aedff47f240a third_party/protobuf (v3.7.0-rc.2-247-g09745575) e143189bf6f37b3957fb31743df6a1bcf4a8c685 third_party/protoc-gen-validate (v0.0.10) + 94324803a497c8f76dbc78df393ef629d3a9f3c3 third_party/udpa (heads/master) 931bbecbd3230ae7f22efa5d203639facc47f719 third_party/upb (heads/master) cacf7f1d4e3d44d871b605da3b647f07d718623f third_party/zlib (v1.2.11) EOF From e70788364bf38947e9d3afb820800b14e44829b9 Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Wed, 28 Aug 2019 13:50:37 -0700 Subject: [PATCH 19/33] Make dependency on template files explicit --- third_party/py/python_configure.bzl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/third_party/py/python_configure.bzl b/third_party/py/python_configure.bzl index 70380e9dde9..6f9a178a057 100644 --- a/third_party/py/python_configure.bzl +++ b/third_party/py/python_configure.bzl @@ -292,14 +292,24 @@ def _python_autoconf_impl(repository_ctx): python_configure = repository_rule( - implementation=_python_autoconf_impl, - environ=[ + implementation = _python_autoconf_impl, + environ = [ _BAZEL_SH, _PYTHON2_BIN_PATH, _PYTHON2_LIB_PATH, _PYTHON3_BIN_PATH, _PYTHON3_LIB_PATH, ], + attrs={ + "_build_tpl": attr.label( + default = Label("//third_party/py:BUILD.tpl"), + allow_single_file = True, + ), + "_variety_tpl": attr.label( + default = Label("//third_party/py:variety.tpl"), + allow_single_file = True, + ), + }, ) """Detects and configures the local Python. From 4dfa808e75fbf0fd94a9787c596bedaabb684215 Mon Sep 17 00:00:00 2001 From: Prashant Jaikumar Date: Fri, 23 Aug 2019 17:12:41 -0700 Subject: [PATCH 20/33] Add test for timer expiry racing with cancelation --- test/cpp/common/timer_test.cc | 71 +++++++++++++++++++++++++++++------ 1 file changed, 60 insertions(+), 11 deletions(-) diff --git a/test/cpp/common/timer_test.cc b/test/cpp/common/timer_test.cc index 9b23be2885a..1abed1660e8 100644 --- a/test/cpp/common/timer_test.cc +++ b/test/cpp/common/timer_test.cc @@ -77,7 +77,7 @@ TEST_F(TimerTest, OneTimerExpires) { grpc_core::ExecCtx exec_ctx; grpc_timer timer; int timer_fired = 0; - grpc_timer_init(&timer, 500, + grpc_timer_init(&timer, grpc_core::ExecCtx::Get()->Now() + 500, GRPC_CLOSURE_CREATE( [](void* arg, grpc_error*) { int* timer_fired = static_cast(arg); @@ -102,7 +102,7 @@ TEST_F(TimerTest, MultipleTimersExpire) { grpc_timer timers[kNumTimers]; int timer_fired = 0; for (int i = 0; i < kNumTimers; ++i) { - grpc_timer_init(&timers[i], 500 + i, + grpc_timer_init(&timers[i], grpc_core::ExecCtx::Get()->Now() + 500 + i, GRPC_CLOSURE_CREATE( [](void* arg, grpc_error*) { int* timer_fired = static_cast(arg); @@ -129,7 +129,7 @@ TEST_F(TimerTest, CancelSomeTimers) { grpc_timer timers[kNumTimers]; int timer_fired = 0; for (int i = 0; i < kNumTimers; ++i) { - grpc_timer_init(&timers[i], 500 + i, + grpc_timer_init(&timers[i], grpc_core::ExecCtx::Get()->Now() + 500 + i, GRPC_CLOSURE_CREATE( [](void* arg, grpc_error* error) { if (error == GRPC_ERROR_CANCELLED) { @@ -157,17 +157,66 @@ TEST_F(TimerTest, CancelSomeTimers) { // Enable the following test after // https://github.com/grpc/grpc/issues/20049 has been fixed. -#if 0 -TEST_F(TimerTest, TimerNotCanceled) { +TEST_F(TimerTest, DISABLED_TimerNotCanceled) { grpc_core::ExecCtx exec_ctx; grpc_timer timer; - grpc_timer_init(&timer, 10000, - GRPC_CLOSURE_CREATE( - [](void*, grpc_error*) { - }, - nullptr, grpc_schedule_on_exec_ctx)); + grpc_timer_init(&timer, grpc_core::ExecCtx::Get()->Now() + 10000, + GRPC_CLOSURE_CREATE([](void*, grpc_error*) {}, nullptr, + grpc_schedule_on_exec_ctx)); +} + +// Enable the following test after +// https://github.com/grpc/grpc/issues/20064 has been fixed. +TEST_F(TimerTest, DISABLED_CancelRace) { + MAYBE_SKIP_TEST; + grpc_core::ExecCtx exec_ctx; + const int kNumTimers = 10; + grpc_timer timers[kNumTimers]; + for (int i = 0; i < kNumTimers; ++i) { + grpc_timer* arg = (i != 0) ? &timers[i - 1] : nullptr; + grpc_timer_init(&timers[i], grpc_core::ExecCtx::Get()->Now() + 100, + GRPC_CLOSURE_CREATE( + [](void* arg, grpc_error* error) { + grpc_timer* timer = static_cast(arg); + if (timer) { + grpc_timer_cancel(timer); + } + }, + arg, grpc_schedule_on_exec_ctx)); + } + gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(100)); +} + +// Enable the following test after +// https://github.com/grpc/grpc/issues/20066 has been fixed. +TEST_F(TimerTest, DISABLED_CancelNextTimer) { + MAYBE_SKIP_TEST; + grpc_core::ExecCtx exec_ctx; + const int kNumTimers = 10; + grpc_timer timers[kNumTimers]; + + for (int i = 0; i < kNumTimers; ++i) { + grpc_timer_init_unset(&timers[i]); + } + + for (int i = 0; i < kNumTimers; ++i) { + grpc_timer* arg = nullptr; + if (i < kNumTimers - 1) { + arg = &timers[i + 1]; + } + grpc_timer_init(&timers[i], grpc_core::ExecCtx::Get()->Now() + 100, + GRPC_CLOSURE_CREATE( + [](void* arg, grpc_error* error) { + grpc_timer* timer = static_cast(arg); + if (timer) { + grpc_timer_cancel(timer); + } + }, + arg, grpc_schedule_on_exec_ctx)); + } + grpc_timer_cancel(&timers[0]); + gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(100)); } -#endif int main(int argc, char** argv) { grpc::testing::TestEnvironment env(argc, argv); From d34f3663379f7e010e985860b27d9f12ba702f32 Mon Sep 17 00:00:00 2001 From: Juanli Shen Date: Wed, 28 Aug 2019 21:46:53 -0700 Subject: [PATCH 21/33] Test message size of 100MB --- test/core/util/test_config.cc | 4 +++ test/core/util/test_config.h | 3 ++ test/cpp/end2end/async_end2end_test.cc | 38 ++++++++++++++++++++++---- 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/test/core/util/test_config.cc b/test/core/util/test_config.cc index 5b248a01daa..5033dc7b66a 100644 --- a/test/core/util/test_config.cc +++ b/test/core/util/test_config.cc @@ -342,6 +342,10 @@ bool BuiltUnderUbsan() { #endif } +bool grpc_test_built_under_tsan_or_msan() { + return BuiltUnderTsan() || BuiltUnderMsan(); +}; + int64_t grpc_test_sanitizer_slowdown_factor() { int64_t sanitizer_multiplier = 1; if (BuiltUnderValgrind()) { diff --git a/test/core/util/test_config.h b/test/core/util/test_config.h index 112af3176f9..905d61f1dd6 100644 --- a/test/core/util/test_config.h +++ b/test/core/util/test_config.h @@ -24,6 +24,9 @@ extern int64_t g_fixture_slowdown_factor; extern int64_t g_poller_slowdown_factor; +/* Returns if the test is built under TSAN or MSAN. */ +bool grpc_test_built_under_tsan_or_msan(); + /* Returns an appropriate scaling factor for timeouts. */ int64_t grpc_test_slowdown_factor(); diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc index 6ca0edf123e..879f16815ee 100644 --- a/test/cpp/end2end/async_end2end_test.cc +++ b/test/cpp/end2end/async_end2end_test.cc @@ -34,6 +34,7 @@ #include "src/core/ext/filters/client_channel/backup_poller.h" #include "src/core/lib/gpr/tls.h" +#include "src/core/lib/gpr/useful.h" #include "src/core/lib/iomgr/port.h" #include "src/proto/grpc/health/v1/health.grpc.pb.h" #include "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h" @@ -59,6 +60,18 @@ namespace testing { namespace { +const size_t MAX_TEST_MESSAGE_SIZE = +#if defined(GPR_APPLE) + // The test will time out with macos build. + GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH; +#else + // Don't test extreme size under tsan or msan, because it uses too much + // memory. + grpc_test_built_under_tsan_or_msan() + ? GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH + : GPR_MAX(100 * 1024 * 1024, GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH); +#endif + void* tag(int i) { return (void*)static_cast(i); } int detag(void* p) { return static_cast(reinterpret_cast(p)); } @@ -218,6 +231,17 @@ class ServerBuilderSyncPluginDisabler : public ::grpc::ServerBuilderOption { } }; +class ServerBuilderMaxRecvMessageSizeOption + : public ::grpc::ServerBuilderOption { + public: + void UpdateArguments(ChannelArguments* arg) override { + arg->SetInt(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH, -1); + } + + void UpdatePlugins( + std::vector>* plugins) override {} +}; + class TestScenario { public: TestScenario(bool inproc_stub, const grpc::string& creds_type, bool hcs, @@ -290,6 +314,9 @@ class AsyncEnd2endTest : public ::testing::TestWithParam { std::unique_ptr sync_plugin_disabler( new ServerBuilderSyncPluginDisabler()); builder.SetOption(move(sync_plugin_disabler)); + std::unique_ptr max_recv_option( + new ServerBuilderMaxRecvMessageSizeOption()); + builder.SetOption(move(max_recv_option)); server_ = builder.BuildAndStart(); } @@ -297,6 +324,7 @@ class AsyncEnd2endTest : public ::testing::TestWithParam { ChannelArguments args; auto channel_creds = GetCredentialsProvider()->GetChannelCredentials( GetParam().credentials_type, &args); + args.SetInt(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH, -1); std::shared_ptr channel = !(GetParam().inproc) ? ::grpc::CreateCustomChannel( server_address_.str(), channel_creds, args) @@ -1822,7 +1850,7 @@ TEST_P(AsyncEnd2endServerTryCancelTest, ServerBidiStreamingTryCancelAfter) { } std::vector CreateTestScenarios(bool test_secure, - bool test_message_size_limit) { + bool test_big_message) { std::vector scenarios; std::vector credentials_types; std::vector messages; @@ -1844,9 +1872,8 @@ std::vector CreateTestScenarios(bool test_secure, GPR_ASSERT(!credentials_types.empty()); messages.push_back("Hello"); - if (test_message_size_limit) { - for (size_t k = 1; k < GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH / 1024; - k *= 32) { + if (test_big_message) { + for (size_t k = 1; k < MAX_TEST_MESSAGE_SIZE / 1024; k *= 32) { grpc::string big_msg; for (size_t i = 0; i < k * 1024; ++i) { char c = 'a' + (i % 26); @@ -1854,8 +1881,7 @@ std::vector CreateTestScenarios(bool test_secure, } messages.push_back(big_msg); } - messages.push_back( - grpc::string(GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH - 10, 'a')); + messages.push_back(grpc::string(MAX_TEST_MESSAGE_SIZE - 10, 'a')); } // TODO (sreek) Renable tests with health check service after the issue From 24c562dbaa95539031c45ab4bdce5070ca6c2af5 Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Thu, 29 Aug 2019 10:47:44 -0700 Subject: [PATCH 22/33] Revert "Merge pull request #20097 from gnossen/dual_version_python_tests" This reverts commit c9c847f334d9310f01456c5f69ec983cfcb99496, reversing changes made to 07ba4de3927dbb2c71b92b4ca38b2fcd1b52e306. --- BUILD | 2 +- bazel/grpc_build_system.bzl | 11 +- bazel/grpc_deps.bzl | 15 ++- bazel/grpc_python_deps.bzl | 9 -- bazel/python_rules.bzl | 26 ----- examples/python/auth/BUILD.bazel | 3 - examples/python/cancellation/BUILD.bazel | 3 - examples/python/compression/BUILD.bazel | 3 - examples/python/debug/BUILD.bazel | 3 - examples/python/errors/BUILD.bazel | 1 - examples/python/multiprocessing/BUILD | 3 - examples/python/wait_for_ready/BUILD.bazel | 1 - .../grpcio_tests/tests/channelz/BUILD.bazel | 4 +- .../tests/health_check/BUILD.bazel | 3 +- .../grpcio_tests/tests/interop/BUILD.bazel | 5 +- .../grpcio_tests/tests/reflection/BUILD.bazel | 3 +- .../grpcio_tests/tests/status/BUILD.bazel | 3 +- .../grpcio_tests/tests/unit/BUILD.bazel | 4 +- .../tests/unit/_cython/BUILD.bazel | 3 +- .../unit/framework/foundation/BUILD.bazel | 3 +- templates/tools/dockerfile/bazel.include | 2 +- third_party/py/BUILD.tpl | 49 ++++----- third_party/py/python_configure.bzl | 104 +++++++----------- third_party/py/remote.BUILD.tpl | 10 ++ third_party/py/variety.tpl | 26 ----- tools/bazel | 2 +- tools/bazel.rc | 4 + tools/dockerfile/test/bazel/Dockerfile | 2 +- tools/dockerfile/test/sanity/Dockerfile | 2 +- .../linux/grpc_python_bazel_test_in_docker.sh | 3 + tools/remote_build/kokoro.bazelrc | 7 +- tools/remote_build/manual.bazelrc | 7 +- tools/remote_build/rbe_common.bazelrc | 2 +- 33 files changed, 114 insertions(+), 214 deletions(-) create mode 100644 third_party/py/remote.BUILD.tpl delete mode 100644 third_party/py/variety.tpl diff --git a/BUILD b/BUILD index e489bc2584a..9198dd61282 100644 --- a/BUILD +++ b/BUILD @@ -65,7 +65,7 @@ config_setting( config_setting( name = "python3", - flag_values = {"@bazel_tools//tools/python:python_version": "PY3"}, + values = {"python_path": "python3"}, ) config_setting( diff --git a/bazel/grpc_build_system.bzl b/bazel/grpc_build_system.bzl index f4777e50bc1..f386b87b583 100644 --- a/bazel/grpc_build_system.bzl +++ b/bazel/grpc_build_system.bzl @@ -269,22 +269,13 @@ def grpc_sh_binary(name, srcs, data = []): data = data, ) -def grpc_py_binary(name, - srcs, - data = [], - deps = [], - external_deps = [], - testonly = False, - python_version = "PY2", - **kwargs): +def grpc_py_binary(name, srcs, data = [], deps = [], external_deps = [], testonly = False): native.py_binary( name = name, srcs = srcs, testonly = testonly, data = data, deps = deps + _get_external_deps(external_deps), - python_version = python_version, - **kwargs ) def grpc_package(name, visibility = "private", features = []): diff --git a/bazel/grpc_deps.bzl b/bazel/grpc_deps.bzl index 6bbb960b6c3..06323ff3f24 100644 --- a/bazel/grpc_deps.bzl +++ b/bazel/grpc_deps.bzl @@ -176,11 +176,11 @@ def grpc_deps(): if "bazel_toolchains" not in native.existing_rules(): http_archive( name = "bazel_toolchains", - sha256 = "872955b658113924eb1a3594b04d43238da47f4f90c17b76e8785709490dc041", - strip_prefix = "bazel-toolchains-1083686fde6032378d52b4c98044922cebde364e", + sha256 = "d968b414b32aa99c86977e1171645d31da2b52ac88060de3ac1e49932d5dcbf1", + strip_prefix = "bazel-toolchains-4bd5df80d77aa7f4fb943dfdfad5c9056a62fb47", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/1083686fde6032378d52b4c98044922cebde364e.tar.gz", - "https://github.com/bazelbuild/bazel-toolchains/archive/1083686fde6032378d52b4c98044922cebde364e.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/4bd5df80d77aa7f4fb943dfdfad5c9056a62fb47.tar.gz", + "https://github.com/bazelbuild/bazel-toolchains/archive/4bd5df80d77aa7f4fb943dfdfad5c9056a62fb47.tar.gz", ], ) @@ -221,11 +221,10 @@ def grpc_deps(): ) if "build_bazel_rules_apple" not in native.existing_rules(): - http_archive( + git_repository( name = "build_bazel_rules_apple", - url = "https://github.com/bazelbuild/rules_apple/archive/b869b0d3868d78a1d4ffd866ccb304fb68aa12c3.tar.gz", - strip_prefix = "rules_apple-b869b0d3868d78a1d4ffd866ccb304fb68aa12c3", - sha256 = "bdc8e66e70b8a75da23b79f1f8c6207356df07d041d96d2189add7ee0780cf4e", + remote = "https://github.com/bazelbuild/rules_apple.git", + tag = "0.17.2", ) grpc_python_deps() diff --git a/bazel/grpc_python_deps.bzl b/bazel/grpc_python_deps.bzl index 2a439bdf226..4e7cc1537fa 100644 --- a/bazel/grpc_python_deps.bzl +++ b/bazel/grpc_python_deps.bzl @@ -47,15 +47,6 @@ def grpc_python_deps(): remote = "https://github.com/bazelbuild/rules_python.git", ) - - if "rules_python" not in native.existing_rules(): - http_archive( - name = "rules_python", - url = "https://github.com/bazelbuild/rules_python/archive/9d68f24659e8ce8b736590ba1e4418af06ec2552.zip", - sha256 = "f7402f11691d657161f871e11968a984e5b48b023321935f5a55d7e56cf4758a", - strip_prefix = "rules_python-9d68f24659e8ce8b736590ba1e4418af06ec2552", - ) - python_configure(name = "local_config_python") native.bind( diff --git a/bazel/python_rules.bzl b/bazel/python_rules.bzl index e7e9e597b05..12f51f8b172 100644 --- a/bazel/python_rules.bzl +++ b/bazel/python_rules.bzl @@ -178,29 +178,3 @@ def py_grpc_library( deps = [Label("//src/python/grpcio/grpc:grpcio")] + deps, **kwargs ) - - -def py2and3_test(name, - py_test = native.py_test, - **kwargs): - if "python_version" in kwargs: - fail("Cannot specify 'python_version' in py2and3_test.") - - names = [name + suffix for suffix in (".python2", ".python3")] - python_versions = ["PY2", "PY3"] - for case_name, python_version in zip(names, python_versions): - py_test( - name = case_name, - python_version = python_version, - **kwargs - ) - - suite_kwargs = {} - if "visibility" in kwargs: - suite_kwargs["visibility"] = kwargs["visibility"] - - native.test_suite( - name = name, - tests = names, - **suite_kwargs - ) diff --git a/examples/python/auth/BUILD.bazel b/examples/python/auth/BUILD.bazel index 72620ee46c5..cc454fdfdfe 100644 --- a/examples/python/auth/BUILD.bazel +++ b/examples/python/auth/BUILD.bazel @@ -39,7 +39,6 @@ py_binary( "//examples:helloworld_py_pb2", "//examples:helloworld_py_pb2_grpc", ], - python_version = "PY3", ) py_binary( @@ -52,7 +51,6 @@ py_binary( "//examples:helloworld_py_pb2", "//examples:helloworld_py_pb2_grpc", ], - python_version = "PY3", ) py_test( @@ -65,5 +63,4 @@ py_test( ":customized_auth_server", ":_credentials", ], - python_version = "PY3", ) diff --git a/examples/python/cancellation/BUILD.bazel b/examples/python/cancellation/BUILD.bazel index b4451f60711..17b1b20168e 100644 --- a/examples/python/cancellation/BUILD.bazel +++ b/examples/python/cancellation/BUILD.bazel @@ -45,7 +45,6 @@ py_binary( "//external:six" ], srcs_version = "PY2AND3", - python_version = "PY3", ) py_library( @@ -69,7 +68,6 @@ py_binary( "//:python3": [], }), srcs_version = "PY2AND3", - python_version = "PY3", ) py_test( @@ -80,5 +78,4 @@ py_test( ":server" ], size = "small", - python_version = "PY3", ) diff --git a/examples/python/compression/BUILD.bazel b/examples/python/compression/BUILD.bazel index 4141eda2ffd..9d5f6bb83ed 100644 --- a/examples/python/compression/BUILD.bazel +++ b/examples/python/compression/BUILD.bazel @@ -21,7 +21,6 @@ py_binary( "//examples:helloworld_py_pb2_grpc", ], srcs_version = "PY2AND3", - python_version = "PY3", ) py_binary( @@ -33,7 +32,6 @@ py_binary( "//examples:helloworld_py_pb2_grpc", ], srcs_version = "PY2AND3", - python_version = "PY3", ) py_test( @@ -45,5 +43,4 @@ py_test( ":server", ], size = "small", - python_version = "PY3", ) diff --git a/examples/python/debug/BUILD.bazel b/examples/python/debug/BUILD.bazel index 332991332f8..657ae860ae3 100644 --- a/examples/python/debug/BUILD.bazel +++ b/examples/python/debug/BUILD.bazel @@ -35,7 +35,6 @@ py_binary( "//examples:helloworld_py_pb2", "//examples:helloworld_py_pb2_grpc", ], - python_version = "PY3", ) py_binary( @@ -46,7 +45,6 @@ py_binary( "//src/python/grpcio/grpc:grpcio", "//src/python/grpcio_channelz/grpc_channelz/v1:grpc_channelz", ], - python_version = "PY3", ) py_test( @@ -61,5 +59,4 @@ py_test( ":send_message", ":get_stats", ], - python_version = "PY3", ) diff --git a/examples/python/errors/BUILD.bazel b/examples/python/errors/BUILD.bazel index 367bd81925f..4b779ddfcf1 100644 --- a/examples/python/errors/BUILD.bazel +++ b/examples/python/errors/BUILD.bazel @@ -55,5 +55,4 @@ py_test( "../../../src/python/grpcio_status", "../../../src/python/grpcio_tests", ], - python_version = "PY3", ) diff --git a/examples/python/multiprocessing/BUILD b/examples/python/multiprocessing/BUILD index 2503970bc80..490aea0c1e6 100644 --- a/examples/python/multiprocessing/BUILD +++ b/examples/python/multiprocessing/BUILD @@ -42,7 +42,6 @@ py_binary( ":prime_proto_pb2_grpc", ], srcs_version = "PY3", - python_version = "PY3", ) py_binary( @@ -58,7 +57,6 @@ py_binary( "//:python3": [], }), srcs_version = "PY3", - python_version = "PY3", ) py_test( @@ -69,5 +67,4 @@ py_test( ":server" ], size = "small", - python_version = "PY3", ) diff --git a/examples/python/wait_for_ready/BUILD.bazel b/examples/python/wait_for_ready/BUILD.bazel index 9cbddd1a6e3..f074ae7bb7f 100644 --- a/examples/python/wait_for_ready/BUILD.bazel +++ b/examples/python/wait_for_ready/BUILD.bazel @@ -30,5 +30,4 @@ py_test( srcs = ["test/_wait_for_ready_example_test.py"], deps = [":wait_for_ready_example",], size = "small", - python_version = "PY3", ) diff --git a/src/python/grpcio_tests/tests/channelz/BUILD.bazel b/src/python/grpcio_tests/tests/channelz/BUILD.bazel index f4d246847f7..63513616e77 100644 --- a/src/python/grpcio_tests/tests/channelz/BUILD.bazel +++ b/src/python/grpcio_tests/tests/channelz/BUILD.bazel @@ -1,8 +1,6 @@ package(default_visibility = ["//visibility:public"]) -load("//bazel:python_rules.bzl", "py2and3_test") - -py2and3_test( +py_test( name = "channelz_servicer_test", srcs = ["_channelz_servicer_test.py"], main = "_channelz_servicer_test.py", diff --git a/src/python/grpcio_tests/tests/health_check/BUILD.bazel b/src/python/grpcio_tests/tests/health_check/BUILD.bazel index 797b6a48e91..49f076be9a1 100644 --- a/src/python/grpcio_tests/tests/health_check/BUILD.bazel +++ b/src/python/grpcio_tests/tests/health_check/BUILD.bazel @@ -1,7 +1,6 @@ package(default_visibility = ["//visibility:public"]) -load("//bazel:python_rules.bzl", "py2and3_test") -py2and3_test( +py_test( name = "health_servicer_test", srcs = ["_health_servicer_test.py"], main = "_health_servicer_test.py", diff --git a/src/python/grpcio_tests/tests/interop/BUILD.bazel b/src/python/grpcio_tests/tests/interop/BUILD.bazel index 4685852162b..8ac3f7d52d5 100644 --- a/src/python/grpcio_tests/tests/interop/BUILD.bazel +++ b/src/python/grpcio_tests/tests/interop/BUILD.bazel @@ -1,5 +1,4 @@ load("@grpc_python_dependencies//:requirements.bzl", "requirement") -load("//bazel:python_rules.bzl", "py2and3_test") package(default_visibility = ["//visibility:public"]) @@ -81,7 +80,7 @@ py_library( ], ) -py2and3_test( +py_test( name = "_insecure_intraop_test", size = "small", srcs = ["_insecure_intraop_test.py"], @@ -100,7 +99,7 @@ py2and3_test( ], ) -py2and3_test( +py_test( name = "_secure_intraop_test", size = "small", srcs = ["_secure_intraop_test.py"], diff --git a/src/python/grpcio_tests/tests/reflection/BUILD.bazel b/src/python/grpcio_tests/tests/reflection/BUILD.bazel index 65a08c2a435..e9b56191df8 100644 --- a/src/python/grpcio_tests/tests/reflection/BUILD.bazel +++ b/src/python/grpcio_tests/tests/reflection/BUILD.bazel @@ -1,9 +1,8 @@ load("@grpc_python_dependencies//:requirements.bzl", "requirement") -load("//bazel:python_rules.bzl", "py2and3_test") package(default_visibility = ["//visibility:public"]) -py2and3_test( +py_test( name="_reflection_servicer_test", size="small", timeout="moderate", diff --git a/src/python/grpcio_tests/tests/status/BUILD.bazel b/src/python/grpcio_tests/tests/status/BUILD.bazel index 0868de01acf..b163fe3975e 100644 --- a/src/python/grpcio_tests/tests/status/BUILD.bazel +++ b/src/python/grpcio_tests/tests/status/BUILD.bazel @@ -1,9 +1,8 @@ load("@grpc_python_dependencies//:requirements.bzl", "requirement") -load("//bazel:python_rules.bzl", "py2and3_test") package(default_visibility = ["//visibility:public"]) -py2and3_test( +py_test( name = "grpc_status_test", srcs = ["_grpc_status_test.py"], main = "_grpc_status_test.py", diff --git a/src/python/grpcio_tests/tests/unit/BUILD.bazel b/src/python/grpcio_tests/tests/unit/BUILD.bazel index 587d8cb246f..49203b7fa16 100644 --- a/src/python/grpcio_tests/tests/unit/BUILD.bazel +++ b/src/python/grpcio_tests/tests/unit/BUILD.bazel @@ -1,5 +1,3 @@ -load("//bazel:python_rules.bzl", "py2and3_test") - package(default_visibility = ["//visibility:public"]) GRPCIO_TESTS_UNIT = [ @@ -82,7 +80,7 @@ py_library( ) [ - py2and3_test( + py_test( name=test_file_name[:-3], size="small", srcs=[test_file_name], diff --git a/src/python/grpcio_tests/tests/unit/_cython/BUILD.bazel b/src/python/grpcio_tests/tests/unit/_cython/BUILD.bazel index 867649a6a50..458a6b1fb8a 100644 --- a/src/python/grpcio_tests/tests/unit/_cython/BUILD.bazel +++ b/src/python/grpcio_tests/tests/unit/_cython/BUILD.bazel @@ -1,5 +1,4 @@ load("@grpc_python_dependencies//:requirements.bzl", "requirement") -load("//bazel:python_rules.bzl", "py2and3_test") package(default_visibility = ["//visibility:public"]) @@ -24,7 +23,7 @@ py_library( ) [ - py2and3_test( + py_test( name=test_file_name[:-3], size="small", srcs=[test_file_name], diff --git a/src/python/grpcio_tests/tests/unit/framework/foundation/BUILD.bazel b/src/python/grpcio_tests/tests/unit/framework/foundation/BUILD.bazel index a93249301c4..d69186e1fde 100644 --- a/src/python/grpcio_tests/tests/unit/framework/foundation/BUILD.bazel +++ b/src/python/grpcio_tests/tests/unit/framework/foundation/BUILD.bazel @@ -1,12 +1,11 @@ package(default_visibility = ["//visibility:public"]) -load("//bazel:python_rules.bzl", "py2and3_test") py_library( name = "stream_testing", srcs = ["stream_testing.py"], ) -py2and3_test( +py_test( name = "logging_pool_test", srcs = ["_logging_pool_test.py"], main = "_logging_pool_test.py", diff --git a/templates/tools/dockerfile/bazel.include b/templates/tools/dockerfile/bazel.include index 12a22785623..adde6ed4787 100644 --- a/templates/tools/dockerfile/bazel.include +++ b/templates/tools/dockerfile/bazel.include @@ -2,7 +2,7 @@ # Bazel installation # Must be in sync with tools/bazel -ENV BAZEL_VERSION 0.28.1 +ENV BAZEL_VERSION 0.26.0 # The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper. ENV DISABLE_BAZEL_WRAPPER 1 diff --git a/third_party/py/BUILD.tpl b/third_party/py/BUILD.tpl index 8f010f85a03..2283c573bc3 100644 --- a/third_party/py/BUILD.tpl +++ b/third_party/py/BUILD.tpl @@ -2,36 +2,35 @@ package(default_visibility=["//visibility:public"]) -config_setting( - name="windows", - values={"cpu": "x64_windows"}, - visibility=["//visibility:public"], +# To build Python C/C++ extension on Windows, we need to link to python import library pythonXY.lib +# See https://docs.python.org/3/extending/windows.html +cc_import( + name="python_lib", + interface_library=select({ + ":windows": ":python_import_lib", + # A placeholder for Unix platforms which makes --no_build happy. + "//conditions:default": "not-existing.lib", + }), + system_provided=1, ) -config_setting( - name="python2", - flag_values = {"@rules_python//python:python_version": "PY2"} +cc_library( + name="python_headers", + hdrs=[":python_include"], + deps=select({ + ":windows": [":python_lib"], + "//conditions:default": [], + }), + includes=["python_include"], ) config_setting( - name="python3", - flag_values = {"@rules_python//python:python_version": "PY3"} + name="windows", + values={"cpu": "x64_windows"}, + visibility=["//visibility:public"], ) -cc_library( - name = "python_lib", - deps = select({ - ":python2": ["//_python2:_python2_lib"], - ":python3": ["//_python3:_python3_lib"], - "//conditions:default": ["not-existing.lib"], - }) -) +%{PYTHON_INCLUDE_GENRULE} +%{PYTHON_IMPORT_LIB_GENRULE} + -cc_library( - name = "python_headers", - deps = select({ - ":python2": ["//_python2:_python2_headers"], - ":python3": ["//_python3:_python3_headers"], - "//conditions:default": ["not-existing.headers"], - }) -) diff --git a/third_party/py/python_configure.bzl b/third_party/py/python_configure.bzl index 6f9a178a057..e6fa5ed10e9 100644 --- a/third_party/py/python_configure.bzl +++ b/third_party/py/python_configure.bzl @@ -3,15 +3,14 @@ `python_configure` depends on the following environment variables: - * `PYTHON2_BIN_PATH`: location of python binary. - * `PYTHON2_LIB_PATH`: Location of python libraries. + * `PYTHON_BIN_PATH`: location of python binary. + * `PYTHON_LIB_PATH`: Location of python libraries. """ _BAZEL_SH = "BAZEL_SH" -_PYTHON2_BIN_PATH = "PYTHON2_BIN_PATH" -_PYTHON2_LIB_PATH = "PYTHON2_LIB_PATH" -_PYTHON3_BIN_PATH = "PYTHON3_BIN_PATH" -_PYTHON3_LIB_PATH = "PYTHON3_LIB_PATH" +_PYTHON_BIN_PATH = "PYTHON_BIN_PATH" +_PYTHON_LIB_PATH = "PYTHON_LIB_PATH" +_PYTHON_CONFIG_REPO = "PYTHON_CONFIG_REPO" def _tpl(repository_ctx, tpl, substitutions={}, out=None): @@ -137,9 +136,9 @@ def _symlink_genrule_for_dir(repository_ctx, "\n".join(outs)) -def _get_python_bin(repository_ctx, bin_path_key, default_bin_path): +def _get_python_bin(repository_ctx): """Gets the python bin path.""" - python_bin = repository_ctx.os.environ.get(bin_path_key, default_bin_path) + python_bin = repository_ctx.os.environ.get(_PYTHON_BIN_PATH, 'python') if not repository_ctx.path(python_bin).exists: # It's a command, use 'which' to find its path. python_bin_path = repository_ctx.which(python_bin) @@ -151,7 +150,7 @@ def _get_python_bin(repository_ctx, bin_path_key, default_bin_path): _fail("Cannot find python in PATH, please make sure " + "python is installed and add its directory in PATH, or --define " + "%s='/something/else'.\nPATH=%s" % - (bin_path_key, repository_ctx.os.environ.get("PATH", ""))) + (_PYTHON_BIN_PATH, repository_ctx.os.environ.get("PATH", ""))) def _get_bash_bin(repository_ctx): @@ -171,9 +170,9 @@ def _get_bash_bin(repository_ctx): (_BAZEL_SH, repository_ctx.os.environ.get("PATH", ""))) -def _get_python_lib(repository_ctx, python_bin, lib_path_key): +def _get_python_lib(repository_ctx, python_bin): """Gets the python lib path.""" - python_lib = repository_ctx.os.environ.get(lib_path_key) + python_lib = repository_ctx.os.environ.get(_PYTHON_LIB_PATH) if python_lib != None: return python_lib print_lib = ( @@ -203,13 +202,13 @@ def _check_python_lib(repository_ctx, python_lib): _fail("Invalid python library path: %s" % python_lib) -def _check_python_bin(repository_ctx, python_bin, bin_path_key): +def _check_python_bin(repository_ctx, python_bin): """Checks the python bin path.""" cmd = '[[ -x "%s" ]] && [[ ! -d "%s" ]]' % (python_bin, python_bin) result = repository_ctx.execute([_get_bash_bin(repository_ctx), "-c", cmd]) if result.return_code == 1: _fail("--define %s='%s' is not executable. Is it the python binary?" % - (bin_path_key, python_bin)) + (_PYTHON_BIN_PATH, python_bin)) def _get_python_include(repository_ctx, python_bin): @@ -223,11 +222,11 @@ def _get_python_include(repository_ctx, python_bin): error_msg="Problem getting python include path.", error_details=( "Is the Python binary path set up right? " + "(See ./configure or " - + _PYTHON2_BIN_PATH + ".) " + "Is distutils installed?")) + + _PYTHON_BIN_PATH + ".) " + "Is distutils installed?")) return result.stdout.splitlines()[0] -def _get_python_import_lib_name(repository_ctx, python_bin, bin_path_key): +def _get_python_import_lib_name(repository_ctx, python_bin): """Get Python import library name (pythonXY.lib) on Windows.""" result = _execute( repository_ctx, [ @@ -237,85 +236,66 @@ def _get_python_import_lib_name(repository_ctx, python_bin, bin_path_key): ], error_msg="Problem getting python import library.", error_details=("Is the Python binary path set up right? " + - "(See ./configure or " + bin_path_key + ".) ")) + "(See ./configure or " + _PYTHON_BIN_PATH + ".) ")) return result.stdout.splitlines()[0] -def _create_single_version_package(repository_ctx, - variety_name, - bin_path_key, - default_bin_path, - lib_path_key): +def _create_local_python_repository(repository_ctx): """Creates the repository containing files set up to build with Python.""" - python_bin = _get_python_bin(repository_ctx, bin_path_key, default_bin_path) - _check_python_bin(repository_ctx, python_bin, bin_path_key) - python_lib = _get_python_lib(repository_ctx, python_bin, lib_path_key) + python_bin = _get_python_bin(repository_ctx) + _check_python_bin(repository_ctx, python_bin) + python_lib = _get_python_lib(repository_ctx, python_bin) _check_python_lib(repository_ctx, python_lib) python_include = _get_python_include(repository_ctx, python_bin) python_include_rule = _symlink_genrule_for_dir( - repository_ctx, python_include, '{}_include'.format(variety_name), - '{}_include'.format(variety_name)) + repository_ctx, python_include, 'python_include', 'python_include') python_import_lib_genrule = "" # To build Python C/C++ extension on Windows, we need to link to python import library pythonXY.lib # See https://docs.python.org/3/extending/windows.html if _is_windows(repository_ctx): python_include = _normalize_path(python_include) - python_import_lib_name = _get_python_import_lib_name, bin_path_key( + python_import_lib_name = _get_python_import_lib_name( repository_ctx, python_bin) python_import_lib_src = python_include.rsplit( '/', 1)[0] + "/libs/" + python_import_lib_name python_import_lib_genrule = _symlink_genrule_for_dir( - repository_ctx, None, '', '{}_import_lib'.format(variety_name), + repository_ctx, None, '', 'python_import_lib', [python_import_lib_src], [python_import_lib_name]) _tpl( - repository_ctx, "variety", { + repository_ctx, "BUILD", { "%{PYTHON_INCLUDE_GENRULE}": python_include_rule, "%{PYTHON_IMPORT_LIB_GENRULE}": python_import_lib_genrule, - "%{VARIETY_NAME}": variety_name, - }, - out="{}/BUILD".format(variety_name)) + }) + + +def _create_remote_python_repository(repository_ctx, remote_config_repo): + """Creates pointers to a remotely configured repo set up to build with Python. + """ + _tpl(repository_ctx, "remote.BUILD", { + "%{REMOTE_PYTHON_REPO}": remote_config_repo, + }, "BUILD") def _python_autoconf_impl(repository_ctx): """Implementation of the python_autoconf repository rule.""" - _create_single_version_package(repository_ctx, - "_python2", - _PYTHON2_BIN_PATH, - "python", - _PYTHON2_LIB_PATH) - _create_single_version_package(repository_ctx, - "_python3", - _PYTHON3_BIN_PATH, - "python3", - _PYTHON3_LIB_PATH) - _tpl(repository_ctx, "BUILD") + if _PYTHON_CONFIG_REPO in repository_ctx.os.environ: + _create_remote_python_repository( + repository_ctx, repository_ctx.os.environ[_PYTHON_CONFIG_REPO]) + else: + _create_local_python_repository(repository_ctx) python_configure = repository_rule( - implementation = _python_autoconf_impl, - environ = [ + implementation=_python_autoconf_impl, + environ=[ _BAZEL_SH, - _PYTHON2_BIN_PATH, - _PYTHON2_LIB_PATH, - _PYTHON3_BIN_PATH, - _PYTHON3_LIB_PATH, + _PYTHON_BIN_PATH, + _PYTHON_LIB_PATH, + _PYTHON_CONFIG_REPO, ], - attrs={ - "_build_tpl": attr.label( - default = Label("//third_party/py:BUILD.tpl"), - allow_single_file = True, - ), - "_variety_tpl": attr.label( - default = Label("//third_party/py:variety.tpl"), - allow_single_file = True, - ), - }, ) """Detects and configures the local Python. -It is expected that the system have both a working Python 2 and python 3 -installation - Add the following to your WORKSPACE FILE: ```python diff --git a/third_party/py/remote.BUILD.tpl b/third_party/py/remote.BUILD.tpl new file mode 100644 index 00000000000..1bfe1f0bf65 --- /dev/null +++ b/third_party/py/remote.BUILD.tpl @@ -0,0 +1,10 @@ +# Adapted with modifications from tensorflow/third_party/py/ + +package(default_visibility=["//visibility:public"]) + +alias( + name="python_headers", + actual="%{REMOTE_PYTHON_REPO}:python_headers", +) + + diff --git a/third_party/py/variety.tpl b/third_party/py/variety.tpl deleted file mode 100644 index 0c466d6d8f0..00000000000 --- a/third_party/py/variety.tpl +++ /dev/null @@ -1,26 +0,0 @@ -package(default_visibility=["//visibility:public"]) - -# To build Python C/C++ extension on Windows, we need to link to python import library pythonXY.lib -# See https://docs.python.org/3/extending/windows.html -cc_import( - name="%{VARIETY_NAME}_lib", - interface_library=select({ - "//:windows": ":%{VARIETY_NAME}_import_lib", - # A placeholder for Unix platforms which makes --no_build happy. - "//conditions:default": "not-existing.lib", - }), - system_provided=1, -) - -cc_library( - name="%{VARIETY_NAME}_headers", - hdrs=[":%{VARIETY_NAME}_include"], - deps=select({ - "//:windows": [":%{VARIETY_NAME}_lib"], - "//conditions:default": [], - }), - includes=["%{VARIETY_NAME}_include"], -) - -%{PYTHON_INCLUDE_GENRULE} -%{PYTHON_IMPORT_LIB_GENRULE} diff --git a/tools/bazel b/tools/bazel index 4d1d57f60d9..4f08d18c656 100755 --- a/tools/bazel +++ b/tools/bazel @@ -32,7 +32,7 @@ then exec -a "$0" "${BAZEL_REAL}" "$@" fi -VERSION=0.28.1 +VERSION=0.26.0 echo "INFO: Running bazel wrapper (see //tools/bazel for details), bazel version $VERSION will be used instead of system-wide bazel installation." diff --git a/tools/bazel.rc b/tools/bazel.rc index fcbe9337b9f..b24f603ddda 100644 --- a/tools/bazel.rc +++ b/tools/bazel.rc @@ -82,3 +82,7 @@ build:basicprof --copt=-DNDEBUG build:basicprof --copt=-O2 build:basicprof --copt=-DGRPC_BASIC_PROFILER build:basicprof --copt=-DGRPC_TIMERS_RDTSC + +build:python3 --python_path=python3 +build:python3 --python_version=PY3 +build:python3 --action_env=PYTHON_BIN_PATH=python3 diff --git a/tools/dockerfile/test/bazel/Dockerfile b/tools/dockerfile/test/bazel/Dockerfile index 7141fb9c5f1..7e7903359e7 100644 --- a/tools/dockerfile/test/bazel/Dockerfile +++ b/tools/dockerfile/test/bazel/Dockerfile @@ -52,7 +52,7 @@ RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 t # Bazel installation # Must be in sync with tools/bazel -ENV BAZEL_VERSION 0.28.1 +ENV BAZEL_VERSION 0.26.0 # The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper. ENV DISABLE_BAZEL_WRAPPER 1 diff --git a/tools/dockerfile/test/sanity/Dockerfile b/tools/dockerfile/test/sanity/Dockerfile index badff52de34..675378b305b 100644 --- a/tools/dockerfile/test/sanity/Dockerfile +++ b/tools/dockerfile/test/sanity/Dockerfile @@ -97,7 +97,7 @@ ENV CLANG_TIDY=clang-tidy # Bazel installation # Must be in sync with tools/bazel -ENV BAZEL_VERSION 0.28.1 +ENV BAZEL_VERSION 0.26.0 # The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper. ENV DISABLE_BAZEL_WRAPPER 1 diff --git a/tools/internal_ci/linux/grpc_python_bazel_test_in_docker.sh b/tools/internal_ci/linux/grpc_python_bazel_test_in_docker.sh index 4a48760aab1..f725eb7a3d7 100755 --- a/tools/internal_ci/linux/grpc_python_bazel_test_in_docker.sh +++ b/tools/internal_ci/linux/grpc_python_bazel_test_in_docker.sh @@ -26,6 +26,9 @@ ${name}') cd /var/local/git/grpc/test bazel test --spawn_strategy=standalone --genrule_strategy=standalone --test_output=errors //src/python/... bazel test --spawn_strategy=standalone --genrule_strategy=standalone --test_output=errors //examples/python/... +bazel clean --expunge +bazel test --config=python3 --spawn_strategy=standalone --genrule_strategy=standalone --test_output=errors //src/python/... +bazel test --config=python3 --spawn_strategy=standalone --genrule_strategy=standalone --test_output=errors //examples/python/... # TODO(https://github.com/grpc/grpc/issues/19854): Move this to a new Kokoro # job. diff --git a/tools/remote_build/kokoro.bazelrc b/tools/remote_build/kokoro.bazelrc index 5c1b061bce3..064e94b2e15 100644 --- a/tools/remote_build/kokoro.bazelrc +++ b/tools/remote_build/kokoro.bazelrc @@ -16,12 +16,13 @@ import %workspace%/tools/remote_build/rbe_common.bazelrc -build --remote_cache=grpcs://remotebuildexecution.googleapis.com -build --remote_executor=grpcs://remotebuildexecution.googleapis.com +build --remote_cache=remotebuildexecution.googleapis.com +build --remote_executor=remotebuildexecution.googleapis.com +build --tls_enabled=true build --auth_enabled=true -build --bes_backend=grpcs://buildeventservice.googleapis.com +build --bes_backend=buildeventservice.googleapis.com build --bes_timeout=600s build --project_id=grpc-testing diff --git a/tools/remote_build/manual.bazelrc b/tools/remote_build/manual.bazelrc index c3c6af42877..fcd41f57521 100644 --- a/tools/remote_build/manual.bazelrc +++ b/tools/remote_build/manual.bazelrc @@ -17,8 +17,9 @@ import %workspace%/tools/remote_build/rbe_common.bazelrc -build --remote_cache=grpcs://remotebuildexecution.googleapis.com -build --remote_executor=grpcs://remotebuildexecution.googleapis.com +build --remote_cache=remotebuildexecution.googleapis.com +build --remote_executor=remotebuildexecution.googleapis.com +build --tls_enabled=true # Enable authentication. This will pick up application default credentials by # default. You can use --auth_credentials=some_file.json to use a service @@ -29,7 +30,7 @@ build --auth_enabled=true # Set flags for uploading to BES in order to view results in the Bazel Build # Results UI. -build --bes_backend=grpcs://buildeventservice.googleapis.com +build --bes_backend="buildeventservice.googleapis.com" build --bes_timeout=60s build --bes_results_url="https://source.cloud.google.com/results/invocations/" build --project_id=grpc-testing diff --git a/tools/remote_build/rbe_common.bazelrc b/tools/remote_build/rbe_common.bazelrc index 6236003fe17..6baaf24732c 100644 --- a/tools/remote_build/rbe_common.bazelrc +++ b/tools/remote_build/rbe_common.bazelrc @@ -87,4 +87,4 @@ build:ubsan --test_timeout=3600 # how to update the bazel toolchain for ubsan: # - check for the latest released version in https://github.com/bazelbuild/bazel-toolchains/tree/master/configs/experimental/ubuntu16_04_clang # - you might need to update the bazel_toolchains dependency in grpc_deps.bzl -build:ubsan --crosstool_top=@bazel_toolchains//configs/experimental/ubuntu16_04_clang/1.2/bazel_0.28.0/ubsan:toolchain +build:ubsan --crosstool_top=@bazel_toolchains//configs/experimental/ubuntu16_04_clang/1.2/bazel_0.23.0/ubsan:toolchain From aa2a65faedd62be2024e270a88f1001b3f5b2f80 Mon Sep 17 00:00:00 2001 From: Alexander Polcyn Date: Thu, 29 Aug 2019 14:08:52 -0700 Subject: [PATCH 23/33] Remove call from queued picks when failing it due to channel destruction --- src/core/ext/filters/client_channel/client_channel.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc index 3272bc3ffed..8a0fabfa6fd 100644 --- a/src/core/ext/filters/client_channel/client_channel.cc +++ b/src/core/ext/filters/client_channel/client_channel.cc @@ -3881,6 +3881,7 @@ void CallData::StartPickLocked(void* arg, grpc_error* error) { GRPC_ERROR_UNREF(result.error); GRPC_CLOSURE_SCHED(&calld->pick_closure_, GRPC_ERROR_REF(disconnect_error)); + if (calld->pick_queued_) calld->RemoveCallFromQueuedPicksLocked(elem); break; } // If wait_for_ready is false, then the error indicates the RPC From 32801fb5eb1b5f50e9282a563eb6226ce602b855 Mon Sep 17 00:00:00 2001 From: Hope Casey-Allen Date: Thu, 29 Aug 2019 14:11:05 -0700 Subject: [PATCH 24/33] Remove build target for microbenchmark --- test/cpp/microbenchmarks/BUILD | 8 -------- 1 file changed, 8 deletions(-) diff --git a/test/cpp/microbenchmarks/BUILD b/test/cpp/microbenchmarks/BUILD index fdae8246c31..b8e9b14d4b4 100644 --- a/test/cpp/microbenchmarks/BUILD +++ b/test/cpp/microbenchmarks/BUILD @@ -27,14 +27,6 @@ grpc_cc_test( deps = ["//test/core/util:grpc_test_util"], ) -grpc_cc_binary( - name = "bm_chttp2_transport", - testonly = 1, - srcs = ["bm_chttp2_transport.cc"], - tags = ["no_windows"], - deps = [":helpers"], -) - grpc_cc_library( name = "helpers", testonly = 1, From d1dae7d9d8cac4366766ca625d902060fa17cd9e Mon Sep 17 00:00:00 2001 From: Alexander Polcyn Date: Thu, 29 Aug 2019 16:50:42 -0700 Subject: [PATCH 25/33] Log errors in ALTS handshaker message op completion cb --- src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc b/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc index 917d375fd82..c5383b3a0ba 100644 --- a/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +++ b/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc @@ -251,7 +251,14 @@ static void on_handshaker_service_resp_recv(void* arg, grpc_error* error) { gpr_log(GPR_ERROR, "ALTS handshaker client is nullptr"); return; } - alts_handshaker_client_handle_response(client, true); + bool success = true; + if (error != GRPC_ERROR_NONE) { + gpr_log(GPR_ERROR, + "ALTS handshaker on_handshaker_service_resp_recv error: %s", + grpc_error_string(error)); + success = false; + } + alts_handshaker_client_handle_response(client, success); } /* gRPC provided callback used when dedicatd CQ and thread are used. From d2b5fd75f05eb4cc391c39888fb1a15c73ac040b Mon Sep 17 00:00:00 2001 From: Prashant Jaikumar Date: Tue, 27 Aug 2019 17:35:49 -0700 Subject: [PATCH 26/33] Added test for time jumps --- test/cpp/common/BUILD | 13 ++ test/cpp/common/time_jump_test.cc | 128 ++++++++++++++++++ .../internal_ci/macos/grpc_run_bazel_tests.sh | 13 +- 3 files changed, 145 insertions(+), 9 deletions(-) create mode 100644 test/cpp/common/time_jump_test.cc diff --git a/test/cpp/common/BUILD b/test/cpp/common/BUILD index f0d0e9a6223..c31eb10344e 100644 --- a/test/cpp/common/BUILD +++ b/test/cpp/common/BUILD @@ -42,6 +42,19 @@ grpc_cc_test( ], ) +grpc_cc_test( + name = "time_jump_test", + srcs = ["time_jump_test.cc"], + external_deps = [ + "gtest", + ], + tags = ["manual"], + deps = [ + "//:grpc++", + "//test/core/util:grpc_test_util", + ], +) + grpc_cc_test( name = "auth_property_iterator_test", srcs = ["auth_property_iterator_test.cc"], diff --git a/test/cpp/common/time_jump_test.cc b/test/cpp/common/time_jump_test.cc new file mode 100644 index 00000000000..86bf012f7c0 --- /dev/null +++ b/test/cpp/common/time_jump_test.cc @@ -0,0 +1,128 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "src/core/lib/gprpp/sync.h" +#include "src/core/lib/iomgr/closure.h" +#include "src/core/lib/iomgr/error.h" +#include "src/core/lib/iomgr/exec_ctx.h" +#include "src/core/lib/iomgr/timer.h" +#include "src/core/lib/iomgr/timer_manager.h" +#include "test/core/util/test_config.h" + +extern char** environ; + +void run_cmd(const char* cmd) { + pid_t pid; + const char* argv[] = {const_cast("sh"), + const_cast("-c"), cmd, nullptr}; + int status; + + status = posix_spawn(&pid, const_cast("/bin/sh"), nullptr, + nullptr, const_cast(argv), environ); + if (status == 0) { + if (waitpid(pid, &status, 0) == -1) { + perror("waitpid"); + } + } +} + +class TimeJumpTest : public ::testing::TestWithParam { + protected: + void SetUp() override { grpc_init(); } + void TearDown() override { + run_cmd("sudo sntp -sS pool.ntp.org"); + grpc_shutdown_blocking(); + } + + const int kWaitTimeMs = 1500; +}; + +std::vector CreateTestScenarios() { + return {"-1M", "+1M", "-1H", "+1H", "-1d", "+1d", "-1y", "+1y"}; +} +INSTANTIATE_TEST_CASE_P(TimeJump, TimeJumpTest, + ::testing::ValuesIn(CreateTestScenarios())); + +TEST_P(TimeJumpTest, TimerRunning) { + grpc_core::ExecCtx exec_ctx; + grpc_timer timer; + grpc_timer_init(&timer, grpc_core::ExecCtx::Get()->Now() + 3000, + GRPC_CLOSURE_CREATE( + [](void*, grpc_error* error) { + GPR_ASSERT(error == GRPC_ERROR_CANCELLED); + }, + nullptr, grpc_schedule_on_exec_ctx)); + gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(100)); + std::ostringstream cmd; + cmd << "sudo date `date -v" << GetParam() << " \"+%m%d%H%M%y\"`"; + run_cmd(cmd.str().c_str()); + gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(kWaitTimeMs)); + // We expect 1 wakeup/sec when there are not timer expiries + int64_t wakeups = grpc_timer_manager_get_wakeups_testonly(); + gpr_log(GPR_DEBUG, "wakeups: %" PRId64 "", wakeups); + GPR_ASSERT(wakeups <= 3); + grpc_timer_cancel(&timer); +} + +TEST_P(TimeJumpTest, TimedWait) { + grpc_core::CondVar cond; + grpc_core::Mutex mu; + { + grpc_core::MutexLock lock(&mu); + std::thread thd = std::thread([]() { + gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(100)); + std::ostringstream cmd; + cmd << "sudo date `date -v" << GetParam() << " \"+%m%d%H%M%y\"`"; + run_cmd(cmd.str().c_str()); + }); + gpr_timespec before = gpr_now(GPR_CLOCK_MONOTONIC); + int timedout = cond.Wait( + &mu, grpc_millis_to_timespec(kWaitTimeMs, GPR_CLOCK_REALTIME)); + gpr_timespec after = gpr_now(GPR_CLOCK_MONOTONIC); + int32_t elapsed_ms = gpr_time_to_millis(gpr_time_sub(after, before)); + gpr_log(GPR_DEBUG, "After wait, timedout = %d elapsed_ms = %d", timedout, + elapsed_ms); + GPR_ASSERT(1 == timedout); + GPR_ASSERT(1 == + gpr_time_similar(gpr_time_sub(after, before), + gpr_time_from_millis(kWaitTimeMs, GPR_TIMESPAN), + gpr_time_from_millis(10, GPR_TIMESPAN))); + + thd.join(); + } + // We expect 1 wakeup/sec when there are not timer expiries + int64_t wakeups = grpc_timer_manager_get_wakeups_testonly(); + gpr_log(GPR_DEBUG, "wakeups: %" PRId64 "", wakeups); + GPR_ASSERT(wakeups <= 3); +} + +int main(int argc, char** argv) { + grpc::testing::TestEnvironment env(argc, argv); + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/tools/internal_ci/macos/grpc_run_bazel_tests.sh b/tools/internal_ci/macos/grpc_run_bazel_tests.sh index d3db59e9379..aaa2dc3f63c 100644 --- a/tools/internal_ci/macos/grpc_run_bazel_tests.sh +++ b/tools/internal_ci/macos/grpc_run_bazel_tests.sh @@ -18,18 +18,13 @@ set -ex # change to grpc repo root cd $(dirname $0)/../../.. -# Download bazel -temp_dir="$(mktemp -d)" -wget -q https://github.com/bazelbuild/bazel/releases/download/0.26.0/bazel-0.26.0-darwin-x86_64 -O "${temp_dir}/bazel" -chmod 755 "${temp_dir}/bazel" -export PATH="${temp_dir}:${PATH}" -# This should show ${temp_dir}/bazel -which bazel - ./tools/run_tests/start_port_server.py # run cfstream_test separately because it messes with the network -bazel test $RUN_TESTS_FLAGS --spawn_strategy=standalone --genrule_strategy=standalone --test_output=all //test/cpp/end2end:cfstream_test +tools/bazel test $RUN_TESTS_FLAGS --spawn_strategy=standalone --genrule_strategy=standalone --test_output=all //test/cpp/end2end:cfstream_test + +# run time_jump_test separately because it changes system time +tools/bazel test $RUN_TESTS_FLAGS --spawn_strategy=standalone --genrule_strategy=standalone --test_output=all //test/cpp/common:time_jump_test # kill port_server.py to prevent the build from hanging ps aux | grep port_server\\.py | awk '{print $2}' | xargs kill -9 From fa7bdff69f6de851e5b34f9bb112cee7618baa84 Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Wed, 28 Aug 2019 16:32:00 -0700 Subject: [PATCH 27/33] Fix buffer-overflow in grpc_static_mdelem_for_static_strings --- src/core/lib/transport/static_metadata.cc | 7 +------ tools/codegen/core/gen_static_metadata.py | 3 +-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/core/lib/transport/static_metadata.cc b/src/core/lib/transport/static_metadata.cc index bd6ff09c80d..f412edb1efe 100644 --- a/src/core/lib/transport/static_metadata.cc +++ b/src/core/lib/transport/static_metadata.cc @@ -1217,12 +1217,7 @@ static const uint16_t elem_keys[] = { 9076, 9185, 9294, 9403, 9512, 9621, 6242, 9730, 9839, 9948, 10057, 10166, 1189, 538, 10275, 10384, 212, 10493, 1195, 1196, 1197, 1198, 1080, 10602, 1843, 11365, 0, 0, 0, 1734, 0, 1850, 0, - 0, 0, 356, 1627, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0}; + 0, 0, 356, 1627}; static const uint8_t elem_idxs[] = { 7, 8, 9, 10, 11, 12, 13, 76, 78, 71, 1, 2, 5, 6, 25, 3, 4, 66, 65, 30, 83, 62, 63, 67, 61, 73, 57, 37, 14, 19, 21, 22, diff --git a/tools/codegen/core/gen_static_metadata.py b/tools/codegen/core/gen_static_metadata.py index 4ac8f9dada7..8560fa47657 100755 --- a/tools/codegen/core/gen_static_metadata.py +++ b/tools/codegen/core/gen_static_metadata.py @@ -627,7 +627,6 @@ def perfect_hash(keys, name): return x + p.r[y] return { - 'PHASHRANGE': p.t - 1 + max(p.r), 'PHASHNKEYS': len(p.slots), 'pyfunc': f, 'code': """ @@ -659,7 +658,7 @@ elem_keys = [ elem_hash = perfect_hash(elem_keys, 'elems') print >> C, elem_hash['code'] -keys = [0] * int(elem_hash['PHASHRANGE']) +keys = [0] * int(elem_hash['PHASHNKEYS']) idxs = [255] * int(elem_hash['PHASHNKEYS']) for i, k in enumerate(elem_keys): h = elem_hash['pyfunc'](k) From b436758b14fa15200089ca42216f4a41fd0902ca Mon Sep 17 00:00:00 2001 From: Prashant Jaikumar Date: Fri, 28 Jun 2019 17:11:02 -0700 Subject: [PATCH 28/33] Added documentation for C++ tests on iOS --- test/cpp/README-iOS.md | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 test/cpp/README-iOS.md diff --git a/test/cpp/README-iOS.md b/test/cpp/README-iOS.md new file mode 100644 index 00000000000..898931085b3 --- /dev/null +++ b/test/cpp/README-iOS.md @@ -0,0 +1,52 @@ +## C++ tests on iOS + +[GTMGoogleTestRunner](https://github.com/google/google-toolbox-for-mac/blob/master/UnitTesting/GTMGoogleTestRunner.mm) is used to convert googletest cases to XCTest that can be run on iOS. GTMGoogleTestRunner doesn't execute the `main` function, so we can't have any test logic in `main`. +However, it's ok to call `::testing::InitGoogleTest` in `main`, as `GTMGoogleTestRunner` [calls InitGoogleTest](https://github.com/google/google-toolbox-for-mac/blob/master/UnitTesting/GTMGoogleTestRunner.mm#L151). +`grpc::testing::TestEnvironment` can also be called from `main`, as it does some test initialization (install crash handler, seed RNG) that's not strictly required to run testcases on iOS. + + +## Porting exising C++ tests to run on iOS + +Please follow these guidelines when porting tests to run on iOS: + +- Tests need to use the googletest framework +- Any setup/teardown code in `main` needs to be moved to `SetUpTestCase`/`TearDownTestCase`, and `TEST` needs to be changed to `TEST_F`. +- [Death tests](https://github.com/google/googletest/blob/master/googletest/docs/advanced.md#death-tests) are not supported on iOS, so use the `*_IF_SUPPORTED()` macros to ensure that your code compiles on iOS. + +For example, the following test +```c++ +TEST(MyTest, TestOne) { + ASSERT_DEATH(ThisShouldDie(), ""); +} + +int main(int argc, char** argv) { + grpc::testing::TestEnvironment env(argc, argv); + ::testing::InitGoogleTest(&argc, argv); + grpc_init(); + return RUN_ALL_TESTS(); + grpc_shutdown(); +} +``` + +should be changed to +```c++ +class MyTest : public ::testing::Test { + protected: + static void SetUpTestCase() { grpc_init(); } + static void TearDownTestCase() { grpc_shutdown(); } +}; + +TEST_F(MyTest, TestOne) { + ASSERT_DEATH_IF_SUPPORTED(ThisShouldDie(), ""); +} + +int main(int argc, char** argv) { + grpc::testing::TestEnvironment env(argc, argv); + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} +``` + +## Limitations + +Due to a [limitation](https://github.com/google/google-toolbox-for-mac/blob/master/UnitTesting/GTMGoogleTestRunner.mm#L48-L56) in GTMGoogleTestRunner, `SetUpTestCase`/`TeardownTestCase` will be called before/after *every* individual test case, similar to `SetUp`/`TearDown`. From 3c6bb96a1fbc07a59e4def4600e5e0249e98ab53 Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Fri, 30 Aug 2019 12:12:26 -0700 Subject: [PATCH 29/33] Add test for static elements --- test/core/transport/BUILD | 14 ++++++ test/core/transport/static_metadata_test.cc | 51 +++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 test/core/transport/static_metadata_test.cc diff --git a/test/core/transport/BUILD b/test/core/transport/BUILD index f38ecf2f66b..44e4fcb978e 100644 --- a/test/core/transport/BUILD +++ b/test/core/transport/BUILD @@ -82,6 +82,20 @@ grpc_cc_test( ], ) +grpc_cc_test( + name = "static_metadata_test", + srcs = ["static_metadata_test.cc"], + external_deps = [ + "gtest", + ], + language = "C++", + deps = [ + "//:gpr", + "//:grpc", + "//test/core/util:grpc_test_util", + ], +) + grpc_cc_test( name = "status_conversion_test", srcs = ["status_conversion_test.cc"], diff --git a/test/core/transport/static_metadata_test.cc b/test/core/transport/static_metadata_test.cc new file mode 100644 index 00000000000..6d3d5ef5c37 --- /dev/null +++ b/test/core/transport/static_metadata_test.cc @@ -0,0 +1,51 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include + +#include + +#include "src/core/lib/transport/metadata.h" +#include "src/core/lib/transport/static_metadata.h" +#include "test/core/util/test_config.h" + +namespace grpc_core { +namespace { + +TEST(StaticMetadataTest, ReadAllStaticElements) { + // This makes sure that all static elements are returned when + // grpc_mdelem_from_slices is called with key pairs pregenerated. + for (int i = 0; i < GRPC_STATIC_MDELEM_COUNT; i++) { + const grpc_mdelem mdelem = grpc_static_mdelem_manifested()[i]; + const grpc_mdelem mdelem2 = + grpc_mdelem_from_slices(GRPC_MDKEY(mdelem), GRPC_MDVALUE(mdelem)); + EXPECT_EQ(mdelem.payload, mdelem2.payload); + } +} + +} // namespace +} // namespace grpc_core + +int main(int argc, char** argv) { + grpc_init(); + grpc::testing::TestEnvironment env(argc, argv); + ::testing::InitGoogleTest(&argc, argv); + int retval = RUN_ALL_TESTS(); + grpc_shutdown(); + return retval; +} From a96cbbd592af2f705402b28e3f0337cff54d7d27 Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Wed, 28 Aug 2019 16:39:08 -0700 Subject: [PATCH 30/33] Fix ubsan on InternNewStringLocked --- src/core/lib/slice/slice_intern.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/lib/slice/slice_intern.cc b/src/core/lib/slice/slice_intern.cc index d813e5195ad..369135c9eac 100644 --- a/src/core/lib/slice/slice_intern.cc +++ b/src/core/lib/slice/slice_intern.cc @@ -208,7 +208,11 @@ static InternedSliceRefcount* InternNewStringLocked(slice_shard* shard, InternedSliceRefcount* s = static_cast(gpr_malloc(sizeof(*s) + len)); new (s) grpc_core::InternedSliceRefcount(len, hash, shard->strs[shard_idx]); - memcpy(reinterpret_cast(s + 1), buffer, len); + // TODO(arjunroy): Investigate why hpack tried to intern the nullptr string. + // https://github.com/grpc/grpc/pull/20110#issuecomment-526729282 + if (len > 0) { + memcpy(reinterpret_cast(s + 1), buffer, len); + } shard->strs[shard_idx] = s; shard->count++; if (shard->count > shard->capacity * 2) { From e6ffb2c3bb97046605de54d4a74516d728aa6ae4 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Fri, 30 Aug 2019 14:36:35 -0700 Subject: [PATCH 31/33] Replace direct closure callback calls with GRPC_CLOSURE_SCHED --- src/core/ext/transport/chttp2/server/chttp2_server.cc | 2 +- src/core/lib/iomgr/tcp_posix.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/ext/transport/chttp2/server/chttp2_server.cc b/src/core/ext/transport/chttp2/server/chttp2_server.cc index 5e9cd77d18a..c0ae64eb2cc 100644 --- a/src/core/ext/transport/chttp2/server/chttp2_server.cc +++ b/src/core/ext/transport/chttp2/server/chttp2_server.cc @@ -266,7 +266,7 @@ static void tcp_server_shutdown_complete(void* arg, grpc_error* error) { // may do a synchronous unref. grpc_core::ExecCtx::Get()->Flush(); if (destroy_done != nullptr) { - destroy_done->cb(destroy_done->cb_arg, GRPC_ERROR_REF(error)); + GRPC_CLOSURE_SCHED(destroy_done, GRPC_ERROR_REF(error)); grpc_core::ExecCtx::Get()->Flush(); } grpc_channel_args_destroy(state->args); diff --git a/src/core/lib/iomgr/tcp_posix.cc b/src/core/lib/iomgr/tcp_posix.cc index 498aecc069b..f0c591d1c6d 100644 --- a/src/core/lib/iomgr/tcp_posix.cc +++ b/src/core/lib/iomgr/tcp_posix.cc @@ -1020,7 +1020,7 @@ static void tcp_handle_write(void* arg /* grpc_tcp */, grpc_error* error) { if (error != GRPC_ERROR_NONE) { cb = tcp->write_cb; tcp->write_cb = nullptr; - cb->cb(cb->cb_arg, error); + GRPC_CLOSURE_SCHED(cb, error); TCP_UNREF(tcp, "write"); return; } From 3476df0b5021b7517d8c756ffdffc771349e8964 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Fri, 30 Aug 2019 15:04:06 -0700 Subject: [PATCH 32/33] Add in ref to error --- src/core/lib/iomgr/tcp_posix.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/lib/iomgr/tcp_posix.cc b/src/core/lib/iomgr/tcp_posix.cc index f0c591d1c6d..571c7d229f2 100644 --- a/src/core/lib/iomgr/tcp_posix.cc +++ b/src/core/lib/iomgr/tcp_posix.cc @@ -1020,7 +1020,7 @@ static void tcp_handle_write(void* arg /* grpc_tcp */, grpc_error* error) { if (error != GRPC_ERROR_NONE) { cb = tcp->write_cb; tcp->write_cb = nullptr; - GRPC_CLOSURE_SCHED(cb, error); + GRPC_CLOSURE_SCHED(cb, GRPC_ERROR_REF(error)); TCP_UNREF(tcp, "write"); return; } From 7315e75ce6c8cea17196f9c0f907187caa851437 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Fri, 30 Aug 2019 15:25:50 -0700 Subject: [PATCH 33/33] Add comments --- src/core/lib/iomgr/tcp_posix.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/lib/iomgr/tcp_posix.cc b/src/core/lib/iomgr/tcp_posix.cc index 571c7d229f2..b6d1381298a 100644 --- a/src/core/lib/iomgr/tcp_posix.cc +++ b/src/core/lib/iomgr/tcp_posix.cc @@ -1030,6 +1030,8 @@ static void tcp_handle_write(void* arg /* grpc_tcp */, grpc_error* error) { gpr_log(GPR_INFO, "write: delayed"); } notify_on_write(tcp); + // tcp_flush does not populate error if it has returned false. + GPR_DEBUG_ASSERT(error == GRPC_ERROR_NONE); } else { cb = tcp->write_cb; tcp->write_cb = nullptr; @@ -1037,6 +1039,7 @@ static void tcp_handle_write(void* arg /* grpc_tcp */, grpc_error* error) { const char* str = grpc_error_string(error); gpr_log(GPR_INFO, "write: %s", str); } + // No need to take a ref on error since tcp_flush provides a ref. GRPC_CLOSURE_SCHED(cb, error); TCP_UNREF(tcp, "write"); }