Merge remote-tracking branch 'upstream/master' into xds_logging

pull/23614/head
Mark D. Roth 4 years ago
commit a24306fa0c
  1. 2
      .github/ISSUE_TEMPLATE/bug_report.md
  2. 2
      .github/ISSUE_TEMPLATE/cleanup_request.md
  3. 2
      .github/ISSUE_TEMPLATE/feature_request.md
  4. 2
      .github/ISSUE_TEMPLATE/question.md
  5. 2
      .github/pull_request_template.md
  6. 16
      BUILD
  7. 2
      BUILD.gn
  8. 2
      CMakeLists.txt
  9. 2
      Makefile
  10. 4
      build_autogenerated.yaml
  11. 1
      build_handwritten.yaml
  12. 26
      config.m4
  13. 27
      config.w32
  14. 2
      gRPC-C++.podspec
  15. 3
      gRPC-Core.podspec
  16. 2
      grpc.gemspec
  17. 2
      grpc.gyp
  18. 51
      package.xml
  19. 58
      src/core/ext/filters/client_channel/lb_policy/xds/xds_routing.cc
  20. 33
      src/core/ext/filters/http/client/http_client_filter.cc
  21. 53
      src/core/ext/filters/http/client/util.cc
  22. 30
      src/core/ext/filters/http/client/util.h
  23. 14
      src/core/lib/iomgr/is_epollexclusive_available.cc
  24. 4
      src/php/docker/grpc-src/Dockerfile
  25. 1
      src/python/grpcio/grpc_core_dependencies.py
  26. 4
      templates/src/php/docker/grpc-src/Dockerfile.template
  27. 4
      test/core/compression/compression_test.cc
  28. 2
      test/core/security/grpc_tls_credentials_options_test.cc
  29. 239
      test/cpp/end2end/xds_end2end_test.cc
  30. 2
      tools/doxygen/Doxyfile.c++.internal
  31. 2
      tools/doxygen/Doxyfile.core.internal
  32. 2
      tools/run_tests/artifacts/artifact_targets.py
  33. 8
      tools/run_tests/artifacts/build_artifact_php.sh

@ -2,7 +2,7 @@
name: Report a bug
about: Create a report to help us improve
labels: kind/bug, priority/P2
assignees: karthikravis
assignees: donnadionne
---

@ -2,7 +2,7 @@
name: Request a cleanup
about: Suggest a cleanup in our repository
labels: kind/internal cleanup, priority/P2
assignees: karthikravis
assignees: donnadionne
---

@ -2,7 +2,7 @@
name: Request a feature
about: Suggest an idea for this project
labels: kind/enhancement, priority/P2
assignees: karthikravis
assignees: donnadionne
---

@ -2,7 +2,7 @@
name: Ask a question
about: Ask a question
labels: kind/question, priority/P3
assignees: karthikravis
assignees: donnadionne
---

@ -8,4 +8,4 @@ If you know who should review your pull request, please remove the mentioning be
-->
@karthikravis
@donnadionne

16
BUILD

