From 8d35a303f20429724cbaa50cbfa4e4863d7d5ecd Mon Sep 17 00:00:00 2001 From: Arvind Bright Date: Fri, 15 Mar 2024 10:30:31 -0700 Subject: [PATCH 01/16] update grpc go v1.62.x to patch release (#36061) Closes #36061 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36061 from arvindbr8:go_patch_release_1.61.1 d89073c5549906b9ac543c88ad9546f98860f1e2 PiperOrigin-RevId: 616173467 --- tools/interop_matrix/client_matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/interop_matrix/client_matrix.py b/tools/interop_matrix/client_matrix.py index 00d07b2b243..c66369efd03 100644 --- a/tools/interop_matrix/client_matrix.py +++ b/tools/interop_matrix/client_matrix.py @@ -297,7 +297,7 @@ LANG_RELEASE_MATRIX = { ("v1.59.0", ReleaseInfo(runtimes=["go1.19"])), ("v1.60.1", ReleaseInfo(runtimes=["go1.19"])), ("v1.61.0", ReleaseInfo(runtimes=["go1.19"])), - ("v1.62.0", ReleaseInfo(runtimes=["go1.19"])), + ("v1.62.1", ReleaseInfo(runtimes=["go1.19"])), ] ), "java": OrderedDict( From 070327677050efab2899963ecb1ad072ac46fcb2 Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Fri, 15 Mar 2024 14:05:46 -0700 Subject: [PATCH 02/16] [CI] Bazel upgrade (#36104) Upgraded Bazel as follows; - Bazel 6.4 to 6.5 - Bazel 7.0 to 7.1 Closes #36104 PiperOrigin-RevId: 616237591 --- .bazelversion | 2 +- bazel/supported_versions.txt | 4 ++-- bazel/update_mirror.sh | 12 ++++++------ doc/bazel_support.md | 4 ++-- templates/tools/dockerfile/oss_fuzz_base.include | 4 ++-- .../bazelify_tests/dockerimage_current_versions.bzl | 8 ++++---- .../bazelify_tests/test/supported_bazel_versions.bzl | 4 ++-- tools/dockerfile/test/bazel.current_version | 2 +- tools/dockerfile/test/bazel/Dockerfile | 6 +++--- tools/dockerfile/test/bazel_arm64.current_version | 2 +- tools/dockerfile/test/bazel_arm64/Dockerfile | 2 +- .../test/binder_transport_apk.current_version | 2 +- .../dockerfile/test/binder_transport_apk/Dockerfile | 6 +++--- tools/dockerfile/test/sanity.current_version | 2 +- tools/dockerfile/test/sanity/Dockerfile | 2 +- 15 files changed, 31 insertions(+), 31 deletions(-) diff --git a/.bazelversion b/.bazelversion index 19b860c1872..f22d756da39 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -6.4.0 +6.5.0 diff --git a/bazel/supported_versions.txt b/bazel/supported_versions.txt index 1197e4958b6..73d8dc3a64c 100644 --- a/bazel/supported_versions.txt +++ b/bazel/supported_versions.txt @@ -1,2 +1,2 @@ -6.4.0 -7.0.0 +6.5.0 +7.1.0 diff --git a/bazel/update_mirror.sh b/bazel/update_mirror.sh index c5f6c84b487..98d752a3cff 100755 --- a/bazel/update_mirror.sh +++ b/bazel/update_mirror.sh @@ -57,12 +57,12 @@ function upload { # upload "github.com/google/boringssl/archive/1c2769383f027befac5b75b6cedd25daf3bf4dcf.tar.gz" # bazel binaries used by the tools/bazel wrapper script -upload github.com/bazelbuild/bazel/releases/download/6.4.0/bazel-6.4.0-linux-x86_64 -upload github.com/bazelbuild/bazel/releases/download/6.4.0/bazel-6.4.0-darwin-x86_64 -upload github.com/bazelbuild/bazel/releases/download/6.4.0/bazel-6.4.0-windows-x86_64.exe -upload github.com/bazelbuild/bazel/releases/download/7.0.0/bazel-7.0.0-linux-x86_64 -upload github.com/bazelbuild/bazel/releases/download/7.0.0/bazel-7.0.0-darwin-x86_64 -upload github.com/bazelbuild/bazel/releases/download/7.0.0/bazel-7.0.0-windows-x86_64.exe +upload github.com/bazelbuild/bazel/releases/download/6.5.0/bazel-6.5.0-linux-x86_64 +upload github.com/bazelbuild/bazel/releases/download/6.5.0/bazel-6.5.0-darwin-x86_64 +upload github.com/bazelbuild/bazel/releases/download/6.5.0/bazel-6.5.0-windows-x86_64.exe +upload github.com/bazelbuild/bazel/releases/download/7.1.0/bazel-7.1.0-linux-x86_64 +upload github.com/bazelbuild/bazel/releases/download/7.1.0/bazel-7.1.0-darwin-x86_64 +upload github.com/bazelbuild/bazel/releases/download/7.1.0/bazel-7.1.0-windows-x86_64.exe # Collect the github archives to mirror from grpc_deps.bzl grep -o '"https://github.com/[^"]*"' bazel/grpc_deps.bzl | sed 's/^"https:\/\///' | sed 's/"$//' | while read -r line ; do diff --git a/doc/bazel_support.md b/doc/bazel_support.md index 0fbc3c22a5f..08cb014f106 100644 --- a/doc/bazel_support.md +++ b/doc/bazel_support.md @@ -43,7 +43,7 @@ However individual releases may have a broader compatibility range. The currently supported versions are captured by the following list: -- [`6.4.0`](https://github.com/bazelbuild/bazel/releases/tag/6.4.0) -- [`7.0.0`](https://github.com/bazelbuild/bazel/releases/tag/7.0.0) +- [`6.5.0`](https://github.com/bazelbuild/bazel/releases/tag/6.5.0) +- [`7.1.0`](https://github.com/bazelbuild/bazel/releases/tag/7.1.0) NOTE: gRPC doesn't support bzlmod yet. \ No newline at end of file diff --git a/templates/tools/dockerfile/oss_fuzz_base.include b/templates/tools/dockerfile/oss_fuzz_base.include index 126b58b723e..95bd410dfb2 100644 --- a/templates/tools/dockerfile/oss_fuzz_base.include +++ b/templates/tools/dockerfile/oss_fuzz_base.include @@ -1,8 +1,8 @@ # Pinned version of the base image is used to avoid regressions caused # by rebuilding of this docker image. To see available versions, you can run # "gcloud container images list-tags gcr.io/oss-fuzz-base/base-builder" -# Image(fd89316ac4c5) is built on Aug 17, 2023 -FROM gcr.io/oss-fuzz-base/base-builder@sha256:fd89316ac4c5f3e25802ca95a00062cece14f0602c5512d71ffeedc22734c0b9 +# This base image is built on Mar 12, 2024 +FROM gcr.io/oss-fuzz-base/base-builder@sha256:c3581153788bc49f3634fec3cd36a5d6dfd26632c4afc157fb6faf8ce3af732e # -------------------------- WARNING -------------------------------------- # If you are making changes to this file, consider changing diff --git a/tools/bazelify_tests/dockerimage_current_versions.bzl b/tools/bazelify_tests/dockerimage_current_versions.bzl index 70dcfc40ae5..41b9a5707b5 100644 --- a/tools/bazelify_tests/dockerimage_current_versions.bzl +++ b/tools/bazelify_tests/dockerimage_current_versions.bzl @@ -88,9 +88,9 @@ DOCKERIMAGE_CURRENT_VERSIONS = { "tools/dockerfile/interoptest/grpc_interop_ruby.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_ruby@sha256:efd7f41a736dd4b8f73b32f5215b86f6bfe9013c422dfcd77978de0253aaee45", "tools/dockerfile/interoptest/lb_interop_fake_servers.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/lb_interop_fake_servers@sha256:b89a51dd9147e1293f50ee64dd719fce5929ca7894d3770a3d80dbdecb99fd52", "tools/dockerfile/test/android_ndk.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/android_ndk@sha256:ab154ecb062af2111d2d3550c4d3da3384201d9893bbd37d49e8160fc34bc137", - "tools/dockerfile/test/bazel.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/bazel@sha256:32bde2dcb2087f2a32afab59e4dfedf7e8c76a52c69881f63a239d311f0e5ecf", - "tools/dockerfile/test/bazel_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/bazel_arm64@sha256:3b087387c44dee405c1b80d6ff50994e6d8e90a4ef67cc94b4291f1a29c0ef41", - "tools/dockerfile/test/binder_transport_apk.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/binder_transport_apk@sha256:bf60a187cd2ce1abe8b4f32ae6479040a72ca6aa789cd5ab509f60ceb37a41f9", + "tools/dockerfile/test/bazel.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/bazel@sha256:eb327f8e44f2712f557de1d8918c41c3cba1112c4b39b13104c29211ed8f827a", + "tools/dockerfile/test/bazel_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/bazel_arm64@sha256:6cddc0ecdb42a7db7105b73fc3192edb911702102d1bac671e26d44a17d7aa95", + "tools/dockerfile/test/binder_transport_apk.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/binder_transport_apk@sha256:a680a8b7d645a2c25948ad3f82f6380c8a1e13fcfe74fc3569acb3b0b202851e", "tools/dockerfile/test/csharp_debian11_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_debian11_arm64@sha256:4d4bc5f15e03f3d3d8fd889670ecde2c66a2e4d2dd9db80733c05c1d90c8a248", "tools/dockerfile/test/csharp_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_debian11_x64@sha256:b2e5c47d986312ea0850e2f2e696b45d23ee0aabceea161d31e28559e19ec4a5", "tools/dockerfile/test/cxx_alpine_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_alpine_x64@sha256:f2019edf9f2afd5042567f11afb1aa78a789fc9acdcce5ee0c14cc11f6830ed7", @@ -112,5 +112,5 @@ DOCKERIMAGE_CURRENT_VERSIONS = { "tools/dockerfile/test/rbe_ubuntu2004.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rbe_ubuntu2004@sha256:d3951aeadf43e3bee6adc5b86d26cdaf0b9d1b5baf790d7b2530d1c197adc9f8", "tools/dockerfile/test/ruby_debian11_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_arm64@sha256:d2e79919b2e2d4cc36a29682ecb5170641df4fb506cfb453978ffdeb8a841bd9", "tools/dockerfile/test/ruby_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/ruby_debian11_x64@sha256:f8fc0ec22065278e5bc02ad7f9a68191e46d083035b3a90ed587561dba9c58c5", - "tools/dockerfile/test/sanity.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/sanity@sha256:ca65b29302e8e381aabf9deb1952281f4e9963654e19c3d681148b5aa972c8a2", + "tools/dockerfile/test/sanity.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/sanity@sha256:a83cf1344c166834d76f49e08448f4253b535cdbc47efffb195cfa710f5114d6", } diff --git a/tools/bazelify_tests/test/supported_bazel_versions.bzl b/tools/bazelify_tests/test/supported_bazel_versions.bzl index d83471d3061..e53bf51d06b 100644 --- a/tools/bazelify_tests/test/supported_bazel_versions.bzl +++ b/tools/bazelify_tests/test/supported_bazel_versions.bzl @@ -17,6 +17,6 @@ This file is generated from the supported_bazel_versions.bzl.template """ SUPPORTED_BAZEL_VERSIONS = [ - "6.4.0", - "7.0.0", + "6.5.0", + "7.1.0", ] diff --git a/tools/dockerfile/test/bazel.current_version b/tools/dockerfile/test/bazel.current_version index 972682e1522..39fe083900c 100644 --- a/tools/dockerfile/test/bazel.current_version +++ b/tools/dockerfile/test/bazel.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/bazel:cacad91746cd598d8756de89b912be291de1f019@sha256:32bde2dcb2087f2a32afab59e4dfedf7e8c76a52c69881f63a239d311f0e5ecf \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/bazel:71afcbd2698751336bd9890d00eb37ed790b3ac6@sha256:eb327f8e44f2712f557de1d8918c41c3cba1112c4b39b13104c29211ed8f827a \ No newline at end of file diff --git a/tools/dockerfile/test/bazel/Dockerfile b/tools/dockerfile/test/bazel/Dockerfile index c52f8313cbb..b85b8a207d6 100644 --- a/tools/dockerfile/test/bazel/Dockerfile +++ b/tools/dockerfile/test/bazel/Dockerfile @@ -15,8 +15,8 @@ # Pinned version of the base image is used to avoid regressions caused # by rebuilding of this docker image. To see available versions, you can run # "gcloud container images list-tags gcr.io/oss-fuzz-base/base-builder" -# Image(fd89316ac4c5) is built on Aug 17, 2023 -FROM gcr.io/oss-fuzz-base/base-builder@sha256:fd89316ac4c5f3e25802ca95a00062cece14f0602c5512d71ffeedc22734c0b9 +# This base image is built on Mar 12, 2024 +FROM gcr.io/oss-fuzz-base/base-builder@sha256:c3581153788bc49f3634fec3cd36a5d6dfd26632c4afc157fb6faf8ce3af732e # -------------------------- WARNING -------------------------------------- # If you are making changes to this file, consider changing @@ -38,7 +38,7 @@ RUN apt-get update && apt-get -y install \ # Bazel installation # Must be in sync with tools/bazel -ENV BAZEL_VERSION 6.4.0 +ENV BAZEL_VERSION 6.5.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/bazel_arm64.current_version b/tools/dockerfile/test/bazel_arm64.current_version index 71008d44e60..eccc25d1444 100644 --- a/tools/dockerfile/test/bazel_arm64.current_version +++ b/tools/dockerfile/test/bazel_arm64.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/bazel_arm64:2638335cbe0cbd8f77c54affdf0e4b36f7741785@sha256:3b087387c44dee405c1b80d6ff50994e6d8e90a4ef67cc94b4291f1a29c0ef41 \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/bazel_arm64:415b428a3108de92d1d819cd053181a110a8078b@sha256:6cddc0ecdb42a7db7105b73fc3192edb911702102d1bac671e26d44a17d7aa95 \ No newline at end of file diff --git a/tools/dockerfile/test/bazel_arm64/Dockerfile b/tools/dockerfile/test/bazel_arm64/Dockerfile index afc341b6ad9..8efb0ef1b22 100644 --- a/tools/dockerfile/test/bazel_arm64/Dockerfile +++ b/tools/dockerfile/test/bazel_arm64/Dockerfile @@ -97,7 +97,7 @@ RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean # Bazel installation # Must be in sync with tools/bazel -ENV BAZEL_VERSION 6.4.0 +ENV BAZEL_VERSION 6.5.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/binder_transport_apk.current_version b/tools/dockerfile/test/binder_transport_apk.current_version index 439b81ec9dd..c5fbd60b28b 100644 --- a/tools/dockerfile/test/binder_transport_apk.current_version +++ b/tools/dockerfile/test/binder_transport_apk.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/binder_transport_apk:783671f597502a2dc3ebf190d52d55be70836a33@sha256:bf60a187cd2ce1abe8b4f32ae6479040a72ca6aa789cd5ab509f60ceb37a41f9 \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/binder_transport_apk:fbe8a32dd2006fab456f2fa0d0e82d3979b7f30b@sha256:a680a8b7d645a2c25948ad3f82f6380c8a1e13fcfe74fc3569acb3b0b202851e \ No newline at end of file diff --git a/tools/dockerfile/test/binder_transport_apk/Dockerfile b/tools/dockerfile/test/binder_transport_apk/Dockerfile index c0644d3285b..9f38130a87a 100644 --- a/tools/dockerfile/test/binder_transport_apk/Dockerfile +++ b/tools/dockerfile/test/binder_transport_apk/Dockerfile @@ -15,8 +15,8 @@ # Pinned version of the base image is used to avoid regressions caused # by rebuilding of this docker image. To see available versions, you can run # "gcloud container images list-tags gcr.io/oss-fuzz-base/base-builder" -# Image(fd89316ac4c5) is built on Aug 17, 2023 -FROM gcr.io/oss-fuzz-base/base-builder@sha256:fd89316ac4c5f3e25802ca95a00062cece14f0602c5512d71ffeedc22734c0b9 +# This base image is built on Mar 12, 2024 +FROM gcr.io/oss-fuzz-base/base-builder@sha256:c3581153788bc49f3634fec3cd36a5d6dfd26632c4afc157fb6faf8ce3af732e # -------------------------- WARNING -------------------------------------- # If you are making changes to this file, consider changing @@ -38,7 +38,7 @@ RUN apt-get update && apt-get -y install \ # Bazel installation # Must be in sync with tools/bazel -ENV BAZEL_VERSION 6.4.0 +ENV BAZEL_VERSION 6.5.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.current_version b/tools/dockerfile/test/sanity.current_version index 2a2d514f070..f05e8d51456 100644 --- a/tools/dockerfile/test/sanity.current_version +++ b/tools/dockerfile/test/sanity.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/sanity:2d20232b40465f3487deef87274f4bfd7122b201@sha256:ca65b29302e8e381aabf9deb1952281f4e9963654e19c3d681148b5aa972c8a2 \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/sanity:38e0bdb9e26335d2d947263d33efa0f688dcd2fc@sha256:a83cf1344c166834d76f49e08448f4253b535cdbc47efffb195cfa710f5114d6 \ No newline at end of file diff --git a/tools/dockerfile/test/sanity/Dockerfile b/tools/dockerfile/test/sanity/Dockerfile index b44b5582710..c75124fa18a 100644 --- a/tools/dockerfile/test/sanity/Dockerfile +++ b/tools/dockerfile/test/sanity/Dockerfile @@ -108,7 +108,7 @@ RUN apt-get update && apt-get install -y jq git && apt-get clean # Bazel installation # Must be in sync with tools/bazel -ENV BAZEL_VERSION 6.4.0 +ENV BAZEL_VERSION 6.5.0 # The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper. ENV DISABLE_BAZEL_WRAPPER 1 From 2aa1b6479f900ae9eaafbf0876567920308808cf Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Fri, 15 Mar 2024 14:35:24 -0700 Subject: [PATCH 03/16] [Build] Massage grpcio_tools build configuration for protobuf upgrade. (#36124) This is a prerequisite for the upcoming Protobuf v26 upgrade and has the following changes; - Reduced the optimization level from `O3` to `O1` on Linux to workaround a segfault issue on `manylinux2014/x86`. This is believed to be caused by an aggressive but buggy optimization that `gcc` 10 made so workaround is to reduce the optimization level. `gcsio_tools` isn't that performance sensitive so we should be able to afford this change. (internal b/329134877) - Added a Windows library dependency `Shell32.lib` to support the use of `CommandLineToArgvW`. (internal b/328455319) Closes #36124 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36124 from veblush:grpcio-x e7b555bfcf031a6aa126de8a89148056fc5724b0 PiperOrigin-RevId: 616245600 --- tools/distrib/python/grpcio_tools/setup.py | 25 ++++++++++++---------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/tools/distrib/python/grpcio_tools/setup.py b/tools/distrib/python/grpcio_tools/setup.py index b778bc31ada..a41915895b3 100644 --- a/tools/distrib/python/grpcio_tools/setup.py +++ b/tools/distrib/python/grpcio_tools/setup.py @@ -23,7 +23,6 @@ import subprocess from subprocess import PIPE import sys import sysconfig -import traceback import setuptools from setuptools import Extension @@ -152,14 +151,7 @@ class BuildExt(build_ext.build_ext): self.compiler._compile = new_compile - try: - build_ext.build_ext.build_extensions(self) - except Exception as error: - formatted_exception = traceback.format_exc() - support.diagnose_build_ext_error(self, error, formatted_exception) - raise CommandError( - "Failed `build_ext` step:\n{}".format(formatted_exception) - ) + build_ext.build_ext.build_extensions(self) # There are some situations (like on Windows) where CC, CFLAGS, and LDFLAGS are @@ -179,12 +171,23 @@ if EXTRA_ENV_COMPILE_ARGS is None: # We need to statically link the C++ Runtime, only the C runtime is # available dynamically EXTRA_ENV_COMPILE_ARGS += " /MT" - elif "linux" in sys.platform or "darwin" in sys.platform: - # GCC & Clang by defaults uses C17 so only C++14 needs to be specified. + elif "linux" in sys.platform: + # GCC by defaults uses C17 so only C++14 needs to be specified. + EXTRA_ENV_COMPILE_ARGS += " -std=c++14" + EXTRA_ENV_COMPILE_ARGS += " -fno-wrapv -frtti" + # Reduce the optimization level from O3 (in many cases) to O1 to + # workaround gcc misalignment bug with MOVAPS (internal b/329134877) + EXTRA_ENV_COMPILE_ARGS += " -O1" + elif "darwin" in sys.platform: + # AppleClang by defaults uses C17 so only C++14 needs to be specified. EXTRA_ENV_COMPILE_ARGS += " -std=c++14" EXTRA_ENV_COMPILE_ARGS += " -fno-wrapv -frtti" + EXTRA_ENV_COMPILE_ARGS += " -stdlib=libc++ -DHAVE_UNISTD_H" if EXTRA_ENV_LINK_ARGS is None: EXTRA_ENV_LINK_ARGS = "" + # This is needed for protobuf/main.cc + if "win32" in sys.platform: + EXTRA_ENV_LINK_ARGS += " Shell32.lib" # NOTE(rbellevi): Clang on Mac OS will make all static symbols (both # variables and objects) global weak symbols. When a process loads the # protobuf wheel's shared object library before loading *this* C extension, From d6edb33ae7baf56b67c4fd974278cbde4550e35c Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Fri, 15 Mar 2024 16:00:10 -0700 Subject: [PATCH 04/16] [Clean-up] Removed grpc.gyp (#36077) No more gyp file! Closes #36077 PiperOrigin-RevId: 616267538 --- .gitattributes | 2 - grpc.gyp | 2702 ----------------------------------- templates/grpc.gyp.template | 162 --- 3 files changed, 2866 deletions(-) delete mode 100644 grpc.gyp delete mode 100644 templates/grpc.gyp.template diff --git a/.gitattributes b/.gitattributes index 3d72aae39fd..b03b218eb51 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12,10 +12,8 @@ gRPC-ProtoRPC.podspec linguist-generated=true gRPC-RxLibrary.podspec linguist-generated=true gRPC.podspec linguist-generated=true grpc.gemspec linguist-generated=true -grpc.gyp linguist-generated=true grpc.def linguist-generated=true package.xml linguist-generated=true -binding.gyp linguist-generated=true Package.swift linguist-generated=true src/python/grpcio/grpc_core_dependencies.py linguist-generated=true src/ruby/ext/grpc/rb_grpc_imports.generated.h linguist-generated=true diff --git a/grpc.gyp b/grpc.gyp deleted file mode 100644 index eb70fc54080..00000000000 --- a/grpc.gyp +++ /dev/null @@ -1,2702 +0,0 @@ -# GRPC GYP build file - -# This file has been automatically generated from a template file. -# Please look at the templates directory instead. -# This file can be regenerated from the template by running -# tools/buildgen/generate_projects.sh - -# Copyright 2015 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. - -{ - 'variables': { - # The openssl and zlib dependencies must be passed in as variables - # defined in an included gypi file, usually common.gypi. - 'openssl_gyp_target%': 'Please Define openssl_gyp_target variable', - 'zlib_gyp_target%': 'Please Define zlib_gyp_target variable', - - 'grpc_gcov%': 'false', - 'grpc_alpine%': 'false', - }, - 'target_defaults': { - 'configurations': { - 'Debug': { - 'cflags': [ - '-O0', - ], - 'defines': [ - '_DEBUG', - 'DEBUG', - ], - }, - 'Release': { - 'cflags': [ - '-O2', - '-Wframe-larger-than=16384', - ], - 'defines': [ - 'NDEBUG', - ], - }, - }, - 'cflags': [ - '-g', - '-Wall', - '-Wextra', - '-DOSATOMIC_USE_INLINED=1', - '-Ithird_party/abseil-cpp', - '-Ithird_party/re2', - '-Ithird_party/upb', - '-Isrc/core/ext/upb-gen', - '-Isrc/core/ext/upbdefs-gen', - '-Ithird_party/utf8_range', - '-Ithird_party/xxhash', - '-Ithird_party/cares/cares/include', - '-Ithird_party/cares', - '-Ithird_party/cares/cares', - '-Ithird_party/address_sorting/include', - ], - 'ldflags': [ - '-g', - ], - 'cflags_c': [ - '-Werror', - '-std=c11', - ], - 'cflags_cc': [ - '-Werror', - '-std=c++14', - ], - 'include_dirs': [ - '.', - '../..', - 'include', - ], - 'defines': [ - 'GRPC_ARES=0', - ], - 'dependencies': [ - '<(openssl_gyp_target)', - '<(zlib_gyp_target)', - ], - 'conditions': [ - ['grpc_gcov=="true"', { - 'cflags': [ - '-O0', - '-fprofile-arcs', - '-ftest-coverage', - '-Wno-return-type', - ], - 'defines': [ - '_DEBUG', - 'DEBUG', - 'GPR_GCOV', - ], - 'ldflags': [ - '-fprofile-arcs', - '-ftest-coverage', - '-rdynamic', - '-lstdc++', - ], - }], - ['grpc_alpine=="true"', { - 'defines': [ - 'GPR_MUSL_LIBC_COMPAT' - ] - }], - ['OS == "win"', { - 'defines': [ - '_WIN32_WINNT=0x0600', - 'WIN32_LEAN_AND_MEAN', - '_HAS_EXCEPTIONS=0', - 'UNICODE', - '_UNICODE', - 'NOMINMAX', - ], - 'msvs_settings': { - 'VCCLCompilerTool': { - 'RuntimeLibrary': 1, # static debug - } - }, - "libraries": [ - "ws2_32" - ] - }], - ['OS == "mac"', { - 'xcode_settings': { - 'OTHER_CFLAGS': [ - '-g', - '-Wall', - '-Wextra', - '-DOSATOMIC_USE_INLINED=1', - '-Ithird_party/abseil-cpp', - '-Ithird_party/re2', - '-Ithird_party/upb', - '-Isrc/core/ext/upb-gen', - '-Isrc/core/ext/upbdefs-gen', - '-Ithird_party/utf8_range', - '-Ithird_party/xxhash', - '-Ithird_party/cares/cares/include', - '-Ithird_party/cares', - '-Ithird_party/cares/cares', - '-Ithird_party/address_sorting/include', - ], - 'OTHER_CPLUSPLUSFLAGS': [ - '-g', - '-Wall', - '-Wextra', - '-DOSATOMIC_USE_INLINED=1', - '-Ithird_party/abseil-cpp', - '-Ithird_party/re2', - '-Ithird_party/upb', - '-Isrc/core/ext/upb-gen', - '-Isrc/core/ext/upbdefs-gen', - '-Ithird_party/utf8_range', - '-Ithird_party/xxhash', - '-Ithird_party/cares/cares/include', - '-Ithird_party/cares', - '-Ithird_party/cares/cares', - '-Ithird_party/address_sorting/include', - '-stdlib=libc++', - '-std=c++14', - '-Wno-error=deprecated-declarations', - ], - }, - }] - ] - }, - 'targets': [ - { - 'target_name': 'address_sorting', - 'type': 'static_library', - 'dependencies': [ - ], - 'sources': [ - 'third_party/address_sorting/address_sorting.c', - 'third_party/address_sorting/address_sorting_posix.c', - 'third_party/address_sorting/address_sorting_windows.c', - ], - }, - { - 'target_name': 'gpr', - 'type': 'static_library', - 'dependencies': [ - 'absl/base:base', - 'absl/base:core_headers', - 'absl/base:log_severity', - 'absl/flags:flag', - 'absl/flags:marshalling', - 'absl/functional:any_invocable', - 'absl/log:log', - 'absl/memory:memory', - 'absl/random:random', - 'absl/status:status', - 'absl/strings:cord', - 'absl/strings:str_format', - 'absl/strings:strings', - 'absl/synchronization:synchronization', - 'absl/time:time', - 'absl/types:optional', - 'absl/types:variant', - ], - 'sources': [ - 'src/core/lib/config/config_vars.cc', - 'src/core/lib/config/config_vars_non_generated.cc', - 'src/core/lib/config/load_config.cc', - 'src/core/lib/event_engine/thread_local.cc', - 'src/core/lib/gpr/alloc.cc', - 'src/core/lib/gpr/android/log.cc', - 'src/core/lib/gpr/atm.cc', - 'src/core/lib/gpr/iphone/cpu.cc', - 'src/core/lib/gpr/linux/cpu.cc', - 'src/core/lib/gpr/linux/log.cc', - 'src/core/lib/gpr/log.cc', - 'src/core/lib/gpr/msys/tmpfile.cc', - 'src/core/lib/gpr/posix/cpu.cc', - 'src/core/lib/gpr/posix/log.cc', - 'src/core/lib/gpr/posix/string.cc', - 'src/core/lib/gpr/posix/sync.cc', - 'src/core/lib/gpr/posix/time.cc', - 'src/core/lib/gpr/posix/tmpfile.cc', - 'src/core/lib/gpr/string.cc', - 'src/core/lib/gpr/sync.cc', - 'src/core/lib/gpr/sync_abseil.cc', - 'src/core/lib/gpr/time.cc', - 'src/core/lib/gpr/time_precise.cc', - 'src/core/lib/gpr/windows/cpu.cc', - 'src/core/lib/gpr/windows/log.cc', - 'src/core/lib/gpr/windows/string.cc', - 'src/core/lib/gpr/windows/string_util.cc', - 'src/core/lib/gpr/windows/sync.cc', - 'src/core/lib/gpr/windows/time.cc', - 'src/core/lib/gpr/windows/tmpfile.cc', - 'src/core/lib/gprpp/crash.cc', - 'src/core/lib/gprpp/examine_stack.cc', - 'src/core/lib/gprpp/fork.cc', - 'src/core/lib/gprpp/host_port.cc', - 'src/core/lib/gprpp/linux/env.cc', - 'src/core/lib/gprpp/mpscq.cc', - 'src/core/lib/gprpp/posix/env.cc', - 'src/core/lib/gprpp/posix/stat.cc', - 'src/core/lib/gprpp/posix/thd.cc', - 'src/core/lib/gprpp/strerror.cc', - 'src/core/lib/gprpp/tchar.cc', - 'src/core/lib/gprpp/time_util.cc', - 'src/core/lib/gprpp/windows/env.cc', - 'src/core/lib/gprpp/windows/stat.cc', - 'src/core/lib/gprpp/windows/thd.cc', - ], - }, - { - 'target_name': 'grpc', - 'type': 'static_library', - 'dependencies': [ - 'upb_json_lib', - 'upb_textformat_lib', - 're2', - 'z', - 'absl/algorithm:container', - 'absl/base:config', - 'absl/base:no_destructor', - 'absl/cleanup:cleanup', - 'absl/container:flat_hash_map', - 'absl/container:flat_hash_set', - 'absl/container:inlined_vector', - 'absl/functional:bind_front', - 'absl/functional:function_ref', - 'absl/hash:hash', - 'absl/meta:type_traits', - 'absl/random:bit_gen_ref', - 'absl/random:distributions', - 'absl/status:statusor', - 'absl/types:span', - 'absl/utility:utility', - 'cares', - 'gpr', - 'address_sorting', - ], - 'sources': [ - 'src/core/client_channel/backup_poller.cc', - 'src/core/client_channel/client_channel_channelz.cc', - 'src/core/client_channel/client_channel_factory.cc', - 'src/core/client_channel/client_channel_filter.cc', - 'src/core/client_channel/client_channel_plugin.cc', - 'src/core/client_channel/client_channel_service_config.cc', - 'src/core/client_channel/config_selector.cc', - 'src/core/client_channel/dynamic_filters.cc', - 'src/core/client_channel/global_subchannel_pool.cc', - 'src/core/client_channel/http_proxy_mapper.cc', - 'src/core/client_channel/local_subchannel_pool.cc', - 'src/core/client_channel/retry_filter.cc', - 'src/core/client_channel/retry_filter_legacy_call_data.cc', - 'src/core/client_channel/retry_service_config.cc', - 'src/core/client_channel/retry_throttle.cc', - 'src/core/client_channel/subchannel.cc', - 'src/core/client_channel/subchannel_pool_interface.cc', - 'src/core/client_channel/subchannel_stream_client.cc', - 'src/core/ext/filters/backend_metrics/backend_metric_filter.cc', - 'src/core/ext/filters/census/grpc_context.cc', - 'src/core/ext/filters/channel_idle/channel_idle_filter.cc', - 'src/core/ext/filters/channel_idle/idle_filter_state.cc', - 'src/core/ext/filters/channel_idle/legacy_channel_idle_filter.cc', - 'src/core/ext/filters/deadline/deadline_filter.cc', - 'src/core/ext/filters/fault_injection/fault_injection_filter.cc', - 'src/core/ext/filters/fault_injection/fault_injection_service_config_parser.cc', - 'src/core/ext/filters/http/client/http_client_filter.cc', - 'src/core/ext/filters/http/client_authority_filter.cc', - 'src/core/ext/filters/http/http_filters_plugin.cc', - 'src/core/ext/filters/http/message_compress/compression_filter.cc', - 'src/core/ext/filters/http/message_compress/legacy_compression_filter.cc', - 'src/core/ext/filters/http/server/http_server_filter.cc', - 'src/core/ext/filters/message_size/message_size_filter.cc', - 'src/core/ext/filters/rbac/rbac_filter.cc', - 'src/core/ext/filters/rbac/rbac_service_config_parser.cc', - 'src/core/ext/filters/server_config_selector/server_config_selector_filter.cc', - 'src/core/ext/filters/stateful_session/stateful_session_filter.cc', - 'src/core/ext/filters/stateful_session/stateful_session_service_config_parser.cc', - 'src/core/ext/gcp/metadata_query.cc', - 'src/core/ext/transport/chttp2/alpn/alpn.cc', - 'src/core/ext/transport/chttp2/client/chttp2_connector.cc', - 'src/core/ext/transport/chttp2/server/chttp2_server.cc', - '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_transport.cc', - 'src/core/ext/transport/chttp2/transport/decode_huff.cc', - 'src/core/ext/transport/chttp2/transport/flow_control.cc', - 'src/core/ext/transport/chttp2/transport/frame.cc', - 'src/core/ext/transport/chttp2/transport/frame_data.cc', - 'src/core/ext/transport/chttp2/transport/frame_goaway.cc', - 'src/core/ext/transport/chttp2/transport/frame_ping.cc', - 'src/core/ext/transport/chttp2/transport/frame_rst_stream.cc', - 'src/core/ext/transport/chttp2/transport/frame_settings.cc', - 'src/core/ext/transport/chttp2/transport/frame_window_update.cc', - 'src/core/ext/transport/chttp2/transport/hpack_encoder.cc', - 'src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc', - 'src/core/ext/transport/chttp2/transport/hpack_parse_result.cc', - 'src/core/ext/transport/chttp2/transport/hpack_parser.cc', - 'src/core/ext/transport/chttp2/transport/hpack_parser_table.cc', - 'src/core/ext/transport/chttp2/transport/http2_settings.cc', - 'src/core/ext/transport/chttp2/transport/http_trace.cc', - 'src/core/ext/transport/chttp2/transport/huffsyms.cc', - 'src/core/ext/transport/chttp2/transport/max_concurrent_streams_policy.cc', - 'src/core/ext/transport/chttp2/transport/parsing.cc', - 'src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc', - 'src/core/ext/transport/chttp2/transport/ping_callbacks.cc', - 'src/core/ext/transport/chttp2/transport/ping_rate_policy.cc', - 'src/core/ext/transport/chttp2/transport/stream_lists.cc', - 'src/core/ext/transport/chttp2/transport/varint.cc', - 'src/core/ext/transport/chttp2/transport/write_size_policy.cc', - 'src/core/ext/transport/chttp2/transport/writing.cc', - 'src/core/ext/transport/inproc/inproc_plugin.cc', - 'src/core/ext/transport/inproc/inproc_transport.cc', - 'src/core/ext/transport/inproc/legacy_inproc_transport.cc', - 'src/core/ext/upb-gen/envoy/admin/v3/certs.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/admin/v3/clusters.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/admin/v3/config_dump.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/admin/v3/config_dump_shared.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/admin/v3/init_dump.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/admin/v3/listeners.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/admin/v3/memory.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/admin/v3/metrics.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/admin/v3/mutex_stats.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/admin/v3/server_info.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/admin/v3/tap.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/annotations/deprecation.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/annotations/resource.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/cluster/v3/filter.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/core/v3/address.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/core/v3/backoff.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/core/v3/base.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/core/v3/config_source.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/core/v3/event_service_config.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/core/v3/extension.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/core/v3/grpc_method_list.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/core/v3/health_check.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/core/v3/http_service.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/core/v3/http_uri.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/core/v3/resolver.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/core/v3/substitution_format_string.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/core/v3/udp_socket_config.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/endpoint/v3/load_report.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/listener/v3/api_listener.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/listener/v3/listener_components.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/listener/v3/udp_listener_config.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/route/v3/route.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/route/v3/scoped_route.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/tap/v3/common.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/trace/v3/datadog.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/trace/v3/dynamic_ot.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/trace/v3/http_tracer.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/trace/v3/lightstep.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/trace/v3/opencensus.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/trace/v3/service.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/trace/v3/skywalking.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/trace/v3/trace.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/trace/v3/xray.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/data/accesslog/v3/accesslog.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3/fault.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/cert.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/service/discovery/v3/ads.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/service/discovery/v3/discovery.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/service/load_stats/v3/lrs.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/service/status/v3/csds.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/type/http/v3/path_transformation.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/type/matcher/v3/filter_state.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/type/matcher/v3/http_inputs.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/type/matcher/v3/metadata.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/type/matcher/v3/node.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/type/matcher/v3/number.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/type/matcher/v3/path.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/type/matcher/v3/regex.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/type/matcher/v3/status_code_input.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/type/matcher/v3/string.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/type/matcher/v3/struct.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/type/matcher/v3/value.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/type/metadata/v3/metadata.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/type/v3/hash_policy.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/type/v3/http.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/type/v3/http_status.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/type/v3/percent.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/type/v3/range.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/type/v3/ratelimit_strategy.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/type/v3/ratelimit_unit.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/type/v3/semantic_version.upb_minitable.c', - 'src/core/ext/upb-gen/envoy/type/v3/token_bucket.upb_minitable.c', - 'src/core/ext/upb-gen/google/api/annotations.upb_minitable.c', - 'src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.upb_minitable.c', - 'src/core/ext/upb-gen/google/api/expr/v1alpha1/syntax.upb_minitable.c', - 'src/core/ext/upb-gen/google/api/http.upb_minitable.c', - 'src/core/ext/upb-gen/google/api/httpbody.upb_minitable.c', - 'src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c', - 'src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.c', - 'src/core/ext/upb-gen/google/protobuf/duration.upb_minitable.c', - 'src/core/ext/upb-gen/google/protobuf/empty.upb_minitable.c', - 'src/core/ext/upb-gen/google/protobuf/struct.upb_minitable.c', - 'src/core/ext/upb-gen/google/protobuf/timestamp.upb_minitable.c', - 'src/core/ext/upb-gen/google/protobuf/wrappers.upb_minitable.c', - 'src/core/ext/upb-gen/google/rpc/status.upb_minitable.c', - 'src/core/ext/upb-gen/opencensus/proto/trace/v1/trace_config.upb_minitable.c', - 'src/core/ext/upb-gen/src/proto/grpc/gcp/altscontext.upb_minitable.c', - 'src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb_minitable.c', - 'src/core/ext/upb-gen/src/proto/grpc/gcp/transport_security_common.upb_minitable.c', - 'src/core/ext/upb-gen/src/proto/grpc/health/v1/health.upb_minitable.c', - 'src/core/ext/upb-gen/src/proto/grpc/lb/v1/load_balancer.upb_minitable.c', - 'src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls.upb_minitable.c', - 'src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls_config.upb_minitable.c', - 'src/core/ext/upb-gen/udpa/annotations/migrate.upb_minitable.c', - 'src/core/ext/upb-gen/udpa/annotations/security.upb_minitable.c', - 'src/core/ext/upb-gen/udpa/annotations/sensitive.upb_minitable.c', - 'src/core/ext/upb-gen/udpa/annotations/status.upb_minitable.c', - 'src/core/ext/upb-gen/udpa/annotations/versioning.upb_minitable.c', - 'src/core/ext/upb-gen/validate/validate.upb_minitable.c', - 'src/core/ext/upb-gen/xds/annotations/v3/migrate.upb_minitable.c', - 'src/core/ext/upb-gen/xds/annotations/v3/security.upb_minitable.c', - 'src/core/ext/upb-gen/xds/annotations/v3/sensitive.upb_minitable.c', - 'src/core/ext/upb-gen/xds/annotations/v3/status.upb_minitable.c', - 'src/core/ext/upb-gen/xds/annotations/v3/versioning.upb_minitable.c', - 'src/core/ext/upb-gen/xds/core/v3/authority.upb_minitable.c', - 'src/core/ext/upb-gen/xds/core/v3/cidr.upb_minitable.c', - 'src/core/ext/upb-gen/xds/core/v3/collection_entry.upb_minitable.c', - 'src/core/ext/upb-gen/xds/core/v3/context_params.upb_minitable.c', - 'src/core/ext/upb-gen/xds/core/v3/extension.upb_minitable.c', - 'src/core/ext/upb-gen/xds/core/v3/resource.upb_minitable.c', - 'src/core/ext/upb-gen/xds/core/v3/resource_locator.upb_minitable.c', - 'src/core/ext/upb-gen/xds/core/v3/resource_name.upb_minitable.c', - 'src/core/ext/upb-gen/xds/data/orca/v3/orca_load_report.upb_minitable.c', - 'src/core/ext/upb-gen/xds/service/orca/v3/orca.upb_minitable.c', - 'src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb_minitable.c', - 'src/core/ext/upb-gen/xds/type/matcher/v3/domain.upb_minitable.c', - 'src/core/ext/upb-gen/xds/type/matcher/v3/http_inputs.upb_minitable.c', - 'src/core/ext/upb-gen/xds/type/matcher/v3/ip.upb_minitable.c', - 'src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb_minitable.c', - 'src/core/ext/upb-gen/xds/type/matcher/v3/range.upb_minitable.c', - 'src/core/ext/upb-gen/xds/type/matcher/v3/regex.upb_minitable.c', - 'src/core/ext/upb-gen/xds/type/matcher/v3/string.upb_minitable.c', - 'src/core/ext/upb-gen/xds/type/v3/cel.upb_minitable.c', - 'src/core/ext/upb-gen/xds/type/v3/range.upb_minitable.c', - 'src/core/ext/upb-gen/xds/type/v3/typed_struct.upb_minitable.c', - 'src/core/ext/upbdefs-gen/envoy/admin/v3/certs.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/admin/v3/clusters.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/admin/v3/config_dump.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/admin/v3/config_dump_shared.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/admin/v3/init_dump.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/admin/v3/listeners.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/admin/v3/memory.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/admin/v3/metrics.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/admin/v3/mutex_stats.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/admin/v3/server_info.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/admin/v3/tap.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/annotations/deprecation.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/annotations/resource.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/accesslog/v3/accesslog.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/bootstrap/v3/bootstrap.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/cluster/v3/circuit_breaker.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/cluster/v3/cluster.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/cluster/v3/filter.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/cluster/v3/outlier_detection.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/common/matcher/v3/matcher.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/core/v3/address.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/core/v3/backoff.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/core/v3/base.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/core/v3/config_source.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/core/v3/event_service_config.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/core/v3/extension.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/core/v3/grpc_method_list.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/core/v3/grpc_service.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/core/v3/health_check.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/core/v3/http_service.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/core/v3/http_uri.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/core/v3/protocol.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/core/v3/proxy_protocol.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/core/v3/resolver.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/core/v3/socket_option.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/core/v3/substitution_format_string.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/core/v3/udp_socket_config.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/endpoint/v3/endpoint.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/endpoint/v3/endpoint_components.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/endpoint/v3/load_report.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/listener/v3/api_listener.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/listener/v3/listener.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/listener/v3/listener_components.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/listener/v3/quic_config.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/listener/v3/udp_listener_config.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/metrics/v3/metrics_service.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/metrics/v3/stats.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/overload/v3/overload.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/rbac/v3/rbac.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/route/v3/route.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/route/v3/route_components.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/route/v3/scoped_route.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/tap/v3/common.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/trace/v3/datadog.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/trace/v3/dynamic_ot.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/trace/v3/http_tracer.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/trace/v3/lightstep.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/trace/v3/opencensus.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/trace/v3/opentelemetry.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/trace/v3/service.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/trace/v3/skywalking.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/trace/v3/trace.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/trace/v3/xray.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/config/trace/v3/zipkin.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/data/accesslog/v3/accesslog.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/router/v3/router.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/extensions/http/stateful_session/cookie/v3/cookie.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/service/discovery/v3/ads.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/service/discovery/v3/discovery.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/service/load_stats/v3/lrs.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/service/status/v3/csds.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/type/http/v3/cookie.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/type/http/v3/path_transformation.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/type/matcher/v3/filter_state.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/type/matcher/v3/http_inputs.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/type/matcher/v3/metadata.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/type/matcher/v3/node.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/type/matcher/v3/number.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/type/matcher/v3/path.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/type/matcher/v3/regex.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/type/matcher/v3/status_code_input.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/type/matcher/v3/string.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/type/matcher/v3/struct.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/type/matcher/v3/value.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/type/metadata/v3/metadata.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/type/tracing/v3/custom_tag.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/type/v3/hash_policy.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/type/v3/http.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/type/v3/http_status.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/type/v3/percent.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/type/v3/range.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/type/v3/ratelimit_strategy.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/type/v3/ratelimit_unit.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/type/v3/semantic_version.upbdefs.c', - 'src/core/ext/upbdefs-gen/envoy/type/v3/token_bucket.upbdefs.c', - 'src/core/ext/upbdefs-gen/google/api/annotations.upbdefs.c', - 'src/core/ext/upbdefs-gen/google/api/expr/v1alpha1/checked.upbdefs.c', - 'src/core/ext/upbdefs-gen/google/api/expr/v1alpha1/syntax.upbdefs.c', - 'src/core/ext/upbdefs-gen/google/api/http.upbdefs.c', - 'src/core/ext/upbdefs-gen/google/api/httpbody.upbdefs.c', - 'src/core/ext/upbdefs-gen/google/protobuf/any.upbdefs.c', - 'src/core/ext/upbdefs-gen/google/protobuf/descriptor.upbdefs.c', - 'src/core/ext/upbdefs-gen/google/protobuf/duration.upbdefs.c', - 'src/core/ext/upbdefs-gen/google/protobuf/empty.upbdefs.c', - 'src/core/ext/upbdefs-gen/google/protobuf/struct.upbdefs.c', - 'src/core/ext/upbdefs-gen/google/protobuf/timestamp.upbdefs.c', - 'src/core/ext/upbdefs-gen/google/protobuf/wrappers.upbdefs.c', - 'src/core/ext/upbdefs-gen/google/rpc/status.upbdefs.c', - 'src/core/ext/upbdefs-gen/opencensus/proto/trace/v1/trace_config.upbdefs.c', - 'src/core/ext/upbdefs-gen/src/proto/grpc/lookup/v1/rls_config.upbdefs.c', - 'src/core/ext/upbdefs-gen/udpa/annotations/migrate.upbdefs.c', - 'src/core/ext/upbdefs-gen/udpa/annotations/security.upbdefs.c', - 'src/core/ext/upbdefs-gen/udpa/annotations/sensitive.upbdefs.c', - 'src/core/ext/upbdefs-gen/udpa/annotations/status.upbdefs.c', - 'src/core/ext/upbdefs-gen/udpa/annotations/versioning.upbdefs.c', - 'src/core/ext/upbdefs-gen/validate/validate.upbdefs.c', - 'src/core/ext/upbdefs-gen/xds/annotations/v3/migrate.upbdefs.c', - 'src/core/ext/upbdefs-gen/xds/annotations/v3/security.upbdefs.c', - 'src/core/ext/upbdefs-gen/xds/annotations/v3/sensitive.upbdefs.c', - 'src/core/ext/upbdefs-gen/xds/annotations/v3/status.upbdefs.c', - 'src/core/ext/upbdefs-gen/xds/annotations/v3/versioning.upbdefs.c', - 'src/core/ext/upbdefs-gen/xds/core/v3/authority.upbdefs.c', - 'src/core/ext/upbdefs-gen/xds/core/v3/cidr.upbdefs.c', - 'src/core/ext/upbdefs-gen/xds/core/v3/collection_entry.upbdefs.c', - 'src/core/ext/upbdefs-gen/xds/core/v3/context_params.upbdefs.c', - 'src/core/ext/upbdefs-gen/xds/core/v3/extension.upbdefs.c', - 'src/core/ext/upbdefs-gen/xds/core/v3/resource.upbdefs.c', - 'src/core/ext/upbdefs-gen/xds/core/v3/resource_locator.upbdefs.c', - 'src/core/ext/upbdefs-gen/xds/core/v3/resource_name.upbdefs.c', - 'src/core/ext/upbdefs-gen/xds/type/matcher/v3/cel.upbdefs.c', - 'src/core/ext/upbdefs-gen/xds/type/matcher/v3/domain.upbdefs.c', - 'src/core/ext/upbdefs-gen/xds/type/matcher/v3/http_inputs.upbdefs.c', - 'src/core/ext/upbdefs-gen/xds/type/matcher/v3/ip.upbdefs.c', - 'src/core/ext/upbdefs-gen/xds/type/matcher/v3/matcher.upbdefs.c', - 'src/core/ext/upbdefs-gen/xds/type/matcher/v3/range.upbdefs.c', - 'src/core/ext/upbdefs-gen/xds/type/matcher/v3/regex.upbdefs.c', - 'src/core/ext/upbdefs-gen/xds/type/matcher/v3/string.upbdefs.c', - 'src/core/ext/upbdefs-gen/xds/type/v3/cel.upbdefs.c', - 'src/core/ext/upbdefs-gen/xds/type/v3/range.upbdefs.c', - 'src/core/ext/upbdefs-gen/xds/type/v3/typed_struct.upbdefs.c', - 'src/core/ext/xds/certificate_provider_store.cc', - 'src/core/ext/xds/file_watcher_certificate_provider_factory.cc', - 'src/core/ext/xds/xds_api.cc', - 'src/core/ext/xds/xds_audit_logger_registry.cc', - 'src/core/ext/xds/xds_bootstrap.cc', - 'src/core/ext/xds/xds_bootstrap_grpc.cc', - 'src/core/ext/xds/xds_certificate_provider.cc', - 'src/core/ext/xds/xds_channel_stack_modifier.cc', - 'src/core/ext/xds/xds_client.cc', - 'src/core/ext/xds/xds_client_grpc.cc', - 'src/core/ext/xds/xds_client_stats.cc', - 'src/core/ext/xds/xds_cluster.cc', - 'src/core/ext/xds/xds_cluster_specifier_plugin.cc', - 'src/core/ext/xds/xds_common_types.cc', - 'src/core/ext/xds/xds_endpoint.cc', - 'src/core/ext/xds/xds_health_status.cc', - 'src/core/ext/xds/xds_http_fault_filter.cc', - 'src/core/ext/xds/xds_http_filters.cc', - 'src/core/ext/xds/xds_http_rbac_filter.cc', - 'src/core/ext/xds/xds_http_stateful_session_filter.cc', - 'src/core/ext/xds/xds_lb_policy_registry.cc', - 'src/core/ext/xds/xds_listener.cc', - 'src/core/ext/xds/xds_route_config.cc', - 'src/core/ext/xds/xds_routing.cc', - 'src/core/ext/xds/xds_server_config_fetcher.cc', - 'src/core/ext/xds/xds_transport_grpc.cc', - 'src/core/lib/address_utils/parse_address.cc', - 'src/core/lib/address_utils/sockaddr_utils.cc', - 'src/core/lib/backoff/backoff.cc', - 'src/core/lib/backoff/random_early_detection.cc', - 'src/core/lib/channel/call_tracer.cc', - 'src/core/lib/channel/channel_args.cc', - 'src/core/lib/channel/channel_args_preconditioning.cc', - 'src/core/lib/channel/channel_stack.cc', - 'src/core/lib/channel/channel_stack_builder.cc', - 'src/core/lib/channel/channel_stack_builder_impl.cc', - 'src/core/lib/channel/channel_stack_trace.cc', - 'src/core/lib/channel/channel_trace.cc', - 'src/core/lib/channel/channelz.cc', - 'src/core/lib/channel/channelz_registry.cc', - 'src/core/lib/channel/connected_channel.cc', - 'src/core/lib/channel/metrics.cc', - 'src/core/lib/channel/promise_based_filter.cc', - 'src/core/lib/channel/server_call_tracer_filter.cc', - 'src/core/lib/channel/status_util.cc', - 'src/core/lib/compression/compression.cc', - 'src/core/lib/compression/compression_internal.cc', - 'src/core/lib/compression/message_compress.cc', - 'src/core/lib/config/core_configuration.cc', - 'src/core/lib/debug/event_log.cc', - 'src/core/lib/debug/histogram_view.cc', - 'src/core/lib/debug/stats.cc', - 'src/core/lib/debug/stats_data.cc', - 'src/core/lib/debug/trace.cc', - 'src/core/lib/event_engine/ares_resolver.cc', - 'src/core/lib/event_engine/cf_engine/cf_engine.cc', - 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc', - 'src/core/lib/event_engine/cf_engine/dns_service_resolver.cc', - 'src/core/lib/event_engine/channel_args_endpoint_config.cc', - 'src/core/lib/event_engine/default_event_engine.cc', - 'src/core/lib/event_engine/default_event_engine_factory.cc', - 'src/core/lib/event_engine/event_engine.cc', - 'src/core/lib/event_engine/forkable.cc', - 'src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc', - 'src/core/lib/event_engine/posix_engine/ev_poll_posix.cc', - 'src/core/lib/event_engine/posix_engine/event_poller_posix_default.cc', - 'src/core/lib/event_engine/posix_engine/internal_errqueue.cc', - 'src/core/lib/event_engine/posix_engine/lockfree_event.cc', - 'src/core/lib/event_engine/posix_engine/native_posix_dns_resolver.cc', - 'src/core/lib/event_engine/posix_engine/posix_endpoint.cc', - 'src/core/lib/event_engine/posix_engine/posix_engine.cc', - 'src/core/lib/event_engine/posix_engine/posix_engine_listener.cc', - 'src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc', - 'src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc', - 'src/core/lib/event_engine/posix_engine/timer.cc', - 'src/core/lib/event_engine/posix_engine/timer_heap.cc', - 'src/core/lib/event_engine/posix_engine/timer_manager.cc', - 'src/core/lib/event_engine/posix_engine/traced_buffer_list.cc', - 'src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.cc', - 'src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.cc', - 'src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.cc', - 'src/core/lib/event_engine/resolved_address.cc', - 'src/core/lib/event_engine/shim.cc', - 'src/core/lib/event_engine/slice.cc', - 'src/core/lib/event_engine/slice_buffer.cc', - 'src/core/lib/event_engine/tcp_socket_utils.cc', - 'src/core/lib/event_engine/thread_pool/thread_count.cc', - 'src/core/lib/event_engine/thread_pool/thread_pool_factory.cc', - 'src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc', - 'src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc', - 'src/core/lib/event_engine/time_util.cc', - 'src/core/lib/event_engine/trace.cc', - 'src/core/lib/event_engine/utils.cc', - 'src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc', - 'src/core/lib/event_engine/windows/iocp.cc', - 'src/core/lib/event_engine/windows/native_windows_dns_resolver.cc', - 'src/core/lib/event_engine/windows/win_socket.cc', - 'src/core/lib/event_engine/windows/windows_endpoint.cc', - 'src/core/lib/event_engine/windows/windows_engine.cc', - 'src/core/lib/event_engine/windows/windows_listener.cc', - 'src/core/lib/event_engine/work_queue/basic_work_queue.cc', - 'src/core/lib/experiments/config.cc', - 'src/core/lib/experiments/experiments.cc', - 'src/core/lib/gprpp/load_file.cc', - 'src/core/lib/gprpp/per_cpu.cc', - 'src/core/lib/gprpp/posix/directory_reader.cc', - 'src/core/lib/gprpp/ref_counted_string.cc', - 'src/core/lib/gprpp/status_helper.cc', - 'src/core/lib/gprpp/time.cc', - 'src/core/lib/gprpp/time_averaged_stats.cc', - 'src/core/lib/gprpp/uuid_v4.cc', - 'src/core/lib/gprpp/validation_errors.cc', - 'src/core/lib/gprpp/windows/directory_reader.cc', - 'src/core/lib/gprpp/work_serializer.cc', - 'src/core/lib/handshaker/proxy_mapper_registry.cc', - 'src/core/lib/http/format_request.cc', - 'src/core/lib/http/httpcli.cc', - 'src/core/lib/http/httpcli_security_connector.cc', - 'src/core/lib/http/parser.cc', - 'src/core/lib/iomgr/buffer_list.cc', - 'src/core/lib/iomgr/call_combiner.cc', - 'src/core/lib/iomgr/cfstream_handle.cc', - 'src/core/lib/iomgr/closure.cc', - 'src/core/lib/iomgr/combiner.cc', - 'src/core/lib/iomgr/dualstack_socket_posix.cc', - 'src/core/lib/iomgr/endpoint.cc', - 'src/core/lib/iomgr/endpoint_cfstream.cc', - 'src/core/lib/iomgr/endpoint_pair_posix.cc', - 'src/core/lib/iomgr/endpoint_pair_windows.cc', - 'src/core/lib/iomgr/error.cc', - 'src/core/lib/iomgr/error_cfstream.cc', - 'src/core/lib/iomgr/ev_apple.cc', - 'src/core/lib/iomgr/ev_epoll1_linux.cc', - 'src/core/lib/iomgr/ev_poll_posix.cc', - 'src/core/lib/iomgr/ev_posix.cc', - 'src/core/lib/iomgr/ev_windows.cc', - 'src/core/lib/iomgr/event_engine_shims/closure.cc', - 'src/core/lib/iomgr/event_engine_shims/endpoint.cc', - 'src/core/lib/iomgr/event_engine_shims/tcp_client.cc', - 'src/core/lib/iomgr/exec_ctx.cc', - 'src/core/lib/iomgr/executor.cc', - 'src/core/lib/iomgr/fork_posix.cc', - 'src/core/lib/iomgr/fork_windows.cc', - 'src/core/lib/iomgr/gethostname_fallback.cc', - 'src/core/lib/iomgr/gethostname_host_name_max.cc', - 'src/core/lib/iomgr/gethostname_sysconf.cc', - 'src/core/lib/iomgr/grpc_if_nametoindex_posix.cc', - 'src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc', - 'src/core/lib/iomgr/internal_errqueue.cc', - 'src/core/lib/iomgr/iocp_windows.cc', - 'src/core/lib/iomgr/iomgr.cc', - 'src/core/lib/iomgr/iomgr_internal.cc', - 'src/core/lib/iomgr/iomgr_posix.cc', - 'src/core/lib/iomgr/iomgr_posix_cfstream.cc', - 'src/core/lib/iomgr/iomgr_windows.cc', - 'src/core/lib/iomgr/lockfree_event.cc', - 'src/core/lib/iomgr/polling_entity.cc', - 'src/core/lib/iomgr/pollset.cc', - 'src/core/lib/iomgr/pollset_set.cc', - 'src/core/lib/iomgr/pollset_set_windows.cc', - 'src/core/lib/iomgr/pollset_windows.cc', - 'src/core/lib/iomgr/resolve_address.cc', - 'src/core/lib/iomgr/resolve_address_posix.cc', - 'src/core/lib/iomgr/resolve_address_windows.cc', - 'src/core/lib/iomgr/sockaddr_utils_posix.cc', - 'src/core/lib/iomgr/socket_factory_posix.cc', - 'src/core/lib/iomgr/socket_mutator.cc', - 'src/core/lib/iomgr/socket_utils_common_posix.cc', - 'src/core/lib/iomgr/socket_utils_linux.cc', - 'src/core/lib/iomgr/socket_utils_posix.cc', - 'src/core/lib/iomgr/socket_utils_windows.cc', - 'src/core/lib/iomgr/socket_windows.cc', - 'src/core/lib/iomgr/systemd_utils.cc', - 'src/core/lib/iomgr/tcp_client.cc', - 'src/core/lib/iomgr/tcp_client_cfstream.cc', - 'src/core/lib/iomgr/tcp_client_posix.cc', - 'src/core/lib/iomgr/tcp_client_windows.cc', - 'src/core/lib/iomgr/tcp_posix.cc', - 'src/core/lib/iomgr/tcp_server.cc', - 'src/core/lib/iomgr/tcp_server_posix.cc', - 'src/core/lib/iomgr/tcp_server_utils_posix_common.cc', - 'src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc', - 'src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc', - 'src/core/lib/iomgr/tcp_server_windows.cc', - 'src/core/lib/iomgr/tcp_windows.cc', - 'src/core/lib/iomgr/timer.cc', - 'src/core/lib/iomgr/timer_generic.cc', - 'src/core/lib/iomgr/timer_heap.cc', - 'src/core/lib/iomgr/timer_manager.cc', - 'src/core/lib/iomgr/unix_sockets_posix.cc', - 'src/core/lib/iomgr/unix_sockets_posix_noop.cc', - 'src/core/lib/iomgr/vsock.cc', - 'src/core/lib/iomgr/wakeup_fd_eventfd.cc', - 'src/core/lib/iomgr/wakeup_fd_nospecial.cc', - 'src/core/lib/iomgr/wakeup_fd_pipe.cc', - 'src/core/lib/iomgr/wakeup_fd_posix.cc', - 'src/core/lib/json/json_object_loader.cc', - 'src/core/lib/json/json_reader.cc', - 'src/core/lib/json/json_util.cc', - 'src/core/lib/json/json_writer.cc', - 'src/core/lib/matchers/matchers.cc', - 'src/core/lib/promise/activity.cc', - 'src/core/lib/promise/party.cc', - 'src/core/lib/promise/sleep.cc', - 'src/core/lib/promise/trace.cc', - 'src/core/lib/resource_quota/api.cc', - 'src/core/lib/resource_quota/arena.cc', - 'src/core/lib/resource_quota/connection_quota.cc', - 'src/core/lib/resource_quota/memory_quota.cc', - 'src/core/lib/resource_quota/periodic_update.cc', - 'src/core/lib/resource_quota/resource_quota.cc', - 'src/core/lib/resource_quota/thread_quota.cc', - 'src/core/lib/resource_quota/trace.cc', - 'src/core/lib/security/authorization/audit_logging.cc', - 'src/core/lib/security/authorization/authorization_policy_provider_vtable.cc', - 'src/core/lib/security/authorization/evaluate_args.cc', - 'src/core/lib/security/authorization/grpc_authorization_engine.cc', - 'src/core/lib/security/authorization/grpc_server_authz_filter.cc', - 'src/core/lib/security/authorization/matchers.cc', - 'src/core/lib/security/authorization/rbac_policy.cc', - 'src/core/lib/security/authorization/stdout_logger.cc', - 'src/core/lib/security/certificate_provider/certificate_provider_registry.cc', - 'src/core/lib/security/context/security_context.cc', - 'src/core/lib/security/credentials/alts/alts_credentials.cc', - 'src/core/lib/security/credentials/alts/check_gcp_environment.cc', - 'src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc', - 'src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc', - 'src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc', - 'src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc', - 'src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc', - 'src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc', - 'src/core/lib/security/credentials/call_creds_util.cc', - 'src/core/lib/security/credentials/channel_creds_registry_init.cc', - 'src/core/lib/security/credentials/composite/composite_credentials.cc', - 'src/core/lib/security/credentials/credentials.cc', - 'src/core/lib/security/credentials/external/aws_external_account_credentials.cc', - 'src/core/lib/security/credentials/external/aws_request_signer.cc', - 'src/core/lib/security/credentials/external/external_account_credentials.cc', - 'src/core/lib/security/credentials/external/file_external_account_credentials.cc', - 'src/core/lib/security/credentials/external/url_external_account_credentials.cc', - 'src/core/lib/security/credentials/fake/fake_credentials.cc', - 'src/core/lib/security/credentials/google_default/credentials_generic.cc', - 'src/core/lib/security/credentials/google_default/google_default_credentials.cc', - 'src/core/lib/security/credentials/iam/iam_credentials.cc', - 'src/core/lib/security/credentials/insecure/insecure_credentials.cc', - 'src/core/lib/security/credentials/jwt/json_token.cc', - 'src/core/lib/security/credentials/jwt/jwt_credentials.cc', - 'src/core/lib/security/credentials/jwt/jwt_verifier.cc', - 'src/core/lib/security/credentials/local/local_credentials.cc', - 'src/core/lib/security/credentials/oauth2/oauth2_credentials.cc', - 'src/core/lib/security/credentials/plugin/plugin_credentials.cc', - 'src/core/lib/security/credentials/ssl/ssl_credentials.cc', - 'src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc', - 'src/core/lib/security/credentials/tls/grpc_tls_certificate_match.cc', - 'src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc', - 'src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc', - 'src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc', - 'src/core/lib/security/credentials/tls/grpc_tls_crl_provider.cc', - 'src/core/lib/security/credentials/tls/tls_credentials.cc', - 'src/core/lib/security/credentials/tls/tls_utils.cc', - 'src/core/lib/security/credentials/xds/xds_credentials.cc', - 'src/core/lib/security/security_connector/alts/alts_security_connector.cc', - 'src/core/lib/security/security_connector/fake/fake_security_connector.cc', - 'src/core/lib/security/security_connector/insecure/insecure_security_connector.cc', - 'src/core/lib/security/security_connector/load_system_roots_fallback.cc', - 'src/core/lib/security/security_connector/load_system_roots_supported.cc', - 'src/core/lib/security/security_connector/load_system_roots_windows.cc', - 'src/core/lib/security/security_connector/local/local_security_connector.cc', - 'src/core/lib/security/security_connector/security_connector.cc', - 'src/core/lib/security/security_connector/ssl/ssl_security_connector.cc', - 'src/core/lib/security/security_connector/ssl_utils.cc', - 'src/core/lib/security/security_connector/tls/tls_security_connector.cc', - 'src/core/lib/security/transport/client_auth_filter.cc', - 'src/core/lib/security/transport/legacy_server_auth_filter.cc', - 'src/core/lib/security/transport/secure_endpoint.cc', - 'src/core/lib/security/transport/security_handshaker.cc', - 'src/core/lib/security/transport/server_auth_filter.cc', - 'src/core/lib/security/transport/tsi_error.cc', - 'src/core/lib/security/util/json_util.cc', - 'src/core/lib/slice/b64.cc', - 'src/core/lib/slice/percent_encoding.cc', - 'src/core/lib/slice/slice.cc', - 'src/core/lib/slice/slice_buffer.cc', - 'src/core/lib/slice/slice_refcount.cc', - 'src/core/lib/slice/slice_string_helpers.cc', - 'src/core/lib/surface/api_trace.cc', - 'src/core/lib/surface/byte_buffer.cc', - 'src/core/lib/surface/byte_buffer_reader.cc', - 'src/core/lib/surface/call.cc', - 'src/core/lib/surface/call_details.cc', - 'src/core/lib/surface/call_log_batch.cc', - 'src/core/lib/surface/channel.cc', - 'src/core/lib/surface/channel_create.cc', - 'src/core/lib/surface/channel_init.cc', - 'src/core/lib/surface/channel_stack_type.cc', - 'src/core/lib/surface/completion_queue.cc', - 'src/core/lib/surface/completion_queue_factory.cc', - 'src/core/lib/surface/event_string.cc', - 'src/core/lib/surface/init.cc', - 'src/core/lib/surface/init_internally.cc', - 'src/core/lib/surface/lame_client.cc', - 'src/core/lib/surface/legacy_channel.cc', - 'src/core/lib/surface/metadata_array.cc', - 'src/core/lib/surface/server.cc', - 'src/core/lib/surface/validate_metadata.cc', - 'src/core/lib/surface/version.cc', - 'src/core/lib/surface/wait_for_cq_end_op.cc', - 'src/core/lib/transport/batch_builder.cc', - 'src/core/lib/transport/bdp_estimator.cc', - 'src/core/lib/transport/call_factory.cc', - 'src/core/lib/transport/call_filters.cc', - 'src/core/lib/transport/call_final_info.cc', - 'src/core/lib/transport/call_size_estimator.cc', - 'src/core/lib/transport/call_spine.cc', - 'src/core/lib/transport/connectivity_state.cc', - 'src/core/lib/transport/error_utils.cc', - 'src/core/lib/transport/handshaker.cc', - 'src/core/lib/transport/handshaker_registry.cc', - 'src/core/lib/transport/http_connect_handshaker.cc', - 'src/core/lib/transport/message.cc', - 'src/core/lib/transport/metadata.cc', - 'src/core/lib/transport/metadata_batch.cc', - 'src/core/lib/transport/metadata_info.cc', - 'src/core/lib/transport/parsed_metadata.cc', - 'src/core/lib/transport/status_conversion.cc', - 'src/core/lib/transport/tcp_connect_handshaker.cc', - 'src/core/lib/transport/timeout_encoding.cc', - 'src/core/lib/transport/transport.cc', - 'src/core/lib/transport/transport_op_string.cc', - 'src/core/lib/uri/uri_parser.cc', - 'src/core/load_balancing/address_filtering.cc', - 'src/core/load_balancing/backend_metric_parser.cc', - 'src/core/load_balancing/child_policy_handler.cc', - 'src/core/load_balancing/endpoint_list.cc', - 'src/core/load_balancing/grpclb/client_load_reporting_filter.cc', - 'src/core/load_balancing/grpclb/grpclb.cc', - 'src/core/load_balancing/grpclb/grpclb_balancer_addresses.cc', - 'src/core/load_balancing/grpclb/grpclb_client_stats.cc', - 'src/core/load_balancing/grpclb/load_balancer_api.cc', - 'src/core/load_balancing/health_check_client.cc', - 'src/core/load_balancing/lb_policy.cc', - 'src/core/load_balancing/lb_policy_registry.cc', - 'src/core/load_balancing/oob_backend_metric.cc', - 'src/core/load_balancing/outlier_detection/outlier_detection.cc', - 'src/core/load_balancing/pick_first/pick_first.cc', - 'src/core/load_balancing/priority/priority.cc', - 'src/core/load_balancing/ring_hash/ring_hash.cc', - 'src/core/load_balancing/rls/rls.cc', - 'src/core/load_balancing/round_robin/round_robin.cc', - 'src/core/load_balancing/weighted_round_robin/static_stride_scheduler.cc', - 'src/core/load_balancing/weighted_round_robin/weighted_round_robin.cc', - 'src/core/load_balancing/weighted_target/weighted_target.cc', - 'src/core/load_balancing/xds/cds.cc', - 'src/core/load_balancing/xds/xds_cluster_impl.cc', - 'src/core/load_balancing/xds/xds_cluster_manager.cc', - 'src/core/load_balancing/xds/xds_override_host.cc', - 'src/core/load_balancing/xds/xds_wrr_locality.cc', - 'src/core/plugin_registry/grpc_plugin_registry.cc', - 'src/core/plugin_registry/grpc_plugin_registry_extra.cc', - 'src/core/resolver/binder/binder_resolver.cc', - 'src/core/resolver/dns/c_ares/dns_resolver_ares.cc', - 'src/core/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc', - 'src/core/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc', - 'src/core/resolver/dns/c_ares/grpc_ares_wrapper.cc', - 'src/core/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc', - 'src/core/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc', - 'src/core/resolver/dns/dns_resolver_plugin.cc', - 'src/core/resolver/dns/event_engine/event_engine_client_channel_resolver.cc', - 'src/core/resolver/dns/event_engine/service_config_helper.cc', - 'src/core/resolver/dns/native/dns_resolver.cc', - 'src/core/resolver/endpoint_addresses.cc', - 'src/core/resolver/fake/fake_resolver.cc', - 'src/core/resolver/google_c2p/google_c2p_resolver.cc', - 'src/core/resolver/polling_resolver.cc', - 'src/core/resolver/resolver.cc', - 'src/core/resolver/resolver_registry.cc', - 'src/core/resolver/sockaddr/sockaddr_resolver.cc', - 'src/core/resolver/xds/xds_dependency_manager.cc', - 'src/core/resolver/xds/xds_resolver.cc', - 'src/core/resolver/xds/xds_resolver_trace.cc', - 'src/core/service_config/service_config_channel_arg_filter.cc', - 'src/core/service_config/service_config_impl.cc', - 'src/core/service_config/service_config_parser.cc', - 'src/core/tsi/alts/crypt/aes_gcm.cc', - 'src/core/tsi/alts/crypt/gsec.cc', - 'src/core/tsi/alts/frame_protector/alts_counter.cc', - 'src/core/tsi/alts/frame_protector/alts_crypter.cc', - 'src/core/tsi/alts/frame_protector/alts_frame_protector.cc', - 'src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.cc', - 'src/core/tsi/alts/frame_protector/alts_seal_privacy_integrity_crypter.cc', - 'src/core/tsi/alts/frame_protector/alts_unseal_privacy_integrity_crypter.cc', - 'src/core/tsi/alts/frame_protector/frame_handler.cc', - 'src/core/tsi/alts/handshaker/alts_handshaker_client.cc', - 'src/core/tsi/alts/handshaker/alts_shared_resource.cc', - 'src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc', - 'src/core/tsi/alts/handshaker/alts_tsi_utils.cc', - 'src/core/tsi/alts/handshaker/transport_security_common_api.cc', - 'src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc', - 'src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc', - 'src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc', - 'src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.cc', - 'src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc', - 'src/core/tsi/fake_transport_security.cc', - 'src/core/tsi/local_transport_security.cc', - 'src/core/tsi/ssl/key_logging/ssl_key_logging.cc', - 'src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc', - 'src/core/tsi/ssl/session_cache/ssl_session_cache.cc', - 'src/core/tsi/ssl/session_cache/ssl_session_openssl.cc', - 'src/core/tsi/ssl_transport_security.cc', - 'src/core/tsi/ssl_transport_security_utils.cc', - 'src/core/tsi/transport_security.cc', - 'src/core/tsi/transport_security_grpc.cc', - ], - }, - { - 'target_name': 'grpc_test_util', - 'type': 'static_library', - 'dependencies': [ - 'absl/debugging:failure_signal_handler', - 'absl/debugging:stacktrace', - 'absl/debugging:symbolize', - 'grpc', - ], - 'sources': [ - 'test/core/event_engine/test_init.cc', - 'test/core/util/build.cc', - 'test/core/util/port.cc', - 'test/core/util/port_isolated_runtime_environment.cc', - 'test/core/util/port_server_client.cc', - 'test/core/util/reconnect_server.cc', - 'test/core/util/stack_tracer.cc', - 'test/core/util/test_config.cc', - 'test/core/util/test_tcp_server.cc', - 'test/core/util/tls_utils.cc', - ], - }, - { - 'target_name': 'grpc_test_util_unsecure', - 'type': 'static_library', - 'dependencies': [ - 'absl/debugging:failure_signal_handler', - 'absl/debugging:stacktrace', - 'absl/debugging:symbolize', - 'grpc_unsecure', - ], - 'sources': [ - 'test/core/event_engine/test_init.cc', - 'test/core/util/build.cc', - 'test/core/util/port.cc', - 'test/core/util/port_isolated_runtime_environment.cc', - 'test/core/util/port_server_client.cc', - 'test/core/util/reconnect_server.cc', - 'test/core/util/stack_tracer.cc', - 'test/core/util/test_config.cc', - 'test/core/util/test_tcp_server.cc', - ], - }, - { - 'target_name': 'grpc_unsecure', - 'type': 'static_library', - 'dependencies': [ - 'upb_message_lib', - 'utf8_range_lib', - 'z', - 'absl/algorithm:container', - 'absl/base:config', - 'absl/base:no_destructor', - 'absl/cleanup:cleanup', - 'absl/container:flat_hash_map', - 'absl/container:flat_hash_set', - 'absl/container:inlined_vector', - 'absl/functional:bind_front', - 'absl/functional:function_ref', - 'absl/hash:hash', - 'absl/meta:type_traits', - 'absl/random:bit_gen_ref', - 'absl/random:distributions', - 'absl/status:statusor', - 'absl/types:span', - 'absl/utility:utility', - 'cares', - 'gpr', - 'address_sorting', - ], - 'sources': [ - 'src/core/client_channel/backup_poller.cc', - 'src/core/client_channel/client_channel_channelz.cc', - 'src/core/client_channel/client_channel_factory.cc', - 'src/core/client_channel/client_channel_filter.cc', - 'src/core/client_channel/client_channel_plugin.cc', - 'src/core/client_channel/client_channel_service_config.cc', - 'src/core/client_channel/config_selector.cc', - 'src/core/client_channel/dynamic_filters.cc', - 'src/core/client_channel/global_subchannel_pool.cc', - 'src/core/client_channel/http_proxy_mapper.cc', - 'src/core/client_channel/local_subchannel_pool.cc', - 'src/core/client_channel/retry_filter.cc', - 'src/core/client_channel/retry_filter_legacy_call_data.cc', - 'src/core/client_channel/retry_service_config.cc', - 'src/core/client_channel/retry_throttle.cc', - 'src/core/client_channel/subchannel.cc', - 'src/core/client_channel/subchannel_pool_interface.cc', - 'src/core/client_channel/subchannel_stream_client.cc', - 'src/core/ext/filters/backend_metrics/backend_metric_filter.cc', - 'src/core/ext/filters/census/grpc_context.cc', - 'src/core/ext/filters/channel_idle/channel_idle_filter.cc', - 'src/core/ext/filters/channel_idle/idle_filter_state.cc', - 'src/core/ext/filters/channel_idle/legacy_channel_idle_filter.cc', - 'src/core/ext/filters/deadline/deadline_filter.cc', - 'src/core/ext/filters/fault_injection/fault_injection_filter.cc', - 'src/core/ext/filters/fault_injection/fault_injection_service_config_parser.cc', - 'src/core/ext/filters/http/client/http_client_filter.cc', - 'src/core/ext/filters/http/client_authority_filter.cc', - 'src/core/ext/filters/http/http_filters_plugin.cc', - 'src/core/ext/filters/http/message_compress/compression_filter.cc', - 'src/core/ext/filters/http/message_compress/legacy_compression_filter.cc', - 'src/core/ext/filters/http/server/http_server_filter.cc', - 'src/core/ext/filters/message_size/message_size_filter.cc', - 'src/core/ext/transport/chttp2/client/chttp2_connector.cc', - 'src/core/ext/transport/chttp2/server/chttp2_server.cc', - '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_transport.cc', - 'src/core/ext/transport/chttp2/transport/decode_huff.cc', - 'src/core/ext/transport/chttp2/transport/flow_control.cc', - 'src/core/ext/transport/chttp2/transport/frame.cc', - 'src/core/ext/transport/chttp2/transport/frame_data.cc', - 'src/core/ext/transport/chttp2/transport/frame_goaway.cc', - 'src/core/ext/transport/chttp2/transport/frame_ping.cc', - 'src/core/ext/transport/chttp2/transport/frame_rst_stream.cc', - 'src/core/ext/transport/chttp2/transport/frame_settings.cc', - 'src/core/ext/transport/chttp2/transport/frame_window_update.cc', - 'src/core/ext/transport/chttp2/transport/hpack_encoder.cc', - 'src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc', - 'src/core/ext/transport/chttp2/transport/hpack_parse_result.cc', - 'src/core/ext/transport/chttp2/transport/hpack_parser.cc', - 'src/core/ext/transport/chttp2/transport/hpack_parser_table.cc', - 'src/core/ext/transport/chttp2/transport/http2_settings.cc', - 'src/core/ext/transport/chttp2/transport/http_trace.cc', - 'src/core/ext/transport/chttp2/transport/huffsyms.cc', - 'src/core/ext/transport/chttp2/transport/max_concurrent_streams_policy.cc', - 'src/core/ext/transport/chttp2/transport/parsing.cc', - 'src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc', - 'src/core/ext/transport/chttp2/transport/ping_callbacks.cc', - 'src/core/ext/transport/chttp2/transport/ping_rate_policy.cc', - 'src/core/ext/transport/chttp2/transport/stream_lists.cc', - 'src/core/ext/transport/chttp2/transport/varint.cc', - 'src/core/ext/transport/chttp2/transport/write_size_policy.cc', - 'src/core/ext/transport/chttp2/transport/writing.cc', - 'src/core/ext/transport/inproc/inproc_plugin.cc', - 'src/core/ext/transport/inproc/inproc_transport.cc', - 'src/core/ext/transport/inproc/legacy_inproc_transport.cc', - 'src/core/ext/upb-gen/google/api/annotations.upb_minitable.c', - 'src/core/ext/upb-gen/google/api/http.upb_minitable.c', - 'src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c', - 'src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.c', - 'src/core/ext/upb-gen/google/protobuf/duration.upb_minitable.c', - 'src/core/ext/upb-gen/google/protobuf/empty.upb_minitable.c', - 'src/core/ext/upb-gen/google/protobuf/struct.upb_minitable.c', - 'src/core/ext/upb-gen/google/protobuf/timestamp.upb_minitable.c', - 'src/core/ext/upb-gen/google/protobuf/wrappers.upb_minitable.c', - 'src/core/ext/upb-gen/google/rpc/status.upb_minitable.c', - 'src/core/ext/upb-gen/src/proto/grpc/gcp/altscontext.upb_minitable.c', - 'src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb_minitable.c', - 'src/core/ext/upb-gen/src/proto/grpc/gcp/transport_security_common.upb_minitable.c', - 'src/core/ext/upb-gen/src/proto/grpc/health/v1/health.upb_minitable.c', - 'src/core/ext/upb-gen/src/proto/grpc/lb/v1/load_balancer.upb_minitable.c', - 'src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls.upb_minitable.c', - 'src/core/ext/upb-gen/validate/validate.upb_minitable.c', - 'src/core/ext/upb-gen/xds/data/orca/v3/orca_load_report.upb_minitable.c', - 'src/core/ext/upb-gen/xds/service/orca/v3/orca.upb_minitable.c', - 'src/core/lib/address_utils/parse_address.cc', - 'src/core/lib/address_utils/sockaddr_utils.cc', - 'src/core/lib/backoff/backoff.cc', - 'src/core/lib/backoff/random_early_detection.cc', - 'src/core/lib/channel/call_tracer.cc', - 'src/core/lib/channel/channel_args.cc', - 'src/core/lib/channel/channel_args_preconditioning.cc', - 'src/core/lib/channel/channel_stack.cc', - 'src/core/lib/channel/channel_stack_builder.cc', - 'src/core/lib/channel/channel_stack_builder_impl.cc', - 'src/core/lib/channel/channel_stack_trace.cc', - 'src/core/lib/channel/channel_trace.cc', - 'src/core/lib/channel/channelz.cc', - 'src/core/lib/channel/channelz_registry.cc', - 'src/core/lib/channel/connected_channel.cc', - 'src/core/lib/channel/metrics.cc', - 'src/core/lib/channel/promise_based_filter.cc', - 'src/core/lib/channel/server_call_tracer_filter.cc', - 'src/core/lib/channel/status_util.cc', - 'src/core/lib/compression/compression.cc', - 'src/core/lib/compression/compression_internal.cc', - 'src/core/lib/compression/message_compress.cc', - 'src/core/lib/config/core_configuration.cc', - 'src/core/lib/debug/event_log.cc', - 'src/core/lib/debug/histogram_view.cc', - 'src/core/lib/debug/stats.cc', - 'src/core/lib/debug/stats_data.cc', - 'src/core/lib/debug/trace.cc', - 'src/core/lib/event_engine/ares_resolver.cc', - 'src/core/lib/event_engine/cf_engine/cf_engine.cc', - 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc', - 'src/core/lib/event_engine/cf_engine/dns_service_resolver.cc', - 'src/core/lib/event_engine/channel_args_endpoint_config.cc', - 'src/core/lib/event_engine/default_event_engine.cc', - 'src/core/lib/event_engine/default_event_engine_factory.cc', - 'src/core/lib/event_engine/event_engine.cc', - 'src/core/lib/event_engine/forkable.cc', - 'src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc', - 'src/core/lib/event_engine/posix_engine/ev_poll_posix.cc', - 'src/core/lib/event_engine/posix_engine/event_poller_posix_default.cc', - 'src/core/lib/event_engine/posix_engine/internal_errqueue.cc', - 'src/core/lib/event_engine/posix_engine/lockfree_event.cc', - 'src/core/lib/event_engine/posix_engine/native_posix_dns_resolver.cc', - 'src/core/lib/event_engine/posix_engine/posix_endpoint.cc', - 'src/core/lib/event_engine/posix_engine/posix_engine.cc', - 'src/core/lib/event_engine/posix_engine/posix_engine_listener.cc', - 'src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc', - 'src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc', - 'src/core/lib/event_engine/posix_engine/timer.cc', - 'src/core/lib/event_engine/posix_engine/timer_heap.cc', - 'src/core/lib/event_engine/posix_engine/timer_manager.cc', - 'src/core/lib/event_engine/posix_engine/traced_buffer_list.cc', - 'src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.cc', - 'src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.cc', - 'src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.cc', - 'src/core/lib/event_engine/resolved_address.cc', - 'src/core/lib/event_engine/shim.cc', - 'src/core/lib/event_engine/slice.cc', - 'src/core/lib/event_engine/slice_buffer.cc', - 'src/core/lib/event_engine/tcp_socket_utils.cc', - 'src/core/lib/event_engine/thread_pool/thread_count.cc', - 'src/core/lib/event_engine/thread_pool/thread_pool_factory.cc', - 'src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc', - 'src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc', - 'src/core/lib/event_engine/time_util.cc', - 'src/core/lib/event_engine/trace.cc', - 'src/core/lib/event_engine/utils.cc', - 'src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc', - 'src/core/lib/event_engine/windows/iocp.cc', - 'src/core/lib/event_engine/windows/native_windows_dns_resolver.cc', - 'src/core/lib/event_engine/windows/win_socket.cc', - 'src/core/lib/event_engine/windows/windows_endpoint.cc', - 'src/core/lib/event_engine/windows/windows_engine.cc', - 'src/core/lib/event_engine/windows/windows_listener.cc', - 'src/core/lib/event_engine/work_queue/basic_work_queue.cc', - 'src/core/lib/experiments/config.cc', - 'src/core/lib/experiments/experiments.cc', - 'src/core/lib/gprpp/load_file.cc', - 'src/core/lib/gprpp/per_cpu.cc', - 'src/core/lib/gprpp/ref_counted_string.cc', - 'src/core/lib/gprpp/status_helper.cc', - 'src/core/lib/gprpp/time.cc', - 'src/core/lib/gprpp/time_averaged_stats.cc', - 'src/core/lib/gprpp/uuid_v4.cc', - 'src/core/lib/gprpp/validation_errors.cc', - 'src/core/lib/gprpp/work_serializer.cc', - 'src/core/lib/handshaker/proxy_mapper_registry.cc', - 'src/core/lib/http/format_request.cc', - 'src/core/lib/http/httpcli.cc', - 'src/core/lib/http/parser.cc', - 'src/core/lib/iomgr/buffer_list.cc', - 'src/core/lib/iomgr/call_combiner.cc', - 'src/core/lib/iomgr/cfstream_handle.cc', - 'src/core/lib/iomgr/closure.cc', - 'src/core/lib/iomgr/combiner.cc', - 'src/core/lib/iomgr/dualstack_socket_posix.cc', - 'src/core/lib/iomgr/endpoint.cc', - 'src/core/lib/iomgr/endpoint_cfstream.cc', - 'src/core/lib/iomgr/endpoint_pair_posix.cc', - 'src/core/lib/iomgr/endpoint_pair_windows.cc', - 'src/core/lib/iomgr/error.cc', - 'src/core/lib/iomgr/error_cfstream.cc', - 'src/core/lib/iomgr/ev_apple.cc', - 'src/core/lib/iomgr/ev_epoll1_linux.cc', - 'src/core/lib/iomgr/ev_poll_posix.cc', - 'src/core/lib/iomgr/ev_posix.cc', - 'src/core/lib/iomgr/ev_windows.cc', - 'src/core/lib/iomgr/event_engine_shims/closure.cc', - 'src/core/lib/iomgr/event_engine_shims/endpoint.cc', - 'src/core/lib/iomgr/event_engine_shims/tcp_client.cc', - 'src/core/lib/iomgr/exec_ctx.cc', - 'src/core/lib/iomgr/executor.cc', - 'src/core/lib/iomgr/fork_posix.cc', - 'src/core/lib/iomgr/fork_windows.cc', - 'src/core/lib/iomgr/gethostname_fallback.cc', - 'src/core/lib/iomgr/gethostname_host_name_max.cc', - 'src/core/lib/iomgr/gethostname_sysconf.cc', - 'src/core/lib/iomgr/grpc_if_nametoindex_posix.cc', - 'src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc', - 'src/core/lib/iomgr/internal_errqueue.cc', - 'src/core/lib/iomgr/iocp_windows.cc', - 'src/core/lib/iomgr/iomgr.cc', - 'src/core/lib/iomgr/iomgr_internal.cc', - 'src/core/lib/iomgr/iomgr_posix.cc', - 'src/core/lib/iomgr/iomgr_posix_cfstream.cc', - 'src/core/lib/iomgr/iomgr_windows.cc', - 'src/core/lib/iomgr/lockfree_event.cc', - 'src/core/lib/iomgr/polling_entity.cc', - 'src/core/lib/iomgr/pollset.cc', - 'src/core/lib/iomgr/pollset_set.cc', - 'src/core/lib/iomgr/pollset_set_windows.cc', - 'src/core/lib/iomgr/pollset_windows.cc', - 'src/core/lib/iomgr/resolve_address.cc', - 'src/core/lib/iomgr/resolve_address_posix.cc', - 'src/core/lib/iomgr/resolve_address_windows.cc', - 'src/core/lib/iomgr/sockaddr_utils_posix.cc', - 'src/core/lib/iomgr/socket_factory_posix.cc', - 'src/core/lib/iomgr/socket_mutator.cc', - 'src/core/lib/iomgr/socket_utils_common_posix.cc', - 'src/core/lib/iomgr/socket_utils_linux.cc', - 'src/core/lib/iomgr/socket_utils_posix.cc', - 'src/core/lib/iomgr/socket_utils_windows.cc', - 'src/core/lib/iomgr/socket_windows.cc', - 'src/core/lib/iomgr/systemd_utils.cc', - 'src/core/lib/iomgr/tcp_client.cc', - 'src/core/lib/iomgr/tcp_client_cfstream.cc', - 'src/core/lib/iomgr/tcp_client_posix.cc', - 'src/core/lib/iomgr/tcp_client_windows.cc', - 'src/core/lib/iomgr/tcp_posix.cc', - 'src/core/lib/iomgr/tcp_server.cc', - 'src/core/lib/iomgr/tcp_server_posix.cc', - 'src/core/lib/iomgr/tcp_server_utils_posix_common.cc', - 'src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc', - 'src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc', - 'src/core/lib/iomgr/tcp_server_windows.cc', - 'src/core/lib/iomgr/tcp_windows.cc', - 'src/core/lib/iomgr/timer.cc', - 'src/core/lib/iomgr/timer_generic.cc', - 'src/core/lib/iomgr/timer_heap.cc', - 'src/core/lib/iomgr/timer_manager.cc', - 'src/core/lib/iomgr/unix_sockets_posix.cc', - 'src/core/lib/iomgr/unix_sockets_posix_noop.cc', - 'src/core/lib/iomgr/vsock.cc', - 'src/core/lib/iomgr/wakeup_fd_eventfd.cc', - 'src/core/lib/iomgr/wakeup_fd_nospecial.cc', - 'src/core/lib/iomgr/wakeup_fd_pipe.cc', - 'src/core/lib/iomgr/wakeup_fd_posix.cc', - 'src/core/lib/json/json_object_loader.cc', - 'src/core/lib/json/json_reader.cc', - 'src/core/lib/json/json_writer.cc', - 'src/core/lib/promise/activity.cc', - 'src/core/lib/promise/party.cc', - 'src/core/lib/promise/sleep.cc', - 'src/core/lib/promise/trace.cc', - 'src/core/lib/resource_quota/api.cc', - 'src/core/lib/resource_quota/arena.cc', - 'src/core/lib/resource_quota/connection_quota.cc', - 'src/core/lib/resource_quota/memory_quota.cc', - 'src/core/lib/resource_quota/periodic_update.cc', - 'src/core/lib/resource_quota/resource_quota.cc', - 'src/core/lib/resource_quota/thread_quota.cc', - 'src/core/lib/resource_quota/trace.cc', - 'src/core/lib/security/authorization/authorization_policy_provider_vtable.cc', - 'src/core/lib/security/authorization/evaluate_args.cc', - 'src/core/lib/security/authorization/grpc_server_authz_filter.cc', - 'src/core/lib/security/certificate_provider/certificate_provider_registry.cc', - 'src/core/lib/security/context/security_context.cc', - 'src/core/lib/security/credentials/alts/check_gcp_environment.cc', - 'src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc', - 'src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc', - 'src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc', - 'src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc', - 'src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc', - 'src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc', - 'src/core/lib/security/credentials/call_creds_util.cc', - 'src/core/lib/security/credentials/composite/composite_credentials.cc', - 'src/core/lib/security/credentials/credentials.cc', - 'src/core/lib/security/credentials/fake/fake_credentials.cc', - 'src/core/lib/security/credentials/insecure/insecure_credentials.cc', - 'src/core/lib/security/credentials/plugin/plugin_credentials.cc', - 'src/core/lib/security/credentials/tls/tls_utils.cc', - 'src/core/lib/security/security_connector/fake/fake_security_connector.cc', - 'src/core/lib/security/security_connector/insecure/insecure_security_connector.cc', - 'src/core/lib/security/security_connector/load_system_roots_fallback.cc', - 'src/core/lib/security/security_connector/load_system_roots_supported.cc', - 'src/core/lib/security/security_connector/load_system_roots_windows.cc', - 'src/core/lib/security/security_connector/security_connector.cc', - 'src/core/lib/security/transport/client_auth_filter.cc', - 'src/core/lib/security/transport/legacy_server_auth_filter.cc', - 'src/core/lib/security/transport/secure_endpoint.cc', - 'src/core/lib/security/transport/security_handshaker.cc', - 'src/core/lib/security/transport/server_auth_filter.cc', - 'src/core/lib/security/transport/tsi_error.cc', - 'src/core/lib/security/util/json_util.cc', - 'src/core/lib/slice/b64.cc', - 'src/core/lib/slice/percent_encoding.cc', - 'src/core/lib/slice/slice.cc', - 'src/core/lib/slice/slice_buffer.cc', - 'src/core/lib/slice/slice_refcount.cc', - 'src/core/lib/slice/slice_string_helpers.cc', - 'src/core/lib/surface/api_trace.cc', - 'src/core/lib/surface/byte_buffer.cc', - 'src/core/lib/surface/byte_buffer_reader.cc', - 'src/core/lib/surface/call.cc', - 'src/core/lib/surface/call_details.cc', - 'src/core/lib/surface/call_log_batch.cc', - 'src/core/lib/surface/channel.cc', - 'src/core/lib/surface/channel_create.cc', - 'src/core/lib/surface/channel_init.cc', - 'src/core/lib/surface/channel_stack_type.cc', - 'src/core/lib/surface/completion_queue.cc', - 'src/core/lib/surface/completion_queue_factory.cc', - 'src/core/lib/surface/event_string.cc', - 'src/core/lib/surface/init.cc', - 'src/core/lib/surface/init_internally.cc', - 'src/core/lib/surface/lame_client.cc', - 'src/core/lib/surface/legacy_channel.cc', - 'src/core/lib/surface/metadata_array.cc', - 'src/core/lib/surface/server.cc', - 'src/core/lib/surface/validate_metadata.cc', - 'src/core/lib/surface/version.cc', - 'src/core/lib/surface/wait_for_cq_end_op.cc', - 'src/core/lib/transport/batch_builder.cc', - 'src/core/lib/transport/bdp_estimator.cc', - 'src/core/lib/transport/call_factory.cc', - 'src/core/lib/transport/call_filters.cc', - 'src/core/lib/transport/call_final_info.cc', - 'src/core/lib/transport/call_size_estimator.cc', - 'src/core/lib/transport/call_spine.cc', - 'src/core/lib/transport/connectivity_state.cc', - 'src/core/lib/transport/error_utils.cc', - 'src/core/lib/transport/handshaker.cc', - 'src/core/lib/transport/handshaker_registry.cc', - 'src/core/lib/transport/http_connect_handshaker.cc', - 'src/core/lib/transport/message.cc', - 'src/core/lib/transport/metadata.cc', - 'src/core/lib/transport/metadata_batch.cc', - 'src/core/lib/transport/metadata_info.cc', - 'src/core/lib/transport/parsed_metadata.cc', - 'src/core/lib/transport/status_conversion.cc', - 'src/core/lib/transport/tcp_connect_handshaker.cc', - 'src/core/lib/transport/timeout_encoding.cc', - 'src/core/lib/transport/transport.cc', - 'src/core/lib/transport/transport_op_string.cc', - 'src/core/lib/uri/uri_parser.cc', - 'src/core/load_balancing/address_filtering.cc', - 'src/core/load_balancing/backend_metric_parser.cc', - 'src/core/load_balancing/child_policy_handler.cc', - 'src/core/load_balancing/endpoint_list.cc', - 'src/core/load_balancing/grpclb/client_load_reporting_filter.cc', - 'src/core/load_balancing/grpclb/grpclb.cc', - 'src/core/load_balancing/grpclb/grpclb_balancer_addresses.cc', - 'src/core/load_balancing/grpclb/grpclb_client_stats.cc', - 'src/core/load_balancing/grpclb/load_balancer_api.cc', - 'src/core/load_balancing/health_check_client.cc', - 'src/core/load_balancing/lb_policy.cc', - 'src/core/load_balancing/lb_policy_registry.cc', - 'src/core/load_balancing/oob_backend_metric.cc', - 'src/core/load_balancing/outlier_detection/outlier_detection.cc', - 'src/core/load_balancing/pick_first/pick_first.cc', - 'src/core/load_balancing/priority/priority.cc', - 'src/core/load_balancing/rls/rls.cc', - 'src/core/load_balancing/round_robin/round_robin.cc', - 'src/core/load_balancing/weighted_round_robin/static_stride_scheduler.cc', - 'src/core/load_balancing/weighted_round_robin/weighted_round_robin.cc', - 'src/core/load_balancing/weighted_target/weighted_target.cc', - 'src/core/plugin_registry/grpc_plugin_registry.cc', - 'src/core/plugin_registry/grpc_plugin_registry_noextra.cc', - 'src/core/resolver/binder/binder_resolver.cc', - 'src/core/resolver/dns/c_ares/dns_resolver_ares.cc', - 'src/core/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc', - 'src/core/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc', - 'src/core/resolver/dns/c_ares/grpc_ares_wrapper.cc', - 'src/core/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc', - 'src/core/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc', - 'src/core/resolver/dns/dns_resolver_plugin.cc', - 'src/core/resolver/dns/event_engine/event_engine_client_channel_resolver.cc', - 'src/core/resolver/dns/event_engine/service_config_helper.cc', - 'src/core/resolver/dns/native/dns_resolver.cc', - 'src/core/resolver/endpoint_addresses.cc', - 'src/core/resolver/fake/fake_resolver.cc', - 'src/core/resolver/polling_resolver.cc', - 'src/core/resolver/resolver.cc', - 'src/core/resolver/resolver_registry.cc', - 'src/core/resolver/sockaddr/sockaddr_resolver.cc', - 'src/core/service_config/service_config_channel_arg_filter.cc', - 'src/core/service_config/service_config_impl.cc', - 'src/core/service_config/service_config_parser.cc', - 'src/core/tsi/alts/handshaker/transport_security_common_api.cc', - 'src/core/tsi/fake_transport_security.cc', - 'src/core/tsi/local_transport_security.cc', - 'src/core/tsi/transport_security.cc', - 'src/core/tsi/transport_security_grpc.cc', - 'third_party/upb/upb/message/accessors.c', - 'third_party/upb/upb/mini_descriptor/build_enum.c', - 'third_party/upb/upb/mini_descriptor/decode.c', - 'third_party/upb/upb/mini_descriptor/internal/base92.c', - 'third_party/upb/upb/mini_descriptor/internal/encode.c', - 'third_party/upb/upb/mini_descriptor/link.c', - 'third_party/upb/upb/wire/decode.c', - 'third_party/upb/upb/wire/decode_fast.c', - 'third_party/upb/upb/wire/encode.c', - 'third_party/upb/upb/wire/eps_copy_input_stream.c', - 'third_party/upb/upb/wire/reader.c', - ], - }, - { - 'target_name': 'gtest', - 'type': 'static_library', - 'dependencies': [ - 're2', - 'absl/container:flat_hash_set', - 'absl/debugging:failure_signal_handler', - 'absl/debugging:stacktrace', - 'absl/debugging:symbolize', - 'absl/flags:flag', - 'absl/flags:parse', - 'absl/flags:reflection', - 'absl/flags:usage', - 'absl/strings:strings', - 'absl/types:any', - 'absl/types:optional', - 'absl/types:variant', - ], - 'sources': [ - 'third_party/googletest/googlemock/src/gmock-cardinalities.cc', - 'third_party/googletest/googlemock/src/gmock-internal-utils.cc', - 'third_party/googletest/googlemock/src/gmock-matchers.cc', - 'third_party/googletest/googlemock/src/gmock-spec-builders.cc', - 'third_party/googletest/googlemock/src/gmock.cc', - 'third_party/googletest/googletest/src/gtest-assertion-result.cc', - 'third_party/googletest/googletest/src/gtest-death-test.cc', - 'third_party/googletest/googletest/src/gtest-filepath.cc', - 'third_party/googletest/googletest/src/gtest-matchers.cc', - 'third_party/googletest/googletest/src/gtest-port.cc', - 'third_party/googletest/googletest/src/gtest-printers.cc', - 'third_party/googletest/googletest/src/gtest-test-part.cc', - 'third_party/googletest/googletest/src/gtest-typed-test.cc', - 'third_party/googletest/googletest/src/gtest.cc', - ], - }, - { - 'target_name': 're2', - 'type': 'static_library', - 'dependencies': [ - ], - 'sources': [ - 'third_party/re2/re2/bitstate.cc', - 'third_party/re2/re2/compile.cc', - 'third_party/re2/re2/dfa.cc', - 'third_party/re2/re2/filtered_re2.cc', - 'third_party/re2/re2/mimics_pcre.cc', - 'third_party/re2/re2/nfa.cc', - 'third_party/re2/re2/onepass.cc', - 'third_party/re2/re2/parse.cc', - 'third_party/re2/re2/perl_groups.cc', - 'third_party/re2/re2/prefilter.cc', - 'third_party/re2/re2/prefilter_tree.cc', - 'third_party/re2/re2/prog.cc', - 'third_party/re2/re2/re2.cc', - 'third_party/re2/re2/regexp.cc', - 'third_party/re2/re2/set.cc', - 'third_party/re2/re2/simplify.cc', - 'third_party/re2/re2/stringpiece.cc', - 'third_party/re2/re2/tostring.cc', - 'third_party/re2/re2/unicode_casefold.cc', - 'third_party/re2/re2/unicode_groups.cc', - 'third_party/re2/util/rune.cc', - 'third_party/re2/util/strutil.cc', - ], - }, - { - 'target_name': 'upb_base_lib', - 'type': 'static_library', - 'dependencies': [ - ], - 'sources': [ - 'third_party/upb/upb/base/status.c', - ], - }, - { - 'target_name': 'upb_json_lib', - 'type': 'static_library', - 'dependencies': [ - 'upb_message_lib', - 'utf8_range_lib', - ], - 'sources': [ - 'src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.c', - 'third_party/upb/upb/json/decode.c', - 'third_party/upb/upb/json/encode.c', - 'third_party/upb/upb/lex/atoi.c', - 'third_party/upb/upb/lex/round_trip.c', - 'third_party/upb/upb/lex/strtod.c', - 'third_party/upb/upb/lex/unicode.c', - 'third_party/upb/upb/message/accessors.c', - 'third_party/upb/upb/mini_descriptor/build_enum.c', - 'third_party/upb/upb/mini_descriptor/decode.c', - 'third_party/upb/upb/mini_descriptor/internal/base92.c', - 'third_party/upb/upb/mini_descriptor/internal/encode.c', - 'third_party/upb/upb/mini_descriptor/link.c', - 'third_party/upb/upb/reflection/def_pool.c', - 'third_party/upb/upb/reflection/def_type.c', - 'third_party/upb/upb/reflection/desc_state.c', - 'third_party/upb/upb/reflection/enum_def.c', - 'third_party/upb/upb/reflection/enum_reserved_range.c', - 'third_party/upb/upb/reflection/enum_value_def.c', - 'third_party/upb/upb/reflection/extension_range.c', - 'third_party/upb/upb/reflection/field_def.c', - 'third_party/upb/upb/reflection/file_def.c', - 'third_party/upb/upb/reflection/internal/def_builder.c', - 'third_party/upb/upb/reflection/internal/strdup2.c', - 'third_party/upb/upb/reflection/message.c', - 'third_party/upb/upb/reflection/message_def.c', - 'third_party/upb/upb/reflection/message_reserved_range.c', - 'third_party/upb/upb/reflection/method_def.c', - 'third_party/upb/upb/reflection/oneof_def.c', - 'third_party/upb/upb/reflection/service_def.c', - 'third_party/upb/upb/wire/decode.c', - 'third_party/upb/upb/wire/decode_fast.c', - 'third_party/upb/upb/wire/encode.c', - 'third_party/upb/upb/wire/eps_copy_input_stream.c', - 'third_party/upb/upb/wire/reader.c', - ], - }, - { - 'target_name': 'upb_mem_lib', - 'type': 'static_library', - 'dependencies': [ - ], - 'sources': [ - 'third_party/upb/upb/mem/alloc.c', - 'third_party/upb/upb/mem/arena.c', - ], - }, - { - 'target_name': 'upb_message_lib', - 'type': 'static_library', - 'dependencies': [ - 'upb_base_lib', - 'upb_mem_lib', - ], - 'sources': [ - 'third_party/upb/upb/hash/common.c', - 'third_party/upb/upb/message/array.c', - 'third_party/upb/upb/message/map.c', - 'third_party/upb/upb/message/map_sorter.c', - 'third_party/upb/upb/message/message.c', - 'third_party/upb/upb/mini_table/extension_registry.c', - 'third_party/upb/upb/mini_table/internal/message.c', - 'third_party/upb/upb/mini_table/message.c', - ], - }, - { - 'target_name': 'upb_textformat_lib', - 'type': 'static_library', - 'dependencies': [ - 'upb_message_lib', - 'utf8_range_lib', - ], - 'sources': [ - 'src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.c', - 'third_party/upb/upb/lex/atoi.c', - 'third_party/upb/upb/lex/round_trip.c', - 'third_party/upb/upb/lex/strtod.c', - 'third_party/upb/upb/lex/unicode.c', - 'third_party/upb/upb/message/accessors.c', - 'third_party/upb/upb/mini_descriptor/build_enum.c', - 'third_party/upb/upb/mini_descriptor/decode.c', - 'third_party/upb/upb/mini_descriptor/internal/base92.c', - 'third_party/upb/upb/mini_descriptor/internal/encode.c', - 'third_party/upb/upb/mini_descriptor/link.c', - 'third_party/upb/upb/reflection/def_pool.c', - 'third_party/upb/upb/reflection/def_type.c', - 'third_party/upb/upb/reflection/desc_state.c', - 'third_party/upb/upb/reflection/enum_def.c', - 'third_party/upb/upb/reflection/enum_reserved_range.c', - 'third_party/upb/upb/reflection/enum_value_def.c', - 'third_party/upb/upb/reflection/extension_range.c', - 'third_party/upb/upb/reflection/field_def.c', - 'third_party/upb/upb/reflection/file_def.c', - 'third_party/upb/upb/reflection/internal/def_builder.c', - 'third_party/upb/upb/reflection/internal/strdup2.c', - 'third_party/upb/upb/reflection/message.c', - 'third_party/upb/upb/reflection/message_def.c', - 'third_party/upb/upb/reflection/message_reserved_range.c', - 'third_party/upb/upb/reflection/method_def.c', - 'third_party/upb/upb/reflection/oneof_def.c', - 'third_party/upb/upb/reflection/service_def.c', - 'third_party/upb/upb/text/encode.c', - 'third_party/upb/upb/wire/decode.c', - 'third_party/upb/upb/wire/decode_fast.c', - 'third_party/upb/upb/wire/encode.c', - 'third_party/upb/upb/wire/eps_copy_input_stream.c', - 'third_party/upb/upb/wire/reader.c', - ], - }, - { - 'target_name': 'utf8_range_lib', - 'type': 'static_library', - 'dependencies': [ - ], - 'sources': [ - 'third_party/utf8_range/naive.c', - 'third_party/utf8_range/range2-neon.c', - 'third_party/utf8_range/range2-sse.c', - ], - }, - { - 'target_name': 'z', - 'type': 'static_library', - 'dependencies': [ - ], - 'sources': [ - 'third_party/zlib/adler32.c', - 'third_party/zlib/compress.c', - 'third_party/zlib/crc32.c', - 'third_party/zlib/deflate.c', - 'third_party/zlib/infback.c', - 'third_party/zlib/inffast.c', - 'third_party/zlib/inflate.c', - 'third_party/zlib/inftrees.c', - 'third_party/zlib/trees.c', - 'third_party/zlib/uncompr.c', - 'third_party/zlib/zutil.c', - ], - }, - { - 'target_name': 'benchmark_helpers', - 'type': 'static_library', - 'dependencies': [ - 'benchmark', - 'grpc++_unsecure', - 'grpc_test_util_unsecure', - 'grpc++_test_config', - ], - 'sources': [ - 'src/proto/grpc/testing/echo.proto', - 'src/proto/grpc/testing/echo_messages.proto', - 'src/proto/grpc/testing/simple_messages.proto', - 'src/proto/grpc/testing/xds/v3/orca_load_report.proto', - 'test/core/util/cmdline.cc', - 'test/core/util/fuzzer_util.cc', - 'test/core/util/grpc_profiler.cc', - 'test/core/util/histogram.cc', - 'test/core/util/mock_endpoint.cc', - 'test/core/util/parse_hexstring.cc', - 'test/core/util/resolve_localhost_ip46.cc', - 'test/core/util/slice_splitter.cc', - 'test/core/util/tracer_util.cc', - 'test/cpp/microbenchmarks/helpers.cc', - ], - }, - { - 'target_name': 'grpc++', - 'type': 'static_library', - 'dependencies': [ - 'grpc', - 'protobuf', - ], - 'sources': [ - 'src/core/ext/transport/binder/client/binder_connector.cc', - 'src/core/ext/transport/binder/client/channel_create.cc', - 'src/core/ext/transport/binder/client/channel_create_impl.cc', - 'src/core/ext/transport/binder/client/connection_id_generator.cc', - 'src/core/ext/transport/binder/client/endpoint_binder_pool.cc', - 'src/core/ext/transport/binder/client/jni_utils.cc', - 'src/core/ext/transport/binder/client/security_policy_setting.cc', - 'src/core/ext/transport/binder/security_policy/binder_security_policy.cc', - 'src/core/ext/transport/binder/server/binder_server.cc', - 'src/core/ext/transport/binder/server/binder_server_credentials.cc', - 'src/core/ext/transport/binder/transport/binder_transport.cc', - 'src/core/ext/transport/binder/utils/ndk_binder.cc', - 'src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc', - 'src/core/ext/transport/binder/wire_format/binder_android.cc', - 'src/core/ext/transport/binder/wire_format/binder_constants.cc', - 'src/core/ext/transport/binder/wire_format/transaction.cc', - 'src/core/ext/transport/binder/wire_format/wire_reader_impl.cc', - 'src/core/ext/transport/binder/wire_format/wire_writer.cc', - 'src/cpp/client/channel_cc.cc', - 'src/cpp/client/client_callback.cc', - 'src/cpp/client/client_context.cc', - 'src/cpp/client/client_interceptor.cc', - 'src/cpp/client/client_stats_interceptor.cc', - 'src/cpp/client/create_channel.cc', - 'src/cpp/client/create_channel_internal.cc', - 'src/cpp/client/create_channel_posix.cc', - 'src/cpp/client/insecure_credentials.cc', - 'src/cpp/client/secure_credentials.cc', - 'src/cpp/client/xds_credentials.cc', - 'src/cpp/common/alarm.cc', - 'src/cpp/common/auth_property_iterator.cc', - 'src/cpp/common/channel_arguments.cc', - 'src/cpp/common/completion_queue_cc.cc', - 'src/cpp/common/resource_quota_cc.cc', - 'src/cpp/common/rpc_method.cc', - 'src/cpp/common/secure_auth_context.cc', - 'src/cpp/common/secure_channel_arguments.cc', - 'src/cpp/common/secure_create_auth_context.cc', - 'src/cpp/common/tls_certificate_provider.cc', - 'src/cpp/common/tls_certificate_verifier.cc', - 'src/cpp/common/tls_credentials_options.cc', - 'src/cpp/common/validate_service_config.cc', - 'src/cpp/common/version_cc.cc', - 'src/cpp/server/async_generic_service.cc', - 'src/cpp/server/backend_metric_recorder.cc', - 'src/cpp/server/channel_argument_option.cc', - 'src/cpp/server/create_default_thread_pool.cc', - 'src/cpp/server/external_connection_acceptor_impl.cc', - 'src/cpp/server/health/default_health_check_service.cc', - 'src/cpp/server/health/health_check_service.cc', - 'src/cpp/server/health/health_check_service_server_builder_option.cc', - 'src/cpp/server/insecure_server_credentials.cc', - 'src/cpp/server/secure_server_credentials.cc', - 'src/cpp/server/server_builder.cc', - 'src/cpp/server/server_callback.cc', - 'src/cpp/server/server_cc.cc', - 'src/cpp/server/server_context.cc', - 'src/cpp/server/server_posix.cc', - 'src/cpp/server/xds_server_builder.cc', - 'src/cpp/server/xds_server_credentials.cc', - 'src/cpp/thread_manager/thread_manager.cc', - 'src/cpp/util/byte_buffer_cc.cc', - 'src/cpp/util/status.cc', - 'src/cpp/util/string_ref.cc', - 'src/cpp/util/time_cc.cc', - ], - }, - { - 'target_name': 'grpc++_alts', - 'type': 'static_library', - 'dependencies': [ - 'grpc++', - ], - 'sources': [ - 'src/cpp/common/alts_context.cc', - 'src/cpp/common/alts_util.cc', - ], - }, - { - 'target_name': 'grpc++_error_details', - 'type': 'static_library', - 'dependencies': [ - 'grpc++', - ], - 'sources': [ - 'src/cpp/util/error_details.cc', - ], - }, - { - 'target_name': 'grpc++_reflection', - 'type': 'static_library', - 'dependencies': [ - 'grpc++', - ], - 'sources': [ - 'src/proto/grpc/reflection/v1/reflection.proto', - 'src/proto/grpc/reflection/v1alpha/reflection.proto', - 'src/cpp/ext/proto_server_reflection.cc', - 'src/cpp/ext/proto_server_reflection_plugin.cc', - ], - }, - { - 'target_name': 'grpc++_test', - 'type': 'static_library', - 'dependencies': [ - 'gtest', - 'grpc++', - ], - 'sources': [ - 'src/cpp/client/channel_test_peer.cc', - ], - }, - { - 'target_name': 'grpc++_test_config', - 'type': 'static_library', - 'dependencies': [ - 'absl/flags:parse', - 'gpr', - ], - 'sources': [ - 'test/cpp/util/test_config_cc.cc', - ], - }, - { - 'target_name': 'grpc++_test_util', - 'type': 'static_library', - 'dependencies': [ - 'grpc++', - 'grpc_test_util', - ], - 'sources': [ - 'src/core/lib/gpr/subprocess_posix.cc', - 'src/core/lib/gpr/subprocess_windows.cc', - 'test/core/end2end/data/client_certs.cc', - 'test/core/end2end/data/server1_cert.cc', - 'test/core/end2end/data/server1_key.cc', - 'test/core/end2end/data/test_root_cert.cc', - 'test/core/util/cmdline.cc', - 'test/core/util/fuzzer_util.cc', - 'test/core/util/grpc_profiler.cc', - 'test/core/util/histogram.cc', - 'test/core/util/mock_endpoint.cc', - 'test/core/util/parse_hexstring.cc', - 'test/core/util/resolve_localhost_ip46.cc', - 'test/core/util/slice_splitter.cc', - 'test/core/util/tracer_util.cc', - 'test/cpp/util/byte_buffer_proto_helper.cc', - 'test/cpp/util/create_test_channel.cc', - 'test/cpp/util/string_ref_helper.cc', - 'test/cpp/util/subprocess.cc', - 'test/cpp/util/test_credentials_provider.cc', - ], - }, - { - 'target_name': 'grpc++_unsecure', - 'type': 'static_library', - 'dependencies': [ - 'grpc_unsecure', - 'protobuf', - ], - 'sources': [ - 'src/cpp/client/channel_cc.cc', - 'src/cpp/client/client_callback.cc', - 'src/cpp/client/client_context.cc', - 'src/cpp/client/client_interceptor.cc', - 'src/cpp/client/client_stats_interceptor.cc', - 'src/cpp/client/create_channel.cc', - 'src/cpp/client/create_channel_internal.cc', - 'src/cpp/client/create_channel_posix.cc', - 'src/cpp/client/insecure_credentials.cc', - 'src/cpp/common/alarm.cc', - 'src/cpp/common/channel_arguments.cc', - 'src/cpp/common/completion_queue_cc.cc', - 'src/cpp/common/insecure_create_auth_context.cc', - 'src/cpp/common/resource_quota_cc.cc', - 'src/cpp/common/rpc_method.cc', - 'src/cpp/common/validate_service_config.cc', - 'src/cpp/common/version_cc.cc', - 'src/cpp/server/async_generic_service.cc', - 'src/cpp/server/backend_metric_recorder.cc', - 'src/cpp/server/channel_argument_option.cc', - 'src/cpp/server/create_default_thread_pool.cc', - 'src/cpp/server/external_connection_acceptor_impl.cc', - 'src/cpp/server/health/default_health_check_service.cc', - 'src/cpp/server/health/health_check_service.cc', - 'src/cpp/server/health/health_check_service_server_builder_option.cc', - 'src/cpp/server/insecure_server_credentials.cc', - 'src/cpp/server/server_builder.cc', - 'src/cpp/server/server_callback.cc', - 'src/cpp/server/server_cc.cc', - 'src/cpp/server/server_context.cc', - 'src/cpp/server/server_posix.cc', - 'src/cpp/thread_manager/thread_manager.cc', - 'src/cpp/util/byte_buffer_cc.cc', - 'src/cpp/util/status.cc', - 'src/cpp/util/string_ref.cc', - 'src/cpp/util/time_cc.cc', - ], - }, - { - 'target_name': 'grpc_authorization_provider', - 'type': 'static_library', - 'dependencies': [ - 'upb_message_lib', - 're2', - 'utf8_range_lib', - 'z', - 'absl/base:config', - 'absl/base:no_destructor', - 'absl/cleanup:cleanup', - 'absl/container:flat_hash_map', - 'absl/container:flat_hash_set', - 'absl/container:inlined_vector', - 'absl/functional:function_ref', - 'absl/hash:hash', - 'absl/meta:type_traits', - 'absl/random:bit_gen_ref', - 'absl/random:distributions', - 'absl/status:statusor', - 'absl/types:span', - 'absl/utility:utility', - 'cares', - 'gpr', - 'address_sorting', - ], - 'sources': [ - 'src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c', - 'src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.c', - 'src/core/ext/upb-gen/google/rpc/status.upb_minitable.c', - 'src/core/ext/upb-gen/src/proto/grpc/gcp/altscontext.upb_minitable.c', - 'src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb_minitable.c', - 'src/core/ext/upb-gen/src/proto/grpc/gcp/transport_security_common.upb_minitable.c', - 'src/core/lib/address_utils/parse_address.cc', - 'src/core/lib/address_utils/sockaddr_utils.cc', - 'src/core/lib/backoff/backoff.cc', - 'src/core/lib/backoff/random_early_detection.cc', - 'src/core/lib/channel/call_tracer.cc', - 'src/core/lib/channel/channel_args.cc', - 'src/core/lib/channel/channel_args_preconditioning.cc', - 'src/core/lib/channel/channel_stack.cc', - 'src/core/lib/channel/channel_stack_builder.cc', - 'src/core/lib/channel/channel_stack_builder_impl.cc', - 'src/core/lib/channel/channel_stack_trace.cc', - 'src/core/lib/channel/channel_trace.cc', - 'src/core/lib/channel/channelz.cc', - 'src/core/lib/channel/channelz_registry.cc', - 'src/core/lib/channel/connected_channel.cc', - 'src/core/lib/channel/metrics.cc', - 'src/core/lib/channel/promise_based_filter.cc', - 'src/core/lib/channel/status_util.cc', - 'src/core/lib/compression/compression.cc', - 'src/core/lib/compression/compression_internal.cc', - 'src/core/lib/compression/message_compress.cc', - 'src/core/lib/config/core_configuration.cc', - 'src/core/lib/debug/event_log.cc', - 'src/core/lib/debug/histogram_view.cc', - 'src/core/lib/debug/stats.cc', - 'src/core/lib/debug/stats_data.cc', - 'src/core/lib/debug/trace.cc', - 'src/core/lib/event_engine/ares_resolver.cc', - 'src/core/lib/event_engine/cf_engine/cf_engine.cc', - 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc', - 'src/core/lib/event_engine/cf_engine/dns_service_resolver.cc', - 'src/core/lib/event_engine/channel_args_endpoint_config.cc', - 'src/core/lib/event_engine/default_event_engine.cc', - 'src/core/lib/event_engine/default_event_engine_factory.cc', - 'src/core/lib/event_engine/event_engine.cc', - 'src/core/lib/event_engine/forkable.cc', - 'src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc', - 'src/core/lib/event_engine/posix_engine/ev_poll_posix.cc', - 'src/core/lib/event_engine/posix_engine/event_poller_posix_default.cc', - 'src/core/lib/event_engine/posix_engine/internal_errqueue.cc', - 'src/core/lib/event_engine/posix_engine/lockfree_event.cc', - 'src/core/lib/event_engine/posix_engine/native_posix_dns_resolver.cc', - 'src/core/lib/event_engine/posix_engine/posix_endpoint.cc', - 'src/core/lib/event_engine/posix_engine/posix_engine.cc', - 'src/core/lib/event_engine/posix_engine/posix_engine_listener.cc', - 'src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc', - 'src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc', - 'src/core/lib/event_engine/posix_engine/timer.cc', - 'src/core/lib/event_engine/posix_engine/timer_heap.cc', - 'src/core/lib/event_engine/posix_engine/timer_manager.cc', - 'src/core/lib/event_engine/posix_engine/traced_buffer_list.cc', - 'src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.cc', - 'src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.cc', - 'src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.cc', - 'src/core/lib/event_engine/resolved_address.cc', - 'src/core/lib/event_engine/shim.cc', - 'src/core/lib/event_engine/slice.cc', - 'src/core/lib/event_engine/slice_buffer.cc', - 'src/core/lib/event_engine/tcp_socket_utils.cc', - 'src/core/lib/event_engine/thread_pool/thread_count.cc', - 'src/core/lib/event_engine/thread_pool/thread_pool_factory.cc', - 'src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc', - 'src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc', - 'src/core/lib/event_engine/time_util.cc', - 'src/core/lib/event_engine/trace.cc', - 'src/core/lib/event_engine/utils.cc', - 'src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc', - 'src/core/lib/event_engine/windows/iocp.cc', - 'src/core/lib/event_engine/windows/native_windows_dns_resolver.cc', - 'src/core/lib/event_engine/windows/win_socket.cc', - 'src/core/lib/event_engine/windows/windows_endpoint.cc', - 'src/core/lib/event_engine/windows/windows_engine.cc', - 'src/core/lib/event_engine/windows/windows_listener.cc', - 'src/core/lib/event_engine/work_queue/basic_work_queue.cc', - 'src/core/lib/experiments/config.cc', - 'src/core/lib/experiments/experiments.cc', - 'src/core/lib/gprpp/load_file.cc', - 'src/core/lib/gprpp/per_cpu.cc', - 'src/core/lib/gprpp/ref_counted_string.cc', - 'src/core/lib/gprpp/status_helper.cc', - 'src/core/lib/gprpp/time.cc', - 'src/core/lib/gprpp/time_averaged_stats.cc', - 'src/core/lib/gprpp/validation_errors.cc', - 'src/core/lib/gprpp/work_serializer.cc', - 'src/core/lib/handshaker/proxy_mapper_registry.cc', - 'src/core/lib/iomgr/buffer_list.cc', - 'src/core/lib/iomgr/call_combiner.cc', - 'src/core/lib/iomgr/cfstream_handle.cc', - 'src/core/lib/iomgr/closure.cc', - 'src/core/lib/iomgr/combiner.cc', - 'src/core/lib/iomgr/dualstack_socket_posix.cc', - 'src/core/lib/iomgr/endpoint.cc', - 'src/core/lib/iomgr/endpoint_cfstream.cc', - 'src/core/lib/iomgr/endpoint_pair_posix.cc', - 'src/core/lib/iomgr/endpoint_pair_windows.cc', - 'src/core/lib/iomgr/error.cc', - 'src/core/lib/iomgr/error_cfstream.cc', - 'src/core/lib/iomgr/ev_apple.cc', - 'src/core/lib/iomgr/ev_epoll1_linux.cc', - 'src/core/lib/iomgr/ev_poll_posix.cc', - 'src/core/lib/iomgr/ev_posix.cc', - 'src/core/lib/iomgr/ev_windows.cc', - 'src/core/lib/iomgr/event_engine_shims/closure.cc', - 'src/core/lib/iomgr/event_engine_shims/endpoint.cc', - 'src/core/lib/iomgr/event_engine_shims/tcp_client.cc', - 'src/core/lib/iomgr/exec_ctx.cc', - 'src/core/lib/iomgr/executor.cc', - 'src/core/lib/iomgr/fork_posix.cc', - 'src/core/lib/iomgr/fork_windows.cc', - 'src/core/lib/iomgr/gethostname_fallback.cc', - 'src/core/lib/iomgr/gethostname_host_name_max.cc', - 'src/core/lib/iomgr/gethostname_sysconf.cc', - 'src/core/lib/iomgr/grpc_if_nametoindex_posix.cc', - 'src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc', - 'src/core/lib/iomgr/internal_errqueue.cc', - 'src/core/lib/iomgr/iocp_windows.cc', - 'src/core/lib/iomgr/iomgr.cc', - 'src/core/lib/iomgr/iomgr_internal.cc', - 'src/core/lib/iomgr/iomgr_posix.cc', - 'src/core/lib/iomgr/iomgr_posix_cfstream.cc', - 'src/core/lib/iomgr/iomgr_windows.cc', - 'src/core/lib/iomgr/lockfree_event.cc', - 'src/core/lib/iomgr/polling_entity.cc', - 'src/core/lib/iomgr/pollset.cc', - 'src/core/lib/iomgr/pollset_set.cc', - 'src/core/lib/iomgr/pollset_set_windows.cc', - 'src/core/lib/iomgr/pollset_windows.cc', - 'src/core/lib/iomgr/resolve_address.cc', - 'src/core/lib/iomgr/resolve_address_posix.cc', - 'src/core/lib/iomgr/resolve_address_windows.cc', - 'src/core/lib/iomgr/sockaddr_utils_posix.cc', - 'src/core/lib/iomgr/socket_factory_posix.cc', - 'src/core/lib/iomgr/socket_mutator.cc', - 'src/core/lib/iomgr/socket_utils_common_posix.cc', - 'src/core/lib/iomgr/socket_utils_linux.cc', - 'src/core/lib/iomgr/socket_utils_posix.cc', - 'src/core/lib/iomgr/socket_utils_windows.cc', - 'src/core/lib/iomgr/socket_windows.cc', - 'src/core/lib/iomgr/systemd_utils.cc', - 'src/core/lib/iomgr/tcp_client.cc', - 'src/core/lib/iomgr/tcp_client_cfstream.cc', - 'src/core/lib/iomgr/tcp_client_posix.cc', - 'src/core/lib/iomgr/tcp_client_windows.cc', - 'src/core/lib/iomgr/tcp_posix.cc', - 'src/core/lib/iomgr/tcp_server.cc', - 'src/core/lib/iomgr/tcp_server_posix.cc', - 'src/core/lib/iomgr/tcp_server_utils_posix_common.cc', - 'src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc', - 'src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc', - 'src/core/lib/iomgr/tcp_server_windows.cc', - 'src/core/lib/iomgr/tcp_windows.cc', - 'src/core/lib/iomgr/timer.cc', - 'src/core/lib/iomgr/timer_generic.cc', - 'src/core/lib/iomgr/timer_heap.cc', - 'src/core/lib/iomgr/timer_manager.cc', - 'src/core/lib/iomgr/unix_sockets_posix.cc', - 'src/core/lib/iomgr/unix_sockets_posix_noop.cc', - 'src/core/lib/iomgr/vsock.cc', - 'src/core/lib/iomgr/wakeup_fd_eventfd.cc', - 'src/core/lib/iomgr/wakeup_fd_nospecial.cc', - 'src/core/lib/iomgr/wakeup_fd_pipe.cc', - 'src/core/lib/iomgr/wakeup_fd_posix.cc', - 'src/core/lib/json/json_reader.cc', - 'src/core/lib/json/json_writer.cc', - 'src/core/lib/matchers/matchers.cc', - 'src/core/lib/promise/activity.cc', - 'src/core/lib/promise/party.cc', - 'src/core/lib/promise/trace.cc', - 'src/core/lib/resource_quota/api.cc', - 'src/core/lib/resource_quota/arena.cc', - 'src/core/lib/resource_quota/connection_quota.cc', - 'src/core/lib/resource_quota/memory_quota.cc', - 'src/core/lib/resource_quota/periodic_update.cc', - 'src/core/lib/resource_quota/resource_quota.cc', - 'src/core/lib/resource_quota/thread_quota.cc', - 'src/core/lib/resource_quota/trace.cc', - 'src/core/lib/security/authorization/audit_logging.cc', - 'src/core/lib/security/authorization/authorization_policy_provider_vtable.cc', - 'src/core/lib/security/authorization/evaluate_args.cc', - 'src/core/lib/security/authorization/grpc_authorization_engine.cc', - 'src/core/lib/security/authorization/grpc_authorization_policy_provider.cc', - 'src/core/lib/security/authorization/grpc_server_authz_filter.cc', - 'src/core/lib/security/authorization/matchers.cc', - 'src/core/lib/security/authorization/rbac_policy.cc', - 'src/core/lib/security/authorization/rbac_translator.cc', - 'src/core/lib/security/authorization/stdout_logger.cc', - 'src/core/lib/security/certificate_provider/certificate_provider_registry.cc', - 'src/core/lib/security/context/security_context.cc', - 'src/core/lib/security/credentials/alts/check_gcp_environment.cc', - 'src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc', - 'src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc', - 'src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc', - 'src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc', - 'src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc', - 'src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc', - 'src/core/lib/security/credentials/call_creds_util.cc', - 'src/core/lib/security/credentials/composite/composite_credentials.cc', - 'src/core/lib/security/credentials/credentials.cc', - 'src/core/lib/security/credentials/plugin/plugin_credentials.cc', - 'src/core/lib/security/credentials/tls/tls_utils.cc', - 'src/core/lib/security/security_connector/load_system_roots_fallback.cc', - 'src/core/lib/security/security_connector/load_system_roots_supported.cc', - 'src/core/lib/security/security_connector/load_system_roots_windows.cc', - 'src/core/lib/security/security_connector/security_connector.cc', - 'src/core/lib/security/transport/client_auth_filter.cc', - 'src/core/lib/security/transport/legacy_server_auth_filter.cc', - 'src/core/lib/security/transport/secure_endpoint.cc', - 'src/core/lib/security/transport/security_handshaker.cc', - 'src/core/lib/security/transport/server_auth_filter.cc', - 'src/core/lib/security/transport/tsi_error.cc', - 'src/core/lib/security/util/json_util.cc', - 'src/core/lib/slice/b64.cc', - 'src/core/lib/slice/percent_encoding.cc', - 'src/core/lib/slice/slice.cc', - 'src/core/lib/slice/slice_buffer.cc', - 'src/core/lib/slice/slice_refcount.cc', - 'src/core/lib/slice/slice_string_helpers.cc', - 'src/core/lib/surface/api_trace.cc', - 'src/core/lib/surface/byte_buffer.cc', - 'src/core/lib/surface/byte_buffer_reader.cc', - 'src/core/lib/surface/call.cc', - 'src/core/lib/surface/call_details.cc', - 'src/core/lib/surface/call_log_batch.cc', - 'src/core/lib/surface/channel.cc', - 'src/core/lib/surface/channel_init.cc', - 'src/core/lib/surface/channel_stack_type.cc', - 'src/core/lib/surface/completion_queue.cc', - 'src/core/lib/surface/completion_queue_factory.cc', - 'src/core/lib/surface/event_string.cc', - 'src/core/lib/surface/init_internally.cc', - 'src/core/lib/surface/lame_client.cc', - 'src/core/lib/surface/metadata_array.cc', - 'src/core/lib/surface/validate_metadata.cc', - 'src/core/lib/surface/version.cc', - 'src/core/lib/surface/wait_for_cq_end_op.cc', - 'src/core/lib/transport/batch_builder.cc', - 'src/core/lib/transport/call_factory.cc', - 'src/core/lib/transport/call_filters.cc', - 'src/core/lib/transport/call_final_info.cc', - 'src/core/lib/transport/call_size_estimator.cc', - 'src/core/lib/transport/call_spine.cc', - 'src/core/lib/transport/connectivity_state.cc', - 'src/core/lib/transport/error_utils.cc', - 'src/core/lib/transport/handshaker.cc', - 'src/core/lib/transport/handshaker_registry.cc', - 'src/core/lib/transport/message.cc', - 'src/core/lib/transport/metadata.cc', - 'src/core/lib/transport/metadata_batch.cc', - 'src/core/lib/transport/parsed_metadata.cc', - 'src/core/lib/transport/status_conversion.cc', - 'src/core/lib/transport/timeout_encoding.cc', - 'src/core/lib/transport/transport.cc', - 'src/core/lib/transport/transport_op_string.cc', - 'src/core/lib/uri/uri_parser.cc', - 'src/core/load_balancing/lb_policy.cc', - 'src/core/load_balancing/lb_policy_registry.cc', - 'src/core/resolver/endpoint_addresses.cc', - 'src/core/resolver/resolver.cc', - 'src/core/resolver/resolver_registry.cc', - 'src/core/service_config/service_config_parser.cc', - 'src/core/tsi/alts/handshaker/transport_security_common_api.cc', - 'src/core/tsi/transport_security.cc', - 'src/core/tsi/transport_security_grpc.cc', - 'third_party/upb/upb/message/accessors.c', - 'third_party/upb/upb/mini_descriptor/build_enum.c', - 'third_party/upb/upb/mini_descriptor/decode.c', - 'third_party/upb/upb/mini_descriptor/internal/base92.c', - 'third_party/upb/upb/mini_descriptor/internal/encode.c', - 'third_party/upb/upb/mini_descriptor/link.c', - 'third_party/upb/upb/wire/decode.c', - 'third_party/upb/upb/wire/decode_fast.c', - 'third_party/upb/upb/wire/encode.c', - 'third_party/upb/upb/wire/eps_copy_input_stream.c', - 'third_party/upb/upb/wire/reader.c', - ], - }, - { - 'target_name': 'grpc_plugin_support', - 'type': 'static_library', - 'dependencies': [ - 'protobuf', - 'protoc', - ], - 'sources': [ - 'src/compiler/cpp_generator.cc', - 'src/compiler/csharp_generator.cc', - 'src/compiler/node_generator.cc', - 'src/compiler/objective_c_generator.cc', - 'src/compiler/php_generator.cc', - 'src/compiler/proto_parser_helper.cc', - 'src/compiler/python_generator.cc', - 'src/compiler/ruby_generator.cc', - ], - }, - { - 'target_name': 'grpcpp_channelz', - 'type': 'static_library', - 'dependencies': [ - 'grpc++', - ], - 'sources': [ - 'src/proto/grpc/channelz/channelz.proto', - 'src/cpp/server/channelz/channelz_service.cc', - 'src/cpp/server/channelz/channelz_service_plugin.cc', - ], - }, - { - 'target_name': 'grpcpp_otel_plugin', - 'type': 'static_library', - 'dependencies': [ - 'grpc++', - 'opentelemetry-cpp::api', - ], - 'sources': [ - 'src/cpp/ext/otel/otel_client_filter.cc', - 'src/cpp/ext/otel/otel_plugin.cc', - 'src/cpp/ext/otel/otel_server_call_tracer.cc', - ], - }, - { - 'target_name': 'boringssl', - 'type': 'static_library', - 'dependencies': [ - ], - 'sources': [ - 'third_party/boringssl-with-bazel/err_data.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_bitstr.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_bool.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_d2i_fp.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_dup.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_gentm.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_i2d_fp.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_int.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_mbstr.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_object.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_octet.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_strex.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_strnid.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_time.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_type.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/a_utctm.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/asn1_lib.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/asn1_par.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/asn_pack.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/f_int.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/f_string.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/posix_time.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_dec.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_fre.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_new.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_typ.c', - 'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_utl.c', - 'third_party/boringssl-with-bazel/src/crypto/base64/base64.c', - 'third_party/boringssl-with-bazel/src/crypto/bio/bio.c', - 'third_party/boringssl-with-bazel/src/crypto/bio/bio_mem.c', - 'third_party/boringssl-with-bazel/src/crypto/bio/connect.c', - 'third_party/boringssl-with-bazel/src/crypto/bio/errno.c', - 'third_party/boringssl-with-bazel/src/crypto/bio/fd.c', - 'third_party/boringssl-with-bazel/src/crypto/bio/file.c', - 'third_party/boringssl-with-bazel/src/crypto/bio/hexdump.c', - 'third_party/boringssl-with-bazel/src/crypto/bio/pair.c', - 'third_party/boringssl-with-bazel/src/crypto/bio/printf.c', - 'third_party/boringssl-with-bazel/src/crypto/bio/socket.c', - 'third_party/boringssl-with-bazel/src/crypto/bio/socket_helper.c', - 'third_party/boringssl-with-bazel/src/crypto/blake2/blake2.c', - 'third_party/boringssl-with-bazel/src/crypto/bn_extra/bn_asn1.c', - 'third_party/boringssl-with-bazel/src/crypto/bn_extra/convert.c', - 'third_party/boringssl-with-bazel/src/crypto/buf/buf.c', - 'third_party/boringssl-with-bazel/src/crypto/bytestring/asn1_compat.c', - 'third_party/boringssl-with-bazel/src/crypto/bytestring/ber.c', - 'third_party/boringssl-with-bazel/src/crypto/bytestring/cbb.c', - 'third_party/boringssl-with-bazel/src/crypto/bytestring/cbs.c', - 'third_party/boringssl-with-bazel/src/crypto/bytestring/unicode.c', - 'third_party/boringssl-with-bazel/src/crypto/chacha/chacha.c', - 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/cipher_extra.c', - 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/derive_key.c', - 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_aesctrhmac.c', - 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_aesgcmsiv.c', - 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_chacha20poly1305.c', - 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_des.c', - 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_null.c', - 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_rc2.c', - 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_rc4.c', - 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_tls.c', - 'third_party/boringssl-with-bazel/src/crypto/cipher_extra/tls_cbc.c', - 'third_party/boringssl-with-bazel/src/crypto/conf/conf.c', - 'third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_apple.c', - 'third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_fuchsia.c', - 'third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_linux.c', - 'third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_openbsd.c', - 'third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_sysreg.c', - 'third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_win.c', - 'third_party/boringssl-with-bazel/src/crypto/cpu_arm_freebsd.c', - 'third_party/boringssl-with-bazel/src/crypto/cpu_arm_linux.c', - 'third_party/boringssl-with-bazel/src/crypto/cpu_intel.c', - 'third_party/boringssl-with-bazel/src/crypto/crypto.c', - 'third_party/boringssl-with-bazel/src/crypto/curve25519/curve25519.c', - 'third_party/boringssl-with-bazel/src/crypto/curve25519/curve25519_64_adx.c', - 'third_party/boringssl-with-bazel/src/crypto/curve25519/spake25519.c', - 'third_party/boringssl-with-bazel/src/crypto/des/des.c', - 'third_party/boringssl-with-bazel/src/crypto/dh_extra/dh_asn1.c', - 'third_party/boringssl-with-bazel/src/crypto/dh_extra/params.c', - 'third_party/boringssl-with-bazel/src/crypto/digest_extra/digest_extra.c', - 'third_party/boringssl-with-bazel/src/crypto/dsa/dsa.c', - 'third_party/boringssl-with-bazel/src/crypto/dsa/dsa_asn1.c', - 'third_party/boringssl-with-bazel/src/crypto/ec_extra/ec_asn1.c', - 'third_party/boringssl-with-bazel/src/crypto/ec_extra/ec_derive.c', - 'third_party/boringssl-with-bazel/src/crypto/ec_extra/hash_to_curve.c', - 'third_party/boringssl-with-bazel/src/crypto/ecdh_extra/ecdh_extra.c', - 'third_party/boringssl-with-bazel/src/crypto/ecdsa_extra/ecdsa_asn1.c', - 'third_party/boringssl-with-bazel/src/crypto/engine/engine.c', - 'third_party/boringssl-with-bazel/src/crypto/err/err.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/evp.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/evp_asn1.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/evp_ctx.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/p_dsa_asn1.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/p_ec.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/p_ec_asn1.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/p_ed25519.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/p_ed25519_asn1.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/p_hkdf.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/p_rsa.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/p_rsa_asn1.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/p_x25519.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/p_x25519_asn1.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/pbkdf.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/print.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/scrypt.c', - 'third_party/boringssl-with-bazel/src/crypto/evp/sign.c', - 'third_party/boringssl-with-bazel/src/crypto/ex_data.c', - 'third_party/boringssl-with-bazel/src/crypto/fipsmodule/bcm.c', - 'third_party/boringssl-with-bazel/src/crypto/fipsmodule/fips_shared_support.c', - 'third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c', - 'third_party/boringssl-with-bazel/src/crypto/hrss/hrss.c', - 'third_party/boringssl-with-bazel/src/crypto/keccak/keccak.c', - 'third_party/boringssl-with-bazel/src/crypto/kyber/kyber.c', - 'third_party/boringssl-with-bazel/src/crypto/lhash/lhash.c', - 'third_party/boringssl-with-bazel/src/crypto/mem.c', - 'third_party/boringssl-with-bazel/src/crypto/obj/obj.c', - 'third_party/boringssl-with-bazel/src/crypto/obj/obj_xref.c', - 'third_party/boringssl-with-bazel/src/crypto/pem/pem_all.c', - 'third_party/boringssl-with-bazel/src/crypto/pem/pem_info.c', - 'third_party/boringssl-with-bazel/src/crypto/pem/pem_lib.c', - 'third_party/boringssl-with-bazel/src/crypto/pem/pem_oth.c', - 'third_party/boringssl-with-bazel/src/crypto/pem/pem_pk8.c', - 'third_party/boringssl-with-bazel/src/crypto/pem/pem_pkey.c', - 'third_party/boringssl-with-bazel/src/crypto/pem/pem_x509.c', - 'third_party/boringssl-with-bazel/src/crypto/pem/pem_xaux.c', - 'third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7.c', - 'third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7_x509.c', - 'third_party/boringssl-with-bazel/src/crypto/pkcs8/p5_pbev2.c', - 'third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8.c', - 'third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8_x509.c', - 'third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305.c', - 'third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_arm.c', - 'third_party/boringssl-with-bazel/src/crypto/poly1305/poly1305_vec.c', - 'third_party/boringssl-with-bazel/src/crypto/pool/pool.c', - 'third_party/boringssl-with-bazel/src/crypto/rand_extra/deterministic.c', - 'third_party/boringssl-with-bazel/src/crypto/rand_extra/forkunsafe.c', - 'third_party/boringssl-with-bazel/src/crypto/rand_extra/getentropy.c', - 'third_party/boringssl-with-bazel/src/crypto/rand_extra/ios.c', - 'third_party/boringssl-with-bazel/src/crypto/rand_extra/passive.c', - 'third_party/boringssl-with-bazel/src/crypto/rand_extra/rand_extra.c', - 'third_party/boringssl-with-bazel/src/crypto/rand_extra/trusty.c', - 'third_party/boringssl-with-bazel/src/crypto/rand_extra/windows.c', - 'third_party/boringssl-with-bazel/src/crypto/rc4/rc4.c', - 'third_party/boringssl-with-bazel/src/crypto/refcount.c', - 'third_party/boringssl-with-bazel/src/crypto/rsa_extra/rsa_asn1.c', - 'third_party/boringssl-with-bazel/src/crypto/rsa_extra/rsa_crypt.c', - 'third_party/boringssl-with-bazel/src/crypto/rsa_extra/rsa_print.c', - 'third_party/boringssl-with-bazel/src/crypto/siphash/siphash.c', - 'third_party/boringssl-with-bazel/src/crypto/spx/address.c', - 'third_party/boringssl-with-bazel/src/crypto/spx/fors.c', - 'third_party/boringssl-with-bazel/src/crypto/spx/merkle.c', - 'third_party/boringssl-with-bazel/src/crypto/spx/spx.c', - 'third_party/boringssl-with-bazel/src/crypto/spx/spx_util.c', - 'third_party/boringssl-with-bazel/src/crypto/spx/thash.c', - 'third_party/boringssl-with-bazel/src/crypto/spx/wots.c', - 'third_party/boringssl-with-bazel/src/crypto/stack/stack.c', - 'third_party/boringssl-with-bazel/src/crypto/thread.c', - 'third_party/boringssl-with-bazel/src/crypto/thread_none.c', - 'third_party/boringssl-with-bazel/src/crypto/thread_pthread.c', - 'third_party/boringssl-with-bazel/src/crypto/thread_win.c', - 'third_party/boringssl-with-bazel/src/crypto/trust_token/pmbtoken.c', - 'third_party/boringssl-with-bazel/src/crypto/trust_token/trust_token.c', - 'third_party/boringssl-with-bazel/src/crypto/trust_token/voprf.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/a_digest.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/a_sign.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/a_verify.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/algorithm.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/asn1_gen.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/by_dir.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/by_file.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/i2d_pr.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/name_print.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/policy.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/rsa_pss.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/t_crl.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/t_req.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/t_x509.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/t_x509a.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/v3_akey.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/v3_akeya.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/v3_alt.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/v3_bcons.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/v3_bitst.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/v3_conf.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/v3_cpols.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/v3_crld.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/v3_enum.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/v3_extku.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/v3_genn.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/v3_ia5.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/v3_info.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/v3_int.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/v3_lib.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/v3_ncons.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/v3_ocsp.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/v3_pcons.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/v3_pmaps.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/v3_prn.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/v3_purp.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/v3_skey.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/v3_utl.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_att.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_cmp.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_d2.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_def.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_ext.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_lu.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_obj.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_req.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_set.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_trs.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_txt.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_v3.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_vfy.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509_vpm.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509cset.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509name.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509rset.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x509spki.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_algor.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_all.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_attrib.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_crl.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_exten.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_name.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_pubkey.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_req.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_sig.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_spki.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_val.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_x509.c', - 'third_party/boringssl-with-bazel/src/crypto/x509/x_x509a.c', - 'third_party/boringssl-with-bazel/src/ssl/bio_ssl.cc', - 'third_party/boringssl-with-bazel/src/ssl/d1_both.cc', - 'third_party/boringssl-with-bazel/src/ssl/d1_lib.cc', - 'third_party/boringssl-with-bazel/src/ssl/d1_pkt.cc', - 'third_party/boringssl-with-bazel/src/ssl/d1_srtp.cc', - 'third_party/boringssl-with-bazel/src/ssl/dtls_method.cc', - 'third_party/boringssl-with-bazel/src/ssl/dtls_record.cc', - 'third_party/boringssl-with-bazel/src/ssl/encrypted_client_hello.cc', - 'third_party/boringssl-with-bazel/src/ssl/extensions.cc', - 'third_party/boringssl-with-bazel/src/ssl/handoff.cc', - 'third_party/boringssl-with-bazel/src/ssl/handshake.cc', - 'third_party/boringssl-with-bazel/src/ssl/handshake_client.cc', - 'third_party/boringssl-with-bazel/src/ssl/handshake_server.cc', - 'third_party/boringssl-with-bazel/src/ssl/s3_both.cc', - 'third_party/boringssl-with-bazel/src/ssl/s3_lib.cc', - 'third_party/boringssl-with-bazel/src/ssl/s3_pkt.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_aead_ctx.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_asn1.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_buffer.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_cert.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_cipher.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_file.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_key_share.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_privkey.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_session.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_stat.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_transcript.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_versions.cc', - 'third_party/boringssl-with-bazel/src/ssl/ssl_x509.cc', - 'third_party/boringssl-with-bazel/src/ssl/t1_enc.cc', - 'third_party/boringssl-with-bazel/src/ssl/tls13_both.cc', - 'third_party/boringssl-with-bazel/src/ssl/tls13_client.cc', - 'third_party/boringssl-with-bazel/src/ssl/tls13_enc.cc', - 'third_party/boringssl-with-bazel/src/ssl/tls13_server.cc', - 'third_party/boringssl-with-bazel/src/ssl/tls_method.cc', - 'third_party/boringssl-with-bazel/src/ssl/tls_record.cc', - ], - }, - { - 'target_name': 'boringssl_test_util', - 'type': 'static_library', - 'dependencies': [ - ], - 'sources': [ - 'third_party/boringssl-with-bazel/src/crypto/test/abi_test.cc', - 'third_party/boringssl-with-bazel/src/crypto/test/file_test.cc', - 'third_party/boringssl-with-bazel/src/crypto/test/test_util.cc', - 'third_party/boringssl-with-bazel/src/crypto/test/wycheproof_util.cc', - ], - }, - { - 'target_name': 'benchmark', - 'type': 'static_library', - 'dependencies': [ - ], - 'sources': [ - 'third_party/benchmark/src/benchmark.cc', - 'third_party/benchmark/src/benchmark_api_internal.cc', - 'third_party/benchmark/src/benchmark_main.cc', - 'third_party/benchmark/src/benchmark_name.cc', - 'third_party/benchmark/src/benchmark_register.cc', - 'third_party/benchmark/src/benchmark_runner.cc', - 'third_party/benchmark/src/check.cc', - 'third_party/benchmark/src/colorprint.cc', - 'third_party/benchmark/src/commandlineflags.cc', - 'third_party/benchmark/src/complexity.cc', - 'third_party/benchmark/src/console_reporter.cc', - 'third_party/benchmark/src/counter.cc', - 'third_party/benchmark/src/csv_reporter.cc', - 'third_party/benchmark/src/json_reporter.cc', - 'third_party/benchmark/src/perf_counters.cc', - 'third_party/benchmark/src/reporter.cc', - 'third_party/benchmark/src/statistics.cc', - 'third_party/benchmark/src/string_util.cc', - 'third_party/benchmark/src/sysinfo.cc', - 'third_party/benchmark/src/timers.cc', - ], - }, - ] -} diff --git a/templates/grpc.gyp.template b/templates/grpc.gyp.template deleted file mode 100644 index 21b3f724da1..00000000000 --- a/templates/grpc.gyp.template +++ /dev/null @@ -1,162 +0,0 @@ -%YAML 1.2 ---- | - # GRPC GYP build file - - # This file has been automatically generated from a template file. - # Please look at the templates directory instead. - # This file can be regenerated from the template by running - # tools/buildgen/generate_projects.sh - - # Copyright 2015 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. - <% - def is_absl_lib(target_name): - return target_name.startswith("absl/"); - %> - { - 'variables': { - # The openssl and zlib dependencies must be passed in as variables - # defined in an included gypi file, usually common.gypi. - 'openssl_gyp_target%': 'Please Define openssl_gyp_target variable', - 'zlib_gyp_target%': 'Please Define zlib_gyp_target variable', - - 'grpc_gcov%': 'false', - 'grpc_alpine%': 'false', - }, - 'target_defaults': { - 'configurations': { - % for name, args in configs.items(): - % if name in ['dbg', 'opt']: - '${{'dbg':'Debug', 'opt': 'Release'}[name]}': { - % for arg, prop in [('CPPFLAGS', 'cflags'), ('DEFINES', 'defines')]: - % if args.get(arg, None) is not None: - '${prop}': [ - % for item in args.get(arg).split(): - '${item}', - % endfor - ], - % endif - % endfor - }, - % endif - % endfor - }, - % for arg, prop in [('CPPFLAGS', 'cflags'), ('LDFLAGS', 'ldflags')]: - % if defaults['global'].get(arg, None) is not None: - '${prop}': [ - % for item in defaults['global'].get(arg).split(): - '${item}', - % endfor - ], - % endif - % endfor - 'cflags_c': [ - '-Werror', - '-std=c11', - ], - 'cflags_cc': [ - '-Werror', - '-std=c++14', - ], - 'include_dirs': [ - '.', - '../..', - 'include', - ], - 'defines': [ - 'GRPC_ARES=0', - ], - 'dependencies': [ - '<(openssl_gyp_target)', - '<(zlib_gyp_target)', - ], - 'conditions': [ - ['grpc_gcov=="true"', { - % for arg, prop in [('CPPFLAGS', 'cflags'), ('DEFINES', 'defines'), ('LDFLAGS', 'ldflags')]: - % if configs['gcov'].get(arg, None) is not None: - '${prop}': [ - % for item in configs['gcov'].get(arg).split(): - '${item}', - % endfor - ], - % endif - % endfor - }], - ['grpc_alpine=="true"', { - 'defines': [ - 'GPR_MUSL_LIBC_COMPAT' - ] - }], - ['OS == "win"', { - 'defines': [ - '_WIN32_WINNT=0x0600', - 'WIN32_LEAN_AND_MEAN', - '_HAS_EXCEPTIONS=0', - 'UNICODE', - '_UNICODE', - 'NOMINMAX', - ], - 'msvs_settings': { - 'VCCLCompilerTool': { - 'RuntimeLibrary': 1, # static debug - } - }, - "libraries": [ - "ws2_32" - ] - }], - ['OS == "mac"', { - 'xcode_settings': { - % if defaults['global'].get('CPPFLAGS', None) is not None: - 'OTHER_CFLAGS': [ - % for item in defaults['global'].get('CPPFLAGS').split(): - '${item}', - % endfor - ], - 'OTHER_CPLUSPLUSFLAGS': [ - % for item in defaults['global'].get('CPPFLAGS').split(): - '${item}', - % endfor - '-stdlib=libc++', - '-std=c++14', - '-Wno-error=deprecated-declarations', - ], - % endif - }, - }] - ] - }, - 'targets': [ - % for lib in libs: - % if getattr(lib, 'platforms', None) is None and lib.name != 'cares' and not is_absl_lib(lib.name): - { - 'target_name': '${lib.name}', - 'type': 'static_library', - 'dependencies': [ - % for dep in getattr(lib, 'deps', []): - % if dep != 'libssl': - '${dep}', - % endif - % endfor - ], - 'sources': [ - % for source in lib.src: - '${source}', - % endfor - ], - }, - % endif - % endfor - ] - } From c68e6c27ca54a8b7b98a21e6315c805f235d5dda Mon Sep 17 00:00:00 2001 From: Gregory Cooke Date: Fri, 15 Mar 2024 16:58:16 -0700 Subject: [PATCH 05/16] [Security Tests - Crl Provider] Fix inconsistent directory related tests (#36122) There were some failures in the Crl Directory related tests after https://github.com/grpc/grpc/pull/36031 This came down to https://github.com/grpc/grpc/pull/36031 adding some CRLs with bad qualities (invalid content/signatures, overriding issuer names) to the `test_creds/crl_data/crls` directory, which is used in the directory reloading tests. The tests began failing on some platforms because they were picking up these bad crls which were failing various checks, but the test was designed to assume that `test_creds/crl_data/crls` was a valid and good directory. This PR moves the bad CRLs to their own directory to prevent this accidental mash-up of test data. It also adds debug logging to our custom verification stack. Closes #36122 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36122 from gtcooke94:crl_fix 508dd1370d85d84a52ac84c65525a0ed1ab8d4aa PiperOrigin-RevId: 616280898 --- src/core/tsi/ssl_transport_security.cc | 14 +++++++++---- src/core/tsi/ssl_transport_security_utils.cc | 11 ++++++++-- test/core/tsi/BUILD | 10 ++++----- .../tsi/crl_ssl_transport_security_test.cc | 7 ++++--- .../tsi/ssl_transport_security_utils_test.cc | 4 ++-- test/core/tsi/test_creds/crl_data/README | 3 ++- .../tsi/test_creds/crl_data/bad_crls/BUILD | 21 +++++++++++++++++++ .../crl_data/{crls => bad_crls}/evil.crl | 0 .../{crls => bad_crls}/invalid_content.crl | 0 .../{crls => bad_crls}/invalid_signature.crl | 0 test/core/tsi/test_creds/crl_data/crls/BUILD | 3 --- test/cpp/end2end/crl_provider_test.cc | 3 ++- 12 files changed, 55 insertions(+), 21 deletions(-) create mode 100644 test/core/tsi/test_creds/crl_data/bad_crls/BUILD rename test/core/tsi/test_creds/crl_data/{crls => bad_crls}/evil.crl (100%) rename test/core/tsi/test_creds/crl_data/{crls => bad_crls}/invalid_content.crl (100%) rename test/core/tsi/test_creds/crl_data/{crls => bad_crls}/invalid_signature.crl (100%) diff --git a/src/core/tsi/ssl_transport_security.cc b/src/core/tsi/ssl_transport_security.cc index 1ee9faf284a..17ad9077393 100644 --- a/src/core/tsi/ssl_transport_security.cc +++ b/src/core/tsi/ssl_transport_security.cc @@ -1045,10 +1045,12 @@ static bool ValidateCrl(X509* cert, X509* issuer, X509_CRL* crl) { // 6.3.3b verify issuer and scope valid = grpc_core::VerifyCrlCertIssuerNamesMatch(crl, cert); if (!valid) { + gpr_log(GPR_DEBUG, "CRL and cert issuer names mismatched."); return valid; } valid = grpc_core::HasCrlSignBit(issuer); if (!valid) { + gpr_log(GPR_DEBUG, "CRL issuer not allowed to sign CRLs."); return valid; } // 6.3.3c Not supporting deltas @@ -1058,6 +1060,9 @@ static bool ValidateCrl(X509* cert, X509* issuer, X509_CRL* crl) { // same. // 6.3.3g Verify CRL Signature valid = grpc_core::VerifyCrlSignature(crl, issuer); + if (!valid) { + gpr_log(GPR_DEBUG, "Crl signature check failed."); + } return valid; } @@ -1146,6 +1151,7 @@ static int CheckChainRevocation( static int CustomVerificationFunction(X509_STORE_CTX* ctx, void* arg) { int ret = X509_verify_cert(ctx); if (ret <= 0) { + gpr_log(GPR_DEBUG, "Failed to verify cert chain."); // Verification failed. We shouldn't expect to have a verified chain, so // there is no need to attempt to extract the root cert from it, check for // revocation, or check anything else. @@ -1154,10 +1160,10 @@ static int CustomVerificationFunction(X509_STORE_CTX* ctx, void* arg) { grpc_core::experimental::CrlProvider* provider = GetCrlProvider(ctx); if (provider != nullptr) { ret = CheckChainRevocation(ctx, provider); - } - if (ret <= 0) { - // Something has failed return the failure - return ret; + if (ret <= 0) { + gpr_log(GPR_DEBUG, "The chain failed revocation checks."); + return ret; + } } return RootCertExtractCallback(ctx, arg); } diff --git a/src/core/tsi/ssl_transport_security_utils.cc b/src/core/tsi/ssl_transport_security_utils.cc index 020e88fa0ac..1c05de9293d 100644 --- a/src/core/tsi/ssl_transport_security_utils.cc +++ b/src/core/tsi/ssl_transport_security_utils.cc @@ -259,12 +259,19 @@ bool VerifyCrlSignature(X509_CRL* crl, X509* issuer) { if (ikey == nullptr) { // Can't verify signature because we couldn't get the pubkey, fail the // check. + gpr_log(GPR_DEBUG, "Could not public key from certificate."); EVP_PKEY_free(ikey); return false; } - bool ret = X509_CRL_verify(crl, ikey) == 1; + int ret = X509_CRL_verify(crl, ikey); + if (ret < 0) { + gpr_log(GPR_DEBUG, + "There was an unexpected problem checking the CRL signature."); + } else if (ret == 0) { + gpr_log(GPR_DEBUG, "CRL failed verification."); + } EVP_PKEY_free(ikey); - return ret; + return ret == 1; } bool VerifyCrlCertIssuerNamesMatch(X509_CRL* crl, X509* cert) { diff --git a/test/core/tsi/BUILD b/test/core/tsi/BUILD index a4854f4dedf..fcf97c83eca 100644 --- a/test/core/tsi/BUILD +++ b/test/core/tsi/BUILD @@ -71,10 +71,10 @@ grpc_cc_test( "//test/core/tsi/test_creds/crl_data:evil_ca.pem", "//test/core/tsi/test_creds/crl_data:intermediate_ca.pem", "//test/core/tsi/test_creds/crl_data:leaf_signed_by_intermediate.pem", + "//test/core/tsi/test_creds/crl_data/bad_crls:invalid_content.crl", + "//test/core/tsi/test_creds/crl_data/bad_crls:invalid_signature.crl", "//test/core/tsi/test_creds/crl_data/crls:current.crl", "//test/core/tsi/test_creds/crl_data/crls:intermediate.crl", - "//test/core/tsi/test_creds/crl_data/crls:invalid_content.crl", - "//test/core/tsi/test_creds/crl_data/crls:invalid_signature.crl", ], external_deps = ["gtest"], language = "C++", @@ -136,13 +136,13 @@ grpc_cc_test( "//test/core/tsi/test_creds/crl_data:revoked.pem", "//test/core/tsi/test_creds/crl_data:valid.key", "//test/core/tsi/test_creds/crl_data:valid.pem", + "//test/core/tsi/test_creds/crl_data/bad_crls:evil.crl", + "//test/core/tsi/test_creds/crl_data/bad_crls:invalid_content.crl", + "//test/core/tsi/test_creds/crl_data/bad_crls:invalid_signature.crl", "//test/core/tsi/test_creds/crl_data/crls:ab06acdd.r0", "//test/core/tsi/test_creds/crl_data/crls:b9322cac.r0", "//test/core/tsi/test_creds/crl_data/crls:current.crl", - "//test/core/tsi/test_creds/crl_data/crls:evil.crl", "//test/core/tsi/test_creds/crl_data/crls:intermediate.crl", - "//test/core/tsi/test_creds/crl_data/crls:invalid_content.crl", - "//test/core/tsi/test_creds/crl_data/crls:invalid_signature.crl", "//test/core/tsi/test_creds/crl_data/crls_missing_intermediate:ab06acdd.r0", "//test/core/tsi/test_creds/crl_data/crls_missing_root:b9322cac.r0", ], diff --git a/test/core/tsi/crl_ssl_transport_security_test.cc b/test/core/tsi/crl_ssl_transport_security_test.cc index da873e80956..93018a818d0 100644 --- a/test/core/tsi/crl_ssl_transport_security_test.cc +++ b/test/core/tsi/crl_ssl_transport_security_test.cc @@ -69,10 +69,11 @@ const char* kRootCrlPath = "test/core/tsi/test_creds/crl_data/crls/current.crl"; const char* kIntermediateCrlPath = "test/core/tsi/test_creds/crl_data/crls/intermediate.crl"; const char* kModifiedSignaturePath = - "test/core/tsi/test_creds/crl_data/crls/invalid_signature.crl"; + "test/core/tsi/test_creds/crl_data/bad_crls/invalid_signature.crl"; const char* kModifiedContentPath = - "test/core/tsi/test_creds/crl_data/crls/invalid_content.crl"; -const char* kEvilCrlPath = "test/core/tsi/test_creds/crl_data/crls/evil.crl"; + "test/core/tsi/test_creds/crl_data/bad_crls/invalid_content.crl"; +const char* kEvilCrlPath = + "test/core/tsi/test_creds/crl_data/bad_crls/evil.crl"; class CrlSslTransportSecurityTest : public testing::TestWithParam { diff --git a/test/core/tsi/ssl_transport_security_utils_test.cc b/test/core/tsi/ssl_transport_security_utils_test.cc index 54e705d7574..2b7b6dfb36f 100644 --- a/test/core/tsi/ssl_transport_security_utils_test.cc +++ b/test/core/tsi/ssl_transport_security_utils_test.cc @@ -46,9 +46,9 @@ namespace testing { const char* kValidCrl = "test/core/tsi/test_creds/crl_data/crls/current.crl"; const char* kCrlIssuer = "test/core/tsi/test_creds/crl_data/ca.pem"; const char* kModifiedSignature = - "test/core/tsi/test_creds/crl_data/crls/invalid_signature.crl"; + "test/core/tsi/test_creds/crl_data/bad_crls/invalid_signature.crl"; const char* kModifiedContent = - "test/core/tsi/test_creds/crl_data/crls/invalid_content.crl"; + "test/core/tsi/test_creds/crl_data/bad_crls/invalid_content.crl"; const char* kIntermediateCrl = "test/core/tsi/test_creds/crl_data/crls/intermediate.crl"; const char* kIntermediateCrlIssuer = diff --git a/test/core/tsi/test_creds/crl_data/README b/test/core/tsi/test_creds/crl_data/README index f69fd1b75b3..3e5cfab739f 100644 --- a/test/core/tsi/test_creds/crl_data/README +++ b/test/core/tsi/test_creds/crl_data/README @@ -57,7 +57,8 @@ Run `ca_with_akid_gen.sh` from the `test/core/tsi/test_creds/crl_data` directory Create CRLs with modified signatures and content ---------------------------------------------------------------------------- -Make two copies of `test/core/tsi/test_creds/crl_data/crls/current.crl` named `test/core/tsi/test_creds/crl_data/crls/invalid_content.crl` and `test/core/tsi/test_creds/crl_data/crls/invalid_signature.crl`. +Make a directory `test/core/tsi/test_creds/crl_data/bad_crls +Make two copies of `test/core/tsi/test_creds/crl_data/crls/current.crl` in the bad_crls directory named `test/core/tsi/test_creds/crl_data/bad_crls/invalid_content.crl` and `test/core/tsi/test_creds/crl_data/bad_crls/invalid_signature.crl`. In `invalid_content.crl`, change the first letter on the second line. In `invalid_signature.crl`, change the last letter before the `=` on the second to last line. diff --git a/test/core/tsi/test_creds/crl_data/bad_crls/BUILD b/test/core/tsi/test_creds/crl_data/bad_crls/BUILD new file mode 100644 index 00000000000..f74dabcf8a0 --- /dev/null +++ b/test/core/tsi/test_creds/crl_data/bad_crls/BUILD @@ -0,0 +1,21 @@ +# Copyright 2021 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. + +licenses(["notice"]) + +exports_files([ + "evil.crl", + "invalid_content.crl", + "invalid_signature.crl", +]) diff --git a/test/core/tsi/test_creds/crl_data/crls/evil.crl b/test/core/tsi/test_creds/crl_data/bad_crls/evil.crl similarity index 100% rename from test/core/tsi/test_creds/crl_data/crls/evil.crl rename to test/core/tsi/test_creds/crl_data/bad_crls/evil.crl diff --git a/test/core/tsi/test_creds/crl_data/crls/invalid_content.crl b/test/core/tsi/test_creds/crl_data/bad_crls/invalid_content.crl similarity index 100% rename from test/core/tsi/test_creds/crl_data/crls/invalid_content.crl rename to test/core/tsi/test_creds/crl_data/bad_crls/invalid_content.crl diff --git a/test/core/tsi/test_creds/crl_data/crls/invalid_signature.crl b/test/core/tsi/test_creds/crl_data/bad_crls/invalid_signature.crl similarity index 100% rename from test/core/tsi/test_creds/crl_data/crls/invalid_signature.crl rename to test/core/tsi/test_creds/crl_data/bad_crls/invalid_signature.crl diff --git a/test/core/tsi/test_creds/crl_data/crls/BUILD b/test/core/tsi/test_creds/crl_data/crls/BUILD index e1a36f42c8f..922d279aa6a 100644 --- a/test/core/tsi/test_creds/crl_data/crls/BUILD +++ b/test/core/tsi/test_creds/crl_data/crls/BUILD @@ -19,7 +19,4 @@ exports_files([ "b9322cac.r0", "current.crl", "intermediate.crl", - "invalid_signature.crl", - "invalid_content.crl", - "evil.crl", ]) diff --git a/test/cpp/end2end/crl_provider_test.cc b/test/cpp/end2end/crl_provider_test.cc index 6902fd7443e..28dabae37d3 100644 --- a/test/cpp/end2end/crl_provider_test.cc +++ b/test/cpp/end2end/crl_provider_test.cc @@ -61,7 +61,8 @@ const char* kRevokedCertPath = "test/core/tsi/test_creds/crl_data/revoked.pem"; const char* kValidKeyPath = "test/core/tsi/test_creds/crl_data/valid.key"; const char* kValidCertPath = "test/core/tsi/test_creds/crl_data/valid.pem"; const char* kRootCrlPath = "test/core/tsi/test_creds/crl_data/crls/current.crl"; -const char* kCrlDirectoryPath = "test/core/tsi/test_creds/crl_data/crls/"; +const char* kCrlDirectoryPath = + "test/core/tsi/test_creds/crl_data/crl_provider_test_dir/"; constexpr char kMessage[] = "Hello"; // This test must be at the top of the file because the From b940f113884427111569799b62cd484e4a94f495 Mon Sep 17 00:00:00 2001 From: nipil Date: Mon, 18 Mar 2024 11:30:08 -0700 Subject: [PATCH 06/16] [posix EventEngine] fix ResolvedAddressIsWildcard documentation (#36143) Fix the wording of the description of the function for the return value : current version says the opposite of what the function does. The current behaviour is to return the port used, but only when the address _is actually_ a wildcard address : 0.0.0.0 (ipv4) or :: (ipv6). Plus mention both ipv4 and ipv6 in the description. Closes #36143 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36143 from nipil:fix_ResolvedAddressIsWildcard_doc 70683d0139cb47f6ff77478cd6167b9e3a5be3a9 PiperOrigin-RevId: 616894483 --- src/core/lib/event_engine/tcp_socket_utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/lib/event_engine/tcp_socket_utils.h b/src/core/lib/event_engine/tcp_socket_utils.h index 632b874bcbf..d92cef3b285 100644 --- a/src/core/lib/event_engine/tcp_socket_utils.h +++ b/src/core/lib/event_engine/tcp_socket_utils.h @@ -57,7 +57,7 @@ void ResolvedAddressSetPort(EventEngine::ResolvedAddress& resolved_addr, int port); // Returns the port number associated with the address if the given address is -// not a wildcard ipv6 or ipv6 address. Otherwise returns absl::nullopt +// a wildcard ipv4 or ipv6 address. Otherwise returns absl::nullopt absl::optional ResolvedAddressIsWildcard( const EventEngine::ResolvedAddress& addr); From 5b4bd43c78ca5d13716249bbac229df7f2ac26d1 Mon Sep 17 00:00:00 2001 From: Gregory Cooke Date: Mon, 18 Mar 2024 11:34:09 -0700 Subject: [PATCH 07/16] File loading fix (#36071) https://github.com/grpc/grpc/pull/35856 was delayed because the API involved was being removed in https://github.com/grpc/grpc/pull/35857 This PR is the work we discussed as followup in https://github.com/grpc/grpc/pull/35857 Namely, removing the assert that will crash grpc because of a file loading failure - we don't want this, and would rather just return an error (https://b.corp.google.com/issues/262285099, b/262240495 Closes #36071 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36071 from gtcooke94:file_loading_fix cc358fadce7cf565e11cfe19eb1bcb60aa2126c1 PiperOrigin-RevId: 616895887 --- src/core/lib/gprpp/load_file.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/lib/gprpp/load_file.cc b/src/core/lib/gprpp/load_file.cc index e03ee728c06..dc870aef218 100644 --- a/src/core/lib/gprpp/load_file.cc +++ b/src/core/lib/gprpp/load_file.cc @@ -32,6 +32,9 @@ namespace grpc_core { // Loads the content of a file into a slice. add_null_terminator will add a NULL // terminator if true. +// This API is NOT thread-safe and requires proper synchronization when used by +// multiple threads, especially when they can happen to be reading from the same +// file. absl::StatusOr LoadFile(const std::string& filename, bool add_null_terminator) { unsigned char* contents = nullptr; @@ -61,7 +64,6 @@ absl::StatusOr LoadFile(const std::string& filename, bytes_read = fread(contents, 1, contents_size, file); if (bytes_read < contents_size) { gpr_free(contents); - GPR_ASSERT(ferror(file)); error = absl::InternalError( absl::StrCat("Failed to load file: ", filename, " due to error(fread): ", strerror(errno))); From c1f9199f9ce8758849276cafd14b365145cb4ce1 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Mon, 18 Mar 2024 12:26:29 -0700 Subject: [PATCH 08/16] [channel] canonify target and set channel arg in only one place (#36134) Channel target will now be reported in canonified form (e.g., in channelz). Closes #36134 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36134 from markdroth:channel_target 22e49e73f82b5ac5dcb35ceb4b048946d9de11b3 PiperOrigin-RevId: 616911536 --- BUILD | 1 + .../transport/binder/client/channel_create.cc | 26 +++++-------------- .../binder/client/channel_create_impl.cc | 11 ++++---- .../binder/client/channel_create_impl.h | 3 ++- .../client/chaotic_good_connector.cc | 4 --- .../chttp2/client/chttp2_connector.cc | 7 +---- src/core/lib/surface/channel_create.cc | 9 +++++++ src/php/tests/unit_tests/CallInvokerTest.php | 2 +- .../channelz/channelz_servicer_test.py | 2 +- 9 files changed, 27 insertions(+), 38 deletions(-) diff --git a/BUILD b/BUILD index 747f134371c..2c3bb0b7d9e 100644 --- a/BUILD +++ b/BUILD @@ -1790,6 +1790,7 @@ grpc_cc_library( "channel", "channel_arg_names", "channelz", + "config", "gpr", "grpc_base", "grpc_public_hdrs", diff --git a/src/core/ext/transport/binder/client/channel_create.cc b/src/core/ext/transport/binder/client/channel_create.cc index b22176e090d..efae0104b28 100644 --- a/src/core/ext/transport/binder/client/channel_create.cc +++ b/src/core/ext/transport/binder/client/channel_create.cc @@ -121,33 +121,21 @@ std::shared_ptr CreateCustomBinderChannel( grpc_binder::TryEstablishConnectionWithUri(static_cast(jni_env_void), context, uri, connection_id); - grpc_channel_args channel_args; - args.SetChannelArgs(&channel_args); + grpc_binder::GetSecurityPolicySetting()->Set(connection_id, security_policy); // Set server URI to a URI that contains connection id. The URI will be used // by subchannel connector to obtain correct endpoint binder from // `EndpointBinderPool`. - grpc_channel_args* new_args; - { - string server_uri = "binder:" + connection_id; - grpc_arg server_uri_arg = - grpc_channel_arg_string_create(const_cast(GRPC_ARG_SERVER_URI), - const_cast(server_uri.c_str())); - const char* to_remove[] = {GRPC_ARG_SERVER_URI}; - new_args = grpc_channel_args_copy_and_add_and_remove( - &channel_args, to_remove, 1, &server_uri_arg, 1); - } + string server_uri = "binder:" + connection_id; - grpc_binder::GetSecurityPolicySetting()->Set(connection_id, security_policy); + grpc_channel_args channel_args; + args.SetChannelArgs(&channel_args); - auto channel = CreateChannelInternal( - "", grpc::internal::CreateClientBinderChannelImpl(new_args), + return CreateChannelInternal( + "", + grpc::internal::CreateClientBinderChannelImpl(server_uri, &channel_args), std::vector< std::unique_ptr>()); - - grpc_channel_args_destroy(new_args); - - return channel; } bool InitializeBinderChannelJavaClass(void* jni_env_void) { diff --git a/src/core/ext/transport/binder/client/channel_create_impl.cc b/src/core/ext/transport/binder/client/channel_create_impl.cc index 8e86d722f03..d9d5208f9a9 100644 --- a/src/core/ext/transport/binder/client/channel_create_impl.cc +++ b/src/core/ext/transport/binder/client/channel_create_impl.cc @@ -65,7 +65,8 @@ grpc_channel* CreateDirectBinderChannelImplForTesting( return channel->release()->c_ptr(); } -grpc_channel* CreateClientBinderChannelImpl(const grpc_channel_args* args) { +grpc_channel* CreateClientBinderChannelImpl(std::string target, + const grpc_channel_args* args) { grpc_core::ExecCtx exec_ctx; gpr_once_init(&g_factory_once, FactoryInit); @@ -75,14 +76,12 @@ grpc_channel* CreateClientBinderChannelImpl(const grpc_channel_args* args) { .PreconditionChannelArgs(args) .SetObject(g_factory); - auto channel = - grpc_core::ChannelCreate("binder_channel_target_placeholder", - channel_args, GRPC_CLIENT_CHANNEL, nullptr); + auto channel = grpc_core::ChannelCreate(target, channel_args, + GRPC_CLIENT_CHANNEL, nullptr); if (!channel.ok()) { return grpc_lame_client_channel_create( - "binder_channel_target_placeholder", - static_cast(channel.status().code()), + target.c_str(), static_cast(channel.status().code()), "Failed to create binder channel"); } diff --git a/src/core/ext/transport/binder/client/channel_create_impl.h b/src/core/ext/transport/binder/client/channel_create_impl.h index b88d39c2d27..7f00a5e1e09 100644 --- a/src/core/ext/transport/binder/client/channel_create_impl.h +++ b/src/core/ext/transport/binder/client/channel_create_impl.h @@ -34,7 +34,8 @@ grpc_channel* CreateDirectBinderChannelImplForTesting( security_policy); // Creates a GRPC_CLIENT_CHANNEL channel -grpc_channel* CreateClientBinderChannelImpl(const grpc_channel_args* args); +grpc_channel* CreateClientBinderChannelImpl(std::string target, + const grpc_channel_args* args); } // namespace internal } // namespace grpc diff --git a/src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc b/src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc index 4fc5cc9dc56..47f8af13760 100644 --- a/src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc +++ b/src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc @@ -370,15 +370,11 @@ grpc_channel* grpc_chaotic_good_channel_create(const char* target, grpc_channel* channel = nullptr; grpc_error_handle error; // Create channel. - std::string canonical_target = grpc_core::CoreConfiguration::Get() - .resolver_registry() - .AddDefaultPrefixIfNeeded(target); auto r = grpc_core::ChannelCreate( target, grpc_core::CoreConfiguration::Get() .channel_args_preconditioning() .PreconditionChannelArgs(args) - .Set(GRPC_ARG_SERVER_URI, canonical_target) .SetObject( grpc_core::NoDestructSingleton< grpc_core::chaotic_good::ChaoticGoodChannelFactory>::Get()), diff --git a/src/core/ext/transport/chttp2/client/chttp2_connector.cc b/src/core/ext/transport/chttp2/client/chttp2_connector.cc index 17edffae52a..93940b5091e 100644 --- a/src/core/ext/transport/chttp2/client/chttp2_connector.cc +++ b/src/core/ext/transport/chttp2/client/chttp2_connector.cc @@ -314,12 +314,7 @@ absl::StatusOr> CreateChannel(const char* target, gpr_log(GPR_ERROR, "cannot create channel with NULL target name"); return absl::InvalidArgumentError("channel target is NULL"); } - // Add channel arg containing the server URI. - std::string canonical_target = - CoreConfiguration::Get().resolver_registry().AddDefaultPrefixIfNeeded( - target); - return ChannelCreate(target, args.Set(GRPC_ARG_SERVER_URI, canonical_target), - GRPC_CLIENT_CHANNEL, nullptr); + return ChannelCreate(target, args, GRPC_CLIENT_CHANNEL, nullptr); } } // namespace diff --git a/src/core/lib/surface/channel_create.cc b/src/core/lib/surface/channel_create.cc index c98da2824b9..7c67e20652c 100644 --- a/src/core/lib/surface/channel_create.cc +++ b/src/core/lib/surface/channel_create.cc @@ -22,6 +22,7 @@ #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channelz.h" +#include "src/core/lib/config/core_configuration.h" #include "src/core/lib/debug/stats.h" #include "src/core/lib/debug/stats_data.h" #include "src/core/lib/surface/channel.h" @@ -34,6 +35,14 @@ absl::StatusOr> ChannelCreate( std::string target, ChannelArgs args, grpc_channel_stack_type channel_stack_type, Transport* optional_transport) { global_stats().IncrementClientChannelsCreated(); + // For client channels, canonify target string and add channel arg. + // Note: We don't do this for direct channels or lame channels. + if (channel_stack_type == GRPC_CLIENT_CHANNEL) { + target = + CoreConfiguration::Get().resolver_registry().AddDefaultPrefixIfNeeded( + target); + args = args.Set(GRPC_ARG_SERVER_URI, target); + } // Set default authority if needed. if (!args.GetString(GRPC_ARG_DEFAULT_AUTHORITY).has_value()) { auto ssl_override = args.GetString(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG); diff --git a/src/php/tests/unit_tests/CallInvokerTest.php b/src/php/tests/unit_tests/CallInvokerTest.php index 52af5b1b72f..5fa22858f45 100644 --- a/src/php/tests/unit_tests/CallInvokerTest.php +++ b/src/php/tests/unit_tests/CallInvokerTest.php @@ -194,7 +194,7 @@ class CallInvokerTest extends \PHPUnit\Framework\TestCase $stub = new \Grpc\BaseStub('localhost:50051', ['credentials' => \Grpc\ChannelCredentials::createInsecure(), 'grpc_call_invoker' => $call_invoker]); - $this->assertEquals($call_invoker->getChannel()->getTarget(), 'localhost:50050'); + $this->assertEquals($call_invoker->getChannel()->getTarget(), 'dns:///localhost:50050'); $call_invoker->getChannel()->close(); } diff --git a/src/python/grpcio_tests/tests_aio/channelz/channelz_servicer_test.py b/src/python/grpcio_tests/tests_aio/channelz/channelz_servicer_test.py index 12b8fd41632..07cfe67427c 100644 --- a/src/python/grpcio_tests/tests_aio/channelz/channelz_servicer_test.py +++ b/src/python/grpcio_tests/tests_aio/channelz/channelz_servicer_test.py @@ -94,7 +94,7 @@ class _ChannelServerPair: channelz_pb2.GetTopChannelsRequest(start_channel_id=0) ) for channel in resp.channel: - if channel.data.target == self.address: + if channel.data.target == "dns:///" + self.address: self.channel_ref_id = channel.ref.channel_id resp = await channelz_stub.GetServers( From 669493b0b754024586bafeb19073195054c2c90e Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Mon, 18 Mar 2024 14:01:33 -0700 Subject: [PATCH 09/16] [EventEngine] Rename and add tests for ResolvedAddress wildcard port accessor (#36144) The function name was not very descriptive of its behavior, and there were no tests that made the behavior clear. The documentation had been wrong for some time, fixed in https://github.com/grpc/grpc/pull/36143. CC @nipil Closes #36144 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36144 from drfloob:test-wildcard-addr-get-port fd32ecb3ef01a44c2e9be410c735e5ef275f0a25 PiperOrigin-RevId: 616939868 --- .../posix_engine/posix_engine_listener.cc | 2 +- src/core/lib/event_engine/tcp_socket_utils.cc | 2 +- src/core/lib/event_engine/tcp_socket_utils.h | 2 +- .../lib/event_engine/windows/windows_listener.cc | 2 +- test/core/event_engine/tcp_socket_utils_test.cc | 15 +++++++++++++++ 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc b/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc index 1bcc32e2fe4..9930b688024 100644 --- a/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +++ b/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc @@ -100,7 +100,7 @@ absl::StatusOr PosixEngineListenerImpl::Bind( } } - auto used_port = ResolvedAddressIsWildcard(res_addr); + auto used_port = MaybeGetWildcardPortFromAddress(res_addr); // Update the callback. Any subsequent new sockets created and added to // acceptors_ in this function will invoke the new callback. acceptors_.UpdateOnAppendCallback(std::move(on_bind_new_fd)); diff --git a/src/core/lib/event_engine/tcp_socket_utils.cc b/src/core/lib/event_engine/tcp_socket_utils.cc index c3bd35fc905..79ccd514d1a 100644 --- a/src/core/lib/event_engine/tcp_socket_utils.cc +++ b/src/core/lib/event_engine/tcp_socket_utils.cc @@ -311,7 +311,7 @@ void ResolvedAddressSetPort(EventEngine::ResolvedAddress& resolved_addr, } } -absl::optional ResolvedAddressIsWildcard( +absl::optional MaybeGetWildcardPortFromAddress( const EventEngine::ResolvedAddress& addr) { const EventEngine::ResolvedAddress* resolved_addr = &addr; EventEngine::ResolvedAddress addr4_normalized; diff --git a/src/core/lib/event_engine/tcp_socket_utils.h b/src/core/lib/event_engine/tcp_socket_utils.h index d92cef3b285..0847447902f 100644 --- a/src/core/lib/event_engine/tcp_socket_utils.h +++ b/src/core/lib/event_engine/tcp_socket_utils.h @@ -58,7 +58,7 @@ void ResolvedAddressSetPort(EventEngine::ResolvedAddress& resolved_addr, // Returns the port number associated with the address if the given address is // a wildcard ipv4 or ipv6 address. Otherwise returns absl::nullopt -absl::optional ResolvedAddressIsWildcard( +absl::optional MaybeGetWildcardPortFromAddress( const EventEngine::ResolvedAddress& addr); // Returns true if resolved_addr is an VSOCK address. Otherwise returns false. diff --git a/src/core/lib/event_engine/windows/windows_listener.cc b/src/core/lib/event_engine/windows/windows_listener.cc index d74cfc0e8bc..868119f4525 100644 --- a/src/core/lib/event_engine/windows/windows_listener.cc +++ b/src/core/lib/event_engine/windows/windows_listener.cc @@ -354,7 +354,7 @@ absl::StatusOr WindowsEventEngineListener::Bind( out_addr = tmp_addr; } // Treat :: or 0.0.0.0 as a family-agnostic wildcard. - if (ResolvedAddressIsWildcard(out_addr)) { + if (MaybeGetWildcardPortFromAddress(out_addr).has_value()) { out_addr = ResolvedAddressMakeWild6(out_port); } // open the socket diff --git a/test/core/event_engine/tcp_socket_utils_test.cc b/test/core/event_engine/tcp_socket_utils_test.cc index 703ee19c5b7..b18c51eb28d 100644 --- a/test/core/event_engine/tcp_socket_utils_test.cc +++ b/test/core/event_engine/tcp_socket_utils_test.cc @@ -313,6 +313,21 @@ TEST(TcpSocketUtilsTest, SockAddrPortTest) { EXPECT_EQ(ResolvedAddressToNormalizedString(wild6).value(), "[::]:22"); } +TEST(TcpSocketUtilsTest, MaybeGetWildcardPortFromAddress) { + EventEngine::ResolvedAddress wild4 = ResolvedAddressMakeWild4(20); + EventEngine::ResolvedAddress wild6 = ResolvedAddressMakeWild6(20); + auto v4_port = MaybeGetWildcardPortFromAddress(wild4); + ASSERT_TRUE(v4_port.has_value()); + auto v6_port = MaybeGetWildcardPortFromAddress(wild6); + ASSERT_TRUE(v6_port.has_value()); + wild4 = MakeAddr4(kIPv4, sizeof(kIPv4)); + v4_port = MaybeGetWildcardPortFromAddress(wild4); + ASSERT_FALSE(v4_port.has_value()); + wild6 = MakeAddr6(kMapped, sizeof(kMapped)); + v6_port = MaybeGetWildcardPortFromAddress(wild6); + ASSERT_FALSE(v6_port.has_value()); +} + } // namespace experimental } // namespace grpc_event_engine From 15d64cf9c9b8660e072cfec74806fda1df83526f Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 18 Mar 2024 15:51:39 -0700 Subject: [PATCH 10/16] [party] Auto-batch cross party wakeups (#36048) If party1 wakes party2 we'd prefer that party1 finishes all its activations before it wakes party2: intuition: party1 might wake party2 for other things too, and being able to coalesce them all into one wakeup significantly helps performance. Closes #36048 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36048 from ctiller:wakey f6d4416685a00f1318cf399e47abe5dee2370b1c PiperOrigin-RevId: 616970833 --- src/core/lib/promise/party.cc | 34 +++++++++++++++++++- test/core/promise/party_test.cc | 57 +++++++++++++++++++++++++++++++-- 2 files changed, 88 insertions(+), 3 deletions(-) diff --git a/src/core/lib/promise/party.cc b/src/core/lib/promise/party.cc index 4a47bb33687..59006a0490c 100644 --- a/src/core/lib/promise/party.cc +++ b/src/core/lib/promise/party.cc @@ -37,6 +37,11 @@ grpc_core::DebugOnlyTraceFlag grpc_trace_party_state(false, "party_state"); namespace grpc_core { +namespace { +// TODO(ctiller): Once all activities are parties we can remove this. +thread_local Party** g_current_party_run_next = nullptr; +} // namespace + /////////////////////////////////////////////////////////////////////////////// // PartySyncUsingAtomics @@ -210,11 +215,38 @@ void Party::ForceImmediateRepoll(WakeupMask mask) { } void Party::RunLocked() { + // If there is a party running, then we don't run it immediately + // but instead add it to the end of the list of parties to run. + // This enables a fairly straightforward batching of work from a + // call to a transport (or back again). + if (g_current_party_run_next != nullptr) { + if (*g_current_party_run_next == nullptr) { + *g_current_party_run_next = this; + } else { + // But if there's already a party queued, we're better off asking event + // engine to run it so we can spread load. + event_engine()->Run([this]() { + ApplicationCallbackExecCtx app_exec_ctx; + ExecCtx exec_ctx; + RunLocked(); + }); + } + return; + } auto body = [this]() { - if (RunParty()) { + GPR_DEBUG_ASSERT(g_current_party_run_next == nullptr); + Party* run_next = nullptr; + g_current_party_run_next = &run_next; + const bool done = RunParty(); + GPR_DEBUG_ASSERT(g_current_party_run_next == &run_next); + g_current_party_run_next = nullptr; + if (done) { ScopedActivity activity(this); PartyOver(); } + if (run_next != nullptr) { + run_next->RunLocked(); + } }; #ifdef GRPC_MAXIMIZE_THREADYNESS Thread thd( diff --git a/test/core/promise/party_test.cc b/test/core/promise/party_test.cc index 6bdf6696da7..02a93a038f3 100644 --- a/test/core/promise/party_test.cc +++ b/test/core/promise/party_test.cc @@ -285,8 +285,7 @@ TEST_F(PartyTest, CanSpawnAndRun) { "TestSpawn", [i = 10]() mutable -> Poll { EXPECT_EQ(GetContext()->DebugTag(), "TestParty"); - gpr_log(GPR_DEBUG, "i=%d", i); - GPR_ASSERT(i > 0); + EXPECT_GT(i, 0); GetContext()->ForceImmediateRepoll(); --i; if (i == 0) return 42; @@ -786,6 +785,60 @@ TEST_F(PartyTest, ThreadStressTestWithInnerSpawn) { } } +TEST_F(PartyTest, NestedWakeup) { + auto party1 = MakeRefCounted(); + auto party2 = MakeRefCounted(); + auto party3 = MakeRefCounted(); + int whats_going_on = 0; + Notification started2; + Notification done2; + Notification started3; + Notification notify_done; + party1->Spawn( + "p1", + [&]() { + EXPECT_EQ(whats_going_on, 0); + whats_going_on = 1; + party2->Spawn( + "p2", + [&]() { + started2.Notify(); + started3.WaitForNotification(); + EXPECT_EQ(whats_going_on, 3); + whats_going_on = 4; + return Empty{}; + }, + [&](Empty) { + EXPECT_EQ(whats_going_on, 4); + whats_going_on = 5; + done2.Notify(); + }); + party3->Spawn( + "p3", + [&]() { + started2.WaitForNotification(); + started3.Notify(); + done2.WaitForNotification(); + EXPECT_EQ(whats_going_on, 5); + whats_going_on = 6; + return Empty{}; + }, + [&](Empty) { + EXPECT_EQ(whats_going_on, 6); + whats_going_on = 7; + notify_done.Notify(); + }); + EXPECT_EQ(whats_going_on, 1); + whats_going_on = 2; + return Empty{}; + }, + [&](Empty) { + EXPECT_EQ(whats_going_on, 2); + whats_going_on = 3; + }); + notify_done.WaitForNotification(); +} + } // namespace grpc_core int main(int argc, char** argv) { From bb9f4466e1568de09f1576b339abeb48ff4cc9a4 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Mon, 18 Mar 2024 18:41:15 -0700 Subject: [PATCH 11/16] [api-fuzzer] Remove ping support (#36146) Pings were removed from the Core API in https://github.com/grpc/proposal/pull/203 Closes #36146 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36146 from yashykt:DisablePingFromApiFuzzer e9a783aecb0eb0b28c2c8991fcef7648d86228ed PiperOrigin-RevId: 617014710 --- test/core/end2end/fuzzers/fuzzing_common.cc | 16 +++------------- test/core/end2end/fuzzers/fuzzing_common.h | 3 --- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/test/core/end2end/fuzzers/fuzzing_common.cc b/test/core/end2end/fuzzers/fuzzing_common.cc index f78dd6a4cd1..0b0ea9ff96f 100644 --- a/test/core/end2end/fuzzers/fuzzing_common.cc +++ b/test/core/end2end/fuzzers/fuzzing_common.cc @@ -547,16 +547,6 @@ BasicFuzzer::Result BasicFuzzer::CancelActiveCall() { return Result::kComplete; } -BasicFuzzer::Result BasicFuzzer::SendPingOnChannel() { - if (channel() != nullptr) { - pending_pings_++; - grpc_channel_ping(channel(), cq_, Decrement(&pending_pings_), nullptr); - } else { - return Result::kFailed; - } - return Result::kComplete; -} - BasicFuzzer::Result BasicFuzzer::Pause(Duration duration) { ++paused_; engine()->RunAfterExactly(duration, [this]() { --paused_; }); @@ -642,8 +632,7 @@ void BasicFuzzer::ShutdownCalls() { bool BasicFuzzer::Continue() { return channel() != nullptr || server() != nullptr || - pending_channel_watches_ > 0 || pending_pings_ > 0 || - ActiveCall() != nullptr || paused_; + pending_channel_watches_ > 0 || ActiveCall() != nullptr || paused_; } BasicFuzzer::Result BasicFuzzer::ExecuteAction( @@ -699,7 +688,8 @@ BasicFuzzer::Result BasicFuzzer::ExecuteAction( return ValidateChannelTarget(); // send a ping on a channel case api_fuzzer::Action::kPing: - return SendPingOnChannel(); + // Ping is no longer a part of the API + return BasicFuzzer::Result::kNotSupported; // enable a tracer case api_fuzzer::Action::kEnableTracer: { grpc_tracer_set_enabled(action.enable_tracer().c_str(), 1); diff --git a/test/core/end2end/fuzzers/fuzzing_common.h b/test/core/end2end/fuzzers/fuzzing_common.h index 94fcbb859bd..abf07cd1db4 100644 --- a/test/core/end2end/fuzzers/fuzzing_common.h +++ b/test/core/end2end/fuzzers/fuzzing_common.h @@ -135,8 +135,6 @@ class BasicFuzzer { Result WatchConnectivity(uint32_t duration_us); // Verify that the channel target can be reliably queried. Result ValidateChannelTarget(); - // Send a http ping on the channel. - Result SendPingOnChannel(); // Server specific actions // Create an active server. @@ -183,7 +181,6 @@ class BasicFuzzer { bool server_shutdown_ = false; int pending_server_shutdowns_ = 0; int pending_channel_watches_ = 0; - int pending_pings_ = 0; int paused_ = 0; std::vector> calls_; RefCountedPtr resource_quota_; From d6bb391449de17a065cd2fccc53b567c93e8391d Mon Sep 17 00:00:00 2001 From: Ming-Chuan <10496191+sifmelcara@users.noreply.github.com> Date: Tue, 19 Mar 2024 11:43:13 -0700 Subject: [PATCH 12/16] [Build] Migrate Android NDK, android rules and platforms (#36116) This commit does the following 3 things for Android bazel rules, which depends on each other 1. Update NDK to 26.2.11394342 (and a few other Android things) 2. Use rules_android_ndk instead of builtin `native.android_ndk_repository` * `third_party/android/android_configure.bzl` was a workaround for users who don't set `$ANDROID_NDK_HOME` env var. Now with rules_android_ndk, we can declare repo without registering the toolchain. Instead users who need NDK toolchain should use `--extra_toolchains` to manually register the toolchain, as shown in README.md. 3. Migrate to platforms. See https://bazel.build/concepts/platforms * Currently we declares android platforms that is needed for binder transport APK. Later gRPC repo can gradually migrate to platforms for other platforms. * The value of `crosstool_top` will still be `//external:android/crosstool` (which is the default value), so existings android `config_settings` will still work. We should migrate them to match with `@platforms//os:android` constraint later. The platforms migration needs Bazel 7.0 to work so we also override bazel version in testing scripts. Closes #36116 PiperOrigin-RevId: 617244655 --- BUILD | 26 ++++++++ WORKSPACE | 31 +++++++--- .../binder/java/io/grpc/binder/cpp/README.md | 25 ++++---- .../io/grpc/binder/cpp/exampleclient/BUILD | 2 - .../io/grpc/binder/cpp/exampleserver/BUILD | 2 - .../binder_transport_apk/Dockerfile.template | 33 +++++----- third_party/android/BUILD | 3 - third_party/android/android_configure.bzl | 62 ------------------- third_party/cares/cares.BUILD | 6 +- .../dockerimage_current_versions.bzl | 2 +- .../test/binder_transport_apk.current_version | 2 +- .../test/binder_transport_apk/Dockerfile | 23 ++++--- ...pc_binder_transport_apk_build_in_docker.sh | 14 ++--- 13 files changed, 108 insertions(+), 123 deletions(-) delete mode 100644 third_party/android/BUILD delete mode 100644 third_party/android/android_configure.bzl diff --git a/BUILD b/BUILD index 2c3bb0b7d9e..3fca11ff4c7 100644 --- a/BUILD +++ b/BUILD @@ -65,6 +65,30 @@ bool_flag( build_setting_default = False, ) +platform( + name = "android_x86_64", + constraint_values = [ + "@platforms//os:android", + "@platforms//cpu:x86_64", + ], +) + +platform( + name = "android_arm64", + constraint_values = [ + "@platforms//os:android", + "@platforms//cpu:arm64", + ], +) + +platform( + name = "android_armv7", + constraint_values = [ + "@platforms//os:android", + "@platforms//cpu:armv7", + ], +) + config_setting( name = "grpc_no_rls_flag", flag_values = {":disable_grpc_rls": "true"}, @@ -84,6 +108,8 @@ config_setting( config_setting( name = "android", values = {"crosstool_top": "//external:android/crosstool"}, + # TODO: Use constraint_values to detect android after Bazel 7.0 platforms migration is finished + # constraint_values = [ "@platforms//os:android" ], ) config_setting( diff --git a/WORKSPACE b/WORKSPACE index 162e9a4e73b..b919672f3a2 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -27,19 +27,34 @@ custom_exec_properties( load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( - name = "build_bazel_rules_android", - sha256 = "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806", - strip_prefix = "rules_android-0.1.1", - urls = ["https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip"], + name = "platforms", + sha256 = "8150406605389ececb6da07cbcb509d5637a3ab9a24bc69b1101531367d89d74", + urls = ["https://github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz"], ) -load("//third_party/android:android_configure.bzl", "android_configure") +RULES_ANDROID_NDK_COMMIT = "010f4f17dd13a8baaaacc28ba6c8c2c75f54c68b" -android_configure(name = "local_config_android") +RULES_ANDROID_NDK_SHA = "2ab6a97748772f289331d75caaaee0593825935d1d9d982231a437fb8ab5a14d" -load("@local_config_android//:android_configure.bzl", "android_workspace") +http_archive( + name = "rules_android_ndk", + sha256 = RULES_ANDROID_NDK_SHA, + strip_prefix = "rules_android_ndk-%s" % RULES_ANDROID_NDK_COMMIT, + url = "https://github.com/bazelbuild/rules_android_ndk/archive/%s.zip" % RULES_ANDROID_NDK_COMMIT, +) + +android_sdk_repository( + name = "androidsdk", + build_tools_version = "34.0.0", +) + +load("@rules_android_ndk//:rules.bzl", "android_ndk_repository") + +android_ndk_repository(name = "androidndk") -android_workspace() +# Note that we intentionally avoid calling `register_toolchains("@androidndk//:all")` +# here, because the toolchain rule fails when $ANDROID_NDK_HOME is not set. +# Use `--extra_toolchains=@androidndk//:all` to manually register it when building for Android. # Prevents bazel's '...' expansion from including the following folder. # This is required because the BUILD file in the following folder diff --git a/examples/android/binder/java/io/grpc/binder/cpp/README.md b/examples/android/binder/java/io/grpc/binder/cpp/README.md index d0817c07d5e..d4df89e277c 100644 --- a/examples/android/binder/java/io/grpc/binder/cpp/README.md +++ b/examples/android/binder/java/io/grpc/binder/cpp/README.md @@ -1,20 +1,23 @@ # gRPC-core BinderTransport example apps -WIP. - ## Build Instruction -1. Install Android SDK and NDK. Currently we only support SDK version 30.0.3 and - NDK version 21.4.7075529 . Make sure you get these exact versions otherwise - Bazel might complain. - -2. Point environment variables to install locations of SDK and NDK +1. Install Android SDK and NDK. Only NDK version >= 25 is supported. We tested against SDK Platform `33` and NDK `26.2.11394342`. +2. Make sure Bazel is at least `7.0`. Use `export OVERRIDE_BAZEL_VERSION=7.1.0` to selected a supported version listed in `bazel/supported_versions.txt` if necessary. +3. Point environment variables to install locations of SDK and NDK + ``` + export ANDROID_HOME=$HOME/android-sdk + export ANDROID_NDK_HOME=$HOME/android-sdk/ndk/26.2.11394342 + ``` +4. To build a fat APK that supports `x86_64`, `armv7`, and `arm64`: ``` - export ANDROID_HOME=$HOME/Android/Sdk/ - export ANDROID_NDK_HOME=$HOME/Android/Sdk/ndk/21.4.7075529 + bazel build \ + --extra_toolchains=@androidndk//:all \ + --android_platforms=//:android_x86_64,//:android_armv7,//:android_arm64 \ + --copt=-Wno-unknown-warning-option \ + //examples/android/binder/java/io/grpc/binder/cpp/exampleserver:app \ + //examples/android/binder/java/io/grpc/binder/cpp/exampleclient:app ``` -3. `bazel build //examples/android/binder/java/io/grpc/binder/cpp/exampleclient:app` -4. `bazel build //examples/android/binder/java/io/grpc/binder/cpp/exampleserver:app` 5. `adb install bazel-bin/examples/android/binder/java/io/grpc/binder/cpp/exampleclient/app.apk` 6. `adb install diff --git a/examples/android/binder/java/io/grpc/binder/cpp/exampleclient/BUILD b/examples/android/binder/java/io/grpc/binder/cpp/exampleclient/BUILD index c21ea99f7c1..8b11ebb383a 100644 --- a/examples/android/binder/java/io/grpc/binder/cpp/exampleclient/BUILD +++ b/examples/android/binder/java/io/grpc/binder/cpp/exampleclient/BUILD @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@build_bazel_rules_android//android:rules.bzl", "android_binary", "android_library") - cc_library( name = "jni_lib", srcs = ["native.cc"], diff --git a/examples/android/binder/java/io/grpc/binder/cpp/exampleserver/BUILD b/examples/android/binder/java/io/grpc/binder/cpp/exampleserver/BUILD index 3c11762ab1a..b4e88ebc90a 100644 --- a/examples/android/binder/java/io/grpc/binder/cpp/exampleserver/BUILD +++ b/examples/android/binder/java/io/grpc/binder/cpp/exampleserver/BUILD @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@build_bazel_rules_android//android:rules.bzl", "android_binary", "android_library") - cc_library( name = "jni_lib", srcs = ["native.cc"], diff --git a/templates/tools/dockerfile/test/binder_transport_apk/Dockerfile.template b/templates/tools/dockerfile/test/binder_transport_apk/Dockerfile.template index d7058936c8c..5601967cd7c 100644 --- a/templates/tools/dockerfile/test/binder_transport_apk/Dockerfile.template +++ b/templates/tools/dockerfile/test/binder_transport_apk/Dockerfile.template @@ -19,26 +19,31 @@ #======================== # Java - RUN apt-get install -y openjdk-8-jdk + RUN apt-get install -y openjdk-21-jdk #======================== # Android SDK/NDK installation - ENV SDK_ROOT=/opt/android-sdk + ENV ANDROID_SDK_VERSION 11076708 + ENV ANDROID_NDK_VERSION 26.2.11394342 + + ENV SDK_ROOT /opt/android-sdk + RUN mkdir -p $SDK_ROOT - RUN wget -O cmd.zip dl.google.com/android/repository/commandlinetools-linux-7302050_latest.zip && \ - unzip cmd.zip && rm cmd.zip && \ - yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'tools' && \ - yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'platform-tools' && \ - yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'build-tools;30.0.3' && \ - yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'platforms;android-29' && \ - yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'ndk-bundle' && \ - yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'ndk;21.4.7075529' + RUN cd $SDK_ROOT && \ + wget -O cmd.zip https://dl.google.com/android/repository/commandlinetools-linux-${'${ANDROID_SDK_VERSION}'}_latest.zip && \ + unzip -q cmd.zip && \ + rm cmd.zip + + RUN yes | $SDK_ROOT/cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT --licenses # accept all licenses + + # This is not required but desirable to reduce the time to download and the chance of download failure. + RUN mkdir -p ~/.android && touch ~/.android/repositories.cfg + + RUN $SDK_ROOT/cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT "ndk;$ANDROID_NDK_VERSION" "platforms;android-33" "build-tools;34.0.0" # Set environment variables for Bazel rules - ENV ANDROID_HOME=/opt/android-sdk - ENV ANDROID_NDK_HOME=/opt/android-sdk/ndk/21.4.7075529 - - RUN mkdir -p /var/local/jenkins + ENV ANDROID_HOME $SDK_ROOT + ENV ANDROID_NDK_HOME $SDK_ROOT/ndk/$ANDROID_NDK_VERSION # Define the default command. CMD ["bash"] diff --git a/third_party/android/BUILD b/third_party/android/BUILD deleted file mode 100644 index 12a7f707152..00000000000 --- a/third_party/android/BUILD +++ /dev/null @@ -1,3 +0,0 @@ -exports_files([ - "android_configure.bzl", -]) diff --git a/third_party/android/android_configure.bzl b/third_party/android/android_configure.bzl deleted file mode 100644 index 40e7f105deb..00000000000 --- a/third_party/android/android_configure.bzl +++ /dev/null @@ -1,62 +0,0 @@ -"""Repository rule for Android SDK and NDK autoconfiguration. - -This rule is a no-op unless the required android environment variables are set. -""" - -# Based on https://github.com/tensorflow/tensorflow/tree/34c03ed67692eb76cb3399cebca50ea8bcde064c/third_party/android -# Workaround for https://github.com/bazelbuild/bazel/issues/14260 - -_ANDROID_NDK_HOME = "ANDROID_NDK_HOME" -_ANDROID_SDK_HOME = "ANDROID_HOME" - -def _escape_for_windows(path): - """Properly escape backslashes for Windows. - - Ideally, we would do this conditionally, but there is seemingly no way to - determine whether or not this is being called from Windows. - """ - return path.replace("\\", "\\\\") - -def _android_autoconf_impl(repository_ctx): - sdk_home = repository_ctx.os.environ.get(_ANDROID_SDK_HOME) - ndk_home = repository_ctx.os.environ.get(_ANDROID_NDK_HOME) - - # version 31.0.0 won't work https://stackoverflow.com/a/68036845 - sdk_rule = "" - if sdk_home: - sdk_rule = """ - native.android_sdk_repository( - name="androidsdk", - path="{}", - build_tools_version="30.0.3", - ) -""".format(_escape_for_windows(sdk_home)) - - # Note that Bazel does not support NDK 22 yet, and Bazel 3.7.1 only - # supports up to API level 29 for NDK 21 - ndk_rule = "" - if ndk_home: - ndk_rule = """ - native.android_ndk_repository( - name="androidndk", - path="{}", - ) -""".format(_escape_for_windows(ndk_home)) - - if ndk_rule == "" and sdk_rule == "": - sdk_rule = "pass" - - repository_ctx.file("BUILD.bazel", "") - repository_ctx.file("android_configure.bzl", """ -def android_workspace(): - {} - {} - """.format(sdk_rule, ndk_rule)) - -android_configure = repository_rule( - implementation = _android_autoconf_impl, - environ = [ - _ANDROID_NDK_HOME, - _ANDROID_SDK_HOME, - ], -) diff --git a/third_party/cares/cares.BUILD b/third_party/cares/cares.BUILD index 5a008ed5ae8..784daed1b6f 100644 --- a/third_party/cares/cares.BUILD +++ b/third_party/cares/cares.BUILD @@ -29,9 +29,9 @@ config_setting( # This just helps with the build for now. config_setting( name = "android", - values = { - "crosstool_top": "//external:android/crosstool", - }, + values = {"crosstool_top": "//external:android/crosstool"}, + # TODO: Use constraint_values to detect android after Bazel 7.0 platforms migration is finished + # constraint_values = [ "@platforms//os:android" ], ) # iOS is not officially supported through C++. diff --git a/tools/bazelify_tests/dockerimage_current_versions.bzl b/tools/bazelify_tests/dockerimage_current_versions.bzl index 41b9a5707b5..e83a0d9a88b 100644 --- a/tools/bazelify_tests/dockerimage_current_versions.bzl +++ b/tools/bazelify_tests/dockerimage_current_versions.bzl @@ -90,7 +90,7 @@ DOCKERIMAGE_CURRENT_VERSIONS = { "tools/dockerfile/test/android_ndk.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/android_ndk@sha256:ab154ecb062af2111d2d3550c4d3da3384201d9893bbd37d49e8160fc34bc137", "tools/dockerfile/test/bazel.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/bazel@sha256:eb327f8e44f2712f557de1d8918c41c3cba1112c4b39b13104c29211ed8f827a", "tools/dockerfile/test/bazel_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/bazel_arm64@sha256:6cddc0ecdb42a7db7105b73fc3192edb911702102d1bac671e26d44a17d7aa95", - "tools/dockerfile/test/binder_transport_apk.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/binder_transport_apk@sha256:a680a8b7d645a2c25948ad3f82f6380c8a1e13fcfe74fc3569acb3b0b202851e", + "tools/dockerfile/test/binder_transport_apk.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/binder_transport_apk@sha256:ff64e263dfa5491ee6fddd7f0d7c1a20ba756636655849a3b923c665d78c8ef2", "tools/dockerfile/test/csharp_debian11_arm64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_debian11_arm64@sha256:4d4bc5f15e03f3d3d8fd889670ecde2c66a2e4d2dd9db80733c05c1d90c8a248", "tools/dockerfile/test/csharp_debian11_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_debian11_x64@sha256:b2e5c47d986312ea0850e2f2e696b45d23ee0aabceea161d31e28559e19ec4a5", "tools/dockerfile/test/cxx_alpine_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_alpine_x64@sha256:f2019edf9f2afd5042567f11afb1aa78a789fc9acdcce5ee0c14cc11f6830ed7", diff --git a/tools/dockerfile/test/binder_transport_apk.current_version b/tools/dockerfile/test/binder_transport_apk.current_version index c5fbd60b28b..bbb66248e57 100644 --- a/tools/dockerfile/test/binder_transport_apk.current_version +++ b/tools/dockerfile/test/binder_transport_apk.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/binder_transport_apk:fbe8a32dd2006fab456f2fa0d0e82d3979b7f30b@sha256:a680a8b7d645a2c25948ad3f82f6380c8a1e13fcfe74fc3569acb3b0b202851e \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/binder_transport_apk:611a0d410d3032bc41175599a5f1495a07759c1f@sha256:ff64e263dfa5491ee6fddd7f0d7c1a20ba756636655849a3b923c665d78c8ef2 diff --git a/tools/dockerfile/test/binder_transport_apk/Dockerfile b/tools/dockerfile/test/binder_transport_apk/Dockerfile index 9f38130a87a..1e053dc599a 100644 --- a/tools/dockerfile/test/binder_transport_apk/Dockerfile +++ b/tools/dockerfile/test/binder_transport_apk/Dockerfile @@ -60,19 +60,28 @@ RUN BAZEL_ARCH_SUFFIX="$(uname -m | sed s/aarch64/arm64/)" \ #======================== # Java -RUN apt-get install -y openjdk-8-jdk +RUN apt-get install -y openjdk-21-jdk #======================== # Android SDK/NDK installation -ENV SDK_ROOT=/opt/android-sdk +ENV ANDROID_SDK_VERSION 11076708 +ENV ANDROID_NDK_VERSION 26.2.11394342 + +ENV SDK_ROOT /opt/android-sdk + RUN mkdir -p $SDK_ROOT -RUN wget -O cmd.zip dl.google.com/android/repository/commandlinetools-linux-7302050_latest.zip && unzip cmd.zip && rm cmd.zip && yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'tools' && yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'platform-tools' && yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'build-tools;30.0.3' && yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'platforms;android-29' && yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'ndk-bundle' && yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'ndk;21.4.7075529' +RUN cd $SDK_ROOT && wget -O cmd.zip https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip && unzip -q cmd.zip && rm cmd.zip -# Set environment variables for Bazel rules -ENV ANDROID_HOME=/opt/android-sdk -ENV ANDROID_NDK_HOME=/opt/android-sdk/ndk/21.4.7075529 +RUN yes | $SDK_ROOT/cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT --licenses # accept all licenses -RUN mkdir -p /var/local/jenkins +# This is not required but desirable to reduce the time to download and the chance of download failure. +RUN mkdir -p ~/.android && touch ~/.android/repositories.cfg + +RUN $SDK_ROOT/cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT "ndk;$ANDROID_NDK_VERSION" "platforms;android-33" "build-tools;34.0.0" + +# Set environment variables for Bazel rules +ENV ANDROID_HOME $SDK_ROOT +ENV ANDROID_NDK_HOME $SDK_ROOT/ndk/$ANDROID_NDK_VERSION # Define the default command. CMD ["bash"] diff --git a/tools/internal_ci/linux/grpc_binder_transport_apk_build_in_docker.sh b/tools/internal_ci/linux/grpc_binder_transport_apk_build_in_docker.sh index b92259cf452..99f51b6d476 100755 --- a/tools/internal_ci/linux/grpc_binder_transport_apk_build_in_docker.sh +++ b/tools/internal_ci/linux/grpc_binder_transport_apk_build_in_docker.sh @@ -18,19 +18,15 @@ set -ex echo $ANDROID_HOME echo $ANDROID_NDK_HOME -# Build all targets using the strict warning option which leverages the -# clang compiler to check if sources can pass a set of warning options. -# CPU are specified because gRPC does not build with 32bit NDK (which has socklen_t -# defined as int due to an accident). -# The python option is for disabling python2 enforcement when packing APK +# Android platforms only works with Bazel >= 7.0 +export OVERRIDE_BAZEL_VERSION=7.1.0 + python3 tools/run_tests/python_utils/bazel_report_helper.py --report_path bazel_binder_example_app bazel_binder_example_app/bazel_wrapper \ --bazelrc=tools/remote_build/include/test_locally_with_resultstore_results.bazelrc \ build \ - --define=use_strict_warning=true \ - --copt=-Wno-unknown-warning-option \ - --fat_apk_cpu=x86_64,arm64-v8a \ - --extra_toolchains=@rules_python//python:autodetecting_toolchain_nonstrict \ + --extra_toolchains=@androidndk//:all \ + --android_platforms=//:android_x86_64,//:android_armv7,//:android_arm64 \ //examples/android/binder/java/io/grpc/binder/cpp/exampleclient:app \ //examples/android/binder/java/io/grpc/binder/cpp/exampleserver:app From bfcbcd6eaa6b6d78516169069d83afb717c319e6 Mon Sep 17 00:00:00 2001 From: nipil Date: Tue, 19 Mar 2024 13:44:57 -0700 Subject: [PATCH 13/16] [bazel/dbg copt] fix warning name for GCC (#36040) Reproduced with : - bazel-bootstrap 3.5.1+ds-3 (pulling bazel 6.4.0) - setting CC to gcc and CXX to g++ otherwise bazel does not detect it - overall, using debian 11 using default gcc/g++ versions 10.2.1 When using --config=dbg, a warning name produces an error at the beginning of the compilation : `cc1plus: error: '-Werror=return-stack-address': no option '-Wreturn-stack-address'; did you mean '-Wreturn-local-addr'?` Fixed the error following the compiler advice for GCC PLEASE NOTE : I guess `return-stack-address` might be related to CLANG and `return-local-addr` is the GCC equivalent. I do not know CLANG, nor am i good enough with bazel to know how to make this option flexible (so any help will be appreciated) Closes #36040 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36040 from nipil:fix_compile_dbg_option 7ade99de768ebfd6a2cc1a8e466381d88bbccb81 PiperOrigin-RevId: 617281605 --- tools/bazel.rc | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/bazel.rc b/tools/bazel.rc index 83fc0aa1767..336a9d3a870 100644 --- a/tools/bazel.rc +++ b/tools/bazel.rc @@ -36,7 +36,6 @@ build:opt --compilation_mode=opt build:opt --copt=-Wframe-larger-than=16384 build:dbg --compilation_mode=dbg -build:dbg --copt=-Werror=return-stack-address # Dynamic link cause issues like: `dyld: malformed mach-o: load commands size (59272) > 32768` # https://github.com/bazelbuild/bazel/issues/9190 From 733e904491e48a8edd4e49d12288be1797d69abc Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Tue, 19 Mar 2024 15:57:41 -0700 Subject: [PATCH 14/16] [XdsClient] implement non-per-call metrics (#36020) As per gRFC A78 (https://github.com/grpc/proposal/pull/419). Closes #36020 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36020 from markdroth:non_per_call_metrics_xds c1d9b464bf6249aa8ed6bc1a46142a9b09c2bf01 PiperOrigin-RevId: 617320495 --- BUILD | 1 + CMakeLists.txt | 1 + Package.swift | 1 + build_autogenerated.yaml | 4 + gRPC-C++.podspec | 2 + gRPC-Core.podspec | 2 + grpc.gemspec | 1 + package.xml | 1 + src/core/BUILD | 1 + src/core/ext/xds/xds_client.cc | 92 +- src/core/ext/xds/xds_client.h | 27 +- src/core/ext/xds/xds_client_grpc.cc | 210 +++- src/core/ext/xds/xds_client_grpc.h | 16 +- src/core/ext/xds/xds_metrics.h | 39 + src/core/ext/xds/xds_server_config_fetcher.cc | 5 +- src/core/lib/channel/metrics.cc | 10 + src/core/lib/channel/metrics.h | 4 +- test/core/xds/BUILD | 14 + test/core/xds/xds_client_fuzzer.cc | 47 +- test/core/xds/xds_client_fuzzer.proto | 7 + test/core/xds/xds_client_test.cc | 982 +++++++++++++++++- test/core/xds/xds_client_test_peer.h | 80 ++ .../xds/xds_cluster_resource_type_test.cc | 3 +- test/core/xds/xds_common_types_test.cc | 3 +- .../xds/xds_endpoint_resource_type_test.cc | 3 +- test/core/xds/xds_http_filters_test.cc | 3 +- .../xds/xds_listener_resource_type_test.cc | 3 +- .../xds_route_config_resource_type_test.cc | 3 +- test/cpp/end2end/xds/BUILD | 1 + test/cpp/end2end/xds/xds_core_end2end_test.cc | 167 +++ tools/doxygen/Doxyfile.c++.internal | 1 + tools/doxygen/Doxyfile.core.internal | 1 + 32 files changed, 1636 insertions(+), 99 deletions(-) create mode 100644 src/core/ext/xds/xds_metrics.h create mode 100644 test/core/xds/xds_client_test_peer.h diff --git a/BUILD b/BUILD index 3fca11ff4c7..bf8daacde4b 100644 --- a/BUILD +++ b/BUILD @@ -4274,6 +4274,7 @@ grpc_cc_library( "//src/core:ext/xds/xds_channel_args.h", "//src/core:ext/xds/xds_client.h", "//src/core:ext/xds/xds_client_stats.h", + "//src/core:ext/xds/xds_metrics.h", "//src/core:ext/xds/xds_resource_type.h", "//src/core:ext/xds/xds_resource_type_impl.h", "//src/core:ext/xds/xds_transport.h", diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ef168cffd9..e022789d29a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33582,6 +33582,7 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/string.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/string.pb.h ${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/string.grpc.pb.h + test/core/util/fake_stats_plugin.cc test/cpp/end2end/test_service_impl.cc test/cpp/end2end/xds/xds_core_end2end_test.cc test/cpp/end2end/xds/xds_end2end_test_lib.cc diff --git a/Package.swift b/Package.swift index 0465d912aa5..f7b1930f099 100644 --- a/Package.swift +++ b/Package.swift @@ -1110,6 +1110,7 @@ let package = Package( "src/core/ext/xds/xds_lb_policy_registry.h", "src/core/ext/xds/xds_listener.cc", "src/core/ext/xds/xds_listener.h", + "src/core/ext/xds/xds_metrics.h", "src/core/ext/xds/xds_resource_type.h", "src/core/ext/xds/xds_resource_type_impl.h", "src/core/ext/xds/xds_route_config.cc", diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index adb59a57a16..973ec51a9ce 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -800,6 +800,7 @@ libs: - src/core/ext/xds/xds_http_stateful_session_filter.h - src/core/ext/xds/xds_lb_policy_registry.h - src/core/ext/xds/xds_listener.h + - src/core/ext/xds/xds_metrics.h - src/core/ext/xds/xds_resource_type.h - src/core/ext/xds/xds_resource_type_impl.h - src/core/ext/xds/xds_route_config.h @@ -20211,6 +20212,7 @@ targets: language: c++ headers: - test/core/util/scoped_env_var.h + - test/core/xds/xds_client_test_peer.h - test/core/xds/xds_transport_fake.h src: - src/proto/grpc/testing/xds/v3/base.proto @@ -20417,6 +20419,7 @@ targets: run: false language: c++ headers: + - test/core/util/fake_stats_plugin.h - test/core/util/scoped_env_var.h - test/cpp/end2end/counted_service.h - test/cpp/end2end/test_service_impl.h @@ -20456,6 +20459,7 @@ targets: - src/proto/grpc/testing/xds/v3/route.proto - src/proto/grpc/testing/xds/v3/router.proto - src/proto/grpc/testing/xds/v3/string.proto + - test/core/util/fake_stats_plugin.cc - test/cpp/end2end/test_service_impl.cc - test/cpp/end2end/xds/xds_core_end2end_test.cc - test/cpp/end2end/xds/xds_end2end_test_lib.cc diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index b8e6e3d892b..e4e0db337dc 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -881,6 +881,7 @@ Pod::Spec.new do |s| 'src/core/ext/xds/xds_http_stateful_session_filter.h', 'src/core/ext/xds/xds_lb_policy_registry.h', 'src/core/ext/xds/xds_listener.h', + 'src/core/ext/xds/xds_metrics.h', 'src/core/ext/xds/xds_resource_type.h', 'src/core/ext/xds/xds_resource_type_impl.h', 'src/core/ext/xds/xds_route_config.h', @@ -2145,6 +2146,7 @@ Pod::Spec.new do |s| 'src/core/ext/xds/xds_http_stateful_session_filter.h', 'src/core/ext/xds/xds_lb_policy_registry.h', 'src/core/ext/xds/xds_listener.h', + 'src/core/ext/xds/xds_metrics.h', 'src/core/ext/xds/xds_resource_type.h', 'src/core/ext/xds/xds_resource_type_impl.h', 'src/core/ext/xds/xds_route_config.h', diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 67f256a60e3..73c31d9c6ed 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -1226,6 +1226,7 @@ Pod::Spec.new do |s| 'src/core/ext/xds/xds_lb_policy_registry.h', 'src/core/ext/xds/xds_listener.cc', 'src/core/ext/xds/xds_listener.h', + 'src/core/ext/xds/xds_metrics.h', 'src/core/ext/xds/xds_resource_type.h', 'src/core/ext/xds/xds_resource_type_impl.h', 'src/core/ext/xds/xds_route_config.cc', @@ -2927,6 +2928,7 @@ Pod::Spec.new do |s| 'src/core/ext/xds/xds_http_stateful_session_filter.h', 'src/core/ext/xds/xds_lb_policy_registry.h', 'src/core/ext/xds/xds_listener.h', + 'src/core/ext/xds/xds_metrics.h', 'src/core/ext/xds/xds_resource_type.h', 'src/core/ext/xds/xds_resource_type_impl.h', 'src/core/ext/xds/xds_route_config.h', diff --git a/grpc.gemspec b/grpc.gemspec index 1016f7ed774..4c7b75d8e43 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -1116,6 +1116,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/xds/xds_lb_policy_registry.h ) s.files += %w( src/core/ext/xds/xds_listener.cc ) s.files += %w( src/core/ext/xds/xds_listener.h ) + s.files += %w( src/core/ext/xds/xds_metrics.h ) s.files += %w( src/core/ext/xds/xds_resource_type.h ) s.files += %w( src/core/ext/xds/xds_resource_type_impl.h ) s.files += %w( src/core/ext/xds/xds_route_config.cc ) diff --git a/package.xml b/package.xml index c31c71f176b..834f8b1aa74 100644 --- a/package.xml +++ b/package.xml @@ -1098,6 +1098,7 @@ + diff --git a/src/core/BUILD b/src/core/BUILD index 857484df4f1..bbc92c0bb8e 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -5060,6 +5060,7 @@ grpc_cc_library( "load_file", "match", "metadata_batch", + "metrics", "pollset_set", "protobuf_any_upb", "protobuf_duration_upb", diff --git a/src/core/ext/xds/xds_client.cc b/src/core/ext/xds/xds_client.cc index c9c65ab3e51..a30c6ceafb0 100644 --- a/src/core/ext/xds/xds_client.cc +++ b/src/core/ext/xds/xds_client.cc @@ -150,7 +150,8 @@ class XdsClient::XdsChannel::AdsCall : public InternallyRefCounted { std::vector errors; std::map> resources_seen; - bool have_valid_resources = false; + uint64_t num_valid_resources = 0; + uint64_t num_invalid_resources = 0; RefCountedPtr read_delay_handle; }; @@ -783,6 +784,7 @@ void XdsClient::XdsChannel::AdsCall::AdsResponseParser::ParseResource( result_.errors.emplace_back( absl::StrCat(error_prefix, "incorrect resource type \"", type_url, "\" (should be \"", result_.type_url, "\")")); + ++result_.num_invalid_resources; return; } // Parse the resource. @@ -803,6 +805,7 @@ void XdsClient::XdsChannel::AdsCall::AdsResponseParser::ParseResource( // there's nothing more we can do here. result_.errors.emplace_back(absl::StrCat( error_prefix, decode_result.resource.status().ToString())); + ++result_.num_invalid_resources; return; } } @@ -818,6 +821,7 @@ void XdsClient::XdsChannel::AdsCall::AdsResponseParser::ParseResource( if (!parsed_resource_name.ok()) { result_.errors.emplace_back( absl::StrCat(error_prefix, "Cannot parse xDS resource name")); + ++result_.num_invalid_resources; return; } // Cancel resource-does-not-exist timer, if needed. @@ -877,10 +881,11 @@ void XdsClient::XdsChannel::AdsCall::AdsResponseParser::ParseResource( result_.read_delay_handle); UpdateResourceMetadataNacked(result_.version, decode_status.ToString(), update_time_, &resource_state.meta); + ++result_.num_invalid_resources; return; } // Resource is valid. - result_.have_valid_resources = true; + ++result_.num_valid_resources; // If it didn't change, ignore it. if (resource_state.resource != nullptr && result_.type->ResourcesEqual(resource_state.resource.get(), @@ -914,6 +919,7 @@ void XdsClient::XdsChannel::AdsCall::AdsResponseParser:: ResourceWrapperParsingFailed(size_t idx, absl::string_view message) { result_.errors.emplace_back( absl::StrCat("resource index ", idx, ": ", message)); + ++result_.num_invalid_resources; } // @@ -1157,13 +1163,19 @@ void XdsClient::XdsChannel::AdsCall::OnRecvMessage(absl::string_view payload) { } } // If we had valid resources or the update was empty, update the version. - if (result.have_valid_resources || result.errors.empty()) { + if (result.num_valid_resources > 0 || result.errors.empty()) { xds_channel()->resource_type_version_map_[result.type] = std::move(result.version); } // Send ACK or NACK. SendMessageLocked(result.type); } + // Update metrics. + if (xds_client()->metrics_reporter_ != nullptr) { + xds_client()->metrics_reporter_->ReportResourceUpdates( + xds_channel()->server_.server_uri(), result.type_url, + result.num_valid_resources, result.num_invalid_resources); + } } xds_client()->work_serializer_.DrainQueue(); } @@ -1484,10 +1496,13 @@ bool XdsClient::XdsChannel::LrsCall::IsCurrentCallOnChannel() const { // XdsClient // +constexpr absl::string_view XdsClient::kOldStyleAuthority; + XdsClient::XdsClient( std::unique_ptr bootstrap, OrphanablePtr transport_factory, std::shared_ptr engine, + std::unique_ptr metrics_reporter, std::string user_agent_name, std::string user_agent_version, Duration resource_request_timeout) : DualRefCounted( @@ -1500,7 +1515,8 @@ XdsClient::XdsClient( api_(this, &grpc_xds_client_trace, bootstrap_->node(), &def_pool_, std::move(user_agent_name), std::move(user_agent_version)), work_serializer_(engine), - engine_(std::move(engine)) { + engine_(std::move(engine)), + metrics_reporter_(std::move(metrics_reporter)) { if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { gpr_log(GPR_INFO, "[xds_client %p] creating xds client", this); } @@ -1575,12 +1591,12 @@ void XdsClient::WatchResource(const XdsResourceType* type, } // Find server to use. const XdsBootstrap::XdsServer* xds_server = nullptr; - absl::string_view authority_name = resource_name->authority; - if (absl::ConsumePrefix(&authority_name, "xdstp:")) { - auto* authority = bootstrap_->LookupAuthority(std::string(authority_name)); + if (resource_name->authority != kOldStyleAuthority) { + auto* authority = + bootstrap_->LookupAuthority(std::string(resource_name->authority)); if (authority == nullptr) { fail(absl::UnavailableError( - absl::StrCat("authority \"", authority_name, + absl::StrCat("authority \"", resource_name->authority, "\" not present in bootstrap config"))); return; } @@ -1738,10 +1754,11 @@ const XdsResourceType* XdsClient::GetResourceTypeLocked( absl::StatusOr XdsClient::ParseXdsResourceName( absl::string_view name, const XdsResourceType* type) { // Old-style names use the empty string for authority. - // authority is prefixed with "old:" to indicate that it's an old-style - // name. + // authority is set to kOldStyleAuthority to indicate that it's an + // old-style name. if (!xds_federation_enabled_ || !absl::StartsWith(name, "xdstp:")) { - return XdsResourceName{"old:", {std::string(name), {}}}; + return XdsResourceName{std::string(kOldStyleAuthority), + {std::string(name), {}}}; } // New style name. Parse URI. auto uri = URI::Parse(name); @@ -1760,14 +1777,14 @@ absl::StatusOr XdsClient::ParseXdsResourceName( URI::QueryParam{std::string(p.first), std::string(p.second)}); } return XdsResourceName{ - absl::StrCat("xdstp:", uri->authority()), + uri->authority(), {std::string(path_parts.second), std::move(query_params)}}; } std::string XdsClient::ConstructFullXdsResourceName( absl::string_view authority, absl::string_view resource_type, const XdsResourceKey& key) { - if (absl::ConsumePrefix(&authority, "xdstp:")) { + if (authority != kOldStyleAuthority) { auto uri = URI::Create("xdstp", std::string(authority), absl::StrCat("/", resource_type, "/", key.id), key.query_params, /*fragment=*/""); @@ -2121,4 +2138,53 @@ void XdsClient::DumpClientConfig( } } +namespace { + +absl::string_view CacheStateForEntry(const XdsApi::ResourceMetadata& metadata, + bool resource_cached) { + switch (metadata.client_status) { + case XdsApi::ResourceMetadata::REQUESTED: + return "requested"; + case XdsApi::ResourceMetadata::DOES_NOT_EXIST: + return "does_not_exist"; + case XdsApi::ResourceMetadata::ACKED: + return "acked"; + case XdsApi::ResourceMetadata::NACKED: + return resource_cached ? "nacked_but_cached" : "nacked"; + } + Crash("unknown resource state"); +} + +} // namespace + +void XdsClient::ReportResourceCounts( + absl::FunctionRef func) { + ResourceCountLabels labels; + for (const auto& a : authority_state_map_) { // authority + labels.xds_authority = a.first; + for (const auto& t : a.second.resource_map) { // type + labels.resource_type = t.first->type_url(); + // Count the number of entries in each state. + std::map counts; + for (const auto& r : t.second) { // resource id + absl::string_view cache_state = + CacheStateForEntry(r.second.meta, r.second.resource != nullptr); + ++counts[cache_state]; + } + // Report the count for each state. + for (const auto& c : counts) { + labels.cache_state = c.first; + func(labels, c.second); + } + } + } +} + +void XdsClient::ReportServerConnections( + absl::FunctionRef func) { + for (const auto& p : xds_channel_map_) { + func(p.second->server_uri(), p.second->status().ok()); + } +} + } // namespace grpc_core diff --git a/src/core/ext/xds/xds_client.h b/src/core/ext/xds/xds_client.h index 038abfe5f29..a9ee6573e82 100644 --- a/src/core/ext/xds/xds_client.h +++ b/src/core/ext/xds/xds_client.h @@ -37,6 +37,7 @@ #include "src/core/ext/xds/xds_api.h" #include "src/core/ext/xds/xds_bootstrap.h" #include "src/core/ext/xds/xds_client_stats.h" +#include "src/core/ext/xds/xds_metrics.h" #include "src/core/ext/xds/xds_resource_type.h" #include "src/core/ext/xds/xds_transport.h" #include "src/core/lib/debug/trace.h" @@ -60,6 +61,9 @@ extern TraceFlag grpc_xds_client_refcount_trace; class XdsClient : public DualRefCounted { public: + // The authority reported for old-style (non-xdstp) resource names. + static constexpr absl::string_view kOldStyleAuthority = "#old"; + class ReadDelayHandle : public RefCounted { public: static RefCountedPtr NoWait() { return nullptr; } @@ -87,6 +91,7 @@ class XdsClient : public DualRefCounted { std::unique_ptr bootstrap, OrphanablePtr transport_factory, std::shared_ptr engine, + std::unique_ptr metrics_reporter, std::string user_agent_name, std::string user_agent_version, Duration resource_request_timeout = Duration::Seconds(15)); ~XdsClient() override; @@ -156,6 +161,8 @@ class XdsClient : public DualRefCounted { } protected: + Mutex* mu() ABSL_LOCK_RETURNED(&mu_) { return &mu_; } + // Dumps the active xDS config to the provided // envoy.service.status.v3.ClientConfig message including the config status // (e.g., CLIENT_REQUESTED, CLIENT_ACKED, CLIENT_NACKED). @@ -163,7 +170,22 @@ class XdsClient : public DualRefCounted { envoy_service_status_v3_ClientConfig* client_config) ABSL_EXCLUSIVE_LOCKS_REQUIRED(&mu_); - Mutex* mu() ABSL_LOCK_RETURNED(&mu_) { return &mu_; } + // Invokes func once for each combination of labels to report the + // resource count for those labels. + struct ResourceCountLabels { + absl::string_view xds_authority; + absl::string_view resource_type; + absl::string_view cache_state; + }; + void ReportResourceCounts( + absl::FunctionRef func) + ABSL_EXCLUSIVE_LOCKS_REQUIRED(&mu_); + + // Invokes func once for each xDS server to report whether the + // connection to that server is working. + void ReportServerConnections( + absl::FunctionRef func) + ABSL_EXCLUSIVE_LOCKS_REQUIRED(&mu_); private: friend testing::XdsClientTestPeer; @@ -221,6 +243,8 @@ class XdsClient : public DualRefCounted { bool delay_unsubscription) ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_); + absl::string_view server_uri() const { return server_.server_uri(); } + private: void OnConnectivityFailure(absl::Status status); @@ -327,6 +351,7 @@ class XdsClient : public DualRefCounted { XdsApi api_; WorkSerializer work_serializer_; std::shared_ptr engine_; + std::unique_ptr metrics_reporter_; Mutex mu_; diff --git a/src/core/ext/xds/xds_client_grpc.cc b/src/core/ext/xds/xds_client_grpc.cc index d5e4447cc02..cbfee8e71fd 100644 --- a/src/core/ext/xds/xds_client_grpc.cc +++ b/src/core/ext/xds/xds_client_grpc.cc @@ -49,6 +49,7 @@ #include "src/core/ext/xds/xds_transport.h" #include "src/core/ext/xds/xds_transport_grpc.h" #include "src/core/lib/channel/channel_args.h" +#include "src/core/lib/channel/metrics.h" #include "src/core/lib/debug/trace.h" #include "src/core/lib/event_engine/default_event_engine.h" #include "src/core/lib/gprpp/debug_location.h" @@ -64,8 +65,6 @@ #include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/transport/error_utils.h" -namespace grpc_core { - // If gRPC is built with -DGRPC_XDS_USER_AGENT_NAME_SUFFIX="...", that string // will be appended to the user agent name reported to the xDS server. #ifdef GRPC_XDS_USER_AGENT_NAME_SUFFIX @@ -84,10 +83,90 @@ namespace grpc_core { #define GRPC_XDS_USER_AGENT_VERSION_SUFFIX_STRING "" #endif +namespace grpc_core { + +namespace { + +// Metric labels. +constexpr absl::string_view kMetricLabelXdsServer = "grpc.xds.server"; +constexpr absl::string_view kMetricLabelXdsAuthority = "grpc.xds.authority"; +constexpr absl::string_view kMetricLabelXdsResourceType = + "grpc.xds.resource_type"; +constexpr absl::string_view kMetricLabelXdsCacheState = "grpc.xds.cache_state"; + +const auto kMetricResourceUpdatesValid = + GlobalInstrumentsRegistry::RegisterUInt64Counter( + "grpc.xds_client.resource_updates_valid", + "EXPERIMENTAL. A counter of resources received that were considered " + "valid. The counter will be incremented even for resources that " + "have not changed.", + "{resource}", + {kMetricLabelTarget, kMetricLabelXdsServer, + kMetricLabelXdsResourceType}, + {}, false); + +const auto kMetricResourceUpdatesInvalid = + GlobalInstrumentsRegistry::RegisterUInt64Counter( + "grpc.xds_client.resource_updates_invalid", + "EXPERIMENTAL. A counter of resources received that were considered " + "invalid.", + "{resource}", + {kMetricLabelTarget, kMetricLabelXdsServer, + kMetricLabelXdsResourceType}, + {}, false); + +const auto kMetricConnected = + GlobalInstrumentsRegistry::RegisterCallbackInt64Gauge( + "grpc.xds_client.connected", + "EXPERIMENTAL. Whether or not the xDS client currently has a " + "working ADS stream to the xDS server. For a given server, this " + "will be set to 0 when we have a connectivity failure or when the " + "ADS stream fails without seeing a response message, as per gRFC " + "A57. It will be set to 1 when we receive the first response on " + "an ADS stream.", + "{bool}", {kMetricLabelTarget, kMetricLabelXdsServer}, {}, false); + +const auto kMetricResources = + GlobalInstrumentsRegistry::RegisterCallbackInt64Gauge( + "grpc.xds_client.resources", "EXPERIMENTAL. Number of xDS resources.", + "{resource}", + {kMetricLabelTarget, kMetricLabelXdsAuthority, + kMetricLabelXdsResourceType, kMetricLabelXdsCacheState}, + {}, false); + +} // namespace + +// +// GrpcXdsClient::MetricsReporter +// + +class GrpcXdsClient::MetricsReporter : public XdsMetricsReporter { + public: + explicit MetricsReporter(GrpcXdsClient& xds_client) + : xds_client_(xds_client) {} + + void ReportResourceUpdates(absl::string_view xds_server, + absl::string_view resource_type, + uint64_t num_valid_resources, + uint64_t num_invalid_resources) override { + xds_client_.stats_plugin_group_.AddCounter( + kMetricResourceUpdatesValid, num_valid_resources, + {xds_client_.key_, xds_server, resource_type}, {}); + xds_client_.stats_plugin_group_.AddCounter( + kMetricResourceUpdatesInvalid, num_invalid_resources, + {xds_client_.key_, xds_server, resource_type}, {}); + } + + private: + GrpcXdsClient& xds_client_; +}; + // // GrpcXdsClient // +constexpr absl::string_view GrpcXdsClient::kServerKey; + namespace { Mutex* g_mu = new Mutex; @@ -97,10 +176,6 @@ NoDestruct> g_xds_client_map ABSL_GUARDED_BY(*g_mu); char* g_fallback_bootstrap_config ABSL_GUARDED_BY(*g_mu) = nullptr; -} // namespace - -namespace { - absl::StatusOr GetBootstrapContents(const char* fallback_config) { // First, try GRPC_XDS_BOOTSTRAP env var. auto path = GetEnv("GRPC_XDS_BOOTSTRAP"); @@ -138,19 +213,6 @@ absl::StatusOr GetBootstrapContents(const char* fallback_config) { "not defined"); } -std::vector> GetAllXdsClients() { - MutexLock lock(g_mu); - std::vector> xds_clients; - for (const auto& key_client : *g_xds_client_map) { - auto xds_client = - key_client.second->RefIfNonZero(DEBUG_LOCATION, "DumpAllClientConfigs"); - if (xds_client != nullptr) { - xds_clients.emplace_back(xds_client.TakeAsSubclass()); - } - } - return xds_clients; -} - } // namespace absl::StatusOr> GrpcXdsClient::GetOrCreate( @@ -201,36 +263,20 @@ absl::StatusOr> GrpcXdsClient::GetOrCreate( return xds_client; } -// ABSL_NO_THREAD_SAFETY_ANALYSIS because we have to manually manage locks for -// individual XdsClients and compiler struggles with checking the validity -grpc_slice GrpcXdsClient::DumpAllClientConfigs() - ABSL_NO_THREAD_SAFETY_ANALYSIS { - auto xds_clients = GetAllXdsClients(); - upb::Arena arena; - // Contains strings that should survive till serialization - std::set string_pool; - auto response = envoy_service_status_v3_ClientStatusResponse_new(arena.ptr()); - // We lock each XdsClient mutex till we are done with the serialization to - // ensure that all data referenced from the UPB proto message stays alive. - for (const auto& xds_client : xds_clients) { - auto client_config = - envoy_service_status_v3_ClientStatusResponse_add_config(response, - arena.ptr()); - xds_client->mu()->Lock(); - xds_client->DumpClientConfig(&string_pool, arena.ptr(), client_config); - envoy_service_status_v3_ClientConfig_set_client_scope( - client_config, StdStringToUpbString(xds_client->key())); - } - // Serialize the upb message to bytes - size_t output_length; - char* output = envoy_service_status_v3_ClientStatusResponse_serialize( - response, arena.ptr(), &output_length); - for (const auto& xds_client : xds_clients) { - xds_client->mu()->Unlock(); +namespace { + +GlobalStatsPluginRegistry::StatsPluginGroup GetStatsPluginGroupForKey( + absl::string_view key) { + if (key == GrpcXdsClient::kServerKey) { + return GlobalStatsPluginRegistry::GetAllStatsPlugins(); } - return grpc_slice_from_cpp_string(std::string(output, output_length)); + // TODO(roth): How do we set the authority here? + StatsPlugin::ChannelScope scope(key, ""); + return GlobalStatsPluginRegistry::GetStatsPluginsForChannel(scope); } +} // namespace + GrpcXdsClient::GrpcXdsClient( absl::string_view key, std::unique_ptr bootstrap, const ChannelArgs& args, @@ -238,6 +284,7 @@ GrpcXdsClient::GrpcXdsClient( : XdsClient( std::move(bootstrap), std::move(transport_factory), grpc_event_engine::experimental::GetDefaultEventEngine(), + std::make_unique(*this), absl::StrCat("gRPC C-core ", GPR_PLATFORM_STRING, GRPC_XDS_USER_AGENT_NAME_SUFFIX_STRING), absl::StrCat("C-core ", grpc_version_string(), @@ -250,15 +297,22 @@ GrpcXdsClient::GrpcXdsClient( key_(key), certificate_provider_store_(MakeOrphanable( static_cast(this->bootstrap()) - .certificate_providers())) {} + .certificate_providers())), + stats_plugin_group_(GetStatsPluginGroupForKey(key_)), + registered_metric_callback_(stats_plugin_group_.RegisterCallback( + [this](CallbackMetricReporter& reporter) { + ReportCallbackMetrics(reporter); + }, + {kMetricConnected, kMetricResources})) {} void GrpcXdsClient::Orphan() { + registered_metric_callback_.reset(); + XdsClient::Orphan(); MutexLock lock(g_mu); auto it = g_xds_client_map->find(key_); if (it != g_xds_client_map->end() && it->second == this) { g_xds_client_map->erase(it); } - XdsClient::Orphan(); } grpc_pollset_set* GrpcXdsClient::interested_parties() const { @@ -266,6 +320,66 @@ grpc_pollset_set* GrpcXdsClient::interested_parties() const { ->interested_parties(); } +namespace { + +std::vector> GetAllXdsClients() { + MutexLock lock(g_mu); + std::vector> xds_clients; + for (const auto& key_client : *g_xds_client_map) { + auto xds_client = + key_client.second->RefIfNonZero(DEBUG_LOCATION, "DumpAllClientConfigs"); + if (xds_client != nullptr) { + xds_clients.emplace_back(xds_client.TakeAsSubclass()); + } + } + return xds_clients; +} + +} // namespace + +// ABSL_NO_THREAD_SAFETY_ANALYSIS because we have to manually manage locks for +// individual XdsClients and compiler struggles with checking the validity +grpc_slice GrpcXdsClient::DumpAllClientConfigs() + ABSL_NO_THREAD_SAFETY_ANALYSIS { + auto xds_clients = GetAllXdsClients(); + upb::Arena arena; + // Contains strings that should survive till serialization + std::set string_pool; + auto response = envoy_service_status_v3_ClientStatusResponse_new(arena.ptr()); + // We lock each XdsClient mutex till we are done with the serialization to + // ensure that all data referenced from the UPB proto message stays alive. + for (const auto& xds_client : xds_clients) { + auto client_config = + envoy_service_status_v3_ClientStatusResponse_add_config(response, + arena.ptr()); + xds_client->mu()->Lock(); + xds_client->DumpClientConfig(&string_pool, arena.ptr(), client_config); + envoy_service_status_v3_ClientConfig_set_client_scope( + client_config, StdStringToUpbString(xds_client->key())); + } + // Serialize the upb message to bytes + size_t output_length; + char* output = envoy_service_status_v3_ClientStatusResponse_serialize( + response, arena.ptr(), &output_length); + for (const auto& xds_client : xds_clients) { + xds_client->mu()->Unlock(); + } + return grpc_slice_from_cpp_string(std::string(output, output_length)); +} + +void GrpcXdsClient::ReportCallbackMetrics(CallbackMetricReporter& reporter) { + MutexLock lock(mu()); + ReportResourceCounts([&](const ResourceCountLabels& labels, uint64_t count) { + reporter.Report( + kMetricResources, count, + {key_, labels.xds_authority, labels.resource_type, labels.cache_state}, + {}); + }); + ReportServerConnections([&](absl::string_view xds_server, bool connected) { + reporter.Report(kMetricConnected, connected, {key_, xds_server}, {}); + }); +} + namespace internal { void SetXdsChannelArgsForTest(grpc_channel_args* args) { diff --git a/src/core/ext/xds/xds_client_grpc.h b/src/core/ext/xds/xds_client_grpc.h index 72df525ab6e..ba6377a5c2d 100644 --- a/src/core/ext/xds/xds_client_grpc.h +++ b/src/core/ext/xds/xds_client_grpc.h @@ -31,6 +31,7 @@ #include "src/core/ext/xds/xds_client.h" #include "src/core/ext/xds/xds_transport.h" #include "src/core/lib/channel/channel_args.h" +#include "src/core/lib/channel/metrics.h" #include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" @@ -41,13 +42,13 @@ namespace grpc_core { class GrpcXdsClient : public XdsClient { public: + // The key to pass to GetOrCreate() for gRPC servers. + static constexpr absl::string_view kServerKey = "#server"; + // Factory function to get or create the global XdsClient instance. static absl::StatusOr> GetOrCreate( absl::string_view key, const ChannelArgs& args, const char* reason); - // Builds ClientStatusResponse containing all resources from all XdsClients - static grpc_slice DumpAllClientConfigs(); - // Do not instantiate directly -- use GetOrCreate() instead. // TODO(roth): The transport factory is injectable here to support // tests that want to use a fake transport factory with code that @@ -83,9 +84,18 @@ class GrpcXdsClient : public XdsClient { absl::string_view key() const { return key_; } + // Builds ClientStatusResponse containing all resources from all XdsClients + static grpc_slice DumpAllClientConfigs(); + private: + class MetricsReporter; + + void ReportCallbackMetrics(CallbackMetricReporter& reporter); + std::string key_; OrphanablePtr certificate_provider_store_; + GlobalStatsPluginRegistry::StatsPluginGroup stats_plugin_group_; + std::unique_ptr registered_metric_callback_; }; namespace internal { diff --git a/src/core/ext/xds/xds_metrics.h b/src/core/ext/xds/xds_metrics.h new file mode 100644 index 00000000000..f30e9dbe962 --- /dev/null +++ b/src/core/ext/xds/xds_metrics.h @@ -0,0 +1,39 @@ +// +// Copyright 2024 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_SRC_CORE_EXT_XDS_XDS_METRICS_H +#define GRPC_SRC_CORE_EXT_XDS_XDS_METRICS_H + +#include + +#include "absl/strings/string_view.h" + +namespace grpc_core { + +// An interface for XdsClient to report metrics. +class XdsMetricsReporter { + public: + virtual ~XdsMetricsReporter() = default; + + virtual void ReportResourceUpdates(absl::string_view xds_server, + absl::string_view resource_type, + uint64_t num_valid, + uint64_t num_invalid) = 0; +}; + +} // namespace grpc_core + +#endif // GRPC_SRC_CORE_EXT_XDS_XDS_METRICS_H diff --git a/src/core/ext/xds/xds_server_config_fetcher.cc b/src/core/ext/xds/xds_server_config_fetcher.cc index 6e406843a64..07747f54d50 100644 --- a/src/core/ext/xds/xds_server_config_fetcher.cc +++ b/src/core/ext/xds/xds_server_config_fetcher.cc @@ -94,8 +94,6 @@ namespace { using ReadDelayHandle = XdsClient::ReadDelayHandle; -constexpr absl::string_view kServerXdsClientKey = "#server"; - TraceFlag grpc_xds_server_config_fetcher_trace(false, "xds_server_config_fetcher"); @@ -1374,7 +1372,8 @@ grpc_server_config_fetcher* grpc_server_config_fetcher_xds_create( "update=%p, user_data=%p}, args=%p)", 3, (notifier.on_serving_status_update, notifier.user_data, args)); auto xds_client = grpc_core::GrpcXdsClient::GetOrCreate( - grpc_core::kServerXdsClientKey, channel_args, "XdsServerConfigFetcher"); + grpc_core::GrpcXdsClient::kServerKey, channel_args, + "XdsServerConfigFetcher"); if (!xds_client.ok()) { gpr_log(GPR_ERROR, "Failed to create xds client: %s", xds_client.status().ToString().c_str()); diff --git a/src/core/lib/channel/metrics.cc b/src/core/lib/channel/metrics.cc index 5a038db187b..813eeb02cd4 100644 --- a/src/core/lib/channel/metrics.cc +++ b/src/core/lib/channel/metrics.cc @@ -311,6 +311,16 @@ void GlobalStatsPluginRegistry::RegisterStatsPlugin( plugins_->push_back(std::move(plugin)); } +GlobalStatsPluginRegistry::StatsPluginGroup +GlobalStatsPluginRegistry::GetAllStatsPlugins() { + MutexLock lock(&*mutex_); + StatsPluginGroup group; + for (const auto& plugin : *plugins_) { + group.push_back(plugin); + } + return group; +} + GlobalStatsPluginRegistry::StatsPluginGroup GlobalStatsPluginRegistry::GetStatsPluginsForChannel( const StatsPlugin::ChannelScope& scope) { diff --git a/src/core/lib/channel/metrics.h b/src/core/lib/channel/metrics.h index a93f0037cb3..c4315e721ee 100644 --- a/src/core/lib/channel/metrics.h +++ b/src/core/lib/channel/metrics.h @@ -310,8 +310,10 @@ class GlobalStatsPluginRegistry { }; static void RegisterStatsPlugin(std::shared_ptr plugin); - // The following two functions can be invoked to get a StatsPluginGroup for + + // The following functions can be invoked to get a StatsPluginGroup for // a specified scope. + static StatsPluginGroup GetAllStatsPlugins(); static StatsPluginGroup GetStatsPluginsForChannel( const StatsPlugin::ChannelScope& scope); // TODO(yijiem): Implement this. diff --git a/test/core/xds/BUILD b/test/core/xds/BUILD index 26030f839f5..581db547721 100644 --- a/test/core/xds/BUILD +++ b/test/core/xds/BUILD @@ -162,6 +162,18 @@ grpc_cc_library( ], ) +grpc_cc_library( + name = "xds_client_test_peer", + hdrs = ["xds_client_test_peer.h"], + external_deps = [ + "absl/functional:function_ref", + ], + language = "C++", + deps = [ + "//:xds_client", + ], +) + grpc_cc_test( name = "xds_client_test", srcs = ["xds_client_test.cc"], @@ -171,6 +183,7 @@ grpc_cc_test( uses_event_engine = True, uses_polling = False, deps = [ + ":xds_client_test_peer", ":xds_transport_fake", "//:xds_client", "//src/proto/grpc/testing/xds/v3:discovery_proto", @@ -192,6 +205,7 @@ grpc_proto_fuzzer( uses_event_engine = False, uses_polling = False, deps = [ + ":xds_client_test_peer", ":xds_transport_fake", "//src/core:grpc_xds_client", "//test/core/util:grpc_test_util", diff --git a/test/core/xds/xds_client_fuzzer.cc b/test/core/xds/xds_client_fuzzer.cc index 4d6994a1381..5b9dc709969 100644 --- a/test/core/xds/xds_client_fuzzer.cc +++ b/test/core/xds/xds_client_fuzzer.cc @@ -43,30 +43,11 @@ #include "src/libfuzzer/libfuzzer_macro.h" #include "src/proto/grpc/testing/xds/v3/discovery.pb.h" #include "test/core/xds/xds_client_fuzzer.pb.h" +#include "test/core/xds/xds_client_test_peer.h" #include "test/core/xds/xds_transport_fake.h" namespace grpc_core { -namespace testing { - -class XdsClientTestPeer { - public: - explicit XdsClientTestPeer(XdsClient* xds_client) : xds_client_(xds_client) {} - - void TestDumpClientConfig() { - upb::Arena arena; - auto client_config = envoy_service_status_v3_ClientConfig_new(arena.ptr()); - std::set string_pool; - MutexLock lock(xds_client_->mu()); - xds_client_->DumpClientConfig(&string_pool, arena.ptr(), client_config); - } - - private: - XdsClient* xds_client_; -}; - -} // namespace testing - class Fuzzer { public: explicit Fuzzer(absl::string_view bootstrap_json) { @@ -84,8 +65,8 @@ class Fuzzer { transport_factory_ = transport_factory.get(); xds_client_ = MakeRefCounted( std::move(*bootstrap), std::move(transport_factory), - grpc_event_engine::experimental::GetDefaultEventEngine(), "foo agent", - "foo version"); + grpc_event_engine::experimental::GetDefaultEventEngine(), + /*metrics_reporter=*/nullptr, "foo agent", "foo version"); } void Act(const xds_client_fuzzer::Action& action) { @@ -135,6 +116,28 @@ class Fuzzer { case xds_client_fuzzer::Action::kDumpCsdsData: testing::XdsClientTestPeer(xds_client_.get()).TestDumpClientConfig(); break; + case xds_client_fuzzer::Action::kReportResourceCounts: + testing::XdsClientTestPeer(xds_client_.get()) + .TestReportResourceCounts( + [](const testing::XdsClientTestPeer::ResourceCountLabels& + labels, + uint64_t count) { + gpr_log(GPR_INFO, + "xds_authority=\"%s\", resource_type=\"%s\", " + "cache_state=\"%s\" count=%" PRIu64, + std::string(labels.xds_authority).c_str(), + std::string(labels.resource_type).c_str(), + std::string(labels.cache_state).c_str(), count); + }); + break; + case xds_client_fuzzer::Action::kReportServerConnections: + testing::XdsClientTestPeer(xds_client_.get()) + .TestReportServerConnections( + [](absl::string_view xds_server, bool connected) { + gpr_log(GPR_INFO, "xds_server=\"%s\" connected=%d", + std::string(xds_server).c_str(), connected); + }); + break; case xds_client_fuzzer::Action::kTriggerConnectionFailure: TriggerConnectionFailure( action.trigger_connection_failure().authority(), diff --git a/test/core/xds/xds_client_fuzzer.proto b/test/core/xds/xds_client_fuzzer.proto index 2738e76b3d4..6d1274eb9cc 100644 --- a/test/core/xds/xds_client_fuzzer.proto +++ b/test/core/xds/xds_client_fuzzer.proto @@ -59,6 +59,10 @@ message StopWatch { message DumpCsdsData {} +message ReportResourceCounts {} + +message ReportServerConnections {} + // // interactions with fake transport // @@ -96,12 +100,15 @@ message SendStatusToClient { Status status = 2; } +// Next free field: 10 message Action { oneof action_type { // interactions with XdsClient API StartWatch start_watch = 1; StopWatch stop_watch = 2; DumpCsdsData dump_csds_data = 3; + ReportResourceCounts report_resource_counts = 8; + ReportServerConnections report_server_connections = 9; // interactions with fake transport TriggerConnectionFailure trigger_connection_failure = 4; ReadMessageFromClient read_message_from_client = 5; diff --git a/test/core/xds/xds_client_test.cc b/test/core/xds/xds_client_test.cc index 741e2022362..b6036e35e96 100644 --- a/test/core/xds/xds_client_test.cc +++ b/test/core/xds/xds_client_test.cc @@ -59,6 +59,7 @@ #include "src/proto/grpc/testing/xds/v3/discovery.pb.h" #include "test/core/util/scoped_env_var.h" #include "test/core/util/test_config.h" +#include "test/core/xds/xds_client_test_peer.h" #include "test/core/xds/xds_transport_fake.h" // IWYU pragma: no_include @@ -594,6 +595,65 @@ class XdsClientTest : public ::testing::Test { DiscoveryResponse response_; }; + class MetricsReporter : public XdsMetricsReporter { + public: + using ResourceUpdateMap = std::map< + std::pair, + uint64_t>; + + const ResourceUpdateMap& resource_updates_valid() const { + return resource_updates_valid_; + } + const ResourceUpdateMap& resource_updates_invalid() const { + return resource_updates_invalid_; + } + + private: + void ReportResourceUpdates(absl::string_view xds_server, + absl::string_view resource_type, + uint64_t num_resources_valid, + uint64_t num_resources_invalid) override { + auto key = + std::make_pair(std::string(xds_server), std::string(resource_type)); + if (num_resources_valid > 0) { + resource_updates_valid_[key] += num_resources_valid; + } + if (num_resources_invalid > 0) { + resource_updates_invalid_[key] += num_resources_invalid; + } + } + + ResourceUpdateMap resource_updates_valid_; + ResourceUpdateMap resource_updates_invalid_; + }; + + using ResourceCounts = + std::vector>; + ResourceCounts GetResourceCounts() { + ResourceCounts resource_counts; + XdsClientTestPeer(xds_client_.get()) + .TestReportResourceCounts( + [&](const XdsClientTestPeer::ResourceCountLabels& labels, + uint64_t count) { + resource_counts.emplace_back(labels, count); + }); + return resource_counts; + } + + using ServerConnectionMap = std::map; + ServerConnectionMap GetServerConnections() { + ServerConnectionMap server_connection_map; + XdsClientTestPeer(xds_client_.get()) + .TestReportServerConnections( + [&](absl::string_view xds_server, bool connected) { + std::string server(xds_server); + EXPECT_EQ(server_connection_map.find(server), + server_connection_map.end()); + server_connection_map[std::move(server)] = connected; + }); + return server_connection_map; + } + // Sets transport_factory_ and initializes xds_client_ with the // specified bootstrap config. void InitXdsClient( @@ -603,10 +663,13 @@ class XdsClientTest : public ::testing::Test { []() { FAIL() << "Multiple concurrent reads"; }); transport_factory_ = transport_factory->Ref().TakeAsSubclass(); + auto metrics_reporter = std::make_unique(); + metrics_reporter_ = metrics_reporter.get(); xds_client_ = MakeRefCounted( bootstrap_builder.Build(), std::move(transport_factory), - grpc_event_engine::experimental::GetDefaultEventEngine(), "foo agent", - "foo version", resource_request_timeout * grpc_test_slowdown_factor()); + grpc_event_engine::experimental::GetDefaultEventEngine(), + std::move(metrics_reporter), "foo agent", "foo version", + resource_request_timeout * grpc_test_slowdown_factor()); } // Starts and cancels a watch for a Foo resource. @@ -764,12 +827,45 @@ class XdsClientTest : public ::testing::Test { RefCountedPtr transport_factory_; RefCountedPtr xds_client_; + MetricsReporter* metrics_reporter_ = nullptr; }; +MATCHER_P3(ResourceCountLabelsEq, xds_authority, resource_type, cache_state, + "equals ResourceCountLabels") { + bool ok = true; + ok &= ::testing::ExplainMatchResult(xds_authority, arg.xds_authority, + result_listener); + ok &= ::testing::ExplainMatchResult(resource_type, arg.resource_type, + result_listener); + ok &= ::testing::ExplainMatchResult(cache_state, arg.cache_state, + result_listener); + return ok; +} + TEST_F(XdsClientTest, BasicWatch) { InitXdsClient(); + // Metrics should initially be empty. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre()); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT(GetResourceCounts(), ::testing::ElementsAre()); + EXPECT_THAT(GetServerConnections(), ::testing::ElementsAre()); // Start a watch for "foo1". auto watcher = StartFooWatch("foo1"); + // Check metrics. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre()); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT(GetServerConnections(), ::testing::ElementsAre(::testing::Pair( + "default_xds_server", true))); + EXPECT_THAT(GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), + "requested"), + 1))); // Watcher should initially not see any resource reported. EXPECT_FALSE(watcher->HasEvent()); // XdsClient should have created an ADS stream. @@ -795,6 +891,22 @@ TEST_F(XdsClientTest, BasicWatch) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "foo1"); EXPECT_EQ(resource->value, 6); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1))); + EXPECT_THAT(GetServerConnections(), ::testing::ElementsAre(::testing::Pair( + "default_xds_server", true))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -805,6 +917,16 @@ TEST_F(XdsClientTest, BasicWatch) { // Cancel watch. CancelFooWatch(watcher.get(), "foo1"); EXPECT_TRUE(stream->Orphaned()); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT(GetResourceCounts(), ::testing::ElementsAre()); + EXPECT_THAT(GetServerConnections(), ::testing::ElementsAre()); } TEST_F(XdsClientTest, UpdateFromServer) { @@ -836,6 +958,20 @@ TEST_F(XdsClientTest, UpdateFromServer) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "foo1"); EXPECT_EQ(resource->value, 6); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -855,6 +991,20 @@ TEST_F(XdsClientTest, UpdateFromServer) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "foo1"); EXPECT_EQ(resource->value, 9); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 2))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -896,6 +1046,20 @@ TEST_F(XdsClientTest, MultipleWatchersForSameResource) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "foo1"); EXPECT_EQ(resource->value, 6); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -929,6 +1093,20 @@ TEST_F(XdsClientTest, MultipleWatchersForSameResource) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "foo1"); EXPECT_EQ(resource->value, 9); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 2))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -951,6 +1129,17 @@ TEST_F(XdsClientTest, SubscribeToMultipleResources) { auto watcher = StartFooWatch("foo1"); // Watcher should initially not see any resource reported. EXPECT_FALSE(watcher->HasEvent()); + // Check metrics. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre()); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT(GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), + "requested"), + 1))); // XdsClient should have created an ADS stream. auto stream = WaitForAdsStream(); ASSERT_TRUE(stream != nullptr); @@ -974,6 +1163,20 @@ TEST_F(XdsClientTest, SubscribeToMultipleResources) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "foo1"); EXPECT_EQ(resource->value, 6); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -983,6 +1186,19 @@ TEST_F(XdsClientTest, SubscribeToMultipleResources) { /*resource_names=*/{"foo1"}); // Start a watch for "foo2". auto watcher2 = StartFooWatch("foo2"); + // Check metric data. + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre( + ::testing::Pair(ResourceCountLabelsEq( + XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1), + ::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), + "requested"), + 1))); // XdsClient should have sent a subscription request on the ADS stream. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -1002,6 +1218,20 @@ TEST_F(XdsClientTest, SubscribeToMultipleResources) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "foo2"); EXPECT_EQ(resource->value, 7); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 2))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 2))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -1011,6 +1241,13 @@ TEST_F(XdsClientTest, SubscribeToMultipleResources) { /*resource_names=*/{"foo1", "foo2"}); // Cancel watch for "foo1". CancelFooWatch(watcher.get(), "foo1"); + // Check metric data. + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1))); // XdsClient should send an unsubscription request. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -1079,6 +1316,20 @@ TEST_F(XdsClientTest, UpdateContainsOnlyChangedResource) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "foo2"); EXPECT_EQ(resource->value, 7); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 2))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 2))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -1098,6 +1349,20 @@ TEST_F(XdsClientTest, UpdateContainsOnlyChangedResource) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "foo1"); EXPECT_EQ(resource->value, 9); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 3))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 2))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -1122,6 +1387,17 @@ TEST_F(XdsClientTest, ResourceValidationFailure) { InitXdsClient(); // Start a watch for "foo1". auto watcher = StartFooWatch("foo1"); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre()); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT(GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), + "requested"), + 1))); // Watcher should initially not see any resource reported. EXPECT_FALSE(watcher->HasEvent()); // XdsClient should have created an ADS stream. @@ -1151,6 +1427,20 @@ TEST_F(XdsClientTest, ResourceValidationFailure) { "invalid resource: INVALID_ARGUMENT: errors validating JSON: " "[field:value error:is not a number] (node ID:xds_client_test)") << *error; + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre()); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), + "nacked"), + 1))); // XdsClient should NACK the update. // Note that version_info is not populated in the request. request = WaitForRequest(stream.get()); @@ -1190,6 +1480,23 @@ TEST_F(XdsClientTest, ResourceValidationFailure) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "foo1"); EXPECT_EQ(resource->value, 9); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -1209,6 +1516,17 @@ TEST_F(XdsClientTest, ResourceValidationFailureMultipleResources) { auto watcher = StartFooWatch("foo1"); // Watcher should initially not see any resource reported. EXPECT_FALSE(watcher->HasEvent()); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre()); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT(GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), + "requested"), + 1))); // XdsClient should have created an ADS stream. auto stream = WaitForAdsStream(); ASSERT_TRUE(stream != nullptr); @@ -1222,6 +1540,17 @@ TEST_F(XdsClientTest, ResourceValidationFailureMultipleResources) { CheckRequestNode(*request); // Should be present on the first request. // Before the server responds, add a watch for another resource. auto watcher2 = StartFooWatch("foo2"); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre()); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT(GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), + "requested"), + 2))); // Client should send another request. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -1231,6 +1560,17 @@ TEST_F(XdsClientTest, ResourceValidationFailureMultipleResources) { /*resource_names=*/{"foo1", "foo2"}); // Add a watch for a third resource. auto watcher3 = StartFooWatch("foo3"); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre()); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT(GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), + "requested"), + 3))); // Client should send another request. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -1240,6 +1580,17 @@ TEST_F(XdsClientTest, ResourceValidationFailureMultipleResources) { /*resource_names=*/{"foo1", "foo2", "foo3"}); // Add a watch for a fourth resource. auto watcher4 = StartFooWatch("foo4"); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre()); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT(GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), + "requested"), + 4))); // Client should send another request. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -1298,6 +1649,36 @@ TEST_F(XdsClientTest, ResourceValidationFailureMultipleResources) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "foo4"); EXPECT_EQ(resource->value, 5); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 5))); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre( + // foo4 + ::testing::Pair(ResourceCountLabelsEq( + XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1), + // foo1 and foo3 + ::testing::Pair(ResourceCountLabelsEq( + XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "nacked"), + 2), + // did not recognize response for foo2 + ::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), + "requested"), + 1))); // XdsClient should NACK the update. // There was one good resource, so the version will be updated. request = WaitForRequest(stream.get()); @@ -1363,6 +1744,20 @@ TEST_F(XdsClientTest, ResourceValidationFailureForCachedResource) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "foo1"); EXPECT_EQ(resource->value, 6); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -1386,6 +1781,23 @@ TEST_F(XdsClientTest, ResourceValidationFailureForCachedResource) { "invalid resource: INVALID_ARGUMENT: errors validating JSON: " "[field:value error:is not a number] (node ID:xds_client_test)") << *error; + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), + "nacked_but_cached"), + 1))); // XdsClient should NACK the update. // Note that version_info is set to the previous version in this request, // because there were no valid resources in it. @@ -1450,6 +1862,26 @@ TEST_F(XdsClientTest, WildcardCapableResponseWithEmptyResource) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "wc1"); EXPECT_EQ(resource->value, 6); + // Check metric data. + EXPECT_THAT( + metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsWildcardCapableResourceType::Get()->type_url()), + 1))); + EXPECT_THAT( + metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsWildcardCapableResourceType::Get()->type_url()), + 1))); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq( + XdsClient::kOldStyleAuthority, + XdsWildcardCapableResourceType::Get()->type_url(), "acked"), + 1))); // XdsClient should NACK the update. // There was one good resource, so the version will be updated. request = WaitForRequest(stream.get()); @@ -1500,6 +1932,22 @@ TEST_F(XdsClientTest, ResourceDeletion) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "wc1"); EXPECT_EQ(resource->value, 6); + // Check metric data. + EXPECT_THAT( + metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsWildcardCapableResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq( + XdsClient::kOldStyleAuthority, + XdsWildcardCapableResourceType::Get()->type_url(), "acked"), + 1))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -1516,6 +1964,22 @@ TEST_F(XdsClientTest, ResourceDeletion) { .Serialize()); // Watcher should see the does-not-exist event. EXPECT_TRUE(watcher->WaitForDoesNotExist(absl::Seconds(1))); + // Check metric data. + EXPECT_THAT( + metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsWildcardCapableResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT(GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq( + XdsClient::kOldStyleAuthority, + XdsWildcardCapableResourceType::Get()->type_url(), + "does_not_exist"), + 1))); // Start a new watcher for the same resource. It should immediately // receive the same does-not-exist notification. auto watcher2 = StartWildcardCapableWatch("wc1"); @@ -1543,6 +2007,22 @@ TEST_F(XdsClientTest, ResourceDeletion) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "wc1"); EXPECT_EQ(resource->value, 7); + // Check metric data. + EXPECT_THAT( + metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsWildcardCapableResourceType::Get()->type_url()), + 2))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq( + XdsClient::kOldStyleAuthority, + XdsWildcardCapableResourceType::Get()->type_url(), "acked"), + 1))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -1587,6 +2067,22 @@ TEST_F(XdsClientTest, ResourceDeletionIgnoredWhenConfigured) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "wc1"); EXPECT_EQ(resource->value, 6); + // Check metric data. + EXPECT_THAT( + metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsWildcardCapableResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq( + XdsClient::kOldStyleAuthority, + XdsWildcardCapableResourceType::Get()->type_url(), "acked"), + 1))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -1604,6 +2100,22 @@ TEST_F(XdsClientTest, ResourceDeletionIgnoredWhenConfigured) { // Watcher should not see any update, since we should have ignored the // deletion. EXPECT_TRUE(watcher->ExpectNoEvent(absl::Seconds(1))); + // Check metric data. + EXPECT_THAT( + metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsWildcardCapableResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq( + XdsClient::kOldStyleAuthority, + XdsWildcardCapableResourceType::Get()->type_url(), "acked"), + 1))); // Start a new watcher for the same resource. It should immediately // receive the cached resource. auto watcher2 = StartWildcardCapableWatch("wc1"); @@ -1634,6 +2146,22 @@ TEST_F(XdsClientTest, ResourceDeletionIgnoredWhenConfigured) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "wc1"); EXPECT_EQ(resource->value, 7); + // Check metric data. + EXPECT_THAT( + metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsWildcardCapableResourceType::Get()->type_url()), + 2))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq( + XdsClient::kOldStyleAuthority, + XdsWildcardCapableResourceType::Get()->type_url(), "acked"), + 1))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -1649,8 +2177,13 @@ TEST_F(XdsClientTest, ResourceDeletionIgnoredWhenConfigured) { TEST_F(XdsClientTest, StreamClosedByServer) { InitXdsClient(); + // Metrics should initially be empty. + EXPECT_THAT(GetServerConnections(), ::testing::ElementsAre()); // Start a watch for "foo1". auto watcher = StartFooWatch("foo1"); + // Check metric data. + EXPECT_THAT(GetServerConnections(), ::testing::ElementsAre(::testing::Pair( + "default_xds_server", true))); // Watcher should initially not see any resource reported. EXPECT_FALSE(watcher->HasEvent()); // XdsClient should have created an ADS stream. @@ -1689,6 +2222,9 @@ TEST_F(XdsClientTest, StreamClosedByServer) { // response on the stream before it failed. // Stream should be orphaned. EXPECT_TRUE(stream->Orphaned()); + // Check metric data. + EXPECT_THAT(GetServerConnections(), ::testing::ElementsAre(::testing::Pair( + "default_xds_server", true))); // XdsClient should create a new stream. stream = WaitForAdsStream(); ASSERT_TRUE(stream != nullptr); @@ -1734,8 +2270,13 @@ TEST_F(XdsClientTest, StreamClosedByServer) { TEST_F(XdsClientTest, StreamClosedByServerWithoutSeeingResponse) { InitXdsClient(); + // Metrics should initially be empty. + EXPECT_THAT(GetServerConnections(), ::testing::ElementsAre()); // Start a watch for "foo1". auto watcher = StartFooWatch("foo1"); + // Check metric data. + EXPECT_THAT(GetServerConnections(), ::testing::ElementsAre(::testing::Pair( + "default_xds_server", true))); // Watcher should initially not see any resource reported. EXPECT_FALSE(watcher->HasEvent()); // XdsClient should have created an ADS stream. @@ -1751,6 +2292,9 @@ TEST_F(XdsClientTest, StreamClosedByServerWithoutSeeingResponse) { CheckRequestNode(*request); // Should be present on the first request. // Server closes the stream without sending a response. stream->MaybeSendStatusToClient(absl::UnavailableError("ugh")); + // Check metric data. + EXPECT_THAT(GetServerConnections(), ::testing::ElementsAre(::testing::Pair( + "default_xds_server", false))); // XdsClient should report an error to the watcher. auto error = watcher->WaitForNextError(); ASSERT_TRUE(error.has_value()); @@ -1771,6 +2315,9 @@ TEST_F(XdsClientTest, StreamClosedByServerWithoutSeeingResponse) { /*error_detail=*/absl::OkStatus(), /*resource_names=*/{"foo1"}); CheckRequestNode(*request); // Should be present on the first request. + // Connection still reported as unhappy until we get a response. + EXPECT_THAT(GetServerConnections(), ::testing::ElementsAre(::testing::Pair( + "default_xds_server", false))); // Server now sends the requested resource. stream->SendMessageToClient( ResponseBuilder(XdsFooResourceType::Get()->type_url()) @@ -1783,6 +2330,9 @@ TEST_F(XdsClientTest, StreamClosedByServerWithoutSeeingResponse) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "foo1"); EXPECT_EQ(resource->value, 6); + // Connection now reported as happy. + EXPECT_THAT(GetServerConnections(), ::testing::ElementsAre(::testing::Pair( + "default_xds_server", true))); // XdsClient sends an ACK. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -1802,8 +2352,13 @@ TEST_F(XdsClientTest, ConnectionFails) { // Tell transport to let us manually trigger completion of the // send_message ops to XdsClient. transport_factory_->SetAutoCompleteMessagesFromClient(false); + // Metrics should initially be empty. + EXPECT_THAT(GetServerConnections(), ::testing::ElementsAre()); // Start a watch for "foo1". auto watcher = StartFooWatch("foo1"); + // Check metric data. + EXPECT_THAT(GetServerConnections(), ::testing::ElementsAre(::testing::Pair( + "default_xds_server", true))); // Watcher should initially not see any resource reported. EXPECT_FALSE(watcher->HasEvent()); // XdsClient should have created an ADS stream. @@ -1828,6 +2383,9 @@ TEST_F(XdsClientTest, ConnectionFails) { "xDS channel for server default_xds_server: " "connection failed (node ID:xds_client_test)") << *error; + // Connection reported as unhappy. + EXPECT_THAT(GetServerConnections(), ::testing::ElementsAre(::testing::Pair( + "default_xds_server", false))); // We should not see a resource-does-not-exist event, because the // timer should not be running while the channel is disconnected. EXPECT_TRUE(watcher->ExpectNoEvent(absl::Seconds(4))); @@ -1853,6 +2411,9 @@ TEST_F(XdsClientTest, ConnectionFails) { .set_nonce("A") .AddFooResource(XdsFooResource("foo1", 6)) .Serialize()); + // Connection now reported as happy. + EXPECT_THAT(GetServerConnections(), ::testing::ElementsAre(::testing::Pair( + "default_xds_server", true))); // XdsClient should have delivered the response to the watchers. auto resource = watcher->WaitForNextResource(); ASSERT_NE(resource, nullptr); @@ -1882,6 +2443,17 @@ TEST_F(XdsClientTest, ResourceDoesNotExistUponTimeout) { auto watcher = StartFooWatch("foo1"); // Watcher should initially not see any resource reported. EXPECT_FALSE(watcher->HasEvent()); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre()); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT(GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), + "requested"), + 1))); // XdsClient should have created an ADS stream. auto stream = WaitForAdsStream(); ASSERT_TRUE(stream != nullptr); @@ -1896,6 +2468,17 @@ TEST_F(XdsClientTest, ResourceDoesNotExistUponTimeout) { // Do not send a response, but wait for the resource to be reported as // not existing. EXPECT_TRUE(watcher->WaitForDoesNotExist(absl::Seconds(5))); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre()); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT(GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), + "does_not_exist"), + 1))); // Start a new watcher for the same resource. It should immediately // receive the same does-not-exist notification. auto watcher2 = StartFooWatch("foo1"); @@ -1916,6 +2499,20 @@ TEST_F(XdsClientTest, ResourceDoesNotExistUponTimeout) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "foo1"); EXPECT_EQ(resource->value, 6); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -1932,8 +2529,25 @@ TEST_F(XdsClientTest, ResourceDoesNotExistUponTimeout) { TEST_F(XdsClientTest, ResourceDoesNotExistAfterStreamRestart) { // Lower resources-does-not-exist timeout so test finishes faster. InitXdsClient(FakeXdsBootstrap::Builder(), Duration::Seconds(3)); + // Metrics should initially be empty. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre()); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT(GetResourceCounts(), ::testing::ElementsAre()); // Start a watch for "foo1". auto watcher = StartFooWatch("foo1"); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre()); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT(GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), + "requested"), + 1))); // Watcher should initially not see any resource reported. EXPECT_FALSE(watcher->HasEvent()); // XdsClient should have created an ADS stream. @@ -1958,6 +2572,17 @@ TEST_F(XdsClientTest, ResourceDoesNotExistAfterStreamRestart) { "with no responses received; status: UNAVAILABLE: ugh " "(node ID:xds_client_test)") << *error; + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre()); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT(GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), + "requested"), + 1))); // XdsClient should create a new stream. stream = WaitForAdsStream(); ASSERT_TRUE(stream != nullptr); @@ -1972,6 +2597,17 @@ TEST_F(XdsClientTest, ResourceDoesNotExistAfterStreamRestart) { // Server does NOT send a response immediately. // Client should receive a resource does-not-exist. ASSERT_TRUE(watcher->WaitForDoesNotExist(absl::Seconds(4))); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre()); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT(GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), + "does_not_exist"), + 1))); // Server now sends the requested resource. stream->SendMessageToClient( ResponseBuilder(XdsFooResourceType::Get()->type_url()) @@ -1984,6 +2620,20 @@ TEST_F(XdsClientTest, ResourceDoesNotExistAfterStreamRestart) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "foo1"); EXPECT_EQ(resource->value, 6); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1))); // XdsClient sends an ACK. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -2022,12 +2672,26 @@ TEST_F(XdsClientTest, DoesNotExistTimerNotStartedUntilSendCompletes) { // We should not see a resource-does-not-exist event, because the // timer should not be running while the channel is disconnected. EXPECT_TRUE(watcher->ExpectNoEvent(absl::Seconds(4))); + // Check metric data. + EXPECT_THAT(GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), + "requested"), + 1))); // The ADS stream uses wait_for_ready inside the XdsTransport interface, // so when the channel connects, the already-started stream will proceed. stream->CompleteSendMessageFromClient(); // Server does NOT send a response. // Watcher should see a does-not-exist event. EXPECT_TRUE(watcher->WaitForDoesNotExist(absl::Seconds(4))); + // Check metric data. + EXPECT_THAT(GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), + "does_not_exist"), + 1))); // Now server sends a response. stream->SendMessageToClient( ResponseBuilder(XdsFooResourceType::Get()->type_url()) @@ -2040,6 +2704,13 @@ TEST_F(XdsClientTest, DoesNotExistTimerNotStartedUntilSendCompletes) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "foo1"); EXPECT_EQ(resource->value, 6); + // Check metric data. + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -2093,6 +2764,20 @@ TEST_F(XdsClientTest, ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "foo1"); EXPECT_EQ(resource->value, 6); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -2105,6 +2790,19 @@ TEST_F(XdsClientTest, auto watcher2 = StartFooWatch("foo2"); // Watcher should initially not see any resource reported. EXPECT_FALSE(watcher2->HasEvent()); + // Check metric data. + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre( + ::testing::Pair(ResourceCountLabelsEq( + XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1), + ::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), + "requested"), + 1))); // XdsClient sends a request to subscribe to the new resource. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -2116,7 +2814,19 @@ TEST_F(XdsClientTest, // complete. // Unsubscribe from foo1 and then re-subscribe to it. CancelFooWatch(watcher.get(), "foo1"); + EXPECT_THAT(GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), + "requested"), + 1))); watcher = StartFooWatch("foo1"); + EXPECT_THAT(GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), + "requested"), + 2))); // Now send a response from the server containing both foo1 and foo2. stream->SendMessageToClient( ResponseBuilder(XdsFooResourceType::Get()->type_url()) @@ -2137,6 +2847,20 @@ TEST_F(XdsClientTest, ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "foo2"); EXPECT_EQ(resource->value, 7); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 3))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 2))); // Now we finally tell XdsClient that its previous send_message op is // complete. stream->CompleteSendMessageFromClient(); @@ -2189,6 +2913,20 @@ TEST_F(XdsClientTest, DoNotSendDoesNotExistForCachedResource) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "foo1"); EXPECT_EQ(resource->value, 6); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -2216,6 +2954,20 @@ TEST_F(XdsClientTest, DoNotSendDoesNotExistForCachedResource) { // resource was already cached, so the server can optimize by not // resending it. EXPECT_TRUE(watcher->ExpectNoEvent(absl::Seconds(4))); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1))); // Now server sends a response. stream->SendMessageToClient( ResponseBuilder(XdsFooResourceType::Get()->type_url()) @@ -2225,6 +2977,22 @@ TEST_F(XdsClientTest, DoNotSendDoesNotExistForCachedResource) { .Serialize()); // Watcher will not see any update, since the resource is unchanged. EXPECT_TRUE(watcher->ExpectNoEvent(absl::Seconds(1))); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 2))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1))); + EXPECT_THAT(GetServerConnections(), ::testing::ElementsAre(::testing::Pair( + "default_xds_server", true))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -2267,6 +3035,20 @@ TEST_F(XdsClientTest, ResourceWrappedInResourceMessage) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "foo1"); EXPECT_EQ(resource->value, 6); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -2308,6 +3090,20 @@ TEST_F(XdsClientTest, MultipleResourceTypes) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "foo1"); EXPECT_EQ(resource->value, 6); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -2338,6 +3134,30 @@ TEST_F(XdsClientTest, MultipleResourceTypes) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource2->name, "bar1"); EXPECT_EQ(resource2->value, "whee"); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre( + ::testing::Pair( + ::testing::Pair("default_xds_server", + XdsBarResourceType::Get()->type_url()), + 1), + ::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::UnorderedElementsAre( + ::testing::Pair(ResourceCountLabelsEq( + XdsClient::kOldStyleAuthority, + XdsBarResourceType::Get()->type_url(), "acked"), + 1), + ::testing::Pair(ResourceCountLabelsEq( + XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -2368,6 +3188,13 @@ TEST_F(XdsClientTest, Federation) { authority.set_server(authority_server); InitXdsClient( FakeXdsBootstrap::Builder().AddAuthority(kAuthority, authority)); + // Metrics should initially be empty. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre()); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT(GetResourceCounts(), ::testing::ElementsAre()); + EXPECT_THAT(GetServerConnections(), ::testing::ElementsAre()); // Start a watch for "foo1". auto watcher = StartFooWatch("foo1"); // Watcher should initially not see any resource reported. @@ -2395,6 +3222,22 @@ TEST_F(XdsClientTest, Federation) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "foo1"); EXPECT_EQ(resource->value, 6); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1))); + EXPECT_THAT(GetServerConnections(), ::testing::ElementsAre(::testing::Pair( + "default_xds_server", true))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -2406,6 +3249,22 @@ TEST_F(XdsClientTest, Federation) { auto watcher2 = StartFooWatch(kXdstpResourceName); // Watcher should initially not see any resource reported. EXPECT_FALSE(watcher2->HasEvent()); + // Check metric data. + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre( + ::testing::Pair(ResourceCountLabelsEq( + XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1), + ::testing::Pair(ResourceCountLabelsEq( + kAuthority, XdsFooResourceType::Get()->type_url(), + "requested"), + 1))); + EXPECT_THAT(GetServerConnections(), + ::testing::ElementsAre( + ::testing::Pair("default_xds_server", true), + ::testing::Pair(authority_server.server_uri(), true))); // XdsClient will create a new stream to the server for this authority. auto stream2 = WaitForAdsStream(authority_server); ASSERT_TRUE(stream2 != nullptr); @@ -2431,6 +3290,34 @@ TEST_F(XdsClientTest, Federation) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, kXdstpResourceName); EXPECT_EQ(resource->value, 3); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre( + ::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1), + ::testing::Pair( + ::testing::Pair(authority_server.server_uri(), + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre( + ::testing::Pair(ResourceCountLabelsEq( + XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1), + ::testing::Pair( + ResourceCountLabelsEq( + kAuthority, XdsFooResourceType::Get()->type_url(), "acked"), + 1))); + EXPECT_THAT(GetServerConnections(), + ::testing::ElementsAre( + ::testing::Pair("default_xds_server", true), + ::testing::Pair(authority_server.server_uri(), true))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream2.get()); ASSERT_TRUE(request.has_value()); @@ -2481,6 +3368,22 @@ TEST_F(XdsClientTest, FederationAuthorityDefaultsToTopLevelXdsServer) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "foo1"); EXPECT_EQ(resource->value, 6); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1))); + EXPECT_THAT(GetServerConnections(), ::testing::ElementsAre(::testing::Pair( + "default_xds_server", true))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -2513,6 +3416,27 @@ TEST_F(XdsClientTest, FederationAuthorityDefaultsToTopLevelXdsServer) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, kXdstpResourceName); EXPECT_EQ(resource->value, 3); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 2))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre( + ::testing::Pair(ResourceCountLabelsEq( + XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1), + ::testing::Pair( + ResourceCountLabelsEq( + kAuthority, XdsFooResourceType::Get()->type_url(), "acked"), + 1))); + EXPECT_THAT(GetServerConnections(), ::testing::ElementsAre(::testing::Pair( + "default_xds_server", true))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -2651,6 +3575,22 @@ TEST_F(XdsClientTest, FederationChannelFailureReportedToWatchers) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, "foo1"); EXPECT_EQ(resource->value, 6); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre(::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre(::testing::Pair( + ResourceCountLabelsEq(XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1))); + EXPECT_THAT(GetServerConnections(), ::testing::ElementsAre(::testing::Pair( + "default_xds_server", true))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream.get()); ASSERT_TRUE(request.has_value()); @@ -2660,6 +3600,11 @@ TEST_F(XdsClientTest, FederationChannelFailureReportedToWatchers) { /*resource_names=*/{"foo1"}); // Start a watch for the xdstp resource name. auto watcher2 = StartFooWatch(kXdstpResourceName); + // Check metric data. + EXPECT_THAT(GetServerConnections(), + ::testing::ElementsAre( + ::testing::Pair("default_xds_server", true), + ::testing::Pair(authority_server.server_uri(), true))); // Watcher should initially not see any resource reported. EXPECT_FALSE(watcher2->HasEvent()); // XdsClient will create a new stream to the server for this authority. @@ -2687,6 +3632,34 @@ TEST_F(XdsClientTest, FederationChannelFailureReportedToWatchers) { ASSERT_NE(resource, nullptr); EXPECT_EQ(resource->name, kXdstpResourceName); EXPECT_EQ(resource->value, 3); + // Check metric data. + EXPECT_THAT(metrics_reporter_->resource_updates_valid(), + ::testing::ElementsAre( + ::testing::Pair( + ::testing::Pair("default_xds_server", + XdsFooResourceType::Get()->type_url()), + 1), + ::testing::Pair( + ::testing::Pair(authority_server.server_uri(), + XdsFooResourceType::Get()->type_url()), + 1))); + EXPECT_THAT(metrics_reporter_->resource_updates_invalid(), + ::testing::ElementsAre()); + EXPECT_THAT( + GetResourceCounts(), + ::testing::ElementsAre( + ::testing::Pair(ResourceCountLabelsEq( + XdsClient::kOldStyleAuthority, + XdsFooResourceType::Get()->type_url(), "acked"), + 1), + ::testing::Pair( + ResourceCountLabelsEq( + kAuthority, XdsFooResourceType::Get()->type_url(), "acked"), + 1))); + EXPECT_THAT(GetServerConnections(), + ::testing::ElementsAre( + ::testing::Pair("default_xds_server", true), + ::testing::Pair(authority_server.server_uri(), true))); // XdsClient should have sent an ACK message to the xDS server. request = WaitForRequest(stream2.get()); ASSERT_TRUE(request.has_value()); @@ -2707,6 +3680,11 @@ TEST_F(XdsClientTest, FederationChannelFailureReportedToWatchers) { << *error; // The watcher for "foo1" should not see any error. EXPECT_FALSE(watcher->HasEvent()); + // Check metric data. + EXPECT_THAT(GetServerConnections(), + ::testing::ElementsAre( + ::testing::Pair("default_xds_server", true), + ::testing::Pair(authority_server.server_uri(), false))); // Cancel watch for "foo1". CancelFooWatch(watcher.get(), "foo1"); EXPECT_TRUE(stream->Orphaned()); diff --git a/test/core/xds/xds_client_test_peer.h b/test/core/xds/xds_client_test_peer.h new file mode 100644 index 00000000000..64cbd841499 --- /dev/null +++ b/test/core/xds/xds_client_test_peer.h @@ -0,0 +1,80 @@ +// +// Copyright 2022 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_TEST_CORE_XDS_XDS_CLIENT_TEST_PEER_H +#define GRPC_TEST_CORE_XDS_XDS_CLIENT_TEST_PEER_H + +#include + +#include + +#include "absl/functional/function_ref.h" +#include "absl/strings/str_cat.h" + +#include "src/core/ext/xds/xds_client.h" + +namespace grpc_core { +namespace testing { + +class XdsClientTestPeer { + public: + explicit XdsClientTestPeer(XdsClient* xds_client) : xds_client_(xds_client) {} + + void TestDumpClientConfig() { + upb::Arena arena; + auto client_config = envoy_service_status_v3_ClientConfig_new(arena.ptr()); + std::set string_pool; + MutexLock lock(xds_client_->mu()); + xds_client_->DumpClientConfig(&string_pool, arena.ptr(), client_config); + } + + struct ResourceCountLabels { + std::string xds_authority; + std::string resource_type; + std::string cache_state; + + std::string ToString() const { + return absl::StrCat("xds_authority=\"", xds_authority, + "\" resource_type=\"", resource_type, + "\" cache_state=\"", cache_state, "\""); + } + }; + void TestReportResourceCounts( + absl::FunctionRef func) { + MutexLock lock(xds_client_->mu()); + xds_client_->ReportResourceCounts( + [&](const XdsClient::ResourceCountLabels& labels, uint64_t count) { + ResourceCountLabels labels_copy = {std::string(labels.xds_authority), + std::string(labels.resource_type), + std::string(labels.cache_state)}; + func(labels_copy, count); + }); + } + + void TestReportServerConnections( + absl::FunctionRef func) { + MutexLock lock(xds_client_->mu()); + xds_client_->ReportServerConnections(func); + } + + private: + XdsClient* xds_client_; +}; + +} // namespace testing +} // namespace grpc_core + +#endif // GRPC_TEST_CORE_XDS_XDS_CLIENT_TEST_PEER_H diff --git a/test/core/xds/xds_cluster_resource_type_test.cc b/test/core/xds/xds_cluster_resource_type_test.cc index a30dd8bc253..2cb04833eec 100644 --- a/test/core/xds/xds_cluster_resource_type_test.cc +++ b/test/core/xds/xds_cluster_resource_type_test.cc @@ -118,7 +118,8 @@ class XdsClusterTest : public ::testing::Test { } return MakeRefCounted(std::move(*bootstrap), /*transport_factory=*/nullptr, - /*event_engine=*/nullptr, "foo agent", + /*event_engine=*/nullptr, + /*metrics_reporter=*/nullptr, "foo agent", "foo version"); } diff --git a/test/core/xds/xds_common_types_test.cc b/test/core/xds/xds_common_types_test.cc index ab049d954d6..4a5be5da3d7 100644 --- a/test/core/xds/xds_common_types_test.cc +++ b/test/core/xds/xds_common_types_test.cc @@ -104,7 +104,8 @@ class XdsCommonTypesTest : public ::testing::Test { } return MakeRefCounted(std::move(*bootstrap), /*transport_factory=*/nullptr, - /*event_engine=*/nullptr, "foo agent", + /*event_engine=*/nullptr, + /*metrics_reporter=*/nullptr, "foo agent", "foo version"); } diff --git a/test/core/xds/xds_endpoint_resource_type_test.cc b/test/core/xds/xds_endpoint_resource_type_test.cc index 8538dcd15c0..9371d50a780 100644 --- a/test/core/xds/xds_endpoint_resource_type_test.cc +++ b/test/core/xds/xds_endpoint_resource_type_test.cc @@ -95,7 +95,8 @@ class XdsEndpointTest : public ::testing::Test { } return MakeRefCounted(std::move(*bootstrap), /*transport_factory=*/nullptr, - /*event_engine=*/nullptr, "foo agent", + /*event_engine=*/nullptr, + /*metrics_reporter=*/nullptr, "foo agent", "foo version"); } diff --git a/test/core/xds/xds_http_filters_test.cc b/test/core/xds/xds_http_filters_test.cc index b8585d319d6..bdbabc45283 100644 --- a/test/core/xds/xds_http_filters_test.cc +++ b/test/core/xds/xds_http_filters_test.cc @@ -117,7 +117,8 @@ class XdsHttpFilterTest : public ::testing::Test { } return MakeRefCounted(std::move(*bootstrap), /*transport_factory=*/nullptr, - /*event_engine=*/nullptr, "foo agent", + /*event_engine=*/nullptr, + /*metrics_reporter=*/nullptr, "foo agent", "foo version"); } diff --git a/test/core/xds/xds_listener_resource_type_test.cc b/test/core/xds/xds_listener_resource_type_test.cc index eac9cb55df7..86a1b299b0a 100644 --- a/test/core/xds/xds_listener_resource_type_test.cc +++ b/test/core/xds/xds_listener_resource_type_test.cc @@ -118,7 +118,8 @@ class XdsListenerTest : public ::testing::Test { } return MakeRefCounted(std::move(*bootstrap), /*transport_factory=*/nullptr, - /*event_engine=*/nullptr, "foo agent", + /*event_engine=*/nullptr, + /*metrics_reporter=*/nullptr, "foo agent", "foo version"); } diff --git a/test/core/xds/xds_route_config_resource_type_test.cc b/test/core/xds/xds_route_config_resource_type_test.cc index 8703efdfcb2..e6df7684377 100644 --- a/test/core/xds/xds_route_config_resource_type_test.cc +++ b/test/core/xds/xds_route_config_resource_type_test.cc @@ -107,7 +107,8 @@ class XdsRouteConfigTest : public ::testing::Test { } return MakeRefCounted(std::move(*bootstrap), /*transport_factory=*/nullptr, - /*event_engine=*/nullptr, "foo agent", + /*event_engine=*/nullptr, + /*metrics_reporter=*/nullptr, "foo agent", "foo version"); } diff --git a/test/cpp/end2end/xds/BUILD b/test/cpp/end2end/xds/BUILD index 30f165067c4..cc36de6519d 100644 --- a/test/cpp/end2end/xds/BUILD +++ b/test/cpp/end2end/xds/BUILD @@ -223,6 +223,7 @@ grpc_cc_test( "//:gpr", "//:grpc", "//:grpc++", + "//test/core/util:fake_stats_plugin", "//test/core/util:grpc_test_util", "//test/core/util:scoped_env_var", ], diff --git a/test/cpp/end2end/xds/xds_core_end2end_test.cc b/test/cpp/end2end/xds/xds_core_end2end_test.cc index 752ed01fe55..df5c480b091 100644 --- a/test/cpp/end2end/xds/xds_core_end2end_test.cc +++ b/test/cpp/end2end/xds/xds_core_end2end_test.cc @@ -27,6 +27,7 @@ #include "src/core/client_channel/backup_poller.h" #include "src/core/lib/config/config_vars.h" #include "src/proto/grpc/testing/xds/v3/listener.pb.h" +#include "test/core/util/fake_stats_plugin.h" #include "test/core/util/resolve_localhost_ip46.h" #include "test/core/util/scoped_env_var.h" #include "test/cpp/end2end/xds/xds_end2end_test_lib.h" @@ -1071,6 +1072,172 @@ TEST_P(XdsFederationTest, FederationServer) { WaitForAllBackends(DEBUG_LOCATION); } +// +// XdsMetricsTest - tests xDS metrics +// + +class XdsMetricsTest : public XdsEnd2endTest { + protected: + void SetUp() override { + stats_plugin_ = grpc_core::FakeStatsPluginBuilder() + .UseDisabledByDefaultMetrics(true) + .BuildAndRegister(); + InitClient(); + } + + std::shared_ptr stats_plugin_; +}; + +// Runs with RDS so that we know all resource types work properly. +INSTANTIATE_TEST_SUITE_P( + XdsTest, XdsMetricsTest, + ::testing::Values(XdsTestType().set_enable_rds_testing()), + &XdsTestType::Name); + +TEST_P(XdsMetricsTest, MetricDefinitionResourceUpdatesValid) { + const auto* descriptor = + grpc_core::GlobalInstrumentsRegistryTestPeer::FindMetricDescriptorByName( + "grpc.xds_client.resource_updates_valid"); + ASSERT_NE(descriptor, nullptr); + EXPECT_EQ(descriptor->value_type, + grpc_core::GlobalInstrumentsRegistry::ValueType::kUInt64); + EXPECT_EQ(descriptor->instrument_type, + grpc_core::GlobalInstrumentsRegistry::InstrumentType::kCounter); + EXPECT_EQ(descriptor->enable_by_default, false); + EXPECT_EQ(descriptor->name, "grpc.xds_client.resource_updates_valid"); + EXPECT_EQ(descriptor->unit, "{resource}"); + EXPECT_THAT(descriptor->label_keys, + ::testing::ElementsAre("grpc.target", "grpc.xds.server", + "grpc.xds.resource_type")); + EXPECT_THAT(descriptor->optional_label_keys, ::testing::ElementsAre()); +} + +TEST_P(XdsMetricsTest, MetricDefinitionResourceUpdatesInvalid) { + const auto* descriptor = + grpc_core::GlobalInstrumentsRegistryTestPeer::FindMetricDescriptorByName( + "grpc.xds_client.resource_updates_invalid"); + ASSERT_NE(descriptor, nullptr); + EXPECT_EQ(descriptor->value_type, + grpc_core::GlobalInstrumentsRegistry::ValueType::kUInt64); + EXPECT_EQ(descriptor->instrument_type, + grpc_core::GlobalInstrumentsRegistry::InstrumentType::kCounter); + EXPECT_EQ(descriptor->enable_by_default, false); + EXPECT_EQ(descriptor->name, "grpc.xds_client.resource_updates_invalid"); + EXPECT_EQ(descriptor->unit, "{resource}"); + EXPECT_THAT(descriptor->label_keys, + ::testing::ElementsAre("grpc.target", "grpc.xds.server", + "grpc.xds.resource_type")); + EXPECT_THAT(descriptor->optional_label_keys, ::testing::ElementsAre()); +} + +TEST_P(XdsMetricsTest, MetricDefinitionConnected) { + const auto* descriptor = + grpc_core::GlobalInstrumentsRegistryTestPeer::FindMetricDescriptorByName( + "grpc.xds_client.connected"); + ASSERT_NE(descriptor, nullptr); + EXPECT_EQ(descriptor->value_type, + grpc_core::GlobalInstrumentsRegistry::ValueType::kInt64); + EXPECT_EQ( + descriptor->instrument_type, + grpc_core::GlobalInstrumentsRegistry::InstrumentType::kCallbackGauge); + EXPECT_EQ(descriptor->enable_by_default, false); + EXPECT_EQ(descriptor->name, "grpc.xds_client.connected"); + EXPECT_EQ(descriptor->unit, "{bool}"); + EXPECT_THAT(descriptor->label_keys, + ::testing::ElementsAre("grpc.target", "grpc.xds.server")); + EXPECT_THAT(descriptor->optional_label_keys, ::testing::ElementsAre()); +} + +TEST_P(XdsMetricsTest, MetricDefinitionResources) { + const auto* descriptor = + grpc_core::GlobalInstrumentsRegistryTestPeer::FindMetricDescriptorByName( + "grpc.xds_client.resources"); + ASSERT_NE(descriptor, nullptr); + EXPECT_EQ(descriptor->value_type, + grpc_core::GlobalInstrumentsRegistry::ValueType::kInt64); + EXPECT_EQ( + descriptor->instrument_type, + grpc_core::GlobalInstrumentsRegistry::InstrumentType::kCallbackGauge); + EXPECT_EQ(descriptor->enable_by_default, false); + EXPECT_EQ(descriptor->name, "grpc.xds_client.resources"); + EXPECT_EQ(descriptor->unit, "{resource}"); + EXPECT_THAT( + descriptor->label_keys, + ::testing::ElementsAre("grpc.target", "grpc.xds.authority", + "grpc.xds.resource_type", "grpc.xds.cache_state")); + EXPECT_THAT(descriptor->optional_label_keys, ::testing::ElementsAre()); +} + +TEST_P(XdsMetricsTest, MetricValues) { + const auto kMetricResourceUpdatesValid = + grpc_core::GlobalInstrumentsRegistryTestPeer:: + FindUInt64CounterHandleByName( + "grpc.xds_client.resource_updates_valid") + .value(); + const auto kMetricResourceUpdatesInvalid = + grpc_core::GlobalInstrumentsRegistryTestPeer:: + FindUInt64CounterHandleByName( + "grpc.xds_client.resource_updates_invalid") + .value(); + const auto kMetricConnected = + grpc_core::GlobalInstrumentsRegistryTestPeer:: + FindCallbackInt64GaugeHandleByName("grpc.xds_client.connected") + .value(); + const auto kMetricResources = + grpc_core::GlobalInstrumentsRegistryTestPeer:: + FindCallbackInt64GaugeHandleByName("grpc.xds_client.resources") + .value(); + const std::string kTarget = absl::StrCat("xds:", kServerName); + const std::string kXdsServer = absl::StrCat("localhost:", balancer_->port()); + CreateAndStartBackends(1, /*xds_enabled=*/true); + EdsResourceArgs args = + EdsResourceArgs({{"locality0", CreateEndpointsForBackends()}}); + balancer_->ads_service()->SetEdsResource(BuildEdsResource(args)); + CheckRpcSendOk(DEBUG_LOCATION); + stats_plugin_->TriggerCallbacks(); + // Check client metrics. + EXPECT_THAT(stats_plugin_->GetCallbackGaugeValue(kMetricConnected, + {kTarget, kXdsServer}, {}), + ::testing::Optional(1)); + for (absl::string_view type_url : + {"envoy.config.listener.v3.Listener", + "envoy.config.route.v3.RouteConfiguration", + "envoy.config.cluster.v3.Cluster", + "envoy.config.endpoint.v3.ClusterLoadAssignment"}) { + EXPECT_THAT( + stats_plugin_->GetCounterValue(kMetricResourceUpdatesValid, + {kTarget, kXdsServer, type_url}, {}), + ::testing::Optional(1)); + EXPECT_THAT( + stats_plugin_->GetCounterValue(kMetricResourceUpdatesInvalid, + {kTarget, kXdsServer, type_url}, {}), + ::testing::Optional(0)); + EXPECT_THAT(stats_plugin_->GetCallbackGaugeValue( + kMetricResources, {kTarget, "#old", type_url, "acked"}, {}), + ::testing::Optional(1)); + } + // Check server metrics. + EXPECT_THAT(stats_plugin_->GetCallbackGaugeValue(kMetricConnected, + {"#server", kXdsServer}, {}), + ::testing::Optional(1)); + for (absl::string_view type_url : + {"envoy.config.listener.v3.Listener", + "envoy.config.route.v3.RouteConfiguration"}) { + EXPECT_THAT( + stats_plugin_->GetCounterValue(kMetricResourceUpdatesValid, + {"#server", kXdsServer, type_url}, {}), + ::testing::Optional(1)); + EXPECT_THAT( + stats_plugin_->GetCounterValue(kMetricResourceUpdatesInvalid, + {"#server", kXdsServer, type_url}, {}), + ::testing::Optional(0)); + EXPECT_THAT( + stats_plugin_->GetCallbackGaugeValue( + kMetricResources, {"#server", "#old", type_url, "acked"}, {}), + ::testing::Optional(1)); + } +} + // // XdsFederationDisabledTest // diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index ba4cbaec282..f855fd03361 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -2115,6 +2115,7 @@ src/core/ext/xds/xds_lb_policy_registry.cc \ src/core/ext/xds/xds_lb_policy_registry.h \ src/core/ext/xds/xds_listener.cc \ src/core/ext/xds/xds_listener.h \ +src/core/ext/xds/xds_metrics.h \ src/core/ext/xds/xds_resource_type.h \ src/core/ext/xds/xds_resource_type_impl.h \ src/core/ext/xds/xds_route_config.cc \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 8796adfd4c6..a61ab574132 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -1885,6 +1885,7 @@ src/core/ext/xds/xds_lb_policy_registry.cc \ src/core/ext/xds/xds_lb_policy_registry.h \ src/core/ext/xds/xds_listener.cc \ src/core/ext/xds/xds_listener.h \ +src/core/ext/xds/xds_metrics.h \ src/core/ext/xds/xds_resource_type.h \ src/core/ext/xds/xds_resource_type_impl.h \ src/core/ext/xds/xds_route_config.cc \ From 065aa63d1754a0271a88b762d02d7b049a39c4e8 Mon Sep 17 00:00:00 2001 From: Ming-Chuan Lin Date: Tue, 19 Mar 2024 16:51:39 -0700 Subject: [PATCH 15/16] Internal change PiperOrigin-RevId: 617335127 --- src/core/ext/transport/binder/java/io/grpc/binder/cpp/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ext/transport/binder/java/io/grpc/binder/cpp/BUILD b/src/core/ext/transport/binder/java/io/grpc/binder/cpp/BUILD index cfdd74e4050..5e63c32bc51 100644 --- a/src/core/ext/transport/binder/java/io/grpc/binder/cpp/BUILD +++ b/src/core/ext/transport/binder/java/io/grpc/binder/cpp/BUILD @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@build_bazel_rules_android//android:rules.bzl", "android_library") +# copybara: Import internal android_library rule here licenses(["notice"]) From 125492ea7046e3dc631613cc2b9273103b9a6b51 Mon Sep 17 00:00:00 2001 From: Eugene Ostroukhov Date: Wed, 20 Mar 2024 11:39:51 -0700 Subject: [PATCH 16/16] [xds] Add env protection for multiple xDS servers in bootstrap (#36154) As per [gRFC A71](https://github.com/grpc/proposal/blob/master/A71-xds-fallback.md). Closes #36154 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36154 from eugeneo:xds-bootstrap-servers-env-var aada3e7e4ab4e4134fa22a97e1d3de7cd5a8b709 PiperOrigin-RevId: 617579604 --- build_autogenerated.yaml | 3 +- src/core/ext/xds/xds_bootstrap_grpc.cc | 28 ++++++++ src/core/ext/xds/xds_bootstrap_grpc.h | 2 + test/core/xds/BUILD | 1 + test/core/xds/xds_bootstrap_test.cc | 96 ++++++++++++++++++++++++-- 5 files changed, 123 insertions(+), 7 deletions(-) diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 973ec51a9ce..a28fd37bcc2 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -20188,7 +20188,8 @@ targets: gtest: true build: test language: c++ - headers: [] + headers: + - test/core/util/scoped_env_var.h src: - test/core/xds/xds_bootstrap_test.cc deps: diff --git a/src/core/ext/xds/xds_bootstrap_grpc.cc b/src/core/ext/xds/xds_bootstrap_grpc.cc index 41749e510cd..dcd5c918091 100644 --- a/src/core/ext/xds/xds_bootstrap_grpc.cc +++ b/src/core/ext/xds/xds_bootstrap_grpc.cc @@ -38,6 +38,8 @@ #include #include "src/core/lib/config/core_configuration.h" +#include "src/core/lib/gpr/string.h" +#include "src/core/lib/gprpp/env.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/json/json.h" #include "src/core/lib/json/json_object_loader.h" @@ -47,6 +49,17 @@ namespace grpc_core { +namespace { +bool IsFallbackExperimentEnabled() { + auto fallback_enabled = GetEnv("GRPC_EXPERIMENTAL_XDS_FALLBACK"); + bool enabled = false; + return gpr_parse_bool_value(fallback_enabled.value_or("0").c_str(), + &enabled) && + enabled; +} + +} // namespace + // // GrpcXdsBootstrap::GrpcNode::Locality // @@ -219,6 +232,16 @@ const JsonLoaderInterface* GrpcXdsBootstrap::GrpcAuthority::JsonLoader( return loader; } +void GrpcXdsBootstrap::GrpcAuthority::JsonPostLoad( + const Json& /*json*/, const JsonArgs& /*args*/, + ValidationErrors* /*errors*/) { + if (!IsFallbackExperimentEnabled()) { + if (servers_.size() > 1) { + servers_.resize(1); + } + } +} + // // GrpcXdsBootstrap // @@ -293,6 +316,11 @@ void GrpcXdsBootstrap::JsonPostLoad(const Json& /*json*/, } } } + if (!IsFallbackExperimentEnabled()) { + if (servers_.size() > 1) { + servers_.resize(1); + } + } } std::string GrpcXdsBootstrap::ToString() const { diff --git a/src/core/ext/xds/xds_bootstrap_grpc.h b/src/core/ext/xds/xds_bootstrap_grpc.h index 13c6c8ac083..89fb7fe15e4 100644 --- a/src/core/ext/xds/xds_bootstrap_grpc.h +++ b/src/core/ext/xds/xds_bootstrap_grpc.h @@ -118,6 +118,8 @@ class GrpcXdsBootstrap : public XdsBootstrap { } static const JsonLoaderInterface* JsonLoader(const JsonArgs&); + void JsonPostLoad(const Json& json, const JsonArgs& args, + ValidationErrors* errors); private: std::vector servers_; diff --git a/test/core/xds/BUILD b/test/core/xds/BUILD index 581db547721..0ca4fe1ac5a 100644 --- a/test/core/xds/BUILD +++ b/test/core/xds/BUILD @@ -37,6 +37,7 @@ grpc_cc_test( "//:gpr", "//src/core:grpc_xds_client", "//test/core/util:grpc_test_util", + "//test/core/util:scoped_env_var", ], ) diff --git a/test/core/xds/xds_bootstrap_test.cc b/test/core/xds/xds_bootstrap_test.cc index 0749a9006e3..f5feb114d51 100644 --- a/test/core/xds/xds_bootstrap_test.cc +++ b/test/core/xds/xds_bootstrap_test.cc @@ -49,6 +49,7 @@ #include "src/core/lib/security/certificate_provider/certificate_provider_factory.h" #include "src/core/lib/security/credentials/channel_creds_registry.h" #include "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h" +#include "test/core/util/scoped_env_var.h" #include "test/core/util/test_config.h" namespace grpc_core { @@ -163,8 +164,7 @@ TEST(XdsBootstrapTest, Basic) { ASSERT_TRUE(bootstrap_or.ok()) << bootstrap_or.status(); auto bootstrap = std::move(*bootstrap_or); EXPECT_THAT(bootstrap->servers(), - ::testing::ElementsAre(EqXdsServer("fake:///lb1", "fake"), - EqXdsServer("fake:///lb2", "fake"))); + ::testing::ElementsAre(EqXdsServer("fake:///lb1", "fake"))); EXPECT_EQ(bootstrap->authorities().size(), 2); auto* authority = static_cast( bootstrap->LookupAuthority("xds.example.com")); @@ -172,10 +172,8 @@ TEST(XdsBootstrapTest, Basic) { EXPECT_EQ(authority->client_listener_resource_name_template(), "xdstp://xds.example.com/envoy.config.listener.v3.Listener/grpc/" "server/%s"); - EXPECT_THAT( - authority->servers(), - ::testing::ElementsAre(EqXdsServer("fake:///xds_server", "fake"), - EqXdsServer("fake:///xds_server2", "fake"))); + EXPECT_THAT(authority->servers(), ::testing::ElementsAre(EqXdsServer( + "fake:///xds_server", "fake"))); authority = static_cast( bootstrap->LookupAuthority("xds.example2.com")); ASSERT_NE(authority, nullptr); @@ -726,6 +724,92 @@ TEST(XdsBootstrapTest, XdsServerToJsonAndParse) { EXPECT_EQ(*xds_server, *output_xds_server); } +TEST(XdsBootstrapTest, NoXdsServersEnvVar) { + ScopedEnvVar fallback_enabled("GRPC_EXPERIMENTAL_XDS_FALLBACK", "1"); + const char* json_str = + "{" + " \"xds_servers\": [" + " {" + " \"server_uri\": \"fake:///lb1\"," + " \"channel_creds\": [" + " {" + " \"type\": \"fake\"," + " \"ignore\": 0" + " }" + " ]," + " \"ignore\": 0" + " }," + " {" + " \"server_uri\": \"fake:///lb2\"," + " \"channel_creds\": [" + " {" + " \"type\": \"fake\"," + " \"ignore\": 0" + " }" + " ]," + " \"ignore\": 0" + " }" + " ]," + " \"authorities\": {" + " \"xds.example.com\": {" + " \"client_listener_resource_name_template\": " + "\"xdstp://xds.example.com/envoy.config.listener.v3.Listener/grpc/server/" + "%s\"," + " \"xds_servers\": [" + " {" + " \"server_uri\": \"fake:///xds_server\"," + " \"channel_creds\": [" + " {" + " \"type\": \"fake\"" + " }" + " ]," + " \"server_features\": [\"xds_v3\"]" + " }," + " {" + " \"server_uri\": \"fake:///xds_server2\"," + " \"channel_creds\": [" + " {" + " \"type\": \"fake\"" + " }" + " ]," + " \"server_features\": [\"xds_v3\"]" + " }" + " ]" + " }" + " }," + " \"node\": {" + " \"id\": \"foo\"," + " \"cluster\": \"bar\"," + " \"locality\": {" + " \"region\": \"milky_way\"," + " \"zone\": \"sol_system\"," + " \"sub_zone\": \"earth\"," + " \"ignore\": {}" + " }," + " \"metadata\": {" + " \"foo\": 1," + " \"bar\": 2" + " }," + " \"ignore\": \"whee\"" + " }," + " \"server_listener_resource_name_template\": \"example/resource\"," + " \"ignore\": {}" + "}"; + auto bootstrap_or = GrpcXdsBootstrap::Create(json_str); + ASSERT_TRUE(bootstrap_or.ok()) << bootstrap_or.status(); + auto bootstrap = std::move(*bootstrap_or); + EXPECT_THAT(bootstrap->servers(), + ::testing::ElementsAre(EqXdsServer("fake:///lb1", "fake"), + EqXdsServer("fake:///lb2", "fake"))); + auto* authority = static_cast( + bootstrap->LookupAuthority("xds.example.com")); + ASSERT_NE(authority, nullptr); + EXPECT_THAT( + authority->servers(), + ::testing::ElementsAre(EqXdsServer("fake:///xds_server", "fake"), + EqXdsServer("fake:///xds_server2", "fake"))); +} + } // namespace } // namespace testing } // namespace grpc_core