@ -1163,20 +1163,6 @@ grpc_cc_library(
],
)
grpc_cc_library(
name = "grpc_http_util",
srcs = [
"src/core/ext/filters/http/client/util.cc",
],
hdrs = [
"src/core/ext/filters/http/client/util.h",
],
language = "c++",
deps = [
"grpc_base",
],
)
grpc_cc_library(
name = "grpc_http_filters",
srcs = [
@ -1195,7 +1181,6 @@ grpc_cc_library(
language = "c++",
deps = [
"grpc_base",
"grpc_http_util",
"grpc_message_size_filter",
],
)
@ -1475,7 +1460,6 @@ grpc_cc_library(
deps = [
"grpc_base",
"grpc_client_channel",
"grpc_http_util",
"grpc_resolver_xds_header",
"grpc_xds_api_header",
],

@ -320,8 +320,6 @@ config("grpc_config") {
"src/core/ext/filters/deadline/deadline_filter.h",
"src/core/ext/filters/http/client/http_client_filter.cc",
"src/core/ext/filters/http/client/http_client_filter.h",
"src/core/ext/filters/http/client/util.cc",
"src/core/ext/filters/http/client/util.h",
"src/core/ext/filters/http/client_authority_filter.cc",
"src/core/ext/filters/http/client_authority_filter.h",
"src/core/ext/filters/http/http_filters_plugin.cc",

@ -1396,7 +1396,6 @@ add_library(grpc
src/core/ext/filters/client_idle/client_idle_filter.cc
src/core/ext/filters/deadline/deadline_filter.cc
src/core/ext/filters/http/client/http_client_filter.cc
src/core/ext/filters/http/client/util.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/message_compress_filter.cc
@ -2141,7 +2140,6 @@ add_library(grpc_unsecure
src/core/ext/filters/client_idle/client_idle_filter.cc
src/core/ext/filters/deadline/deadline_filter.cc
src/core/ext/filters/http/client/http_client_filter.cc
src/core/ext/filters/http/client/util.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/message_compress_filter.cc

@ -3462,7 +3462,6 @@ LIBGRPC_SRC = \
src/core/ext/filters/client_idle/client_idle_filter.cc \
src/core/ext/filters/deadline/deadline_filter.cc \
src/core/ext/filters/http/client/http_client_filter.cc \
src/core/ext/filters/http/client/util.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/message_compress_filter.cc \
@ -4176,7 +4175,6 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/filters/client_idle/client_idle_filter.cc \
src/core/ext/filters/deadline/deadline_filter.cc \
src/core/ext/filters/http/client/http_client_filter.cc \
src/core/ext/filters/http/client/util.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/message_compress_filter.cc \

@ -426,7 +426,6 @@ libs:
- src/core/ext/filters/client_channel/xds/xds_client_stats.h
- src/core/ext/filters/deadline/deadline_filter.h
- src/core/ext/filters/http/client/http_client_filter.h
- src/core/ext/filters/http/client/util.h
- src/core/ext/filters/http/client_authority_filter.h
- src/core/ext/filters/http/message_compress/message_compress_filter.h
- src/core/ext/filters/http/message_compress/message_decompress_filter.h
@ -875,7 +874,6 @@ libs:
- src/core/ext/filters/client_idle/client_idle_filter.cc
- src/core/ext/filters/deadline/deadline_filter.cc
- src/core/ext/filters/http/client/http_client_filter.cc
- src/core/ext/filters/http/client/util.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/message_compress_filter.cc
@ -1489,7 +1487,6 @@ libs:
- src/core/ext/filters/client_channel/xds/xds_client_stats.h
- src/core/ext/filters/deadline/deadline_filter.h
- src/core/ext/filters/http/client/http_client_filter.h
- src/core/ext/filters/http/client/util.h
- src/core/ext/filters/http/client_authority_filter.h
- src/core/ext/filters/http/message_compress/message_compress_filter.h
- src/core/ext/filters/http/message_compress/message_decompress_filter.h
@ -1874,7 +1871,6 @@ libs:
- src/core/ext/filters/client_idle/client_idle_filter.cc
- src/core/ext/filters/deadline/deadline_filter.cc
- src/core/ext/filters/http/client/http_client_filter.cc
- src/core/ext/filters/http/client/util.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/message_compress_filter.cc

@ -224,6 +224,7 @@ php_config_m4:
- grpc
- address_sorting
- boringssl
- re2
- z
headers:
- src/php/ext/grpc/byte_buffer.h

@ -106,7 +106,6 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/filters/client_idle/client_idle_filter.cc \
src/core/ext/filters/deadline/deadline_filter.cc \
src/core/ext/filters/http/client/http_client_filter.cc \
src/core/ext/filters/http/client/util.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/message_compress_filter.cc \
@ -894,6 +893,29 @@ if test "$PHP_GRPC" != "no"; then
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 \
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/pcre.cc \
third_party/re2/util/rune.cc \
third_party/re2/util/strutil.cc \
third_party/upb/upb/decode.c \
third_party/upb/upb/def.c \
third_party/upb/upb/encode.c \
@ -1068,5 +1090,7 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl-with-bazel/src/crypto/x509)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl-with-bazel/src/crypto/x509v3)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl-with-bazel/src/ssl)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/re2/re2)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/re2/util)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/upb/upb)
fi

@ -74,7 +74,6 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\filters\\client_idle\\client_idle_filter.cc " +
"src\\core\\ext\\filters\\deadline\\deadline_filter.cc " +
"src\\core\\ext\\filters\\http\\client\\http_client_filter.cc " +
"src\\core\\ext\\filters\\http\\client\\util.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\\message_compress_filter.cc " +
@ -862,6 +861,29 @@ if (PHP_GRPC != "no") {
"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 " +
"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\\pcre.cc " +
"third_party\\re2\\util\\rune.cc " +
"third_party\\re2\\util\\strutil.cc " +
"third_party\\upb\\upb\\decode.c " +
"third_party\\upb\\upb\\def.c " +
"third_party\\upb\\upb\\encode.c " +
@ -1107,6 +1129,9 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl-with-bazel\\src\\crypto\\x509");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl-with-bazel\\src\\crypto\\x509v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl-with-bazel\\src\\ssl");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\re2");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\re2\\re2");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\re2\\util");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\upb\\upb");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\zlib");

@ -269,7 +269,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/xds/xds_client_stats.h',
'src/core/ext/filters/deadline/deadline_filter.h',
'src/core/ext/filters/http/client/http_client_filter.h',
'src/core/ext/filters/http/client/util.h',
'src/core/ext/filters/http/client_authority_filter.h',
'src/core/ext/filters/http/message_compress/message_compress_filter.h',
'src/core/ext/filters/http/message_compress/message_decompress_filter.h',
@ -828,7 +827,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/xds/xds_client_stats.h',
'src/core/ext/filters/deadline/deadline_filter.h',
'src/core/ext/filters/http/client/http_client_filter.h',
'src/core/ext/filters/http/client/util.h',
'src/core/ext/filters/http/client_authority_filter.h',
'src/core/ext/filters/http/message_compress/message_compress_filter.h',
'src/core/ext/filters/http/message_compress/message_decompress_filter.h',

@ -304,8 +304,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/deadline/deadline_filter.h',
'src/core/ext/filters/http/client/http_client_filter.cc',
'src/core/ext/filters/http/client/http_client_filter.h',
'src/core/ext/filters/http/client/util.cc',
'src/core/ext/filters/http/client/util.h',
'src/core/ext/filters/http/client_authority_filter.cc',
'src/core/ext/filters/http/client_authority_filter.h',
'src/core/ext/filters/http/http_filters_plugin.cc',
@ -1295,7 +1293,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/xds/xds_client_stats.h',
'src/core/ext/filters/deadline/deadline_filter.h',
'src/core/ext/filters/http/client/http_client_filter.h',
'src/core/ext/filters/http/client/util.h',
'src/core/ext/filters/http/client_authority_filter.h',
'src/core/ext/filters/http/message_compress/message_compress_filter.h',
'src/core/ext/filters/http/message_compress/message_decompress_filter.h',

@ -226,8 +226,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/deadline/deadline_filter.h )
s.files += %w( src/core/ext/filters/http/client/http_client_filter.cc )
s.files += %w( src/core/ext/filters/http/client/http_client_filter.h )
s.files += %w( src/core/ext/filters/http/client/util.cc )
s.files += %w( src/core/ext/filters/http/client/util.h )
s.files += %w( src/core/ext/filters/http/client_authority_filter.cc )
s.files += %w( src/core/ext/filters/http/client_authority_filter.h )
s.files += %w( src/core/ext/filters/http/http_filters_plugin.cc )

@ -503,7 +503,6 @@
'src/core/ext/filters/client_idle/client_idle_filter.cc',
'src/core/ext/filters/deadline/deadline_filter.cc',
'src/core/ext/filters/http/client/http_client_filter.cc',
'src/core/ext/filters/http/client/util.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/message_compress_filter.cc',
@ -1079,7 +1078,6 @@
'src/core/ext/filters/client_idle/client_idle_filter.cc',
'src/core/ext/filters/deadline/deadline_filter.cc',
'src/core/ext/filters/http/client/http_client_filter.cc',
'src/core/ext/filters/http/client/util.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/message_compress_filter.cc',

@ -206,8 +206,6 @@
<file baseinstalldir="/" name="src/core/ext/filters/deadline/deadline_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/client/http_client_filter.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/client/http_client_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/client/util.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/client/util.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/client_authority_filter.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/client_authority_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/http_filters_plugin.cc" role="src" />
@ -1717,6 +1715,55 @@
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/third_party/fiat/curve25519_64.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/third_party/fiat/p256_32.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/third_party/fiat/p256_64.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/bitmap256.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/bitstate.cc" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/compile.cc" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/dfa.cc" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/filtered_re2.cc" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/filtered_re2.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/mimics_pcre.cc" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/nfa.cc" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/onepass.cc" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/parse.cc" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/perl_groups.cc" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/pod_array.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/prefilter.cc" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/prefilter.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/prefilter_tree.cc" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/prefilter_tree.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/prog.cc" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/prog.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/re2.cc" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/re2.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/regexp.cc" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/regexp.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/set.cc" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/set.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/simplify.cc" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/sparse_array.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/sparse_set.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/stringpiece.cc" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/stringpiece.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/tostring.cc" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/unicode_casefold.cc" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/unicode_casefold.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/unicode_groups.cc" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/unicode_groups.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/re2/walker-inl.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/util/benchmark.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/util/flags.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/util/logging.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/util/malloc_counter.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/util/mix.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/util/mutex.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/util/pcre.cc" role="src" />
<file baseinstalldir="/" name="third_party/re2/util/pcre.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/util/rune.cc" role="src" />
<file baseinstalldir="/" name="third_party/re2/util/strutil.cc" role="src" />
<file baseinstalldir="/" name="third_party/re2/util/strutil.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/util/test.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/util/utf.h" role="src" />
<file baseinstalldir="/" name="third_party/re2/util/util.h" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/decode.c" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/decode.h" role="src" />
<file baseinstalldir="/" name="third_party/upb/upb/def.c" role="src" />

@ -37,7 +37,6 @@
#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
#include "src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h"
#include "src/core/ext/filters/client_channel/xds/xds_api.h"
#include "src/core/ext/filters/http/client/util.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/orphanable.h"
@ -120,18 +119,14 @@ class XdsRoutingLb : public LoadBalancingPolicy {
// Maintains an ordered xds route table as provided by RDS response.
using RouteTable = std::vector<Route>;
RoutePicker(RouteTable route_table, std::string user_agent,
RefCountedPtr<XdsRoutingLbConfig> config)
: route_table_(std::move(route_table)),
user_agent_(std::move(user_agent)),
config_(std::move(config)) {}
explicit RoutePicker(RouteTable route_table,
RefCountedPtr<XdsRoutingLbConfig> config)
: route_table_(std::move(route_table)), config_(std::move(config)) {}
PickResult Pick(PickArgs args) override;
private:
RouteTable route_table_;
// Storing user_agent generated from args from http layer.
std::string user_agent_;
// Take a reference to config so that we can use
// XdsApi::RdsUpdate::RdsRoute::Matchers from it.
RefCountedPtr<XdsRoutingLbConfig> config_;
@ -220,9 +215,6 @@ class XdsRoutingLb : public LoadBalancingPolicy {
// Children.
std::map<std::string, OrphanablePtr<XdsRoutingChild>> actions_;
// Storing user_agent generated from args from http layer.
std::string user_agent_;
};
//
@ -270,24 +262,10 @@ absl::optional<absl::string_view> GetMetadataValue(
bool HeaderMatchHelper(
const XdsApi::RdsUpdate::RdsRoute::Matchers::HeaderMatcher& header_matcher,
LoadBalancingPolicy::MetadataInterface* initial_metadata,
const std::string& user_agent, absl::string_view deadline) {
LoadBalancingPolicy::MetadataInterface* initial_metadata) {
std::string concatenated_value;
absl::optional<absl::string_view> value;
if (header_matcher.name == "grpc-tags-bin" ||
header_matcher.name == "grpc-trace-bin" ||
header_matcher.name == "grpc-previous-rpc-attempts") {
value = absl::nullopt;
} else if (header_matcher.name == "content-type") {
value = "application/grpc";
} else if (header_matcher.name == "user-agent") {
value = user_agent;
} else if (header_matcher.name == "grpc-timeout") {
value = deadline;
} else {
value = GetMetadataValue(header_matcher.name, initial_metadata,
&concatenated_value);
}
auto value = GetMetadataValue(header_matcher.name, initial_metadata,
&concatenated_value);
if (!value.has_value()) {
if (header_matcher.type == XdsApi::RdsUpdate::RdsRoute::Matchers::
HeaderMatcher::HeaderMatcherType::PRESENT) {
@ -325,13 +303,11 @@ bool HeaderMatchHelper(
}
bool HeadersMatch(
LoadBalancingPolicy::PickArgs args,
const std::vector<XdsApi::RdsUpdate::RdsRoute::Matchers::HeaderMatcher>&
header_matchers,
LoadBalancingPolicy::MetadataInterface* initial_metadata,
const std::string& user_agent, absl::string_view deadline) {
header_matchers) {
for (const auto& header_matcher : header_matchers) {
bool match = HeaderMatchHelper(header_matcher, initial_metadata, user_agent,
deadline);
bool match = HeaderMatchHelper(header_matcher, args.initial_metadata);
if (header_matcher.invert_match) match = !match;
if (!match) return false;
}
@ -349,16 +325,11 @@ XdsRoutingLb::PickResult XdsRoutingLb::RoutePicker::Pick(PickArgs args) {
// Path matching.
if (!PathMatch(args.path, route.matchers->path_matcher)) continue;
// Header Matching.
if (!HeadersMatch(route.matchers->header_matchers, args.initial_metadata,
user_agent_,
args.call_state->ExperimentalGetCallAttribute(
kCallAttributeDeadline)))
continue;
if (!HeadersMatch(args, route.matchers->header_matchers)) continue;
// Match fraction check
if (route.matchers->fraction_per_million.has_value() &&
!UnderFraction(route.matchers->fraction_per_million.value())) {
!UnderFraction(route.matchers->fraction_per_million.value()))
continue;
}
// Found a match
return route.picker->Pick(args);
}
@ -375,9 +346,7 @@ XdsRoutingLb::PickResult XdsRoutingLb::RoutePicker::Pick(PickArgs args) {
// XdsRoutingLb
//
XdsRoutingLb::XdsRoutingLb(Args args)
: LoadBalancingPolicy(std::move(args)),
user_agent_(GenerateUserAgentFromArgs(args.args, "chttp2")) {}
XdsRoutingLb::XdsRoutingLb(Args args) : LoadBalancingPolicy(std::move(args)) {}
XdsRoutingLb::~XdsRoutingLb() {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_routing_lb_trace)) {
@ -502,8 +471,7 @@ void XdsRoutingLb::UpdateStateLocked() {
}
route_table.push_back(std::move(route));
}
picker = absl::make_unique<RoutePicker>(std::move(route_table),
user_agent_, config_);
picker = absl::make_unique<RoutePicker>(std::move(route_table), config_);
break;
}
case GRPC_CHANNEL_CONNECTING:

@ -31,7 +31,6 @@
#include <grpc/support/log.h>
#include "src/core/ext/filters/http/client/http_client_filter.h"
#include "src/core/ext/filters/http/client/util.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/profiling/timers.h"
@ -529,8 +528,36 @@ static size_t max_payload_size_from_args(const grpc_channel_args* args) {
static grpc_core::ManagedMemorySlice user_agent_from_args(
const grpc_channel_args* args, const char* transport_name) {
return grpc_core::ManagedMemorySlice(
grpc_core::GenerateUserAgentFromArgs(args, transport_name).c_str());
std::vector<std::string> user_agent_fields;
for (size_t i = 0; args && i < args->num_args; i++) {
if (0 == strcmp(args->args[i].key, GRPC_ARG_PRIMARY_USER_AGENT_STRING)) {
if (args->args[i].type != GRPC_ARG_STRING) {
gpr_log(GPR_ERROR, "Channel argument '%s' should be a string",
GRPC_ARG_PRIMARY_USER_AGENT_STRING);
} else {
user_agent_fields.push_back(args->args[i].value.string);
}
}
}
user_agent_fields.push_back(
absl::StrFormat("grpc-c/%s (%s; %s)", grpc_version_string(),
GPR_PLATFORM_STRING, transport_name));
for (size_t i = 0; args && i < args->num_args; i++) {
if (0 == strcmp(args->args[i].key, GRPC_ARG_SECONDARY_USER_AGENT_STRING)) {
if (args->args[i].type != GRPC_ARG_STRING) {
gpr_log(GPR_ERROR, "Channel argument '%s' should be a string",
GRPC_ARG_SECONDARY_USER_AGENT_STRING);
} else {
user_agent_fields.push_back(args->args[i].value.string);
}
}
}
std::string user_agent_string = absl::StrJoin(user_agent_fields, " ");
return grpc_core::ManagedMemorySlice(user_agent_string.c_str());
}
/* Constructor for channel_data */

@ -1,53 +0,0 @@
//
// 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.
//
#include <grpc/support/port_platform.h>
#include "absl/strings/str_format.h"
#include "absl/strings/str_join.h"
#include "src/core/ext/filters/http/client/util.h"
namespace grpc_core {
std::string GenerateUserAgentFromArgs(const grpc_channel_args* args,
const char* transport_name) {
std::vector<std::string> user_agent_fields;
for (size_t i = 0; args && i < args->num_args; i++) {
if (0 == strcmp(args->args[i].key, GRPC_ARG_PRIMARY_USER_AGENT_STRING)) {
if (args->args[i].type != GRPC_ARG_STRING) {
gpr_log(GPR_ERROR, "Channel argument '%s' should be a string",
GRPC_ARG_PRIMARY_USER_AGENT_STRING);
} else {
user_agent_fields.push_back(args->args[i].value.string);
}
}
}
user_agent_fields.push_back(
absl::StrFormat("grpc-c/%s (%s; %s)", grpc_version_string(),
GPR_PLATFORM_STRING, transport_name));
for (size_t i = 0; args && i < args->num_args; i++) {
if (0 == strcmp(args->args[i].key, GRPC_ARG_SECONDARY_USER_AGENT_STRING)) {
if (args->args[i].type != GRPC_ARG_STRING) {
gpr_log(GPR_ERROR, "Channel argument '%s' should be a string",
GRPC_ARG_SECONDARY_USER_AGENT_STRING);
} else {
user_agent_fields.push_back(args->args[i].value.string);
}
}
}
return absl::StrJoin(user_agent_fields, " ");
}
} // namespace grpc_core

@ -1,30 +0,0 @@
//
// 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.
//
#ifndef GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_UTIL_H
#define GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_UTIL_H
#include <grpc/support/port_platform.h>
#include "absl/strings/str_join.h"
#include "src/core/lib/channel/channel_stack.h"
namespace grpc_core {
std::string GenerateUserAgentFromArgs(const grpc_channel_args* args,
const char* transport_name);
} // namespace grpc_core
#endif /* GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_UTIL_H */

@ -93,6 +93,20 @@ bool grpc_is_epollexclusive_available(void) {
close(evfd);
return false;
}
// Check that EPOLLEXCLUSIVE is supported at all.
ev.events = static_cast<uint32_t>(EPOLLET | EPOLLIN | EPOLLEXCLUSIVE);
if (epoll_ctl(fd, EPOLL_CTL_ADD, evfd, &ev) != 0) {
if (!logged_why_not) {
gpr_log(GPR_DEBUG,
"epoll_ctl with EPOLLEXCLUSIVE failed with error: "
"%d. Not using epollex polling engine.",
errno);
logged_why_not = true;
}
close(fd);
close(evfd);
return false;
}
close(evfd);
close(fd);
return true;

@ -32,13 +32,13 @@ WORKDIR /github/grpc
COPY . .
RUN make && make install
RUN make shared_c static_c
WORKDIR /github/grpc/src/php/ext/grpc
RUN phpize && \
./configure --enable-tests && \
GRPC_LIB_SUBDIR=libs/opt ./configure --enable-grpc=/github/grpc --enable-tests && \
make && \
make install

@ -83,7 +83,6 @@ CORE_SOURCE_FILES = [
'src/core/ext/filters/client_idle/client_idle_filter.cc',
'src/core/ext/filters/deadline/deadline_filter.cc',
'src/core/ext/filters/http/client/http_client_filter.cc',
'src/core/ext/filters/http/client/util.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/message_compress_filter.cc',

@ -31,13 +31,13 @@
COPY . .
RUN make && make install
RUN make shared_c static_c
WORKDIR /github/grpc/src/php/ext/grpc
RUN phpize && ${'\\'}
./configure --enable-tests && ${'\\'}
GRPC_LIB_SUBDIR=libs/opt ./configure --enable-grpc=/github/grpc --enable-tests && ${'\\'}
make && ${'\\'}
make install

@ -335,7 +335,8 @@ static void test_channel_args_compression_algorithm_states(void) {
grpc_channel_args_destroy(ch_args);
}
int main(int /*argc*/, char** /*argv*/) {
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();
test_compression_algorithm_parse();
test_compression_algorithm_name();
@ -344,6 +345,5 @@ int main(int /*argc*/, char** /*argv*/) {
test_channel_args_set_compression_algorithm();
test_channel_args_compression_algorithm_states();
grpc_shutdown();
return 0;
}

@ -25,6 +25,7 @@
#include <gtest/gtest.h>
#include "src/core/lib/iomgr/load_file.h"
#include "test/core/util/test_config.h"
#define CA_CERT_PATH "src/core/tsi/test_creds/ca.pem"
#define SERVER_CERT_PATH "src/core/tsi/test_creds/server1.pem"
@ -92,6 +93,7 @@ TEST(GrpcTlsCredentialsOptionsTest, ErrorDetails) {
} // namespace testing
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(argc, argv);
::testing::InitGoogleTest(&argc, argv);
grpc_init();
int ret = RUN_ALL_TESTS();

@ -3608,245 +3608,6 @@ TEST_P(LdsRdsTest, XdsRoutingHeadersMatching) {
gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_ROUTING");
}
TEST_P(LdsRdsTest, XdsRoutingHeadersMatchingSpecialHeaderContentType) {
gpr_setenv("GRPC_XDS_EXPERIMENTAL_ROUTING", "true");
const char* kNewCluster1Name = "new_cluster_1";
const size_t kNumEchoRpcs = 100;
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
// Populate new EDS resources.
AdsServiceImpl::EdsResourceArgs args({
{"locality0", GetBackendPorts(0, 1)},
});
AdsServiceImpl::EdsResourceArgs args1({
{"locality0", GetBackendPorts(1, 2)},
});
balancers_[0]->ads_service()->SetEdsResource(
AdsServiceImpl::BuildEdsResource(args));
balancers_[0]->ads_service()->SetEdsResource(
AdsServiceImpl::BuildEdsResource(args1, kNewCluster1Name));
// Populate new CDS resources.
Cluster new_cluster1 = balancers_[0]->ads_service()->default_cluster();
new_cluster1.set_name(kNewCluster1Name);
balancers_[0]->ads_service()->SetCdsResource(new_cluster1);
// Populating Route Configurations for LDS.
RouteConfiguration route_config =
balancers_[0]->ads_service()->default_route_config();
auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
route1->mutable_match()->set_prefix("");
auto* header_matcher1 = route1->mutable_match()->add_headers();
header_matcher1->set_name("content-type");
header_matcher1->set_exact_match("notapplication/grpc");
route1->mutable_route()->set_cluster(kNewCluster1Name);
auto* default_route = route_config.mutable_virtual_hosts(0)->add_routes();
default_route->mutable_match()->set_prefix("");
auto* header_matcher2 = default_route->mutable_match()->add_headers();
header_matcher2->set_name("content-type");
header_matcher2->set_exact_match("application/grpc");
default_route->mutable_route()->set_cluster(kDefaultResourceName);
SetRouteConfiguration(0, route_config);
// Make sure the backend is up.
WaitForAllBackends(0, 1);
// Send RPCs.
CheckRpcSendOk(kNumEchoRpcs);
EXPECT_EQ(kNumEchoRpcs, backends_[0]->backend_service()->request_count());
EXPECT_EQ(0, backends_[1]->backend_service()->request_count());
const auto& response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::ACKED);
gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_ROUTING");
}
TEST_P(LdsRdsTest, XdsRoutingHeadersMatchingSpecialHeaderUserAgent) {
gpr_setenv("GRPC_XDS_EXPERIMENTAL_ROUTING", "true");
const char* kNewCluster1Name = "new_cluster_1";
const size_t kNumEchoRpcs = 100;
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
// Populate new EDS resources.
AdsServiceImpl::EdsResourceArgs args({
{"locality0", GetBackendPorts(0, 1)},
});
AdsServiceImpl::EdsResourceArgs args1({
{"locality0", GetBackendPorts(1, 2)},
});
balancers_[0]->ads_service()->SetEdsResource(
AdsServiceImpl::BuildEdsResource(args));
balancers_[0]->ads_service()->SetEdsResource(
AdsServiceImpl::BuildEdsResource(args1, kNewCluster1Name));
// Populate new CDS resources.
Cluster new_cluster1 = balancers_[0]->ads_service()->default_cluster();
new_cluster1.set_name(kNewCluster1Name);
balancers_[0]->ads_service()->SetCdsResource(new_cluster1);
// Populating Route Configurations for LDS.
RouteConfiguration route_config =
balancers_[0]->ads_service()->default_route_config();
auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
route1->mutable_match()->set_prefix("");
auto* header_matcher1 = route1->mutable_match()->add_headers();
header_matcher1->set_name("user-agent");
header_matcher1->mutable_safe_regex_match()->set_regex(
"(does-not-match-grpc-c).*");
route1->mutable_route()->set_cluster(kNewCluster1Name);
auto* default_route = route_config.mutable_virtual_hosts(0)->add_routes();
default_route->mutable_match()->set_prefix("");
auto* header_matcher2 = default_route->mutable_match()->add_headers();
header_matcher2->set_name("user-agent");
// user-agent string is a 2-part string like "grpc-c++/1.31.0-dev
// grpc-c/11.0.0".
header_matcher2->mutable_safe_regex_match()->set_regex(
"((grpc-c).*[0-9]+.[0-9]+.[0-9]+.*){2}");
default_route->mutable_route()->set_cluster(kDefaultResourceName);
SetRouteConfiguration(0, route_config);
// Make sure backend is up.
WaitForAllBackends(0, 1);
// Send RPCs.
CheckRpcSendOk(kNumEchoRpcs);
EXPECT_EQ(kNumEchoRpcs, backends_[0]->backend_service()->request_count());
EXPECT_EQ(0, backends_[1]->backend_service()->request_count());
const auto& response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::ACKED);
gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_ROUTING");
}
TEST_P(LdsRdsTest, XdsRoutingHeadersMatchingSpecialHeaderGrpcTimeout) {
gpr_setenv("GRPC_XDS_EXPERIMENTAL_ROUTING", "true");
const char* kNewCluster1Name = "new_cluster_1";
const size_t kNumEchoRpcs = 100;
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
// Populate new EDS resources.
AdsServiceImpl::EdsResourceArgs args({
{"locality0", GetBackendPorts(0, 1)},
});
AdsServiceImpl::EdsResourceArgs args1({
{"locality0", GetBackendPorts(1, 2)},
});
balancers_[0]->ads_service()->SetEdsResource(
AdsServiceImpl::BuildEdsResource(args));
balancers_[0]->ads_service()->SetEdsResource(
AdsServiceImpl::BuildEdsResource(args1, kNewCluster1Name));
// Populate new CDS resources.
Cluster new_cluster1 = balancers_[0]->ads_service()->default_cluster();
new_cluster1.set_name(kNewCluster1Name);
balancers_[0]->ads_service()->SetCdsResource(new_cluster1);
// Populating Route Configurations for LDS.
RouteConfiguration route_config =
balancers_[0]->ads_service()->default_route_config();
auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
route1->mutable_match()->set_prefix("");
auto* header_matcher1 = route1->mutable_match()->add_headers();
header_matcher1->set_name("grpc-timeout");
header_matcher1->mutable_safe_regex_match()->set_regex("[0-9]+(s|h)");
route1->mutable_route()->set_cluster(kNewCluster1Name);
auto* default_route = route_config.mutable_virtual_hosts(0)->add_routes();
default_route->mutable_match()->set_prefix("");
auto* header_matcher2 = default_route->mutable_match()->add_headers();
header_matcher2->set_name("grpc-timeout");
header_matcher2->mutable_safe_regex_match()->set_regex("[0-9]+(m|S|M|H)");
default_route->mutable_route()->set_cluster(kDefaultResourceName);
SetRouteConfiguration(0, route_config);
// Make sure backend is up.
WaitForAllBackends(0, 1);
// Send RPCs.
CheckRpcSendOk(kNumEchoRpcs);
EXPECT_EQ(kNumEchoRpcs, backends_[0]->backend_service()->request_count());
EXPECT_EQ(0, backends_[1]->backend_service()->request_count());
const auto& response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::ACKED);
gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_ROUTING");
}
TEST_P(LdsRdsTest, XdsRoutingHeadersMatchingSpecialCasesToIgnore) {
gpr_setenv("GRPC_XDS_EXPERIMENTAL_ROUTING", "true");
const char* kNewCluster1Name = "new_cluster_1";
const char* kNewCluster2Name = "new_cluster_2";
const char* kNewCluster3Name = "new_cluster_3";
const size_t kNumEcho1Rpcs = 100;
const size_t kNumEchoRpcs = 5;
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
// Populate new EDS resources.
AdsServiceImpl::EdsResourceArgs args({
{"locality0", GetBackendPorts(0, 1)},
});
AdsServiceImpl::EdsResourceArgs args1({
{"locality0", GetBackendPorts(1, 2)},
});
AdsServiceImpl::EdsResourceArgs args2({
{"locality0", GetBackendPorts(2, 3)},
});
AdsServiceImpl::EdsResourceArgs args3({
{"locality0", GetBackendPorts(3, 4)},
});
balancers_[0]->ads_service()->SetEdsResource(
AdsServiceImpl::BuildEdsResource(args));
balancers_[0]->ads_service()->SetEdsResource(
AdsServiceImpl::BuildEdsResource(args1, kNewCluster1Name));
balancers_[0]->ads_service()->SetEdsResource(
AdsServiceImpl::BuildEdsResource(args2, kNewCluster2Name));
balancers_[0]->ads_service()->SetEdsResource(
AdsServiceImpl::BuildEdsResource(args3, kNewCluster3Name));
// Populate new CDS resources.
Cluster new_cluster1 = balancers_[0]->ads_service()->default_cluster();
new_cluster1.set_name(kNewCluster1Name);
balancers_[0]->ads_service()->SetCdsResource(new_cluster1);
Cluster new_cluster2 = balancers_[0]->ads_service()->default_cluster();
new_cluster2.set_name(kNewCluster2Name);
balancers_[0]->ads_service()->SetCdsResource(new_cluster2);
Cluster new_cluster3 = balancers_[0]->ads_service()->default_cluster();
new_cluster1.set_name(kNewCluster3Name);
balancers_[0]->ads_service()->SetCdsResource(new_cluster3);
// Populating Route Configurations for LDS.
RouteConfiguration route_config =
balancers_[0]->ads_service()->default_route_config();
auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
route1->mutable_match()->set_prefix("/grpc.testing.EchoTest1Service/");
auto* header_matcher1 = route1->mutable_match()->add_headers();
header_matcher1->set_name("grpc-tags-bin");
header_matcher1->set_exact_match("grpc-tags-bin");
route1->mutable_route()->set_cluster(kNewCluster1Name);
auto route2 = route_config.mutable_virtual_hosts(0)->add_routes();
route2->mutable_match()->set_prefix("/grpc.testing.EchoTest1Service/");
auto* header_matcher2 = route2->mutable_match()->add_headers();
header_matcher2->set_name("grpc-trace-bin");
header_matcher2->set_exact_match("grpc-trace-bin");
route2->mutable_route()->set_cluster(kNewCluster2Name);
auto route3 = route_config.mutable_virtual_hosts(0)->add_routes();
route3->mutable_match()->set_prefix("/grpc.testing.EchoTest1Service/");
auto* header_matcher3 = route3->mutable_match()->add_headers();
header_matcher3->set_name("grpc-previous-rpc-attempts");
header_matcher3->set_exact_match("grpc-previous-rpc-attempts");
route3->mutable_route()->set_cluster(kNewCluster3Name);
auto* default_route = route_config.mutable_virtual_hosts(0)->add_routes();
default_route->mutable_match()->set_prefix("");
default_route->mutable_route()->set_cluster(kDefaultResourceName);
SetRouteConfiguration(0, route_config);
// Send headers which will mismatch each route
std::vector<std::pair<std::string, std::string>> metadata = {
{"grpc-tags-bin", "grpc-tags-bin"},
{"grpc-trace-bin", "grpc-trace-bin"},
{"grpc-previous-rpc-attempts", "grpc-previous-rpc-attempts"},
};
WaitForAllBackends(0, 1);
CheckRpcSendOk(kNumEchoRpcs, RpcOptions().set_metadata(metadata));
CheckRpcSendOk(kNumEcho1Rpcs, RpcOptions()
.set_rpc_service(SERVICE_ECHO1)
.set_rpc_method(METHOD_ECHO1)
.set_metadata(metadata));
// Verify that only the default backend got RPCs since all previous routes
// were mismatched.
for (size_t i = 1; i < 4; ++i) {
EXPECT_EQ(0, backends_[i]->backend_service()->request_count());
EXPECT_EQ(0, backends_[i]->backend_service1()->request_count());
EXPECT_EQ(0, backends_[i]->backend_service2()->request_count());
}
EXPECT_EQ(kNumEchoRpcs, backends_[0]->backend_service()->request_count());
EXPECT_EQ(kNumEcho1Rpcs, backends_[0]->backend_service1()->request_count());
EXPECT_EQ(0, backends_[0]->backend_service2()->request_count());
const auto& response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::ACKED);
gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_ROUTING");
}
TEST_P(LdsRdsTest, XdsRoutingRuntimeFractionMatching) {
gpr_setenv("GRPC_XDS_EXPERIMENTAL_ROUTING", "true");
const char* kNewCluster1Name = "new_cluster_1";

@ -1183,8 +1183,6 @@ src/core/ext/filters/deadline/deadline_filter.cc \
src/core/ext/filters/deadline/deadline_filter.h \
src/core/ext/filters/http/client/http_client_filter.cc \
src/core/ext/filters/http/client/http_client_filter.h \
src/core/ext/filters/http/client/util.cc \
src/core/ext/filters/http/client/util.h \
src/core/ext/filters/http/client_authority_filter.cc \
src/core/ext/filters/http/client_authority_filter.h \
src/core/ext/filters/http/http_filters_plugin.cc \

@ -990,8 +990,6 @@ src/core/ext/filters/deadline/deadline_filter.cc \
src/core/ext/filters/deadline/deadline_filter.h \
src/core/ext/filters/http/client/http_client_filter.cc \
src/core/ext/filters/http/client/http_client_filter.h \
src/core/ext/filters/http/client/util.cc \
src/core/ext/filters/http/client/util.h \
src/core/ext/filters/http/client_authority_filter.cc \
src/core/ext/filters/http/client_authority_filter.h \
src/core/ext/filters/http/http_filters_plugin.cc \

@ -286,7 +286,7 @@ class PHPArtifact:
def build_jobspec(self):
return create_docker_jobspec(
self.name,
'tools/dockerfile/grpc_artifact_centos6_{}'.format(self.arch),
'tools/dockerfile/test/php73_zts_stretch_{}'.format(self.arch),
'tools/run_tests/artifacts/build_artifact_php.sh')

@ -19,6 +19,14 @@ cd "$(dirname "$0")/../../.."
mkdir -p "${ARTIFACTS_OUT}"
# Build the PHP extension archive (this just zips all the files up)
pear package
# Note: the extension compiled by this step is not being used in any
# way, i.e. they are not the pacakge being distributed.
# This is done here to get an early signal for compiling the PHP
# extension in some form.
find . -name "grpc-*.tgz" | cut -b3- | xargs pecl install
# Verified that the grpc extension is built properly.
php -d extension=grpc.so --re grpc | head -1
cp -r grpc-*.tgz "${ARTIFACTS_OUT}"/

Loading…
Cancel
Save