Merge branch 'master' into wakey

pull/36048/head
Craig Tiller 8 months ago
commit f6d4416685
  1. 2
      .bazelignore
  2. 2
      .bazelversion
  3. 2
      .gitattributes
  4. 297
      BUILD
  5. 319
      BoringSSL-Package.swift
  6. 242
      CMakeLists.txt
  7. 2351
      Makefile
  8. 16
      Package.swift
  9. 1
      Rakefile
  10. 45
      bazel/experiments.bzl
  11. 1
      bazel/grpc_build_system.bzl
  12. 8
      bazel/grpc_deps.bzl
  13. 4
      bazel/supported_versions.txt
  14. 12
      bazel/update_mirror.sh
  15. 110
      build_autogenerated.yaml
  16. 10
      build_handwritten.yaml
  17. 44
      cmake/opentelemetry-cpp.cmake
  18. 22
      config.m4
  19. 22
      config.w32
  20. 4
      doc/bazel_support.md
  21. 79
      examples/cpp/otel/CMakeLists.txt
  22. 9
      examples/cpp/otel/README.md
  23. 4
      examples/cpp/systemd_socket_activation/test.sh
  24. 2
      examples/python/helloworld/helloworld_pb2.py
  25. 25
      examples/python/helloworld/helloworld_pb2_grpc.py
  26. 33
      examples/python/observability/observability_greeter_client.py
  27. 43
      examples/python/observability/observability_greeter_server.py
  28. 20
      gRPC-C++.podspec
  29. 29
      gRPC-Core.podspec
  30. 54
      grpc.gemspec
  31. 2676
      grpc.gyp
  32. 3
      include/grpc/event_engine/event_engine.h
  33. 4
      include/grpc/impl/channel_arg_names.h
  34. 9
      include/grpcpp/impl/codegen/config_protobuf.h
  35. 54
      package.xml
  36. 5
      setup.py
  37. 22
      src/boringssl/boringssl_prefix_symbols.h
  38. 14
      src/compiler/cpp_plugin.h
  39. 15
      src/compiler/csharp_plugin.cc
  40. 15
      src/compiler/objective_c_plugin.cc
  41. 15
      src/compiler/php_plugin.cc
  42. 66
      src/compiler/python_generator.cc
  43. 19
      src/compiler/python_generator.h
  44. 15
      src/compiler/ruby_plugin.cc
  45. 169
      src/core/BUILD
  46. 250
      src/core/client_channel/channel_connectivity.cc
  47. 11
      src/core/client_channel/client_channel_filter.cc
  48. 5
      src/core/client_channel/client_channel_filter.h
  49. 9
      src/core/ext/filters/channel_idle/channel_idle_filter.cc
  50. 9
      src/core/ext/filters/channel_idle/legacy_channel_idle_filter.cc
  51. 15
      src/core/ext/filters/http/message_compress/compression_filter.cc
  52. 3
      src/core/ext/filters/http/message_compress/compression_filter.h
  53. 13
      src/core/ext/filters/http/message_compress/legacy_compression_filter.cc
  54. 3
      src/core/ext/filters/http/message_compress/legacy_compression_filter.h
  55. 23
      src/core/ext/filters/message_size/message_size_filter.cc
  56. 9
      src/core/ext/transport/binder/client/channel_create_impl.cc
  57. 20
      src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc
  58. 36
      src/core/ext/transport/chaotic_good/server/chaotic_good_server.cc
  59. 108
      src/core/ext/transport/chaotic_good/server_transport.cc
  60. 8
      src/core/ext/transport/chaotic_good/server_transport.h
  61. 10
      src/core/ext/transport/chttp2/client/chttp2_connector.cc
  62. 39
      src/core/ext/transport/chttp2/server/chttp2_server.cc
  63. 2
      src/core/ext/transport/cronet/BUILD
  64. 5
      src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc
  65. 9
      src/core/ext/transport/inproc/inproc_transport.cc
  66. 3
      src/core/ext/transport/inproc/legacy_inproc_transport.cc
  67. 6
      src/core/ext/xds/xds_bootstrap.h
  68. 14
      src/core/ext/xds/xds_bootstrap_grpc.cc
  69. 19
      src/core/ext/xds/xds_bootstrap_grpc.h
  70. 5
      src/core/ext/xds/xds_client.cc
  71. 12
      src/core/ext/xds/xds_client_stats.h
  72. 47
      src/core/ext/xds/xds_transport_grpc.cc
  73. 6
      src/core/ext/xds/xds_transport_grpc.h
  74. 2
      src/core/lib/channel/call_finalization.h
  75. 7
      src/core/lib/channel/call_tracer.h
  76. 3
      src/core/lib/channel/channelz.h
  77. 145
      src/core/lib/channel/metrics.cc
  78. 137
      src/core/lib/channel/metrics.h
  79. 33
      src/core/lib/compression/compression_internal.cc
  80. 3
      src/core/lib/compression/compression_internal.h
  81. 10
      src/core/lib/config/config_vars.cc
  82. 4
      src/core/lib/config/config_vars.h
  83. 5
      src/core/lib/config/config_vars.yaml
  84. 228
      src/core/lib/debug/stats_data.cc
  85. 108
      src/core/lib/debug/stats_data.h
  86. 57
      src/core/lib/debug/stats_data.yaml
  87. 45
      src/core/lib/event_engine/extensions/chaotic_good_extension.h
  88. 8
      src/core/lib/event_engine/posix.h
  89. 75
      src/core/lib/experiments/experiments.cc
  90. 44
      src/core/lib/experiments/experiments.h
  91. 25
      src/core/lib/experiments/experiments.yaml
  92. 8
      src/core/lib/experiments/rollouts.yaml
  93. 2
      src/core/lib/gpr/android/log.cc
  94. 2
      src/core/lib/gpr/linux/log.cc
  95. 26
      src/core/lib/gpr/log.cc
  96. 2
      src/core/lib/gpr/posix/log.cc
  97. 60
      src/core/lib/gpr/posix/time.cc
  98. 2
      src/core/lib/gpr/windows/log.cc
  99. 71
      src/core/lib/resource_quota/connection_quota.cc
  100. 61
      src/core/lib/resource_quota/connection_quota.h
  101. Some files were not shown because too many files have changed in this diff Show More

@ -14,10 +14,12 @@ third_party/envoy-api
third_party/googleapis
third_party/googletest
third_party/opencensus-proto
third_party/opentelemetry-cpp
third_party/protobuf
third_party/protoc-gen-validate
third_party/re2
third_party/upb
third_party/utf8_range
third_party/xds
test/distrib/bazel/cpp

@ -1 +1 @@
6.4.0
6.5.0

2
.gitattributes vendored

@ -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

297
BUILD

@ -554,6 +554,7 @@ grpc_cc_library(
],
visibility = ["@grpc:public"],
deps = [
"api_trace",
"channel_arg_names",
"channel_stack_builder",
"config",
@ -567,6 +568,7 @@ grpc_cc_library(
"grpc_trace",
"http_connect_handshaker",
"iomgr_timer",
"server",
"//src/core:channel_args",
"//src/core:channel_init",
"//src/core:channel_stack_type",
@ -578,6 +580,7 @@ grpc_cc_library(
"//src/core:http_proxy_mapper",
"//src/core:init_internally",
"//src/core:posix_event_engine_timer_manager",
"//src/core:server_call_tracer_filter",
"//src/core:service_config_channel_arg_filter",
"//src/core:slice",
"//src/core:tcp_connect_handshaker",
@ -629,6 +632,7 @@ grpc_cc_library(
"@grpc:public",
],
deps = [
"api_trace",
"channel_arg_names",
"channel_stack_builder",
"config",
@ -649,6 +653,7 @@ grpc_cc_library(
"iomgr_timer",
"promise",
"ref_counted_ptr",
"server",
"sockaddr_utils",
"tsi_base",
"uri_parser",
@ -676,6 +681,7 @@ grpc_cc_library(
"//src/core:json",
"//src/core:posix_event_engine_timer_manager",
"//src/core:ref_counted",
"//src/core:server_call_tracer_filter",
"//src/core:service_config_channel_arg_filter",
"//src/core:slice",
"//src/core:slice_refcount",
@ -740,7 +746,9 @@ grpc_cc_library(
external_deps = [
"absl/base",
"absl/base:core_headers",
"absl/base:log_severity",
"absl/functional:any_invocable",
"absl/log",
"absl/memory",
"absl/random",
"absl/status",
@ -1101,6 +1109,9 @@ grpc_cc_library(
],
tags = ["nofixdeps"],
deps = [
"api_trace",
"channel",
"channel_create",
"config",
"debug_location",
"exec_ctx",
@ -1113,6 +1124,7 @@ grpc_cc_library(
"grpc_public_hdrs",
"orphanable",
"ref_counted_ptr",
"server",
"//src/core:arena",
"//src/core:channel_args",
"//src/core:channel_args_preconditioning",
@ -1251,6 +1263,7 @@ grpc_cc_library(
],
visibility = ["@grpc:public"],
deps = [
"api_trace",
"gpr",
"grpc_base",
"grpc_public_hdrs",
@ -1405,6 +1418,21 @@ grpc_cc_library(
],
)
grpc_cc_library(
name = "api_trace",
srcs = [
"//src/core:lib/surface/api_trace.cc",
],
hdrs = [
"//src/core:lib/surface/api_trace.h",
],
language = "c++",
deps = [
"gpr",
"grpc_trace",
],
)
grpc_cc_library(
name = "byte_buffer",
srcs = [
@ -1416,6 +1444,7 @@ grpc_cc_library(
"exec_ctx",
"gpr_public_hdrs",
"grpc_public_hdrs",
"//src/core:compression",
"//src/core:slice",
],
)
@ -1626,31 +1655,253 @@ grpc_cc_library(
)
grpc_cc_library(
name = "grpc_base",
name = "call_tracer",
srcs = [
"//src/core:lib/channel/call_tracer.cc",
],
hdrs = [
"//src/core:lib/channel/call_tracer.h",
],
external_deps = [
"absl/status",
"absl/strings",
],
language = "c++",
visibility = ["@grpc:alt_grpc_base_legacy"],
deps = [
"config",
"gpr",
"legacy_context",
"tcp_tracer",
"//src/core:arena",
"//src/core:call_final_info",
"//src/core:channel_args",
"//src/core:context",
"//src/core:error",
"//src/core:metadata_batch",
"//src/core:slice_buffer",
],
)
grpc_cc_library(
name = "channel",
srcs = [
"//src/core:lib/surface/channel.cc",
],
hdrs = [
"//src/core:lib/surface/channel.h",
],
external_deps = [
"absl/base:core_headers",
"absl/status:statusor",
"absl/strings",
"absl/types:optional",
],
language = "c++",
visibility = ["@grpc:alt_grpc_base_legacy"],
deps = [
"api_trace",
"channel_arg_names",
"channelz",
"cpp_impl_of",
"event_engine_base_hdrs",
"exec_ctx",
"gpr",
"grpc_public_hdrs",
"grpc_trace",
"orphanable",
"ref_counted_ptr",
"stats",
"//src/core:arena",
"//src/core:channel_args",
"//src/core:channel_stack_type",
"//src/core:compression",
"//src/core:connectivity_state",
"//src/core:iomgr_fwd",
"//src/core:ref_counted",
"//src/core:slice",
"//src/core:stats_data",
"//src/core:time",
],
)
grpc_cc_library(
name = "legacy_channel",
srcs = [
"//src/core:lib/surface/legacy_channel.cc",
],
hdrs = [
"//src/core:lib/surface/legacy_channel.h",
],
external_deps = [
"absl/base:core_headers",
"absl/status",
"absl/status:statusor",
"absl/types:optional",
],
language = "c++",
visibility = ["@grpc:alt_grpc_base_legacy"],
deps = [
"api_trace",
"channel",
"channelz",
"config",
"exec_ctx",
"gpr",
"grpc_base",
"grpc_client_channel",
"ref_counted_ptr",
"stats",
"//src/core:arena",
"//src/core:call_factory",
"//src/core:channel_args",
"//src/core:channel_fwd",
"//src/core:channel_init",
"//src/core:channel_stack_type",
"//src/core:closure",
"//src/core:dual_ref_counted",
"//src/core:error",
"//src/core:init_internally",
"//src/core:iomgr_fwd",
"//src/core:metrics",
"//src/core:slice",
"//src/core:stats_data",
"//src/core:time",
],
)
grpc_cc_library(
name = "channel_create",
srcs = [
"//src/core:lib/surface/channel_create.cc",
],
hdrs = [
"//src/core:lib/surface/channel_create.h",
],
external_deps = [
"absl/base:core_headers",
"absl/status:statusor",
"absl/strings",
"absl/types:optional",
],
language = "c++",
visibility = ["@grpc:alt_grpc_base_legacy"],
deps = [
"channel",
"channel_arg_names",
"channelz",
"gpr",
"grpc_base",
"grpc_public_hdrs",
"legacy_channel",
"ref_counted_ptr",
"stats",
"//src/core:arena",
"//src/core:channel_args",
"//src/core:channel_stack_type",
"//src/core:iomgr_fwd",
"//src/core:ref_counted",
"//src/core:slice",
"//src/core:stats_data",
],
)
grpc_cc_library(
name = "server",
srcs = [
"//src/core:lib/surface/server.cc",
],
hdrs = [
"//src/core:lib/surface/server.h",
],
external_deps = [
"absl/base:core_headers",
"absl/cleanup",
"absl/container:flat_hash_map",
"absl/container:flat_hash_set",
"absl/hash",
"absl/random",
"absl/status",
"absl/status:statusor",
"absl/strings",
"absl/types:optional",
],
language = "c++",
visibility = ["@grpc:alt_grpc_base_legacy"],
deps = [
"api_trace",
"call_combiner",
"call_tracer",
"channel",
"channel_arg_names",
"channelz",
"config",
"cpp_impl_of",
"debug_location",
"exec_ctx",
"gpr",
"grpc_base",
"grpc_public_hdrs",
"grpc_trace",
"iomgr",
"legacy_channel",
"orphanable",
"promise",
"ref_counted_ptr",
"stats",
"//src/core:1999",
"//src/core:activity",
"//src/core:arena",
"//src/core:arena_promise",
"//src/core:cancel_callback",
"//src/core:channel_args",
"//src/core:channel_args_preconditioning",
"//src/core:channel_fwd",
"//src/core:channel_stack_type",
"//src/core:closure",
"//src/core:connectivity_state",
"//src/core:context",
"//src/core:dual_ref_counted",
"//src/core:error",
"//src/core:error_utils",
"//src/core:experiments",
"//src/core:iomgr_fwd",
"//src/core:map",
"//src/core:metadata_batch",
"//src/core:pipe",
"//src/core:poll",
"//src/core:pollset_set",
"//src/core:random_early_detection",
"//src/core:seq",
"//src/core:server_interface",
"//src/core:slice",
"//src/core:slice_buffer",
"//src/core:status_helper",
"//src/core:time",
"//src/core:try_join",
"//src/core:try_seq",
"//src/core:useful",
],
)
grpc_cc_library(
name = "grpc_base",
srcs = [
"//src/core:lib/channel/channel_stack.cc",
"//src/core:lib/channel/channel_stack_builder_impl.cc",
"//src/core:lib/channel/connected_channel.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/message_compress.cc",
"//src/core:lib/slice/b64.cc",
"//src/core:lib/surface/api_trace.cc",
"//src/core:lib/surface/builtins.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_ping.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/lame_client.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",
@ -1659,8 +1910,6 @@ grpc_cc_library(
"//src/core:lib/transport/transport_op_string.cc",
],
hdrs = [
"//src/core:lib/channel/call_finalization.h",
"//src/core:lib/channel/call_tracer.h",
"//src/core:lib/channel/channel_stack.h",
"//src/core:lib/channel/channel_stack_builder_impl.h",
"//src/core:lib/channel/connected_channel.h",
@ -1668,17 +1917,13 @@ grpc_cc_library(
"//src/core:lib/channel/status_util.h",
"//src/core:lib/compression/message_compress.h",
"//src/core:lib/slice/b64.h",
"//src/core:lib/surface/api_trace.h",
"//src/core:lib/surface/builtins.h",
"//src/core:lib/surface/call.h",
"//src/core:lib/surface/call_test_only.h",
"//src/core:lib/surface/channel.h",
"//src/core:lib/surface/completion_queue.h",
"//src/core:lib/surface/completion_queue_factory.h",
"//src/core:lib/surface/event_string.h",
"//src/core:lib/surface/init.h",
"//src/core:lib/surface/lame_client.h",
"//src/core:lib/surface/server.h",
"//src/core:lib/surface/validate_metadata.h",
"//src/core:lib/surface/wait_for_cq_end_op.h",
"//src/core:lib/transport/batch_builder.h",
@ -1716,9 +1961,12 @@ grpc_cc_library(
public_hdrs = GRPC_PUBLIC_HDRS + GRPC_PUBLIC_EVENT_ENGINE_HDRS,
visibility = ["@grpc:alt_grpc_base_legacy"],
deps = [
"api_trace",
"byte_buffer",
"call_combiner",
"call_trace",
"call_tracer",
"channel",
"channel_arg_names",
"channel_stack_builder",
"channelz",
@ -1755,6 +2003,7 @@ grpc_cc_library(
"//src/core:call_factory",
"//src/core:call_filters",
"//src/core:call_final_info",
"//src/core:call_finalization",
"//src/core:call_spine",
"//src/core:cancel_callback",
"//src/core:channel_args",
@ -1765,7 +2014,7 @@ grpc_cc_library(
"//src/core:channel_stack_trace",
"//src/core:channel_stack_type",
"//src/core:closure",
"//src/core:compression_internal",
"//src/core:compression",
"//src/core:connectivity_state",
"//src/core:construct_destruct",
"//src/core:context",
@ -1818,6 +2067,7 @@ grpc_cc_library(
"//src/core:resource_quota",
"//src/core:resource_quota_trace",
"//src/core:seq",
"//src/core:server_interface",
"//src/core:slice",
"//src/core:slice_buffer",
"//src/core:slice_cast",
@ -2013,6 +2263,7 @@ grpc_cc_library(
public_hdrs = GRPC_PUBLIC_HDRS,
visibility = ["@grpc:public"],
deps = [
"api_trace",
"call_trace",
"channel_arg_names",
"channelz",
@ -2196,6 +2447,7 @@ grpc_cc_library(
"legacy_context",
"ref_counted_ptr",
"resource_quota_api",
"server",
"//src/core:arena",
"//src/core:channel_args",
"//src/core:channel_fwd",
@ -2274,6 +2526,7 @@ grpc_cc_library(
"legacy_context",
"ref_counted_ptr",
"resource_quota_api",
"server",
"//src/core:arena",
"//src/core:channel_args",
"//src/core:channel_init",
@ -2539,6 +2792,7 @@ grpc_cc_library(
],
visibility = ["@grpc:grpc++_test"],
deps = [
"channel",
"grpc++",
"grpc_base",
],
@ -2585,6 +2839,7 @@ grpc_cc_library(
language = "c++",
visibility = ["@grpc:grpc_opencensus_plugin"],
deps = [
"call_tracer",
"config",
"gpr",
"grpc++_base",
@ -3313,7 +3568,6 @@ grpc_cc_library(
grpc_cc_library(
name = "grpc_client_channel",
srcs = [
"//src/core:client_channel/channel_connectivity.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",
@ -3356,8 +3610,10 @@ grpc_cc_library(
language = "c++",
visibility = ["@grpc:client_channel"],
deps = [
"api_trace",
"backoff",
"call_combiner",
"call_tracer",
"channel_arg_names",
"channelz",
"config",
@ -3670,6 +3926,7 @@ grpc_cc_library(
language = "c++",
visibility = ["@grpc:public"],
deps = [
"api_trace",
"exec_ctx",
"gpr",
"grpc_base",
@ -3757,6 +4014,9 @@ grpc_cc_library(
deps = [
"alts_upb",
"alts_util",
"channel",
"channel_create",
"exec_ctx",
"gpr",
"grpc_base",
"grpc_security_base",
@ -3921,6 +4181,7 @@ grpc_cc_library(
visibility = ["@grpc:http"],
deps = [
"call_trace",
"call_tracer",
"channel_arg_names",
"config",
"gpr",
@ -3935,7 +4196,7 @@ grpc_cc_library(
"//src/core:channel_args",
"//src/core:channel_fwd",
"//src/core:channel_stack_type",
"//src/core:compression_internal",
"//src/core:compression",
"//src/core:context",
"//src/core:experiments",
"//src/core:grpc_message_size_filter",
@ -4217,6 +4478,7 @@ grpc_cc_library(
"absl/types:variant",
],
deps = [
"call_tracer",
"chttp2_legacy_frame",
"gpr",
"gpr_platform",
@ -4367,6 +4629,7 @@ grpc_cc_library(
language = "c++",
visibility = ["@grpc:grpclb"],
deps = [
"call_tracer",
"channel_arg_names",
"channelz",
"chttp2_context_list_entry",

@ -0,0 +1,319 @@
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
import Foundation
let basePath = "third_party/boringssl-with-bazel"
let privacyInfoPath = "../../src/objective-c/PrivacyInfo.xcprivacy"
let testPath = "test/boringssl_spm_build"
let package = Package(
name: "BoringSSL-GRPC",
products: [
.library(
name: "openssl_grpc",
targets: ["openssl_grpc"]
)
],
targets: [
.target(
name: "openssl_grpc",
path: basePath,
exclude: [
],
sources: [
"err_data.c",
"src/crypto/asn1/a_bitstr.c",
"src/crypto/asn1/a_bool.c",
"src/crypto/asn1/a_d2i_fp.c",
"src/crypto/asn1/a_dup.c",
"src/crypto/asn1/a_gentm.c",
"src/crypto/asn1/a_i2d_fp.c",
"src/crypto/asn1/a_int.c",
"src/crypto/asn1/a_mbstr.c",
"src/crypto/asn1/a_object.c",
"src/crypto/asn1/a_octet.c",
"src/crypto/asn1/a_strex.c",
"src/crypto/asn1/a_strnid.c",
"src/crypto/asn1/a_time.c",
"src/crypto/asn1/a_type.c",
"src/crypto/asn1/a_utctm.c",
"src/crypto/asn1/asn1_lib.c",
"src/crypto/asn1/asn1_par.c",
"src/crypto/asn1/asn_pack.c",
"src/crypto/asn1/f_int.c",
"src/crypto/asn1/f_string.c",
"src/crypto/asn1/posix_time.c",
"src/crypto/asn1/tasn_dec.c",
"src/crypto/asn1/tasn_enc.c",
"src/crypto/asn1/tasn_fre.c",
"src/crypto/asn1/tasn_new.c",
"src/crypto/asn1/tasn_typ.c",
"src/crypto/asn1/tasn_utl.c",
"src/crypto/base64/base64.c",
"src/crypto/bio/bio.c",
"src/crypto/bio/bio_mem.c",
"src/crypto/bio/connect.c",
"src/crypto/bio/errno.c",
"src/crypto/bio/fd.c",
"src/crypto/bio/file.c",
"src/crypto/bio/hexdump.c",
"src/crypto/bio/pair.c",
"src/crypto/bio/printf.c",
"src/crypto/bio/socket.c",
"src/crypto/bio/socket_helper.c",
"src/crypto/blake2/blake2.c",
"src/crypto/bn_extra/bn_asn1.c",
"src/crypto/bn_extra/convert.c",
"src/crypto/buf/buf.c",
"src/crypto/bytestring/asn1_compat.c",
"src/crypto/bytestring/ber.c",
"src/crypto/bytestring/cbb.c",
"src/crypto/bytestring/cbs.c",
"src/crypto/bytestring/unicode.c",
"src/crypto/chacha/chacha.c",
"src/crypto/cipher_extra/cipher_extra.c",
"src/crypto/cipher_extra/derive_key.c",
"src/crypto/cipher_extra/e_aesctrhmac.c",
"src/crypto/cipher_extra/e_aesgcmsiv.c",
"src/crypto/cipher_extra/e_chacha20poly1305.c",
"src/crypto/cipher_extra/e_des.c",
"src/crypto/cipher_extra/e_null.c",
"src/crypto/cipher_extra/e_rc2.c",
"src/crypto/cipher_extra/e_rc4.c",
"src/crypto/cipher_extra/e_tls.c",
"src/crypto/cipher_extra/tls_cbc.c",
"src/crypto/conf/conf.c",
"src/crypto/cpu_aarch64_apple.c",
"src/crypto/cpu_aarch64_fuchsia.c",
"src/crypto/cpu_aarch64_linux.c",
"src/crypto/cpu_aarch64_openbsd.c",
"src/crypto/cpu_aarch64_sysreg.c",
"src/crypto/cpu_aarch64_win.c",
"src/crypto/cpu_arm_freebsd.c",
"src/crypto/cpu_arm_linux.c",
"src/crypto/cpu_intel.c",
"src/crypto/crypto.c",
"src/crypto/curve25519/curve25519.c",
"src/crypto/curve25519/curve25519_64_adx.c",
"src/crypto/curve25519/spake25519.c",
"src/crypto/des/des.c",
"src/crypto/dh_extra/dh_asn1.c",
"src/crypto/dh_extra/params.c",
"src/crypto/digest_extra/digest_extra.c",
"src/crypto/dsa/dsa.c",
"src/crypto/dsa/dsa_asn1.c",
"src/crypto/ec_extra/ec_asn1.c",
"src/crypto/ec_extra/ec_derive.c",
"src/crypto/ec_extra/hash_to_curve.c",
"src/crypto/ecdh_extra/ecdh_extra.c",
"src/crypto/ecdsa_extra/ecdsa_asn1.c",
"src/crypto/engine/engine.c",
"src/crypto/err/err.c",
"src/crypto/evp/evp.c",
"src/crypto/evp/evp_asn1.c",
"src/crypto/evp/evp_ctx.c",
"src/crypto/evp/p_dsa_asn1.c",
"src/crypto/evp/p_ec.c",
"src/crypto/evp/p_ec_asn1.c",
"src/crypto/evp/p_ed25519.c",
"src/crypto/evp/p_ed25519_asn1.c",
"src/crypto/evp/p_hkdf.c",
"src/crypto/evp/p_rsa.c",
"src/crypto/evp/p_rsa_asn1.c",
"src/crypto/evp/p_x25519.c",
"src/crypto/evp/p_x25519_asn1.c",
"src/crypto/evp/pbkdf.c",
"src/crypto/evp/print.c",
"src/crypto/evp/scrypt.c",
"src/crypto/evp/sign.c",
"src/crypto/ex_data.c",
"src/crypto/fipsmodule/bcm.c",
"src/crypto/fipsmodule/fips_shared_support.c",
"src/crypto/hpke/hpke.c",
"src/crypto/hrss/hrss.c",
"src/crypto/keccak/keccak.c",
"src/crypto/kyber/kyber.c",
"src/crypto/lhash/lhash.c",
"src/crypto/mem.c",
"src/crypto/obj/obj.c",
"src/crypto/obj/obj_xref.c",
"src/crypto/pem/pem_all.c",
"src/crypto/pem/pem_info.c",
"src/crypto/pem/pem_lib.c",
"src/crypto/pem/pem_oth.c",
"src/crypto/pem/pem_pk8.c",
"src/crypto/pem/pem_pkey.c",
"src/crypto/pem/pem_x509.c",
"src/crypto/pem/pem_xaux.c",
"src/crypto/pkcs7/pkcs7.c",
"src/crypto/pkcs7/pkcs7_x509.c",
"src/crypto/pkcs8/p5_pbev2.c",
"src/crypto/pkcs8/pkcs8.c",
"src/crypto/pkcs8/pkcs8_x509.c",
"src/crypto/poly1305/poly1305.c",
"src/crypto/poly1305/poly1305_arm.c",
"src/crypto/poly1305/poly1305_vec.c",
"src/crypto/pool/pool.c",
"src/crypto/rand_extra/deterministic.c",
"src/crypto/rand_extra/forkunsafe.c",
"src/crypto/rand_extra/getentropy.c",
"src/crypto/rand_extra/ios.c",
"src/crypto/rand_extra/passive.c",
"src/crypto/rand_extra/rand_extra.c",
"src/crypto/rand_extra/trusty.c",
"src/crypto/rand_extra/windows.c",
"src/crypto/rc4/rc4.c",
"src/crypto/refcount.c",
"src/crypto/rsa_extra/rsa_asn1.c",
"src/crypto/rsa_extra/rsa_crypt.c",
"src/crypto/rsa_extra/rsa_print.c",
"src/crypto/siphash/siphash.c",
"src/crypto/spx/address.c",
"src/crypto/spx/fors.c",
"src/crypto/spx/merkle.c",
"src/crypto/spx/spx.c",
"src/crypto/spx/spx_util.c",
"src/crypto/spx/thash.c",
"src/crypto/spx/wots.c",
"src/crypto/stack/stack.c",
"src/crypto/thread.c",
"src/crypto/thread_none.c",
"src/crypto/thread_pthread.c",
"src/crypto/thread_win.c",
"src/crypto/trust_token/pmbtoken.c",
"src/crypto/trust_token/trust_token.c",
"src/crypto/trust_token/voprf.c",
"src/crypto/x509/a_digest.c",
"src/crypto/x509/a_sign.c",
"src/crypto/x509/a_verify.c",
"src/crypto/x509/algorithm.c",
"src/crypto/x509/asn1_gen.c",
"src/crypto/x509/by_dir.c",
"src/crypto/x509/by_file.c",
"src/crypto/x509/i2d_pr.c",
"src/crypto/x509/name_print.c",
"src/crypto/x509/policy.c",
"src/crypto/x509/rsa_pss.c",
"src/crypto/x509/t_crl.c",
"src/crypto/x509/t_req.c",
"src/crypto/x509/t_x509.c",
"src/crypto/x509/t_x509a.c",
"src/crypto/x509/v3_akey.c",
"src/crypto/x509/v3_akeya.c",
"src/crypto/x509/v3_alt.c",
"src/crypto/x509/v3_bcons.c",
"src/crypto/x509/v3_bitst.c",
"src/crypto/x509/v3_conf.c",
"src/crypto/x509/v3_cpols.c",
"src/crypto/x509/v3_crld.c",
"src/crypto/x509/v3_enum.c",
"src/crypto/x509/v3_extku.c",
"src/crypto/x509/v3_genn.c",
"src/crypto/x509/v3_ia5.c",
"src/crypto/x509/v3_info.c",
"src/crypto/x509/v3_int.c",
"src/crypto/x509/v3_lib.c",
"src/crypto/x509/v3_ncons.c",
"src/crypto/x509/v3_ocsp.c",
"src/crypto/x509/v3_pcons.c",
"src/crypto/x509/v3_pmaps.c",
"src/crypto/x509/v3_prn.c",
"src/crypto/x509/v3_purp.c",
"src/crypto/x509/v3_skey.c",
"src/crypto/x509/v3_utl.c",
"src/crypto/x509/x509.c",
"src/crypto/x509/x509_att.c",
"src/crypto/x509/x509_cmp.c",
"src/crypto/x509/x509_d2.c",
"src/crypto/x509/x509_def.c",
"src/crypto/x509/x509_ext.c",
"src/crypto/x509/x509_lu.c",
"src/crypto/x509/x509_obj.c",
"src/crypto/x509/x509_req.c",
"src/crypto/x509/x509_set.c",
"src/crypto/x509/x509_trs.c",
"src/crypto/x509/x509_txt.c",
"src/crypto/x509/x509_v3.c",
"src/crypto/x509/x509_vfy.c",
"src/crypto/x509/x509_vpm.c",
"src/crypto/x509/x509cset.c",
"src/crypto/x509/x509name.c",
"src/crypto/x509/x509rset.c",
"src/crypto/x509/x509spki.c",
"src/crypto/x509/x_algor.c",
"src/crypto/x509/x_all.c",
"src/crypto/x509/x_attrib.c",
"src/crypto/x509/x_crl.c",
"src/crypto/x509/x_exten.c",
"src/crypto/x509/x_name.c",
"src/crypto/x509/x_pubkey.c",
"src/crypto/x509/x_req.c",
"src/crypto/x509/x_sig.c",
"src/crypto/x509/x_spki.c",
"src/crypto/x509/x_val.c",
"src/crypto/x509/x_x509.c",
"src/crypto/x509/x_x509a.c",
"src/ssl/bio_ssl.cc",
"src/ssl/d1_both.cc",
"src/ssl/d1_lib.cc",
"src/ssl/d1_pkt.cc",
"src/ssl/d1_srtp.cc",
"src/ssl/dtls_method.cc",
"src/ssl/dtls_record.cc",
"src/ssl/encrypted_client_hello.cc",
"src/ssl/extensions.cc",
"src/ssl/handoff.cc",
"src/ssl/handshake.cc",
"src/ssl/handshake_client.cc",
"src/ssl/handshake_server.cc",
"src/ssl/s3_both.cc",
"src/ssl/s3_lib.cc",
"src/ssl/s3_pkt.cc",
"src/ssl/ssl_aead_ctx.cc",
"src/ssl/ssl_asn1.cc",
"src/ssl/ssl_buffer.cc",
"src/ssl/ssl_cert.cc",
"src/ssl/ssl_cipher.cc",
"src/ssl/ssl_file.cc",
"src/ssl/ssl_key_share.cc",
"src/ssl/ssl_lib.cc",
"src/ssl/ssl_privkey.cc",
"src/ssl/ssl_session.cc",
"src/ssl/ssl_stat.cc",
"src/ssl/ssl_transcript.cc",
"src/ssl/ssl_versions.cc",
"src/ssl/ssl_x509.cc",
"src/ssl/t1_enc.cc",
"src/ssl/tls13_both.cc",
"src/ssl/tls13_client.cc",
"src/ssl/tls13_enc.cc",
"src/ssl/tls13_server.cc",
"src/ssl/tls_method.cc",
"src/ssl/tls_record.cc",
],
resources: [
.copy(privacyInfoPath),
],
publicHeadersPath: "src/include",
cSettings: [
.define("OPENSSL_NO_ASM", to: "1"),
.headerSearchPath("./"),
.headerSearchPath("include/"),
]
),
.testTarget(
name: "build-test",
dependencies: [
"openssl_grpc",
],
path: testPath
),
],
cxxLanguageStandard: .cxx14
)

242
CMakeLists.txt generated

@ -97,6 +97,7 @@ set(gRPC_ABSL_PROVIDER "module" CACHE STRING "Provider of absl library")
set_property(CACHE gRPC_ABSL_PROVIDER PROPERTY STRINGS "module" "package")
set(gRPC_ABSL_USED_TARGETS
absl_absl_vlog_is_on
absl_algorithm
absl_algorithm_container
absl_any_invocable
@ -135,6 +136,7 @@ set(gRPC_ABSL_USED_TARGETS
absl_dynamic_annotations
absl_endian
absl_errno_saver
absl_examine_stack
absl_exponential_biased
absl_fast_type_id
absl_fixed_array
@ -163,7 +165,26 @@ set(gRPC_ABSL_USED_TARGETS
absl_int128
absl_kernel_timeout_internal
absl_layout
absl_log
absl_log_entry
absl_log_globals
absl_log_internal_append_truncated
absl_log_internal_conditions
absl_log_internal_config
absl_log_internal_fnmatch
absl_log_internal_format
absl_log_internal_globals
absl_log_internal_log_impl
absl_log_internal_log_sink_set
absl_log_internal_message
absl_log_internal_nullguard
absl_log_internal_nullstream
absl_log_internal_proto
absl_log_internal_strip
absl_log_internal_voidify
absl_log_severity
absl_log_sink
absl_log_sink_registry
absl_low_level_hash
absl_malloc_internal
absl_memory
@ -221,14 +242,25 @@ set(gRPC_ABSL_USED_TARGETS
absl_type_traits
absl_utility
absl_variant
absl_vlog_config_internal
absl_vlog_is_on
absl_meta
)
# The OpenTelemetry plugin supports "package" build only at present.
set(gRPC_OPENTELEMETRY_PROVIDER "package")
# set(gRPC_OPENTELEMETRY_PROVIDER "module" CACHE STRING "Provider of opentelemetry library")
# set_property(CACHE gRPC_OPENTELEMETRY_PROVIDER PROPERTY STRINGS "module" "package")
set(gRPC_USE_PROTO_LITE OFF CACHE BOOL "Use the protobuf-lite library")
if(UNIX)
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(_gRPC_PLATFORM_LINUX ON)
if(NOT CMAKE_CROSSCOMPILING AND CMAKE_SIZEOF_VOID_P EQUAL 4)
message("+++ Enabling SSE2 for ${CMAKE_SYSTEM_PROCESSOR}")
set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} -msse2")
endif()
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(_gRPC_PLATFORM_MAC ON)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "iOS")
@ -348,6 +380,11 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
set(_gRPC_ALLTARGETS_LIBRARIES ${_gRPC_ALLTARGETS_LIBRARIES} ${_gRPC_SYSTEMD_LIBRARIES})
endif()
option(gRPC_BUILD_GRPCPP_OTEL_PLUGIN "Build grpcpp_otel_plugin" OFF)
if(gRPC_BUILD_GRPCPP_OTEL_PLUGIN)
include(cmake/opentelemetry-cpp.cmake)
endif()
# Setup external proto library at third_party/envoy-api with 2 download URLs
if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/envoy-api AND gRPC_DOWNLOAD_ARCHIVES)
# Download the archive via HTTP, validate the checksum, and extract to third_party/envoy-api.
@ -1610,7 +1647,6 @@ if(gRPC_INSTALL)
endif()
add_library(gpr
src/core/lib/config/config_vars.cc
src/core/lib/config/config_vars_non_generated.cc
@ -1700,9 +1736,11 @@ target_link_libraries(gpr
${_gRPC_ALLTARGETS_LIBRARIES}
absl::base
absl::core_headers
absl::log_severity
absl::flags
absl::flags_marshalling
absl::any_invocable
absl::log
absl::memory
absl::random_random
absl::status
@ -1775,10 +1813,8 @@ if(gRPC_INSTALL)
endif()
add_library(grpc
src/core/client_channel/backup_poller.cc
src/core/client_channel/channel_connectivity.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
@ -2279,6 +2315,7 @@ add_library(grpc
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
@ -2375,6 +2412,7 @@ add_library(grpc
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
@ -2453,15 +2491,14 @@ add_library(grpc
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/builtins.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_ping.cc
src/core/lib/surface/channel_stack_type.cc
src/core/lib/surface/completion_queue.cc
src/core/lib/surface/completion_queue_factory.cc
@ -2469,6 +2506,7 @@ add_library(grpc
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
@ -2744,7 +2782,6 @@ endif()
if(gRPC_BUILD_TESTS)
add_library(grpc_test_util
test/core/event_engine/test_init.cc
test/core/util/build.cc
@ -2811,7 +2848,6 @@ endif()
endif()
if(gRPC_BUILD_TESTS)
add_library(grpc_test_util_unsecure
test/core/event_engine/test_init.cc
test/core/util/build.cc
@ -2876,10 +2912,8 @@ endif()
endif()
add_library(grpc_unsecure
src/core/client_channel/backup_poller.cc
src/core/client_channel/channel_connectivity.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
@ -3048,6 +3082,7 @@ add_library(grpc_unsecure
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
@ -3140,6 +3175,7 @@ add_library(grpc_unsecure
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
@ -3184,15 +3220,14 @@ add_library(grpc_unsecure
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/builtins.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_ping.cc
src/core/lib/surface/channel_stack_type.cc
src/core/lib/surface/completion_queue.cc
src/core/lib/surface/completion_queue_factory.cc
@ -3200,6 +3235,7 @@ add_library(grpc_unsecure
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
@ -3451,7 +3487,6 @@ endif()
if(gRPC_BUILD_TESTS)
add_library(gtest
third_party/googletest/googlemock/src/gmock-cardinalities.cc
third_party/googletest/googlemock/src/gmock-internal-utils.cc
@ -3524,7 +3559,6 @@ target_link_libraries(gtest
endif()
add_library(upb_base_lib
third_party/upb/upb/base/status.c
)
@ -3576,7 +3610,6 @@ if(gRPC_INSTALL)
endif()
add_library(upb_json_lib ${_gRPC_STATIC_WIN32}
src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.c
third_party/upb/upb/json/decode.c
@ -3664,7 +3697,6 @@ if(gRPC_INSTALL)
endif()
add_library(upb_mem_lib
third_party/upb/upb/mem/alloc.c
third_party/upb/upb/mem/arena.c
@ -3717,7 +3749,6 @@ if(gRPC_INSTALL)
endif()
add_library(upb_message_lib
third_party/upb/upb/hash/common.c
third_party/upb/upb/message/array.c
@ -3778,7 +3809,6 @@ if(gRPC_INSTALL)
endif()
add_library(upb_textformat_lib ${_gRPC_STATIC_WIN32}
src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.c
third_party/upb/upb/lex/atoi.c
@ -3865,7 +3895,6 @@ if(gRPC_INSTALL)
endif()
add_library(utf8_range_lib
third_party/utf8_range/naive.c
third_party/utf8_range/range2-neon.c
@ -3921,7 +3950,6 @@ endif()
if(gRPC_BUILD_TESTS)
if(gRPC_BUILD_CODEGEN)
add_library(benchmark_helpers ${_gRPC_STATIC_WIN32}
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.cc
@ -4004,7 +4032,6 @@ endif()
endif()
add_library(grpc++
src/core/ext/transport/binder/client/binder_connector.cc
src/core/ext/transport/binder/client/channel_create.cc
@ -4345,7 +4372,6 @@ if(gRPC_INSTALL)
endif()
add_library(grpc++_alts
src/cpp/common/alts_context.cc
src/cpp/common/alts_util.cc
@ -4419,7 +4445,6 @@ if(gRPC_INSTALL)
endif()
add_library(grpc++_error_details
src/cpp/util/error_details.cc
)
@ -4492,7 +4517,6 @@ endif()
if(gRPC_BUILD_CODEGEN)
add_library(grpc++_reflection ${_gRPC_STATIC_WIN32}
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1/reflection.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/reflection/v1/reflection.grpc.pb.cc
@ -4577,7 +4601,6 @@ endif()
endif()
if(gRPC_BUILD_TESTS)
add_library(grpc++_test
src/cpp/client/channel_test_peer.cc
)
@ -4651,7 +4674,6 @@ endforeach()
endif()
if(gRPC_BUILD_TESTS)
add_library(grpc++_test_config
test/cpp/util/test_config_cc.cc
)
@ -4704,7 +4726,6 @@ target_link_libraries(grpc++_test_config
endif()
if(gRPC_BUILD_TESTS)
add_library(grpc++_test_util
src/core/lib/gpr/subprocess_posix.cc
src/core/lib/gpr/subprocess_windows.cc
@ -4777,7 +4798,6 @@ target_link_libraries(grpc++_test_util
endif()
add_library(grpc++_unsecure
src/cpp/client/channel_cc.cc
src/cpp/client/client_callback.cc
@ -5086,7 +5106,6 @@ if(gRPC_INSTALL)
endif()
add_library(grpc_authorization_provider
src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c
src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.c
@ -5111,7 +5130,6 @@ add_library(grpc_authorization_provider
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
@ -5265,6 +5283,7 @@ add_library(grpc_authorization_provider
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
@ -5312,7 +5331,6 @@ add_library(grpc_authorization_provider
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/builtins.cc
src/core/lib/surface/byte_buffer.cc
src/core/lib/surface/byte_buffer_reader.cc
src/core/lib/surface/call.cc
@ -5320,7 +5338,6 @@ add_library(grpc_authorization_provider
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_ping.cc
src/core/lib/surface/channel_stack_type.cc
src/core/lib/surface/completion_queue.cc
src/core/lib/surface/completion_queue_factory.cc
@ -5328,7 +5345,6 @@ add_library(grpc_authorization_provider
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/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
@ -5528,7 +5544,6 @@ if(gRPC_INSTALL)
endif()
add_library(grpc_plugin_support
src/compiler/cpp_generator.cc
src/compiler/csharp_generator.cc
@ -5603,7 +5618,6 @@ endif()
# grpcpp_channelz doesn't build with protobuf-lite
# See https://github.com/grpc/grpc/issues/19473
if(gRPC_BUILD_CODEGEN AND NOT gRPC_USE_PROTO_LITE)
add_library(grpcpp_channelz ${_gRPC_STATIC_WIN32}
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/channelz/channelz.grpc.pb.cc
@ -5682,6 +5696,81 @@ if(gRPC_INSTALL AND NOT gRPC_USE_PROTO_LITE)
)
endif()
endif()
if(gRPC_BUILD_GRPCPP_OTEL_PLUGIN)
add_library(grpcpp_otel_plugin
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_compile_features(grpcpp_otel_plugin PUBLIC cxx_std_14)
set_target_properties(grpcpp_otel_plugin PROPERTIES
VERSION ${gRPC_CPP_VERSION}
SOVERSION ${gRPC_CPP_SOVERSION}
)
if(WIN32 AND MSVC)
set_target_properties(grpcpp_otel_plugin PROPERTIES COMPILE_PDB_NAME "grpcpp_otel_plugin"
COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
)
if(BUILD_SHARED_LIBS)
target_compile_definitions(grpcpp_otel_plugin
PRIVATE
"GPR_DLL_IMPORTS"
"GRPC_DLL_IMPORTS"
"GRPCXX_DLL_IMPORTS"
)
endif()
if(gRPC_INSTALL)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/grpcpp_otel_plugin.pdb
DESTINATION ${gRPC_INSTALL_LIBDIR} OPTIONAL
)
endif()
endif()
target_include_directories(grpcpp_otel_plugin
PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
${_gRPC_RE2_INCLUDE_DIR}
${_gRPC_SSL_INCLUDE_DIR}
${_gRPC_UPB_GENERATED_DIR}
${_gRPC_UPB_GRPC_GENERATED_DIR}
${_gRPC_UPB_INCLUDE_DIR}
${_gRPC_XXHASH_INCLUDE_DIR}
${_gRPC_ZLIB_INCLUDE_DIR}
${_gRPC_PROTO_GENS_DIR}
)
target_link_libraries(grpcpp_otel_plugin
${_gRPC_ALLTARGETS_LIBRARIES}
grpc++
opentelemetry-cpp::api
)
foreach(_hdr
include/grpcpp/ext/otel_plugin.h
)
string(REPLACE "include/" "" _path ${_hdr})
get_filename_component(_path ${_path} PATH)
install(FILES ${_hdr}
DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}"
)
endforeach()
if(gRPC_INSTALL)
install(TARGETS grpcpp_otel_plugin EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
endif()
endif()
if(gRPC_BUILD_TESTS)
@ -8438,6 +8527,7 @@ add_executable(call_filters_test
src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.c
src/core/ext/upb-gen/google/rpc/status.upb_minitable.c
src/core/lib/channel/channel_args.cc
src/core/lib/compression/compression.cc
src/core/lib/compression/compression_internal.cc
src/core/lib/debug/trace.cc
src/core/lib/experiments/config.cc
@ -8462,6 +8552,7 @@ add_executable(call_filters_test
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/channel_stack_type.cc
src/core/lib/transport/call_filters.cc
src/core/lib/transport/call_final_info.cc
@ -10118,6 +10209,7 @@ add_executable(chunked_vector_test
src/core/lib/promise/activity.cc
src/core/lib/promise/trace.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
@ -14116,6 +14208,7 @@ add_executable(flow_control_test
src/core/lib/iomgr/iomgr_internal.cc
src/core/lib/promise/activity.cc
src/core/lib/promise/trace.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
@ -14204,6 +14297,7 @@ add_executable(for_each_test
src/core/lib/promise/activity.cc
src/core/lib/promise/trace.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
@ -17650,6 +17744,7 @@ add_executable(interceptor_list_test
src/core/lib/promise/activity.cc
src/core/lib/promise/trace.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
@ -18841,6 +18936,7 @@ add_executable(map_pipe_test
src/core/lib/promise/activity.cc
src/core/lib/promise/trace.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
@ -20522,6 +20618,72 @@ target_link_libraries(osa_distance_test
)
endif()
if(gRPC_BUILD_TESTS AND gRPC_BUILD_GRPCPP_OTEL_PLUGIN)
add_executable(otel_plugin_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/simple_messages.grpc.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_load_report.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_load_report.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_load_report.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_load_report.grpc.pb.h
src/cpp/ext/otel/otel_client_filter.cc
src/cpp/ext/otel/otel_plugin.cc
src/cpp/ext/otel/otel_server_call_tracer.cc
test/cpp/end2end/test_service_impl.cc
test/cpp/ext/otel/otel_plugin_test.cc
test/cpp/ext/otel/otel_test_library.cc
)
if(WIN32 AND MSVC)
if(BUILD_SHARED_LIBS)
target_compile_definitions(otel_plugin_test
PRIVATE
"GPR_DLL_IMPORTS"
"GRPC_DLL_IMPORTS"
"GRPCXX_DLL_IMPORTS"
)
endif()
endif()
target_compile_features(otel_plugin_test PUBLIC cxx_std_14)
target_include_directories(otel_plugin_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
${_gRPC_RE2_INCLUDE_DIR}
${_gRPC_SSL_INCLUDE_DIR}
${_gRPC_UPB_GENERATED_DIR}
${_gRPC_UPB_GRPC_GENERATED_DIR}
${_gRPC_UPB_INCLUDE_DIR}
${_gRPC_XXHASH_INCLUDE_DIR}
${_gRPC_ZLIB_INCLUDE_DIR}
third_party/googletest/googletest/include
third_party/googletest/googletest
third_party/googletest/googlemock/include
third_party/googletest/googlemock
${_gRPC_PROTO_GENS_DIR}
)
target_link_libraries(otel_plugin_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
opentelemetry-cpp::api
opentelemetry-cpp::metrics
grpc++_test_util
)
endif()
if(gRPC_BUILD_TESTS)
@ -25843,6 +26005,7 @@ add_executable(rls_end2end_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_load_report.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_load_report.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_load_report.grpc.pb.h
test/core/util/fake_stats_plugin.cc
test/core/util/test_lb_policies.cc
test/cpp/end2end/rls_end2end_test.cc
test/cpp/end2end/rls_server.cc
@ -31541,7 +31704,6 @@ endif()
if(gRPC_BUILD_TESTS)
add_executable(uuid_v4_test
src/core/lib/gprpp/uuid_v4.cc
test/core/gprpp/uuid_v4_test.cc
)
if(WIN32 AND MSVC)
@ -36231,7 +36393,7 @@ generate_pkgconfig(
"gpr"
"gRPC platform support library"
"${gRPC_CORE_VERSION}"
"absl_any_invocable absl_base absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_memory absl_optional absl_random_random absl_status absl_str_format absl_strings absl_synchronization absl_time absl_variant"
"absl_any_invocable absl_base absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_log absl_log_severity absl_memory absl_optional absl_random_random absl_status absl_str_format absl_strings absl_synchronization absl_time absl_variant"
""
"-lgpr"
""
@ -36242,7 +36404,7 @@ generate_pkgconfig(
"gRPC"
"high performance general RPC framework"
"${gRPC_CORE_VERSION}"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_cleanup absl_config absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_no_destructor absl_optional absl_random_bit_gen_ref absl_random_distributions absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant gpr"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_cleanup absl_config absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_log absl_log_severity absl_memory absl_no_destructor absl_optional absl_random_bit_gen_ref absl_random_distributions absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant gpr"
"libcares openssl re2 zlib"
"-lgrpc"
"-laddress_sorting -lupb_textformat_lib -lupb_json_lib -lutf8_range_lib -lupb_message_lib -lupb_mem_lib -lupb_base_lib"
@ -36253,7 +36415,7 @@ generate_pkgconfig(
"gRPC unsecure"
"high performance general RPC framework without SSL"
"${gRPC_CORE_VERSION}"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_cleanup absl_config absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_no_destructor absl_optional absl_random_bit_gen_ref absl_random_distributions absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant gpr"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_cleanup absl_config absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_log absl_log_severity absl_memory absl_no_destructor absl_optional absl_random_bit_gen_ref absl_random_distributions absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant gpr"
"libcares zlib"
"-lgrpc_unsecure"
"-laddress_sorting -lutf8_range_lib -lupb_message_lib -lupb_mem_lib -lupb_base_lib"
@ -36264,7 +36426,7 @@ generate_pkgconfig(
"gRPC++"
"C++ wrapper for gRPC"
"${gRPC_CPP_VERSION}"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_cleanup absl_config absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_no_destructor absl_optional absl_random_bit_gen_ref absl_random_distributions absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant gpr grpc"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_cleanup absl_config absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_log absl_log_severity absl_memory absl_no_destructor absl_optional absl_random_bit_gen_ref absl_random_distributions absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant gpr grpc"
"libcares openssl re2 zlib"
"-lgrpc++"
"-laddress_sorting -lupb_textformat_lib -lupb_json_lib -lutf8_range_lib -lupb_message_lib -lupb_mem_lib -lupb_base_lib"
@ -36275,7 +36437,7 @@ generate_pkgconfig(
"gRPC++ unsecure"
"C++ wrapper for gRPC without SSL"
"${gRPC_CPP_VERSION}"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_cleanup absl_config absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_no_destructor absl_optional absl_random_bit_gen_ref absl_random_distributions absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant gpr grpc_unsecure"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_cleanup absl_config absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_log absl_log_severity absl_memory absl_no_destructor absl_optional absl_random_bit_gen_ref absl_random_distributions absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant gpr grpc_unsecure"
"libcares zlib"
"-lgrpc++_unsecure"
"-laddress_sorting -lutf8_range_lib -lupb_message_lib -lupb_mem_lib -lupb_base_lib"

2351
Makefile generated

File diff suppressed because it is too large Load Diff

16
Package.swift generated

@ -117,7 +117,6 @@ let package = Package(
"include/grpc/support/workaround_list.h",
"src/core/client_channel/backup_poller.cc",
"src/core/client_channel/backup_poller.h",
"src/core/client_channel/channel_connectivity.cc",
"src/core/client_channel/client_channel_channelz.cc",
"src/core/client_channel/client_channel_channelz.h",
"src/core/client_channel/client_channel_factory.cc",
@ -1203,6 +1202,7 @@ let package = Package(
"src/core/lib/event_engine/default_event_engine_factory.h",
"src/core/lib/event_engine/event_engine.cc",
"src/core/lib/event_engine/extensions/can_track_errors.h",
"src/core/lib/event_engine/extensions/chaotic_good_extension.h",
"src/core/lib/event_engine/extensions/supports_fd.h",
"src/core/lib/event_engine/forkable.cc",
"src/core/lib/event_engine/forkable.h",
@ -1394,6 +1394,8 @@ let package = Package(
"src/core/lib/gprpp/time_util.h",
"src/core/lib/gprpp/type_list.h",
"src/core/lib/gprpp/unique_type_name.h",
"src/core/lib/gprpp/uuid_v4.cc",
"src/core/lib/gprpp/uuid_v4.h",
"src/core/lib/gprpp/validation_errors.cc",
"src/core/lib/gprpp/validation_errors.h",
"src/core/lib/gprpp/windows/directory_reader.cc",
@ -1607,6 +1609,8 @@ let package = Package(
"src/core/lib/resource_quota/api.h",
"src/core/lib/resource_quota/arena.cc",
"src/core/lib/resource_quota/arena.h",
"src/core/lib/resource_quota/connection_quota.cc",
"src/core/lib/resource_quota/connection_quota.h",
"src/core/lib/resource_quota/memory_quota.cc",
"src/core/lib/resource_quota/memory_quota.h",
"src/core/lib/resource_quota/periodic_update.cc",
@ -1760,8 +1764,6 @@ let package = Package(
"src/core/lib/slice/slice_string_helpers.h",
"src/core/lib/surface/api_trace.cc",
"src/core/lib/surface/api_trace.h",
"src/core/lib/surface/builtins.cc",
"src/core/lib/surface/builtins.h",
"src/core/lib/surface/byte_buffer.cc",
"src/core/lib/surface/byte_buffer_reader.cc",
"src/core/lib/surface/call.cc",
@ -1772,9 +1774,10 @@ let package = Package(
"src/core/lib/surface/call_trace.h",
"src/core/lib/surface/channel.cc",
"src/core/lib/surface/channel.h",
"src/core/lib/surface/channel_create.cc",
"src/core/lib/surface/channel_create.h",
"src/core/lib/surface/channel_init.cc",
"src/core/lib/surface/channel_init.h",
"src/core/lib/surface/channel_ping.cc",
"src/core/lib/surface/channel_stack_type.cc",
"src/core/lib/surface/channel_stack_type.h",
"src/core/lib/surface/completion_queue.cc",
@ -1789,9 +1792,12 @@ let package = Package(
"src/core/lib/surface/init_internally.h",
"src/core/lib/surface/lame_client.cc",
"src/core/lib/surface/lame_client.h",
"src/core/lib/surface/legacy_channel.cc",
"src/core/lib/surface/legacy_channel.h",
"src/core/lib/surface/metadata_array.cc",
"src/core/lib/surface/server.cc",
"src/core/lib/surface/server.h",
"src/core/lib/surface/server_interface.h",
"src/core/lib/surface/validate_metadata.cc",
"src/core/lib/surface/validate_metadata.h",
"src/core/lib/surface/version.cc",
@ -1887,9 +1893,9 @@ let package = Package(
"src/core/load_balancing/ring_hash/ring_hash.cc",
"src/core/load_balancing/ring_hash/ring_hash.h",
"src/core/load_balancing/rls/rls.cc",
"src/core/load_balancing/rls/rls.h",
"src/core/load_balancing/round_robin/round_robin.cc",
"src/core/load_balancing/subchannel_interface.h",
"src/core/load_balancing/subchannel_list.h",
"src/core/load_balancing/weighted_round_robin/static_stride_scheduler.cc",
"src/core/load_balancing/weighted_round_robin/static_stride_scheduler.h",
"src/core/load_balancing/weighted_round_robin/weighted_round_robin.cc",

@ -109,7 +109,6 @@ task 'dlls', [:plat] do |t, args|
env += 'SYSTEM=MINGW32 '
env += 'EMBED_ZLIB=true '
env += 'EMBED_OPENSSL=true '
env += 'EMBED_CARES=true '
env += 'BUILDDIR=/tmp '
env += "V=#{verbose} "
env += "GRPC_RUBY_BUILD_PROCS=#{nproc_override} "

@ -21,7 +21,6 @@ EXPERIMENT_ENABLES = {
"call_status_override_on_cancellation": "call_status_override_on_cancellation",
"call_v3": "call_v3",
"canary_client_privacy": "canary_client_privacy",
"client_idleness": "client_idleness",
"client_privacy": "client_privacy",
"event_engine_client": "event_engine_client",
"event_engine_dns": "event_engine_dns",
@ -34,13 +33,11 @@ EXPERIMENT_ENABLES = {
"multiping": "multiping",
"peer_state_based_framing": "peer_state_based_framing",
"pending_queue_cap": "pending_queue_cap",
"pick_first_happy_eyeballs": "pick_first_happy_eyeballs",
"promise_based_client_call": "event_engine_client,event_engine_listener,promise_based_client_call",
"promise_based_server_call": "promise_based_server_call",
"chaotic_good": "chaotic_good,event_engine_client,event_engine_listener,promise_based_client_call,promise_based_server_call",
"registered_method_lookup_in_transport": "registered_method_lookup_in_transport",
"promise_based_inproc_transport": "event_engine_client,event_engine_listener,promise_based_client_call,promise_based_inproc_transport,promise_based_server_call,registered_method_lookup_in_transport",
"round_robin_delegate_to_pick_first": "round_robin_delegate_to_pick_first",
"rstpit": "rstpit",
"schedule_cancellation_over_write": "schedule_cancellation_over_write",
"server_privacy": "server_privacy",
@ -54,7 +51,6 @@ EXPERIMENT_ENABLES = {
"v3_server_auth_filter": "v3_server_auth_filter",
"work_serializer_clears_time_cache": "work_serializer_clears_time_cache",
"work_serializer_dispatch": "event_engine_client,work_serializer_dispatch",
"wrr_delegate_to_pick_first": "wrr_delegate_to_pick_first",
}
EXPERIMENT_POLLERS = [
@ -103,30 +99,15 @@ EXPERIMENTS = {
"core_end2end_test": [
"event_engine_listener",
],
"cpp_lb_end2end_test": [
"pick_first_happy_eyeballs",
"round_robin_delegate_to_pick_first",
"wrr_delegate_to_pick_first",
],
"credential_token_tests": [
"absl_base64",
],
"event_engine_listener_test": [
"event_engine_listener",
],
"lb_unit_test": [
"pick_first_happy_eyeballs",
"round_robin_delegate_to_pick_first",
"wrr_delegate_to_pick_first",
],
"surface_registered_method_lookup": [
"registered_method_lookup_in_transport",
],
"xds_end2end_test": [
"pick_first_happy_eyeballs",
"round_robin_delegate_to_pick_first",
"wrr_delegate_to_pick_first",
],
},
},
"ios": {
@ -165,27 +146,12 @@ EXPERIMENTS = {
],
},
"on": {
"cpp_lb_end2end_test": [
"pick_first_happy_eyeballs",
"round_robin_delegate_to_pick_first",
"wrr_delegate_to_pick_first",
],
"credential_token_tests": [
"absl_base64",
],
"lb_unit_test": [
"pick_first_happy_eyeballs",
"round_robin_delegate_to_pick_first",
"wrr_delegate_to_pick_first",
],
"surface_registered_method_lookup": [
"registered_method_lookup_in_transport",
],
"xds_end2end_test": [
"pick_first_happy_eyeballs",
"round_robin_delegate_to_pick_first",
"wrr_delegate_to_pick_first",
],
},
},
"posix": {
@ -243,11 +209,6 @@ EXPERIMENTS = {
"cpp_end2end_test": [
"work_serializer_dispatch",
],
"cpp_lb_end2end_test": [
"pick_first_happy_eyeballs",
"round_robin_delegate_to_pick_first",
"wrr_delegate_to_pick_first",
],
"credential_token_tests": [
"absl_base64",
],
@ -255,10 +216,7 @@ EXPERIMENTS = {
"event_engine_listener",
],
"lb_unit_test": [
"pick_first_happy_eyeballs",
"round_robin_delegate_to_pick_first",
"work_serializer_dispatch",
"wrr_delegate_to_pick_first",
],
"resolver_component_tests_runner_invoker": [
"event_engine_dns",
@ -267,10 +225,7 @@ EXPERIMENTS = {
"registered_method_lookup_in_transport",
],
"xds_end2end_test": [
"pick_first_happy_eyeballs",
"round_robin_delegate_to_pick_first",
"work_serializer_dispatch",
"wrr_delegate_to_pick_first",
],
},
},

@ -204,7 +204,6 @@ def grpc_cc_library(
testonly = testonly,
linkopts = linkopts,
includes = [
"api/include",
"include",
"src/core/ext/upb-gen", # Once upb code-gen issue is resolved, remove this.
"src/core/ext/upbdefs-gen", # Once upb code-gen issue is resolved, remove this.

@ -240,11 +240,11 @@ def grpc_deps():
name = "boringssl",
# Use github mirror instead of https://boringssl.googlesource.com/boringssl
# to obtain a boringssl archive with consistent sha256
sha256 = "057f662b0e85931a84945b2e89ba201fd44b0583da827c948fe443593690fb83",
strip_prefix = "boringssl-ae72a4514c7afd150596b0a80947f3ca9b8363b5",
sha256 = "06ba43ff1825c8a9a45dae7f85e532153a531707f6a3e56be1e892fd2d3b75f6",
strip_prefix = "boringssl-e14d29f68c2d1b02e06f10c83b9b8ea4d061f8df",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/boringssl/archive/ae72a4514c7afd150596b0a80947f3ca9b8363b5.tar.gz",
"https://github.com/google/boringssl/archive/ae72a4514c7afd150596b0a80947f3ca9b8363b5.tar.gz",
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/boringssl/archive/e14d29f68c2d1b02e06f10c83b9b8ea4d061f8df.tar.gz",
"https://github.com/google/boringssl/archive/e14d29f68c2d1b02e06f10c83b9b8ea4d061f8df.tar.gz",
],
)

@ -1,2 +1,2 @@
6.4.0
7.0.0
6.5.0
7.1.0

@ -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

@ -125,9 +125,11 @@ libs:
deps:
- 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
@ -845,6 +847,7 @@ libs:
- src/core/lib/event_engine/default_event_engine.h
- src/core/lib/event_engine/default_event_engine_factory.h
- src/core/lib/event_engine/extensions/can_track_errors.h
- src/core/lib/event_engine/extensions/chaotic_good_extension.h
- src/core/lib/event_engine/extensions/supports_fd.h
- src/core/lib/event_engine/forkable.h
- src/core/lib/event_engine/grpc_polled_fd.h
@ -926,6 +929,7 @@ libs:
- src/core/lib/gprpp/time_averaged_stats.h
- src/core/lib/gprpp/type_list.h
- src/core/lib/gprpp/unique_type_name.h
- src/core/lib/gprpp/uuid_v4.h
- src/core/lib/gprpp/validation_errors.h
- src/core/lib/gprpp/work_serializer.h
- src/core/lib/gprpp/xxhash_inline.h
@ -1040,6 +1044,7 @@ libs:
- src/core/lib/promise/try_seq.h
- src/core/lib/resource_quota/api.h
- src/core/lib/resource_quota/arena.h
- src/core/lib/resource_quota/connection_quota.h
- src/core/lib/resource_quota/memory_quota.h
- src/core/lib/resource_quota/periodic_update.h
- src/core/lib/resource_quota/resource_quota.h
@ -1111,11 +1116,11 @@ libs:
- src/core/lib/slice/slice_refcount.h
- src/core/lib/slice/slice_string_helpers.h
- src/core/lib/surface/api_trace.h
- src/core/lib/surface/builtins.h
- src/core/lib/surface/call.h
- src/core/lib/surface/call_test_only.h
- src/core/lib/surface/call_trace.h
- src/core/lib/surface/channel.h
- src/core/lib/surface/channel_create.h
- src/core/lib/surface/channel_init.h
- src/core/lib/surface/channel_stack_type.h
- src/core/lib/surface/completion_queue.h
@ -1124,7 +1129,9 @@ libs:
- src/core/lib/surface/init.h
- src/core/lib/surface/init_internally.h
- src/core/lib/surface/lame_client.h
- src/core/lib/surface/legacy_channel.h
- src/core/lib/surface/server.h
- src/core/lib/surface/server_interface.h
- src/core/lib/surface/validate_metadata.h
- src/core/lib/surface/wait_for_cq_end_op.h
- src/core/lib/transport/batch_builder.h
@ -1176,8 +1183,8 @@ libs:
- src/core/load_balancing/outlier_detection/outlier_detection.h
- src/core/load_balancing/pick_first/pick_first.h
- src/core/load_balancing/ring_hash/ring_hash.h
- src/core/load_balancing/rls/rls.h
- src/core/load_balancing/subchannel_interface.h
- src/core/load_balancing/subchannel_list.h
- src/core/load_balancing/weighted_round_robin/static_stride_scheduler.h
- src/core/load_balancing/weighted_target/weighted_target.h
- src/core/load_balancing/xds/xds_channel_args.h
@ -1236,7 +1243,6 @@ libs:
- third_party/xxhash/xxhash.h
src:
- src/core/client_channel/backup_poller.cc
- src/core/client_channel/channel_connectivity.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
@ -1737,6 +1743,7 @@ libs:
- 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
@ -1833,6 +1840,7 @@ libs:
- 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
@ -1911,15 +1919,14 @@ libs:
- 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/builtins.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_ping.cc
- src/core/lib/surface/channel_stack_type.cc
- src/core/lib/surface/completion_queue.cc
- src/core/lib/surface/completion_queue_factory.cc
@ -1927,6 +1934,7 @@ libs:
- 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
@ -2347,6 +2355,7 @@ libs:
- src/core/lib/event_engine/default_event_engine.h
- src/core/lib/event_engine/default_event_engine_factory.h
- src/core/lib/event_engine/extensions/can_track_errors.h
- src/core/lib/event_engine/extensions/chaotic_good_extension.h
- src/core/lib/event_engine/extensions/supports_fd.h
- src/core/lib/event_engine/forkable.h
- src/core/lib/event_engine/grpc_polled_fd.h
@ -2427,6 +2436,7 @@ libs:
- src/core/lib/gprpp/time_averaged_stats.h
- src/core/lib/gprpp/type_list.h
- src/core/lib/gprpp/unique_type_name.h
- src/core/lib/gprpp/uuid_v4.h
- src/core/lib/gprpp/validation_errors.h
- src/core/lib/gprpp/work_serializer.h
- src/core/lib/handshaker/proxy_mapper.h
@ -2537,6 +2547,7 @@ libs:
- src/core/lib/promise/try_seq.h
- src/core/lib/resource_quota/api.h
- src/core/lib/resource_quota/arena.h
- src/core/lib/resource_quota/connection_quota.h
- src/core/lib/resource_quota/memory_quota.h
- src/core/lib/resource_quota/periodic_update.h
- src/core/lib/resource_quota/resource_quota.h
@ -2577,11 +2588,11 @@ libs:
- src/core/lib/slice/slice_refcount.h
- src/core/lib/slice/slice_string_helpers.h
- src/core/lib/surface/api_trace.h
- src/core/lib/surface/builtins.h
- src/core/lib/surface/call.h
- src/core/lib/surface/call_test_only.h
- src/core/lib/surface/call_trace.h
- src/core/lib/surface/channel.h
- src/core/lib/surface/channel_create.h
- src/core/lib/surface/channel_init.h
- src/core/lib/surface/channel_stack_type.h
- src/core/lib/surface/completion_queue.h
@ -2590,7 +2601,9 @@ libs:
- src/core/lib/surface/init.h
- src/core/lib/surface/init_internally.h
- src/core/lib/surface/lame_client.h
- src/core/lib/surface/legacy_channel.h
- src/core/lib/surface/server.h
- src/core/lib/surface/server_interface.h
- src/core/lib/surface/validate_metadata.h
- src/core/lib/surface/wait_for_cq_end_op.h
- src/core/lib/transport/batch_builder.h
@ -2641,8 +2654,8 @@ libs:
- src/core/load_balancing/oob_backend_metric_internal.h
- src/core/load_balancing/outlier_detection/outlier_detection.h
- src/core/load_balancing/pick_first/pick_first.h
- src/core/load_balancing/rls/rls.h
- src/core/load_balancing/subchannel_interface.h
- src/core/load_balancing/subchannel_list.h
- src/core/load_balancing/weighted_round_robin/static_stride_scheduler.h
- src/core/load_balancing/weighted_target/weighted_target.h
- src/core/resolver/dns/c_ares/dns_resolver_ares.h
@ -2692,7 +2705,6 @@ libs:
- third_party/upb/upb/wire/types.h
src:
- src/core/client_channel/backup_poller.cc
- src/core/client_channel/channel_connectivity.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
@ -2861,6 +2873,7 @@ libs:
- 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
@ -2953,6 +2966,7 @@ libs:
- 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
@ -2997,15 +3011,14 @@ libs:
- 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/builtins.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_ping.cc
- src/core/lib/surface/channel_stack_type.cc
- src/core/lib/surface/completion_queue.cc
- src/core/lib/surface/completion_queue_factory.cc
@ -3013,6 +3026,7 @@ libs:
- 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
@ -4427,6 +4441,7 @@ libs:
- src/core/lib/event_engine/default_event_engine.h
- src/core/lib/event_engine/default_event_engine_factory.h
- src/core/lib/event_engine/extensions/can_track_errors.h
- src/core/lib/event_engine/extensions/chaotic_good_extension.h
- src/core/lib/event_engine/extensions/supports_fd.h
- src/core/lib/event_engine/forkable.h
- src/core/lib/event_engine/grpc_polled_fd.h
@ -4611,6 +4626,7 @@ libs:
- src/core/lib/promise/try_seq.h
- src/core/lib/resource_quota/api.h
- src/core/lib/resource_quota/arena.h
- src/core/lib/resource_quota/connection_quota.h
- src/core/lib/resource_quota/memory_quota.h
- src/core/lib/resource_quota/periodic_update.h
- src/core/lib/resource_quota/resource_quota.h
@ -4654,7 +4670,6 @@ libs:
- src/core/lib/slice/slice_refcount.h
- src/core/lib/slice/slice_string_helpers.h
- src/core/lib/surface/api_trace.h
- src/core/lib/surface/builtins.h
- src/core/lib/surface/call.h
- src/core/lib/surface/call_test_only.h
- src/core/lib/surface/call_trace.h
@ -4667,7 +4682,7 @@ libs:
- src/core/lib/surface/init.h
- src/core/lib/surface/init_internally.h
- src/core/lib/surface/lame_client.h
- src/core/lib/surface/server.h
- src/core/lib/surface/server_interface.h
- src/core/lib/surface/validate_metadata.h
- src/core/lib/surface/wait_for_cq_end_op.h
- src/core/lib/transport/batch_builder.h
@ -4756,7 +4771,6 @@ libs:
- 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
@ -4910,6 +4924,7 @@ libs:
- 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
@ -4957,7 +4972,6 @@ libs:
- 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/builtins.cc
- src/core/lib/surface/byte_buffer.cc
- src/core/lib/surface/byte_buffer_reader.cc
- src/core/lib/surface/call.cc
@ -4965,7 +4979,6 @@ libs:
- 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_ping.cc
- src/core/lib/surface/channel_stack_type.cc
- src/core/lib/surface/completion_queue.cc
- src/core/lib/surface/completion_queue_factory.cc
@ -4973,7 +4986,6 @@ libs:
- 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/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
@ -5094,6 +5106,24 @@ libs:
- src/cpp/server/channelz/channelz_service_plugin.cc
deps:
- grpc++
- name: grpcpp_otel_plugin
build: plugin
language: c++
public_headers:
- include/grpcpp/ext/otel_plugin.h
headers:
- src/cpp/ext/otel/key_value_iterable.h
- src/cpp/ext/otel/otel_call_tracer.h
- src/cpp/ext/otel/otel_client_filter.h
- src/cpp/ext/otel/otel_plugin.h
- src/cpp/ext/otel/otel_server_call_tracer.h
src:
- src/cpp/ext/otel/otel_client_filter.cc
- src/cpp/ext/otel/otel_plugin.cc
- src/cpp/ext/otel/otel_server_call_tracer.cc
deps:
- grpc++
- opentelemetry-cpp::api
targets:
- name: fd_conservation_posix_test
build: test
@ -6407,6 +6437,7 @@ targets:
- src/core/lib/slice/slice_internal.h
- src/core/lib/slice/slice_refcount.h
- src/core/lib/slice/slice_string_helpers.h
- src/core/lib/surface/api_trace.h
- src/core/lib/surface/channel_stack_type.h
- src/core/lib/transport/call_filters.h
- src/core/lib/transport/call_final_info.h
@ -6447,6 +6478,7 @@ targets:
- src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.c
- src/core/ext/upb-gen/google/rpc/status.upb_minitable.c
- src/core/lib/channel/channel_args.cc
- src/core/lib/compression/compression.cc
- src/core/lib/compression/compression_internal.cc
- src/core/lib/debug/trace.cc
- src/core/lib/experiments/config.cc
@ -6471,6 +6503,7 @@ targets:
- 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/channel_stack_type.cc
- src/core/lib/transport/call_filters.cc
- src/core/lib/transport/call_final_info.cc
@ -7665,6 +7698,7 @@ targets:
- src/core/lib/promise/seq.h
- src/core/lib/promise/trace.h
- src/core/lib/resource_quota/arena.h
- src/core/lib/resource_quota/connection_quota.h
- src/core/lib/resource_quota/memory_quota.h
- src/core/lib/resource_quota/periodic_update.h
- src/core/lib/resource_quota/resource_quota.h
@ -7714,6 +7748,7 @@ targets:
- src/core/lib/promise/activity.cc
- src/core/lib/promise/trace.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
@ -9761,6 +9796,7 @@ targets:
- src/core/lib/promise/race.h
- src/core/lib/promise/seq.h
- src/core/lib/promise/trace.h
- src/core/lib/resource_quota/connection_quota.h
- src/core/lib/resource_quota/memory_quota.h
- src/core/lib/resource_quota/periodic_update.h
- src/core/lib/resource_quota/resource_quota.h
@ -9815,6 +9851,7 @@ targets:
- src/core/lib/iomgr/iomgr_internal.cc
- src/core/lib/promise/activity.cc
- src/core/lib/promise/trace.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
@ -9904,6 +9941,7 @@ targets:
- src/core/lib/promise/trace.h
- src/core/lib/promise/try_seq.h
- src/core/lib/resource_quota/arena.h
- src/core/lib/resource_quota/connection_quota.h
- src/core/lib/resource_quota/memory_quota.h
- src/core/lib/resource_quota/periodic_update.h
- src/core/lib/resource_quota/resource_quota.h
@ -9954,6 +9992,7 @@ targets:
- src/core/lib/promise/activity.cc
- src/core/lib/promise/trace.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
@ -11554,6 +11593,7 @@ targets:
- src/core/lib/promise/seq.h
- src/core/lib/promise/trace.h
- src/core/lib/resource_quota/arena.h
- src/core/lib/resource_quota/connection_quota.h
- src/core/lib/resource_quota/memory_quota.h
- src/core/lib/resource_quota/periodic_update.h
- src/core/lib/resource_quota/resource_quota.h
@ -11604,6 +11644,7 @@ targets:
- src/core/lib/promise/activity.cc
- src/core/lib/promise/trace.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
@ -12232,6 +12273,7 @@ targets:
- src/core/lib/promise/trace.h
- src/core/lib/promise/try_seq.h
- src/core/lib/resource_quota/arena.h
- src/core/lib/resource_quota/connection_quota.h
- src/core/lib/resource_quota/memory_quota.h
- src/core/lib/resource_quota/periodic_update.h
- src/core/lib/resource_quota/resource_quota.h
@ -12282,6 +12324,7 @@ targets:
- src/core/lib/promise/activity.cc
- src/core/lib/promise/trace.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
@ -13165,6 +13208,35 @@ targets:
- test/core/util/osa_distance_test.cc
deps:
- gtest
- name: otel_plugin_test
gtest: true
build: plugin_test
language: c++
plugin_option: gRPC_BUILD_GRPCPP_OTEL_PLUGIN
headers:
- src/cpp/ext/otel/key_value_iterable.h
- src/cpp/ext/otel/otel_call_tracer.h
- src/cpp/ext/otel/otel_client_filter.h
- src/cpp/ext/otel/otel_plugin.h
- src/cpp/ext/otel/otel_server_call_tracer.h
- test/cpp/end2end/test_service_impl.h
- test/cpp/ext/otel/otel_test_library.h
src:
- 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
- src/cpp/ext/otel/otel_client_filter.cc
- src/cpp/ext/otel/otel_plugin.cc
- src/cpp/ext/otel/otel_server_call_tracer.cc
- test/cpp/end2end/test_service_impl.cc
- test/cpp/ext/otel/otel_plugin_test.cc
- test/cpp/ext/otel/otel_test_library.cc
deps:
- gtest
- opentelemetry-cpp::api
- opentelemetry-cpp::metrics
- grpc++_test_util
- name: out_of_bounds_bad_client_test
gtest: true
build: test
@ -16869,6 +16941,7 @@ targets:
run: false
language: c++
headers:
- test/core/util/fake_stats_plugin.h
- test/core/util/test_lb_policies.h
- test/cpp/end2end/counted_service.h
- test/cpp/end2end/rls_server.h
@ -16880,6 +16953,7 @@ targets:
- 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/fake_stats_plugin.cc
- test/core/util/test_lb_policies.cc
- test/cpp/end2end/rls_end2end_test.cc
- test/cpp/end2end/rls_server.cc
@ -19503,10 +19577,8 @@ targets:
gtest: true
build: test
language: c++
headers:
- src/core/lib/gprpp/uuid_v4.h
headers: []
src:
- src/core/lib/gprpp/uuid_v4.cc
- test/core/gprpp/uuid_v4_test.cc
deps:
- gtest

@ -129,10 +129,6 @@ configs:
test_environ:
UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1:suppressions=test/core/util/ubsan_suppressions.txt
defaults:
abseil:
CPPFLAGS: -g -Ithird_party/abseil-cpp
benchmark:
CPPFLAGS: -Ithird_party/benchmark/include -DHAVE_POSIX_REGEX
boringssl:
CFLAGS: -g
CPPFLAGS: -Ithird_party/boringssl-with-bazel/src/include -fvisibility=hidden -DOPENSSL_NO_ASM
@ -150,7 +146,8 @@ defaults:
COREFLAGS: -fno-exceptions
CPPFLAGS: -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/xxhash -Ithird_party/cares/cares/include -Ithird_party/cares -Ithird_party/cares/cares
-Ithird_party/address_sorting/include
LDFLAGS: -g
zlib:
CFLAGS: -fvisibility=hidden
@ -202,6 +199,9 @@ ruby_gem:
- boringssl
- re2
- z
swift_boringssl_package:
deps:
- boringssl
swift_package:
deps:
- grpc

@ -0,0 +1,44 @@
# 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.
if(TARGET opentelemetry-cpp::api)
# If opentelemetry is included already, skip including it.
# OpenTelemetry does not work with "module" mode at present.
# elseif(gRPC_OPENTELEMETRY_PROVIDER STREQUAL "module")
# if(NOT OPENTELEMETRY_ROOT_DIR)
# set(OPENTELEMETRY_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/opentelemetry-cpp)
# endif()
# set(BUILD_TESTING OFF)
# if(NOT gRPC_BUILD_TESTS)
# set(WITH_API_ONLY ON)
# endif()
# set(WITH_ABSEIL ON)
# include_directories(${OPENTELEMETRY_ROOT_DIR} "${OPENTELEMETRY_ROOT_DIR}/api/include")
# add_subdirectory(${OPENTELEMETRY_ROOT_DIR} third_party/opentelemetry-cpp)
# if(EXISTS "${OPENTELEMETRY_ROOT_DIR}/CMakeLists.txt")
# Unclear whether we should install OpenTelemetry along with gRPC
# if(gRPC_INSTALL AND _gRPC_INSTALL_SUPPORTED_FROM_MODULE)
# set(OPENTELEMETRY_INSTALL ON)
# endif()
# else()
# message(WARNING "gRPC_OPENTELEMETRY_PROVIDER is \"module\" but OPENTELEMETRY_ROOT_DIR is wrong")
# endif()
# if(gRPC_INSTALL AND NOT _gRPC_INSTALL_SUPPORTED_FROM_MODULE)
# message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_OPENTELEMETRY_PROVIDER is \"module\" and CMake version (${CMAKE_VERSION}) is less than 3.13.")
# set(gRPC_INSTALL FALSE)
# endif()
elseif(gRPC_OPENTELEMETRY_PROVIDER STREQUAL "package")
find_package(opentelemetry-cpp CONFIG REQUIRED)
endif()
set(_gRPC_FIND_OPENTELEMETRY "if(NOT TARGET opentelemetry-cpp::opentelemetry_api)\n find_package(opentelemetry-cpp)\nendif()")

22
config.m4 generated

@ -42,7 +42,6 @@ if test "$PHP_GRPC" != "no"; then
PHP_NEW_EXTENSION(grpc,
src/core/client_channel/backup_poller.cc \
src/core/client_channel/channel_connectivity.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 \
@ -585,6 +584,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/gprpp/time.cc \
src/core/lib/gprpp/time_averaged_stats.cc \
src/core/lib/gprpp/time_util.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/windows/env.cc \
@ -684,6 +684,7 @@ if test "$PHP_GRPC" != "no"; then
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 \
@ -762,15 +763,14 @@ if test "$PHP_GRPC" != "no"; then
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/builtins.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_ping.cc \
src/core/lib/surface/channel_stack_type.cc \
src/core/lib/surface/completion_queue.cc \
src/core/lib/surface/completion_queue_factory.cc \
@ -778,6 +778,7 @@ if test "$PHP_GRPC" != "no"; then
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 \
@ -923,6 +924,7 @@ if test "$PHP_GRPC" != "no"; then
third_party/abseil-cpp/absl/debugging/internal/address_is_readable.cc \
third_party/abseil-cpp/absl/debugging/internal/demangle.cc \
third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc \
third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc \
third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc \
third_party/abseil-cpp/absl/debugging/stacktrace.cc \
third_party/abseil-cpp/absl/debugging/symbolize.cc \
@ -937,6 +939,18 @@ if test "$PHP_GRPC" != "no"; then
third_party/abseil-cpp/absl/hash/internal/city.cc \
third_party/abseil-cpp/absl/hash/internal/hash.cc \
third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc \
third_party/abseil-cpp/absl/log/globals.cc \
third_party/abseil-cpp/absl/log/internal/conditions.cc \
third_party/abseil-cpp/absl/log/internal/fnmatch.cc \
third_party/abseil-cpp/absl/log/internal/globals.cc \
third_party/abseil-cpp/absl/log/internal/log_format.cc \
third_party/abseil-cpp/absl/log/internal/log_message.cc \
third_party/abseil-cpp/absl/log/internal/log_sink_set.cc \
third_party/abseil-cpp/absl/log/internal/nullguard.cc \
third_party/abseil-cpp/absl/log/internal/proto.cc \
third_party/abseil-cpp/absl/log/internal/vlog_config.cc \
third_party/abseil-cpp/absl/log/log_entry.cc \
third_party/abseil-cpp/absl/log/log_sink.cc \
third_party/abseil-cpp/absl/numeric/int128.cc \
third_party/abseil-cpp/absl/profiling/internal/exponential_biased.cc \
third_party/abseil-cpp/absl/random/discrete_distribution.cc \
@ -1599,6 +1613,8 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/flags)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/flags/internal)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/hash/internal)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/log)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/log/internal)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/numeric)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/profiling/internal)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/random)

22
config.w32 generated

@ -7,7 +7,6 @@ if (PHP_GRPC != "no") {
EXTENSION("grpc",
"src\\core\\client_channel\\backup_poller.cc " +
"src\\core\\client_channel\\channel_connectivity.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 " +
@ -550,6 +549,7 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\gprpp\\time.cc " +
"src\\core\\lib\\gprpp\\time_averaged_stats.cc " +
"src\\core\\lib\\gprpp\\time_util.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\\windows\\env.cc " +
@ -649,6 +649,7 @@ if (PHP_GRPC != "no") {
"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 " +
@ -727,15 +728,14 @@ if (PHP_GRPC != "no") {
"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\\builtins.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_ping.cc " +
"src\\core\\lib\\surface\\channel_stack_type.cc " +
"src\\core\\lib\\surface\\completion_queue.cc " +
"src\\core\\lib\\surface\\completion_queue_factory.cc " +
@ -743,6 +743,7 @@ if (PHP_GRPC != "no") {
"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 " +
@ -888,6 +889,7 @@ if (PHP_GRPC != "no") {
"third_party\\abseil-cpp\\absl\\debugging\\internal\\address_is_readable.cc " +
"third_party\\abseil-cpp\\absl\\debugging\\internal\\demangle.cc " +
"third_party\\abseil-cpp\\absl\\debugging\\internal\\elf_mem_image.cc " +
"third_party\\abseil-cpp\\absl\\debugging\\internal\\examine_stack.cc " +
"third_party\\abseil-cpp\\absl\\debugging\\internal\\vdso_support.cc " +
"third_party\\abseil-cpp\\absl\\debugging\\stacktrace.cc " +
"third_party\\abseil-cpp\\absl\\debugging\\symbolize.cc " +
@ -902,6 +904,18 @@ if (PHP_GRPC != "no") {
"third_party\\abseil-cpp\\absl\\hash\\internal\\city.cc " +
"third_party\\abseil-cpp\\absl\\hash\\internal\\hash.cc " +
"third_party\\abseil-cpp\\absl\\hash\\internal\\low_level_hash.cc " +
"third_party\\abseil-cpp\\absl\\log\\globals.cc " +
"third_party\\abseil-cpp\\absl\\log\\internal\\conditions.cc " +
"third_party\\abseil-cpp\\absl\\log\\internal\\fnmatch.cc " +
"third_party\\abseil-cpp\\absl\\log\\internal\\globals.cc " +
"third_party\\abseil-cpp\\absl\\log\\internal\\log_format.cc " +
"third_party\\abseil-cpp\\absl\\log\\internal\\log_message.cc " +
"third_party\\abseil-cpp\\absl\\log\\internal\\log_sink_set.cc " +
"third_party\\abseil-cpp\\absl\\log\\internal\\nullguard.cc " +
"third_party\\abseil-cpp\\absl\\log\\internal\\proto.cc " +
"third_party\\abseil-cpp\\absl\\log\\internal\\vlog_config.cc " +
"third_party\\abseil-cpp\\absl\\log\\log_entry.cc " +
"third_party\\abseil-cpp\\absl\\log\\log_sink.cc " +
"third_party\\abseil-cpp\\absl\\numeric\\int128.cc " +
"third_party\\abseil-cpp\\absl\\profiling\\internal\\exponential_biased.cc " +
"third_party\\abseil-cpp\\absl\\random\\discrete_distribution.cc " +
@ -1746,6 +1760,8 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\flags\\internal");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\hash");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\hash\\internal");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\log");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\log\\internal");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\numeric");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\profiling");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\profiling\\internal");

@ -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.

@ -0,0 +1,79 @@
# Copyright 2018 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.
#
# cmake build file for C++ gRPC OpenTelemetry example.
# Assumes absl, protobuf, prometheus-cpp, opentelemetry-cpp and gRPC (with -DgRPC_BUILD_OPENTELEMETRY_PLUGIN=ON) have been installed using cmake.
# See cmake_externalproject/CMakeLists.txt for all-in-one cmake build
# that automatically builds all the dependencies before building helloworld.
cmake_minimum_required(VERSION 3.13)
project(grpc_opentelemetry_example C CXX)
include(../cmake/common.cmake)
# Find prometheus-cpp package
find_package(prometheus-cpp CONFIG REQUIRED)
# Find opentelemetry-cpp package
find_package(opentelemetry-cpp CONFIG REQUIRED)
# Proto file
get_filename_component(hw_proto "../../protos/helloworld.proto" ABSOLUTE)
get_filename_component(hw_proto_path "${hw_proto}" PATH)
# Generated sources
set(hw_proto_srcs "${CMAKE_CURRENT_BINARY_DIR}/helloworld.pb.cc")
set(hw_proto_hdrs "${CMAKE_CURRENT_BINARY_DIR}/helloworld.pb.h")
set(hw_grpc_srcs "${CMAKE_CURRENT_BINARY_DIR}/helloworld.grpc.pb.cc")
set(hw_grpc_hdrs "${CMAKE_CURRENT_BINARY_DIR}/helloworld.grpc.pb.h")
add_custom_command(
OUTPUT "${hw_proto_srcs}" "${hw_proto_hdrs}" "${hw_grpc_srcs}" "${hw_grpc_hdrs}"
COMMAND ${_PROTOBUF_PROTOC}
ARGS --grpc_out "${CMAKE_CURRENT_BINARY_DIR}"
--cpp_out "${CMAKE_CURRENT_BINARY_DIR}"
-I "${hw_proto_path}"
--plugin=protoc-gen-grpc="${_GRPC_CPP_PLUGIN_EXECUTABLE}"
"${hw_proto}"
DEPENDS "${hw_proto}")
# Include generated *.pb.h files
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
# hw_grpc_proto
add_library(hw_grpc_proto
${hw_grpc_srcs}
${hw_grpc_hdrs}
${hw_proto_srcs}
${hw_proto_hdrs})
target_link_libraries(hw_grpc_proto
${_REFLECTION}
${_GRPC_GRPCPP}
${_PROTOBUF_LIBPROTOBUF})
# Targets greeter_callback_(client|server)
foreach(_target
greeter_callback_client greeter_callback_server)
add_executable(${_target} "${_target}.cc")
target_link_libraries(${_target}
hw_grpc_proto
absl::flags
absl::flags_parse
opentelemetry-cpp::metrics
opentelemetry-cpp::prometheus_exporter
${_REFLECTION}
${_GRPC_GRPCPP}
gRPC::grpcpp_otel_plugin
${_PROTOBUF_LIBPROTOBUF})
endforeach()

@ -39,6 +39,15 @@ $ curl localhost:9465/metrics
> ***NOTE:*** If the prometheus endpoint configured is overridden, please update
> the target in the above curl command.
## CMake Instructions
The following libraries need to be installed before building the example with CMake -
* absl
* protobuf
* prometheus-cpp
* opentelemetry-cpp (with the options `-DWITH_ABSEIL=ON` `-DWITH_PROMETHEUS=ON`)
* grpc (with the option `-DgRPC_BUILD_GRPCPP_OTEL_PLUGIN=ON`)
You can find a complete set of instructions for building gRPC and running the
Hello World app in the [C++ Quick Start][].

@ -37,8 +37,8 @@ pass() {
}
bazel build --define=use_systemd=true //examples/cpp/systemd_socket_activation:all || fail "Failed to build sd_sock_act"
cp ../../../../bazel-bin/examples/cpp/systemd_socket_activation/server /tmp/greeter_server
cp ../../../../bazel-bin/examples/cpp/systemd_socket_activation/client /tmp/greeter_client
cp ../../../bazel-bin/examples/cpp/systemd_socket_activation/server /tmp/greeter_server
cp ../../../bazel-bin/examples/cpp/systemd_socket_activation/client /tmp/greeter_client
cat << EOF > /etc/systemd/system/sdsockact.service
[Service]

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: helloworld.proto
# Protobuf Python Version: 4.25.0
# Protobuf Python Version: 4.25.1
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool

@ -1,9 +1,34 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings
import helloworld_pb2 as helloworld__pb2
GRPC_GENERATED_VERSION = '1.63.0.dev0'
GRPC_VERSION = grpc.__version__
EXPECTED_ERROR_RELEASE = '1.65.0'
SCHEDULED_RELEASE_DATE = 'June 25, 2024'
_version_not_supported = False
try:
from grpc._utilities import first_version_is_lower
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
_version_not_supported = True
if _version_not_supported:
warnings.warn(
f'The grpc package installed is at version {GRPC_VERSION},'
+ f' but the generated code in helloworld_pb2_grpc.py depends on'
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
+ f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
+ f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
RuntimeWarning
)
class GreeterStub(object):
"""The greeting service definition.

@ -16,7 +16,6 @@
from collections import defaultdict
import logging
import time
from typing import Optional
import grpc
import grpc_observability
@ -29,14 +28,6 @@ from opentelemetry.sdk.metrics.export import PeriodicExportingMetricReader
OTEL_EXPORT_INTERVAL_S = 0.5
class BaseOpenTelemetryPlugin(grpc_observability.OpenTelemetryPlugin):
def __init__(self, provider: MeterProvider):
self.provider = provider
def get_meter_provider(self) -> Optional[MeterProvider]:
return self.provider
def run():
all_metrics = defaultdict(list)
otel_exporter = open_telemetry_exporter.OTelMetricExporter(all_metrics)
@ -45,18 +36,20 @@ def run():
export_interval_millis=OTEL_EXPORT_INTERVAL_S * 1000,
)
provider = MeterProvider(metric_readers=[reader])
otel_plugin = BaseOpenTelemetryPlugin(provider)
with grpc_observability.OpenTelemetryObservability(plugins=[otel_plugin]):
with grpc.insecure_channel(target="localhost:50051") as channel:
stub = helloworld_pb2_grpc.GreeterStub(channel)
try:
response = stub.SayHello(
helloworld_pb2.HelloRequest(name="You")
)
print(f"Greeter client received: {response.message}")
except grpc.RpcError as rpc_error:
print("Call failed with code: ", rpc_error.code())
otel_plugin = grpc_observability.OpenTelemetryPlugin(
meter_provider=provider
)
otel_plugin.register_global()
with grpc.insecure_channel(target="localhost:50051") as channel:
stub = helloworld_pb2_grpc.GreeterStub(channel)
try:
response = stub.SayHello(helloworld_pb2.HelloRequest(name="You"))
print(f"Greeter client received: {response.message}")
except grpc.RpcError as rpc_error:
print("Call failed with code: ", rpc_error.code())
otel_plugin.deregister_global()
# Sleep to make sure all metrics are exported.
time.sleep(5)

@ -17,7 +17,6 @@ from collections import defaultdict
from concurrent import futures
import logging
import time
from typing import Optional
import grpc
import grpc_observability
@ -31,14 +30,6 @@ _OTEL_EXPORT_INTERVAL_S = 0.5
_SERVER_PORT = "50051"
class BaseOpenTelemetryPlugin(grpc_observability.OpenTelemetryPlugin):
def __init__(self, provider: MeterProvider):
self.provider = provider
def get_meter_provider(self) -> Optional[MeterProvider]:
return self.provider
class Greeter(helloworld_pb2_grpc.GreeterServicer):
def SayHello(self, request, context):
message = request.name
@ -55,24 +46,28 @@ def serve():
export_interval_millis=_OTEL_EXPORT_INTERVAL_S * 1000,
)
provider = MeterProvider(metric_readers=[reader])
otel_plugin = BaseOpenTelemetryPlugin(provider)
with grpc_observability.OpenTelemetryObservability(plugins=[otel_plugin]):
server = grpc.server(
thread_pool=futures.ThreadPoolExecutor(max_workers=10),
)
helloworld_pb2_grpc.add_GreeterServicer_to_server(Greeter(), server)
server.add_insecure_port("[::]:" + _SERVER_PORT)
server.start()
print("Server started, listening on " + _SERVER_PORT)
otel_plugin = grpc_observability.OpenTelemetryPlugin(
meter_provider=provider
)
otel_plugin.register_global()
server = grpc.server(
thread_pool=futures.ThreadPoolExecutor(max_workers=10),
)
helloworld_pb2_grpc.add_GreeterServicer_to_server(Greeter(), server)
server.add_insecure_port("[::]:" + _SERVER_PORT)
server.start()
print("Server started, listening on " + _SERVER_PORT)
# Sleep to make sure client made RPC call and all metrics are exported.
time.sleep(10)
print("Metrics exported on Server side:")
for metric in all_metrics:
print(metric)
# Sleep to make sure client made RPC call and all metrics are exported.
time.sleep(10)
print("Metrics exported on Server side:")
for metric in all_metrics:
print(metric)
server.stop(0)
server.stop(0)
otel_plugin.deregister_global()
if __name__ == "__main__":

20
gRPC-C++.podspec generated

@ -230,6 +230,7 @@ Pod::Spec.new do |s|
ss.dependency 'abseil/base/base', abseil_version
ss.dependency 'abseil/base/config', abseil_version
ss.dependency 'abseil/base/core_headers', abseil_version
ss.dependency 'abseil/base/log_severity', abseil_version
ss.dependency 'abseil/base/no_destructor', abseil_version
ss.dependency 'abseil/cleanup/cleanup', abseil_version
ss.dependency 'abseil/container/flat_hash_map', abseil_version
@ -241,6 +242,7 @@ Pod::Spec.new do |s|
ss.dependency 'abseil/functional/bind_front', abseil_version
ss.dependency 'abseil/functional/function_ref', abseil_version
ss.dependency 'abseil/hash/hash', abseil_version
ss.dependency 'abseil/log/log', abseil_version
ss.dependency 'abseil/memory/memory', abseil_version
ss.dependency 'abseil/meta/type_traits', abseil_version
ss.dependency 'abseil/random/bit_gen_ref', abseil_version
@ -928,6 +930,7 @@ Pod::Spec.new do |s|
'src/core/lib/event_engine/default_event_engine.h',
'src/core/lib/event_engine/default_event_engine_factory.h',
'src/core/lib/event_engine/extensions/can_track_errors.h',
'src/core/lib/event_engine/extensions/chaotic_good_extension.h',
'src/core/lib/event_engine/extensions/supports_fd.h',
'src/core/lib/event_engine/forkable.h',
'src/core/lib/event_engine/grpc_polled_fd.h',
@ -1032,6 +1035,7 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/time_util.h',
'src/core/lib/gprpp/type_list.h',
'src/core/lib/gprpp/unique_type_name.h',
'src/core/lib/gprpp/uuid_v4.h',
'src/core/lib/gprpp/validation_errors.h',
'src/core/lib/gprpp/work_serializer.h',
'src/core/lib/gprpp/xxhash_inline.h',
@ -1146,6 +1150,7 @@ Pod::Spec.new do |s|
'src/core/lib/promise/try_seq.h',
'src/core/lib/resource_quota/api.h',
'src/core/lib/resource_quota/arena.h',
'src/core/lib/resource_quota/connection_quota.h',
'src/core/lib/resource_quota/memory_quota.h',
'src/core/lib/resource_quota/periodic_update.h',
'src/core/lib/resource_quota/resource_quota.h',
@ -1217,11 +1222,11 @@ Pod::Spec.new do |s|
'src/core/lib/slice/slice_refcount.h',
'src/core/lib/slice/slice_string_helpers.h',
'src/core/lib/surface/api_trace.h',
'src/core/lib/surface/builtins.h',
'src/core/lib/surface/call.h',
'src/core/lib/surface/call_test_only.h',
'src/core/lib/surface/call_trace.h',
'src/core/lib/surface/channel.h',
'src/core/lib/surface/channel_create.h',
'src/core/lib/surface/channel_init.h',
'src/core/lib/surface/channel_stack_type.h',
'src/core/lib/surface/completion_queue.h',
@ -1230,7 +1235,9 @@ Pod::Spec.new do |s|
'src/core/lib/surface/init.h',
'src/core/lib/surface/init_internally.h',
'src/core/lib/surface/lame_client.h',
'src/core/lib/surface/legacy_channel.h',
'src/core/lib/surface/server.h',
'src/core/lib/surface/server_interface.h',
'src/core/lib/surface/validate_metadata.h',
'src/core/lib/surface/wait_for_cq_end_op.h',
'src/core/lib/transport/batch_builder.h',
@ -1282,8 +1289,8 @@ Pod::Spec.new do |s|
'src/core/load_balancing/outlier_detection/outlier_detection.h',
'src/core/load_balancing/pick_first/pick_first.h',
'src/core/load_balancing/ring_hash/ring_hash.h',
'src/core/load_balancing/rls/rls.h',
'src/core/load_balancing/subchannel_interface.h',
'src/core/load_balancing/subchannel_list.h',
'src/core/load_balancing/weighted_round_robin/static_stride_scheduler.h',
'src/core/load_balancing/weighted_target/weighted_target.h',
'src/core/load_balancing/xds/xds_channel_args.h',
@ -2187,6 +2194,7 @@ Pod::Spec.new do |s|
'src/core/lib/event_engine/default_event_engine.h',
'src/core/lib/event_engine/default_event_engine_factory.h',
'src/core/lib/event_engine/extensions/can_track_errors.h',
'src/core/lib/event_engine/extensions/chaotic_good_extension.h',
'src/core/lib/event_engine/extensions/supports_fd.h',
'src/core/lib/event_engine/forkable.h',
'src/core/lib/event_engine/grpc_polled_fd.h',
@ -2291,6 +2299,7 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/time_util.h',
'src/core/lib/gprpp/type_list.h',
'src/core/lib/gprpp/unique_type_name.h',
'src/core/lib/gprpp/uuid_v4.h',
'src/core/lib/gprpp/validation_errors.h',
'src/core/lib/gprpp/work_serializer.h',
'src/core/lib/gprpp/xxhash_inline.h',
@ -2405,6 +2414,7 @@ Pod::Spec.new do |s|
'src/core/lib/promise/try_seq.h',
'src/core/lib/resource_quota/api.h',
'src/core/lib/resource_quota/arena.h',
'src/core/lib/resource_quota/connection_quota.h',
'src/core/lib/resource_quota/memory_quota.h',
'src/core/lib/resource_quota/periodic_update.h',
'src/core/lib/resource_quota/resource_quota.h',
@ -2476,11 +2486,11 @@ Pod::Spec.new do |s|
'src/core/lib/slice/slice_refcount.h',
'src/core/lib/slice/slice_string_helpers.h',
'src/core/lib/surface/api_trace.h',
'src/core/lib/surface/builtins.h',
'src/core/lib/surface/call.h',
'src/core/lib/surface/call_test_only.h',
'src/core/lib/surface/call_trace.h',
'src/core/lib/surface/channel.h',
'src/core/lib/surface/channel_create.h',
'src/core/lib/surface/channel_init.h',
'src/core/lib/surface/channel_stack_type.h',
'src/core/lib/surface/completion_queue.h',
@ -2489,7 +2499,9 @@ Pod::Spec.new do |s|
'src/core/lib/surface/init.h',
'src/core/lib/surface/init_internally.h',
'src/core/lib/surface/lame_client.h',
'src/core/lib/surface/legacy_channel.h',
'src/core/lib/surface/server.h',
'src/core/lib/surface/server_interface.h',
'src/core/lib/surface/validate_metadata.h',
'src/core/lib/surface/wait_for_cq_end_op.h',
'src/core/lib/transport/batch_builder.h',
@ -2541,8 +2553,8 @@ Pod::Spec.new do |s|
'src/core/load_balancing/outlier_detection/outlier_detection.h',
'src/core/load_balancing/pick_first/pick_first.h',
'src/core/load_balancing/ring_hash/ring_hash.h',
'src/core/load_balancing/rls/rls.h',
'src/core/load_balancing/subchannel_interface.h',
'src/core/load_balancing/subchannel_list.h',
'src/core/load_balancing/weighted_round_robin/static_stride_scheduler.h',
'src/core/load_balancing/weighted_target/weighted_target.h',
'src/core/load_balancing/xds/xds_channel_args.h',

29
gRPC-Core.podspec generated

@ -195,11 +195,12 @@ Pod::Spec.new do |s|
ss.libraries = 'z'
ss.dependency "#{s.name}/Interface", version
ss.dependency "#{s.name}/Privacy", version
ss.dependency 'BoringSSL-GRPC', '0.0.32'
ss.dependency 'BoringSSL-GRPC', '0.0.33'
ss.dependency 'abseil/algorithm/container', abseil_version
ss.dependency 'abseil/base/base', abseil_version
ss.dependency 'abseil/base/config', abseil_version
ss.dependency 'abseil/base/core_headers', abseil_version
ss.dependency 'abseil/base/log_severity', abseil_version
ss.dependency 'abseil/base/no_destructor', abseil_version
ss.dependency 'abseil/cleanup/cleanup', abseil_version
ss.dependency 'abseil/container/flat_hash_map', abseil_version
@ -211,6 +212,7 @@ Pod::Spec.new do |s|
ss.dependency 'abseil/functional/bind_front', abseil_version
ss.dependency 'abseil/functional/function_ref', abseil_version
ss.dependency 'abseil/hash/hash', abseil_version
ss.dependency 'abseil/log/log', abseil_version
ss.dependency 'abseil/memory/memory', abseil_version
ss.dependency 'abseil/meta/type_traits', abseil_version
ss.dependency 'abseil/random/bit_gen_ref', abseil_version
@ -231,7 +233,6 @@ Pod::Spec.new do |s|
ss.source_files = 'src/core/client_channel/backup_poller.cc',
'src/core/client_channel/backup_poller.h',
'src/core/client_channel/channel_connectivity.cc',
'src/core/client_channel/client_channel_channelz.cc',
'src/core/client_channel/client_channel_channelz.h',
'src/core/client_channel/client_channel_factory.cc',
@ -1317,6 +1318,7 @@ Pod::Spec.new do |s|
'src/core/lib/event_engine/default_event_engine_factory.h',
'src/core/lib/event_engine/event_engine.cc',
'src/core/lib/event_engine/extensions/can_track_errors.h',
'src/core/lib/event_engine/extensions/chaotic_good_extension.h',
'src/core/lib/event_engine/extensions/supports_fd.h',
'src/core/lib/event_engine/forkable.cc',
'src/core/lib/event_engine/forkable.h',
@ -1508,6 +1510,8 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/time_util.h',
'src/core/lib/gprpp/type_list.h',
'src/core/lib/gprpp/unique_type_name.h',
'src/core/lib/gprpp/uuid_v4.cc',
'src/core/lib/gprpp/uuid_v4.h',
'src/core/lib/gprpp/validation_errors.cc',
'src/core/lib/gprpp/validation_errors.h',
'src/core/lib/gprpp/windows/directory_reader.cc',
@ -1721,6 +1725,8 @@ Pod::Spec.new do |s|
'src/core/lib/resource_quota/api.h',
'src/core/lib/resource_quota/arena.cc',
'src/core/lib/resource_quota/arena.h',
'src/core/lib/resource_quota/connection_quota.cc',
'src/core/lib/resource_quota/connection_quota.h',
'src/core/lib/resource_quota/memory_quota.cc',
'src/core/lib/resource_quota/memory_quota.h',
'src/core/lib/resource_quota/periodic_update.cc',
@ -1870,8 +1876,6 @@ Pod::Spec.new do |s|
'src/core/lib/slice/slice_string_helpers.h',
'src/core/lib/surface/api_trace.cc',
'src/core/lib/surface/api_trace.h',
'src/core/lib/surface/builtins.cc',
'src/core/lib/surface/builtins.h',
'src/core/lib/surface/byte_buffer.cc',
'src/core/lib/surface/byte_buffer_reader.cc',
'src/core/lib/surface/call.cc',
@ -1882,9 +1886,10 @@ Pod::Spec.new do |s|
'src/core/lib/surface/call_trace.h',
'src/core/lib/surface/channel.cc',
'src/core/lib/surface/channel.h',
'src/core/lib/surface/channel_create.cc',
'src/core/lib/surface/channel_create.h',
'src/core/lib/surface/channel_init.cc',
'src/core/lib/surface/channel_init.h',
'src/core/lib/surface/channel_ping.cc',
'src/core/lib/surface/channel_stack_type.cc',
'src/core/lib/surface/channel_stack_type.h',
'src/core/lib/surface/completion_queue.cc',
@ -1899,9 +1904,12 @@ Pod::Spec.new do |s|
'src/core/lib/surface/init_internally.h',
'src/core/lib/surface/lame_client.cc',
'src/core/lib/surface/lame_client.h',
'src/core/lib/surface/legacy_channel.cc',
'src/core/lib/surface/legacy_channel.h',
'src/core/lib/surface/metadata_array.cc',
'src/core/lib/surface/server.cc',
'src/core/lib/surface/server.h',
'src/core/lib/surface/server_interface.h',
'src/core/lib/surface/validate_metadata.cc',
'src/core/lib/surface/validate_metadata.h',
'src/core/lib/surface/version.cc',
@ -1997,9 +2005,9 @@ Pod::Spec.new do |s|
'src/core/load_balancing/ring_hash/ring_hash.cc',
'src/core/load_balancing/ring_hash/ring_hash.h',
'src/core/load_balancing/rls/rls.cc',
'src/core/load_balancing/rls/rls.h',
'src/core/load_balancing/round_robin/round_robin.cc',
'src/core/load_balancing/subchannel_interface.h',
'src/core/load_balancing/subchannel_list.h',
'src/core/load_balancing/weighted_round_robin/static_stride_scheduler.cc',
'src/core/load_balancing/weighted_round_robin/static_stride_scheduler.h',
'src/core/load_balancing/weighted_round_robin/weighted_round_robin.cc',
@ -2968,6 +2976,7 @@ Pod::Spec.new do |s|
'src/core/lib/event_engine/default_event_engine.h',
'src/core/lib/event_engine/default_event_engine_factory.h',
'src/core/lib/event_engine/extensions/can_track_errors.h',
'src/core/lib/event_engine/extensions/chaotic_good_extension.h',
'src/core/lib/event_engine/extensions/supports_fd.h',
'src/core/lib/event_engine/forkable.h',
'src/core/lib/event_engine/grpc_polled_fd.h',
@ -3072,6 +3081,7 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/time_util.h',
'src/core/lib/gprpp/type_list.h',
'src/core/lib/gprpp/unique_type_name.h',
'src/core/lib/gprpp/uuid_v4.h',
'src/core/lib/gprpp/validation_errors.h',
'src/core/lib/gprpp/work_serializer.h',
'src/core/lib/gprpp/xxhash_inline.h',
@ -3186,6 +3196,7 @@ Pod::Spec.new do |s|
'src/core/lib/promise/try_seq.h',
'src/core/lib/resource_quota/api.h',
'src/core/lib/resource_quota/arena.h',
'src/core/lib/resource_quota/connection_quota.h',
'src/core/lib/resource_quota/memory_quota.h',
'src/core/lib/resource_quota/periodic_update.h',
'src/core/lib/resource_quota/resource_quota.h',
@ -3257,11 +3268,11 @@ Pod::Spec.new do |s|
'src/core/lib/slice/slice_refcount.h',
'src/core/lib/slice/slice_string_helpers.h',
'src/core/lib/surface/api_trace.h',
'src/core/lib/surface/builtins.h',
'src/core/lib/surface/call.h',
'src/core/lib/surface/call_test_only.h',
'src/core/lib/surface/call_trace.h',
'src/core/lib/surface/channel.h',
'src/core/lib/surface/channel_create.h',
'src/core/lib/surface/channel_init.h',
'src/core/lib/surface/channel_stack_type.h',
'src/core/lib/surface/completion_queue.h',
@ -3270,7 +3281,9 @@ Pod::Spec.new do |s|
'src/core/lib/surface/init.h',
'src/core/lib/surface/init_internally.h',
'src/core/lib/surface/lame_client.h',
'src/core/lib/surface/legacy_channel.h',
'src/core/lib/surface/server.h',
'src/core/lib/surface/server_interface.h',
'src/core/lib/surface/validate_metadata.h',
'src/core/lib/surface/wait_for_cq_end_op.h',
'src/core/lib/transport/batch_builder.h',
@ -3322,8 +3335,8 @@ Pod::Spec.new do |s|
'src/core/load_balancing/outlier_detection/outlier_detection.h',
'src/core/load_balancing/pick_first/pick_first.h',
'src/core/load_balancing/ring_hash/ring_hash.h',
'src/core/load_balancing/rls/rls.h',
'src/core/load_balancing/subchannel_interface.h',
'src/core/load_balancing/subchannel_list.h',
'src/core/load_balancing/weighted_round_robin/static_stride_scheduler.h',
'src/core/load_balancing/weighted_target/weighted_target.h',
'src/core/load_balancing/xds/xds_channel_args.h',

54
grpc.gemspec generated

@ -123,7 +123,6 @@ Gem::Specification.new do |s|
s.files += %w( include/grpc/support/workaround_list.h )
s.files += %w( src/core/client_channel/backup_poller.cc )
s.files += %w( src/core/client_channel/backup_poller.h )
s.files += %w( src/core/client_channel/channel_connectivity.cc )
s.files += %w( src/core/client_channel/client_channel_channelz.cc )
s.files += %w( src/core/client_channel/client_channel_channelz.h )
s.files += %w( src/core/client_channel/client_channel_factory.cc )
@ -1209,6 +1208,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/event_engine/default_event_engine_factory.h )
s.files += %w( src/core/lib/event_engine/event_engine.cc )
s.files += %w( src/core/lib/event_engine/extensions/can_track_errors.h )
s.files += %w( src/core/lib/event_engine/extensions/chaotic_good_extension.h )
s.files += %w( src/core/lib/event_engine/extensions/supports_fd.h )
s.files += %w( src/core/lib/event_engine/forkable.cc )
s.files += %w( src/core/lib/event_engine/forkable.h )
@ -1400,6 +1400,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/gprpp/time_util.h )
s.files += %w( src/core/lib/gprpp/type_list.h )
s.files += %w( src/core/lib/gprpp/unique_type_name.h )
s.files += %w( src/core/lib/gprpp/uuid_v4.cc )
s.files += %w( src/core/lib/gprpp/uuid_v4.h )
s.files += %w( src/core/lib/gprpp/validation_errors.cc )
s.files += %w( src/core/lib/gprpp/validation_errors.h )
s.files += %w( src/core/lib/gprpp/windows/directory_reader.cc )
@ -1613,6 +1615,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/resource_quota/api.h )
s.files += %w( src/core/lib/resource_quota/arena.cc )
s.files += %w( src/core/lib/resource_quota/arena.h )
s.files += %w( src/core/lib/resource_quota/connection_quota.cc )
s.files += %w( src/core/lib/resource_quota/connection_quota.h )
s.files += %w( src/core/lib/resource_quota/memory_quota.cc )
s.files += %w( src/core/lib/resource_quota/memory_quota.h )
s.files += %w( src/core/lib/resource_quota/periodic_update.cc )
@ -1762,8 +1766,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/slice/slice_string_helpers.h )
s.files += %w( src/core/lib/surface/api_trace.cc )
s.files += %w( src/core/lib/surface/api_trace.h )
s.files += %w( src/core/lib/surface/builtins.cc )
s.files += %w( src/core/lib/surface/builtins.h )
s.files += %w( src/core/lib/surface/byte_buffer.cc )
s.files += %w( src/core/lib/surface/byte_buffer_reader.cc )
s.files += %w( src/core/lib/surface/call.cc )
@ -1774,9 +1776,10 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/surface/call_trace.h )
s.files += %w( src/core/lib/surface/channel.cc )
s.files += %w( src/core/lib/surface/channel.h )
s.files += %w( src/core/lib/surface/channel_create.cc )
s.files += %w( src/core/lib/surface/channel_create.h )
s.files += %w( src/core/lib/surface/channel_init.cc )
s.files += %w( src/core/lib/surface/channel_init.h )
s.files += %w( src/core/lib/surface/channel_ping.cc )
s.files += %w( src/core/lib/surface/channel_stack_type.cc )
s.files += %w( src/core/lib/surface/channel_stack_type.h )
s.files += %w( src/core/lib/surface/completion_queue.cc )
@ -1791,9 +1794,12 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/surface/init_internally.h )
s.files += %w( src/core/lib/surface/lame_client.cc )
s.files += %w( src/core/lib/surface/lame_client.h )
s.files += %w( src/core/lib/surface/legacy_channel.cc )
s.files += %w( src/core/lib/surface/legacy_channel.h )
s.files += %w( src/core/lib/surface/metadata_array.cc )
s.files += %w( src/core/lib/surface/server.cc )
s.files += %w( src/core/lib/surface/server.h )
s.files += %w( src/core/lib/surface/server_interface.h )
s.files += %w( src/core/lib/surface/validate_metadata.cc )
s.files += %w( src/core/lib/surface/validate_metadata.h )
s.files += %w( src/core/lib/surface/version.cc )
@ -1889,9 +1895,9 @@ Gem::Specification.new do |s|
s.files += %w( src/core/load_balancing/ring_hash/ring_hash.cc )
s.files += %w( src/core/load_balancing/ring_hash/ring_hash.h )
s.files += %w( src/core/load_balancing/rls/rls.cc )
s.files += %w( src/core/load_balancing/rls/rls.h )
s.files += %w( src/core/load_balancing/round_robin/round_robin.cc )
s.files += %w( src/core/load_balancing/subchannel_interface.h )
s.files += %w( src/core/load_balancing/subchannel_list.h )
s.files += %w( src/core/load_balancing/weighted_round_robin/static_stride_scheduler.cc )
s.files += %w( src/core/load_balancing/weighted_round_robin/static_stride_scheduler.h )
s.files += %w( src/core/load_balancing/weighted_round_robin/weighted_round_robin.cc )
@ -2116,6 +2122,8 @@ Gem::Specification.new do |s|
s.files += %w( third_party/abseil-cpp/absl/debugging/internal/demangle.h )
s.files += %w( third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc )
s.files += %w( third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h )
s.files += %w( third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc )
s.files += %w( third_party/abseil-cpp/absl/debugging/internal/examine_stack.h )
s.files += %w( third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc )
s.files += %w( third_party/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc )
s.files += %w( third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h )
@ -2173,6 +2181,40 @@ Gem::Specification.new do |s|
s.files += %w( third_party/abseil-cpp/absl/hash/internal/hash.h )
s.files += %w( third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc )
s.files += %w( third_party/abseil-cpp/absl/hash/internal/low_level_hash.h )
s.files += %w( third_party/abseil-cpp/absl/log/absl_vlog_is_on.h )
s.files += %w( third_party/abseil-cpp/absl/log/globals.cc )
s.files += %w( third_party/abseil-cpp/absl/log/globals.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/append_truncated.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/conditions.cc )
s.files += %w( third_party/abseil-cpp/absl/log/internal/conditions.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/config.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/fnmatch.cc )
s.files += %w( third_party/abseil-cpp/absl/log/internal/fnmatch.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/globals.cc )
s.files += %w( third_party/abseil-cpp/absl/log/internal/globals.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/log_format.cc )
s.files += %w( third_party/abseil-cpp/absl/log/internal/log_format.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/log_impl.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/log_message.cc )
s.files += %w( third_party/abseil-cpp/absl/log/internal/log_message.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/log_sink_set.cc )
s.files += %w( third_party/abseil-cpp/absl/log/internal/log_sink_set.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/nullguard.cc )
s.files += %w( third_party/abseil-cpp/absl/log/internal/nullguard.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/nullstream.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/proto.cc )
s.files += %w( third_party/abseil-cpp/absl/log/internal/proto.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/strip.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/vlog_config.cc )
s.files += %w( third_party/abseil-cpp/absl/log/internal/vlog_config.h )
s.files += %w( third_party/abseil-cpp/absl/log/internal/voidify.h )
s.files += %w( third_party/abseil-cpp/absl/log/log.h )
s.files += %w( third_party/abseil-cpp/absl/log/log_entry.cc )
s.files += %w( third_party/abseil-cpp/absl/log/log_entry.h )
s.files += %w( third_party/abseil-cpp/absl/log/log_sink.cc )
s.files += %w( third_party/abseil-cpp/absl/log/log_sink.h )
s.files += %w( third_party/abseil-cpp/absl/log/log_sink_registry.h )
s.files += %w( third_party/abseil-cpp/absl/log/vlog_is_on.h )
s.files += %w( third_party/abseil-cpp/absl/memory/memory.h )
s.files += %w( third_party/abseil-cpp/absl/meta/type_traits.h )
s.files += %w( third_party/abseil-cpp/absl/numeric/bits.h )
@ -2838,6 +2880,8 @@ Gem::Specification.new do |s|
s.files += %w( third_party/boringssl-with-bazel/src/include/openssl/pkcs12.h )
s.files += %w( third_party/boringssl-with-bazel/src/include/openssl/pkcs7.h )
s.files += %w( third_party/boringssl-with-bazel/src/include/openssl/pkcs8.h )
s.files += %w( third_party/boringssl-with-bazel/src/include/openssl/pki/certificate.h )
s.files += %w( third_party/boringssl-with-bazel/src/include/openssl/pki/signature_verify_cache.h )
s.files += %w( third_party/boringssl-with-bazel/src/include/openssl/poly1305.h )
s.files += %w( third_party/boringssl-with-bazel/src/include/openssl/pool.h )
s.files += %w( third_party/boringssl-with-bazel/src/include/openssl/posix_time.h )

2676
grpc.gyp

File diff suppressed because it is too large Load Diff

@ -444,6 +444,9 @@ class EventEngine : public std::enable_shared_from_this<EventEngine>,
///
/// Implementations must not execute the closure in the calling thread before
/// \a RunAfter returns.
///
/// Implementations may return a \a kInvalid handle if the callback can be
/// immediately executed, and is therefore not cancellable.
virtual TaskHandle RunAfter(Duration when, Closure* closure) = 0;
/// Synonymous with scheduling an alarm to run after duration \a when.
///

@ -395,6 +395,10 @@
* factory. */
#define GRPC_ARG_EVENT_ENGINE_USE_MEMORY_ALLOCATOR_FACTORY \
"grpc.event_engine_use_memory_allocator_factory"
/** Configure the max number of allowed incoming connections to the server.
* If unspecified, it is unlimited */
#define GRPC_ARG_MAX_ALLOWED_INCOMING_CONNECTIONS \
"grpc.max_allowed_incoming_connections"
/** \} */
#endif /* GRPC_IMPL_CHANNEL_ARG_NAMES_H */

@ -40,8 +40,14 @@
#ifndef GRPC_CUSTOM_DESCRIPTOR
#include <google/protobuf/descriptor.h>
#include <google/protobuf/descriptor.pb.h>
#if GOOGLE_PROTOBUF_VERSION >= 4025000
#define GRPC_PROTOBUF_EDITION_SUPPORT
#endif
#define GRPC_CUSTOM_DESCRIPTOR ::google::protobuf::Descriptor
#define GRPC_CUSTOM_DESCRIPTORPOOL ::google::protobuf::DescriptorPool
#ifdef GRPC_PROTOBUF_EDITION_SUPPORT
#define GRPC_CUSTOM_EDITION ::google::protobuf::Edition
#endif
#define GRPC_CUSTOM_FIELDDESCRIPTOR ::google::protobuf::FieldDescriptor
#define GRPC_CUSTOM_FILEDESCRIPTOR ::google::protobuf::FileDescriptor
#define GRPC_CUSTOM_FILEDESCRIPTORPROTO ::google::protobuf::FileDescriptorProto
@ -85,6 +91,9 @@ typedef GRPC_CUSTOM_MESSAGELITE MessageLite;
typedef GRPC_CUSTOM_DESCRIPTOR Descriptor;
typedef GRPC_CUSTOM_DESCRIPTORPOOL DescriptorPool;
typedef GRPC_CUSTOM_DESCRIPTORDATABASE DescriptorDatabase;
#ifdef GRPC_PROTOBUF_EDITION_SUPPORT
typedef GRPC_CUSTOM_EDITION Edition;
#endif
typedef GRPC_CUSTOM_FIELDDESCRIPTOR FieldDescriptor;
typedef GRPC_CUSTOM_FILEDESCRIPTOR FileDescriptor;
typedef GRPC_CUSTOM_FILEDESCRIPTORPROTO FileDescriptorProto;

54
package.xml generated

@ -105,7 +105,6 @@
<file baseinstalldir="/" name="include/grpc/support/workaround_list.h" role="src" />
<file baseinstalldir="/" name="src/core/client_channel/backup_poller.cc" role="src" />
<file baseinstalldir="/" name="src/core/client_channel/backup_poller.h" role="src" />
<file baseinstalldir="/" name="src/core/client_channel/channel_connectivity.cc" role="src" />
<file baseinstalldir="/" name="src/core/client_channel/client_channel_channelz.cc" role="src" />
<file baseinstalldir="/" name="src/core/client_channel/client_channel_channelz.h" role="src" />
<file baseinstalldir="/" name="src/core/client_channel/client_channel_factory.cc" role="src" />
@ -1191,6 +1190,7 @@
<file baseinstalldir="/" name="src/core/lib/event_engine/default_event_engine_factory.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/event_engine/event_engine.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/event_engine/extensions/can_track_errors.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/event_engine/extensions/chaotic_good_extension.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/event_engine/extensions/supports_fd.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/event_engine/forkable.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/event_engine/forkable.h" role="src" />
@ -1382,6 +1382,8 @@
<file baseinstalldir="/" name="src/core/lib/gprpp/time_util.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/type_list.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/unique_type_name.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/uuid_v4.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/uuid_v4.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/validation_errors.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/validation_errors.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/windows/directory_reader.cc" role="src" />
@ -1595,6 +1597,8 @@
<file baseinstalldir="/" name="src/core/lib/resource_quota/api.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/resource_quota/arena.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/resource_quota/arena.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/resource_quota/connection_quota.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/resource_quota/connection_quota.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/resource_quota/memory_quota.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/resource_quota/memory_quota.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/resource_quota/periodic_update.cc" role="src" />
@ -1744,8 +1748,6 @@
<file baseinstalldir="/" name="src/core/lib/slice/slice_string_helpers.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/api_trace.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/api_trace.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/builtins.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/builtins.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/byte_buffer.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/byte_buffer_reader.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/call.cc" role="src" />
@ -1756,9 +1758,10 @@
<file baseinstalldir="/" name="src/core/lib/surface/call_trace.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/channel.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/channel.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/channel_create.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/channel_create.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/channel_init.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/channel_init.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/channel_ping.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/channel_stack_type.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/channel_stack_type.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/completion_queue.cc" role="src" />
@ -1773,9 +1776,12 @@
<file baseinstalldir="/" name="src/core/lib/surface/init_internally.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/lame_client.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/lame_client.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/legacy_channel.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/legacy_channel.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/metadata_array.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/server.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/server.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/server_interface.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/validate_metadata.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/validate_metadata.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/version.cc" role="src" />
@ -1871,9 +1877,9 @@
<file baseinstalldir="/" name="src/core/load_balancing/ring_hash/ring_hash.cc" role="src" />
<file baseinstalldir="/" name="src/core/load_balancing/ring_hash/ring_hash.h" role="src" />
<file baseinstalldir="/" name="src/core/load_balancing/rls/rls.cc" role="src" />
<file baseinstalldir="/" name="src/core/load_balancing/rls/rls.h" role="src" />
<file baseinstalldir="/" name="src/core/load_balancing/round_robin/round_robin.cc" role="src" />
<file baseinstalldir="/" name="src/core/load_balancing/subchannel_interface.h" role="src" />
<file baseinstalldir="/" name="src/core/load_balancing/subchannel_list.h" role="src" />
<file baseinstalldir="/" name="src/core/load_balancing/weighted_round_robin/static_stride_scheduler.cc" role="src" />
<file baseinstalldir="/" name="src/core/load_balancing/weighted_round_robin/static_stride_scheduler.h" role="src" />
<file baseinstalldir="/" name="src/core/load_balancing/weighted_round_robin/weighted_round_robin.cc" role="src" />
@ -2120,6 +2126,8 @@
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/demangle.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/examine_stack.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h" role="src" />
@ -2177,6 +2185,40 @@
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/hash/internal/hash.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/hash/internal/low_level_hash.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/absl_vlog_is_on.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/globals.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/globals.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/append_truncated.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/conditions.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/conditions.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/config.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/fnmatch.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/fnmatch.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/globals.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/globals.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/log_format.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/log_format.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/log_impl.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/log_message.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/log_message.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/log_sink_set.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/log_sink_set.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/nullguard.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/nullguard.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/nullstream.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/proto.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/proto.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/strip.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/vlog_config.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/vlog_config.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/internal/voidify.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/log.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/log_entry.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/log_entry.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/log_sink.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/log_sink.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/log_sink_registry.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/log/vlog_is_on.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/memory/memory.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/meta/type_traits.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/numeric/bits.h" role="src" />
@ -2842,6 +2884,8 @@
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/include/openssl/pkcs12.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/include/openssl/pkcs7.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/include/openssl/pkcs8.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/include/openssl/pki/certificate.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/include/openssl/pki/signature_verify_cache.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/include/openssl/poly1305.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/include/openssl/pool.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/include/openssl/posix_time.h" role="src" />

@ -393,6 +393,11 @@ if BUILD_WITH_BORING_SSL_ASM and not BUILD_WITH_SYSTEM_OPENSSL:
if BUILD_OVERRIDE_BORING_SSL_ASM_PLATFORM
else sysconfig.get_platform()
)
if "i686" in boringssl_asm_platform:
print("Enabling SSE2 on %s platform" % boringssl_asm_platform)
EXTRA_COMPILE_ARGS.append("-msse2")
else:
print("SSE2 not enabled on %s platform" % boringssl_asm_platform)
# BoringSSL's gas-compatible assembly files are all internally conditioned
# by the preprocessor. Provided the platform has a gas-compatible assembler
# (i.e. not Windows), we can include the assembly files and let BoringSSL

@ -1,4 +1,4 @@
// generated by generate_boringssl_prefix_header.sh on BoringSSL commit: ae72a4514c7afd150596b0a80947f3ca9b8363b5
// generated by generate_boringssl_prefix_header.sh on BoringSSL commit: e14d29f68c2d1b02e06f10c83b9b8ea4d061f8df
// Copyright (c) 2018, Google Inc.
//
@ -317,6 +317,7 @@
#define SSL_generate_key_block BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_generate_key_block)
#define SSL_get0_alpn_selected BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get0_alpn_selected)
#define SSL_get0_certificate_types BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get0_certificate_types)
#define SSL_get0_chain BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get0_chain)
#define SSL_get0_chain_certs BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get0_chain_certs)
#define SSL_get0_ech_name_override BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get0_ech_name_override)
#define SSL_get0_ech_retry_configs BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get0_ech_retry_configs)
@ -1285,12 +1286,17 @@
#define ChaCha20_ctr32_ssse3_4x BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ChaCha20_ctr32_ssse3_4x)
#define DES_decrypt3 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DES_decrypt3)
#define DES_ecb3_encrypt BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DES_ecb3_encrypt)
#define DES_ecb3_encrypt_ex BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DES_ecb3_encrypt_ex)
#define DES_ecb_encrypt BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DES_ecb_encrypt)
#define DES_ecb_encrypt_ex BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DES_ecb_encrypt_ex)
#define DES_ede2_cbc_encrypt BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DES_ede2_cbc_encrypt)
#define DES_ede3_cbc_encrypt BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DES_ede3_cbc_encrypt)
#define DES_ede3_cbc_encrypt_ex BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DES_ede3_cbc_encrypt_ex)
#define DES_encrypt3 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DES_encrypt3)
#define DES_ncbc_encrypt BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DES_ncbc_encrypt)
#define DES_ncbc_encrypt_ex BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DES_ncbc_encrypt_ex)
#define DES_set_key BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DES_set_key)
#define DES_set_key_ex BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DES_set_key_ex)
#define DES_set_key_unchecked BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DES_set_key_unchecked)
#define DES_set_odd_parity BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DES_set_odd_parity)
#define DH_bits BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DH_bits)
@ -2551,14 +2557,9 @@
#define X509_PUBKEY_set BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_PUBKEY_set)
#define X509_PUBKEY_set0_param BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_PUBKEY_set0_param)
#define X509_PURPOSE_get0 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_PURPOSE_get0)
#define X509_PURPOSE_get0_name BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_PURPOSE_get0_name)
#define X509_PURPOSE_get0_sname BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_PURPOSE_get0_sname)
#define X509_PURPOSE_get_by_id BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_PURPOSE_get_by_id)
#define X509_PURPOSE_get_by_sname BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_PURPOSE_get_by_sname)
#define X509_PURPOSE_get_count BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_PURPOSE_get_count)
#define X509_PURPOSE_get_id BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_PURPOSE_get_id)
#define X509_PURPOSE_get_trust BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_PURPOSE_get_trust)
#define X509_PURPOSE_set BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_PURPOSE_set)
#define X509_REQ_INFO_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_REQ_INFO_free)
#define X509_REQ_INFO_it BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_REQ_INFO_it)
#define X509_REQ_INFO_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_REQ_INFO_new)
@ -2665,6 +2666,7 @@
#define X509_STORE_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_STORE_free)
#define X509_STORE_get0_objects BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_STORE_get0_objects)
#define X509_STORE_get0_param BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_STORE_get0_param)
#define X509_STORE_get1_objects BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_STORE_get1_objects)
#define X509_STORE_load_locations BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_STORE_load_locations)
#define X509_STORE_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_STORE_new)
#define X509_STORE_set1_param BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_STORE_set1_param)
@ -2677,13 +2679,6 @@
#define X509_STORE_set_trust BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_STORE_set_trust)
#define X509_STORE_set_verify_cb BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_STORE_set_verify_cb)
#define X509_STORE_up_ref BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_STORE_up_ref)
#define X509_TRUST_get0 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_TRUST_get0)
#define X509_TRUST_get0_name BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_TRUST_get0_name)
#define X509_TRUST_get_by_id BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_TRUST_get_by_id)
#define X509_TRUST_get_count BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_TRUST_get_count)
#define X509_TRUST_get_flags BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_TRUST_get_flags)
#define X509_TRUST_get_trust BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_TRUST_get_trust)
#define X509_TRUST_set BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_TRUST_set)
#define X509_VAL_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_VAL_free)
#define X509_VAL_it BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_VAL_it)
#define X509_VAL_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_VAL_new)
@ -2782,6 +2777,7 @@
#define X509_getm_notAfter BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_getm_notAfter)
#define X509_getm_notBefore BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_getm_notBefore)
#define X509_gmtime_adj BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_gmtime_adj)
#define X509_is_valid_trust_id BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_is_valid_trust_id)
#define X509_issuer_name_cmp BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_issuer_name_cmp)
#define X509_issuer_name_hash BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_issuer_name_hash)
#define X509_issuer_name_hash_old BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_issuer_name_hash_old)

@ -34,8 +34,20 @@ class CppGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
virtual ~CppGrpcGenerator() {}
uint64_t GetSupportedFeatures() const override {
return FEATURE_PROTO3_OPTIONAL;
return FEATURE_PROTO3_OPTIONAL
#ifdef GRPC_PROTOBUF_EDITION_SUPPORT
| FEATURE_SUPPORTS_EDITIONS
#endif
;
}
#ifdef GRPC_PROTOBUF_EDITION_SUPPORT
grpc::protobuf::Edition GetMinimumEdition() const override {
return grpc::protobuf::Edition::EDITION_PROTO2;
}
grpc::protobuf::Edition GetMaximumEdition() const override {
return grpc::protobuf::Edition::EDITION_2023;
}
#endif
virtual bool Generate(const grpc::protobuf::FileDescriptor* file,
const std::string& parameter,

@ -30,9 +30,22 @@ class CSharpGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
~CSharpGrpcGenerator() {}
uint64_t GetSupportedFeatures() const override {
return FEATURE_PROTO3_OPTIONAL;
return FEATURE_PROTO3_OPTIONAL
#ifdef GRPC_PROTOBUF_EDITION_SUPPORT
| FEATURE_SUPPORTS_EDITIONS
#endif
;
}
#ifdef GRPC_PROTOBUF_EDITION_SUPPORT
grpc::protobuf::Edition GetMinimumEdition() const override {
return grpc::protobuf::Edition::EDITION_PROTO2;
}
grpc::protobuf::Edition GetMaximumEdition() const override {
return grpc::protobuf::Edition::EDITION_2023;
}
#endif
bool Generate(const grpc::protobuf::FileDescriptor* file,
const std::string& parameter,
grpc::protobuf::compiler::GeneratorContext* context,

@ -81,8 +81,21 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
public:
uint64_t GetSupportedFeatures() const override {
return FEATURE_PROTO3_OPTIONAL;
return FEATURE_PROTO3_OPTIONAL
#ifdef GRPC_PROTOBUF_EDITION_SUPPORT
| FEATURE_SUPPORTS_EDITIONS
#endif
;
}
#ifdef GRPC_PROTOBUF_EDITION_SUPPORT
grpc::protobuf::Edition GetMinimumEdition() const override {
return grpc::protobuf::Edition::EDITION_PROTO2;
}
grpc::protobuf::Edition GetMaximumEdition() const override {
return grpc::protobuf::Edition::EDITION_2023;
}
#endif
virtual bool Generate(const grpc::protobuf::FileDescriptor* file,
const ::std::string& parameter,

@ -34,9 +34,22 @@ class PHPGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
~PHPGrpcGenerator() {}
uint64_t GetSupportedFeatures() const override {
return FEATURE_PROTO3_OPTIONAL;
return FEATURE_PROTO3_OPTIONAL
#ifdef GRPC_PROTOBUF_EDITION_SUPPORT
| FEATURE_SUPPORTS_EDITIONS
#endif
;
}
#ifdef GRPC_PROTOBUF_EDITION_SUPPORT
grpc::protobuf::Edition GetMinimumEdition() const override {
return grpc::protobuf::Edition::EDITION_PROTO2;
}
grpc::protobuf::Edition GetMaximumEdition() const override {
return grpc::protobuf::Edition::EDITION_2023;
}
#endif
bool Generate(const grpc::protobuf::FileDescriptor* file,
const std::string& parameter,
grpc::protobuf::compiler::GeneratorContext* context,

@ -688,6 +688,9 @@ bool PrivateGenerator::PrintPreamble(grpc_generator::Printer* out) {
StringMap var;
var["Package"] = config.grpc_package_root;
out->Print(var, "import $Package$\n");
if (config.grpc_tools_version.size() > 0) {
out->Print(var, "import warnings\n");
}
if (generate_in_pb2_grpc) {
out->Print("\n");
StringPairSet imports_set;
@ -732,6 +735,56 @@ bool PrivateGenerator::PrintPreamble(grpc_generator::Printer* out) {
}
out->Print(var, "$ImportStatement$ as $ModuleAlias$\n");
}
// Checks if generate code is used with a supported grpcio version.
if (config.grpc_tools_version.size() > 0) {
var["ToolsVersion"] = config.grpc_tools_version;
out->Print(var, "\nGRPC_GENERATED_VERSION = '$ToolsVersion$'\n");
out->Print("GRPC_VERSION = grpc.__version__\n");
out->Print("EXPECTED_ERROR_RELEASE = '1.65.0'\n");
out->Print("SCHEDULED_RELEASE_DATE = 'June 25, 2024'\n");
out->Print("_version_not_supported = False\n\n");
out->Print("try:\n");
{
IndentScope raii_import_indent(out);
out->Print(
"from grpc._utilities import first_version_is_lower\n"
"_version_not_supported = first_version_is_lower(GRPC_VERSION, "
"GRPC_GENERATED_VERSION)\n");
}
out->Print("except ImportError:\n");
{
IndentScope raii_import_error_indent(out);
out->Print("_version_not_supported = True\n");
}
out->Print("\nif _version_not_supported:\n");
{
IndentScope raii_warning_indent(out);
out->Print("warnings.warn(\n");
{
IndentScope raii_warning_string_indent(out);
std::string filename_without_ext = file->filename_without_ext();
std::replace(filename_without_ext.begin(), filename_without_ext.end(),
'-', '_');
var["Pb2GrpcFileName"] = filename_without_ext;
out->Print(
var,
"f'The grpc package installed is at version {GRPC_VERSION},'\n"
"+ f' but the generated code in $Pb2GrpcFileName$_pb2_grpc.py "
"depends on'\n"
"+ f' grpcio>={GRPC_GENERATED_VERSION}.'\n"
"+ f' Please upgrade your grpc module to "
"grpcio>={GRPC_GENERATED_VERSION}'\n"
"+ f' or downgrade your generated code using "
"grpcio-tools<={GRPC_VERSION}.'\n"
"+ f' This warning will become an error in "
"{EXPECTED_ERROR_RELEASE},'\n"
"+ f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',\n"
"RuntimeWarning\n");
}
out->Print(")\n");
}
}
}
return true;
}
@ -828,7 +881,14 @@ pair<bool, std::string> PrivateGenerator::GetGrpcServices() {
GeneratorConfiguration::GeneratorConfiguration()
: grpc_package_root("grpc"),
beta_package_root("grpc.beta"),
import_prefix("") {}
import_prefix(""),
grpc_tools_version("") {}
GeneratorConfiguration::GeneratorConfiguration(std::string version)
: grpc_package_root("grpc"),
beta_package_root("grpc.beta"),
import_prefix(""),
grpc_tools_version(version) {}
PythonGrpcGenerator::PythonGrpcGenerator(const GeneratorConfiguration& config)
: config_(config) {}
@ -884,10 +944,6 @@ static bool ParseParameters(const std::string& parameter,
return true;
}
uint64_t PythonGrpcGenerator::GetSupportedFeatures() const {
return FEATURE_PROTO3_OPTIONAL;
}
bool PythonGrpcGenerator::Generate(const FileDescriptor* file,
const std::string& parameter,
GeneratorContext* context,

@ -31,11 +31,13 @@ namespace grpc_python_generator {
// that may be used internally at Google.
struct GeneratorConfiguration {
GeneratorConfiguration();
GeneratorConfiguration(std::string version);
std::string grpc_package_root;
// TODO(https://github.com/grpc/grpc/issues/8622): Drop this.
std::string beta_package_root;
// TODO(https://github.com/protocolbuffers/protobuf/issues/888): Drop this.
std::string import_prefix;
std::string grpc_tools_version;
std::vector<std::string> prefixes_to_filter;
};
@ -44,7 +46,22 @@ class PythonGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
PythonGrpcGenerator(const GeneratorConfiguration& config);
~PythonGrpcGenerator();
uint64_t GetSupportedFeatures() const override;
uint64_t GetSupportedFeatures() const override {
return FEATURE_PROTO3_OPTIONAL
#ifdef GRPC_PROTOBUF_EDITION_SUPPORT
| FEATURE_SUPPORTS_EDITIONS
#endif
;
}
#ifdef GRPC_PROTOBUF_EDITION_SUPPORT
grpc::protobuf::Edition GetMinimumEdition() const override {
return grpc::protobuf::Edition::EDITION_PROTO2;
}
grpc::protobuf::Edition GetMaximumEdition() const override {
return grpc::protobuf::Edition::EDITION_2023;
}
#endif
bool Generate(const grpc::protobuf::FileDescriptor* file,
const std::string& parameter,

@ -30,9 +30,22 @@ class RubyGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
~RubyGrpcGenerator() {}
uint64_t GetSupportedFeatures() const override {
return FEATURE_PROTO3_OPTIONAL;
return FEATURE_PROTO3_OPTIONAL
#ifdef GRPC_PROTOBUF_EDITION_SUPPORT
| FEATURE_SUPPORTS_EDITIONS
#endif
;
}
#ifdef GRPC_PROTOBUF_EDITION_SUPPORT
grpc::protobuf::Edition GetMinimumEdition() const override {
return grpc::protobuf::Edition::EDITION_PROTO2;
}
grpc::protobuf::Edition GetMaximumEdition() const override {
return grpc::protobuf::Edition::EDITION_2023;
}
#endif
bool Generate(const grpc::protobuf::FileDescriptor* file,
const std::string& /*parameter*/,
grpc::protobuf::compiler::GeneratorContext* context,

@ -59,6 +59,7 @@ grpc_cc_library(
name = "event_engine_extensions",
hdrs = [
"lib/event_engine/extensions/can_track_errors.h",
"lib/event_engine/extensions/chaotic_good_extension.h",
"lib/event_engine/extensions/supports_fd.h",
],
external_deps = [
@ -113,6 +114,35 @@ grpc_cc_library(
language = "c++",
)
grpc_cc_library(
name = "server_call_tracer_filter",
srcs = [
"lib/channel/server_call_tracer_filter.cc",
],
external_deps = [
"absl/status",
"absl/status:statusor",
],
language = "c++",
visibility = ["@grpc:alt_grpc_base_legacy"],
deps = [
"arena_promise",
"call_finalization",
"cancel_callback",
"channel_args",
"channel_fwd",
"channel_stack_type",
"context",
"map",
"pipe",
"//:call_tracer",
"//:config",
"//:gpr_platform",
"//:grpc_base",
"//:legacy_context",
],
)
grpc_cc_library(
name = "atomic_utils",
language = "c++",
@ -137,6 +167,7 @@ grpc_cc_library(
"hpack_constants",
"metadata_batch",
"slice",
"//:call_tracer",
"//:gpr_platform",
"//:grpc_base",
],
@ -1369,6 +1400,23 @@ grpc_cc_library(
],
)
grpc_cc_library(
name = "connection_quota",
srcs = [
"lib/resource_quota/connection_quota.cc",
],
hdrs = [
"lib/resource_quota/connection_quota.h",
],
external_deps = ["absl/base:core_headers"],
deps = [
"memory_quota",
"ref_counted",
"//:gpr",
"//:ref_counted_ptr",
],
)
grpc_cc_library(
name = "resource_quota_trace",
srcs = [
@ -1396,6 +1444,7 @@ grpc_cc_library(
"@grpc:alt_grpc_base_legacy",
],
deps = [
"connection_quota",
"memory_quota",
"ref_counted",
"thread_quota",
@ -2526,10 +2575,10 @@ grpc_cc_library(
grpc_cc_library(
name = "channel_args_endpoint_config",
srcs = [
"//src/core:lib/event_engine/channel_args_endpoint_config.cc",
"lib/event_engine/channel_args_endpoint_config.cc",
],
hdrs = [
"//src/core:lib/event_engine/channel_args_endpoint_config.h",
"lib/event_engine/channel_args_endpoint_config.h",
],
external_deps = [
"absl/strings",
@ -2889,6 +2938,19 @@ grpc_cc_library(
],
)
grpc_cc_library(
name = "server_interface",
hdrs = [
"lib/surface/server_interface.h",
],
language = "c++",
deps = [
"channel_args",
"//:channelz",
"//:gpr_platform",
],
)
grpc_cc_library(
name = "single_set_ptr",
hdrs = [
@ -3005,6 +3067,7 @@ grpc_cc_library(
"grpc_service_config",
"lb_policy",
"unique_type_name",
"//:call_tracer",
"//:gpr_public_hdrs",
"//:grpc_base",
"//:legacy_context",
@ -3827,6 +3890,7 @@ grpc_cc_library(
"iomgr_fwd",
"unique_type_name",
"useful",
"//:api_trace",
"//:channel_arg_names",
"//:debug_location",
"//:exec_ctx",
@ -3882,6 +3946,7 @@ grpc_cc_library(
"unique_type_name",
"useful",
"//:alts_util",
"//:api_trace",
"//:channel_arg_names",
"//:exec_ctx",
"//:gpr",
@ -3955,6 +4020,7 @@ grpc_cc_library(
"status_helper",
"unique_type_name",
"useful",
"//:api_trace",
"//:channel_arg_names",
"//:debug_location",
"//:exec_ctx",
@ -3995,6 +4061,7 @@ grpc_cc_library(
"slice",
"unique_type_name",
"useful",
"//:api_trace",
"//:exec_ctx",
"//:gpr",
"//:grpc_base",
@ -4042,6 +4109,7 @@ grpc_cc_library(
"time",
"unique_type_name",
"useful",
"//:api_trace",
"//:gpr",
"//:grpc_base",
"//:grpc_credentials_util",
@ -4687,7 +4755,9 @@ grpc_cc_library(
"useful",
"validation_errors",
"//:backoff",
"//:channel",
"//:channel_arg_names",
"//:channel_create",
"//:channelz",
"//:config",
"//:debug_location",
@ -4751,9 +4821,13 @@ grpc_cc_library(
srcs = [
"load_balancing/rls/rls.cc",
],
hdrs = [
"load_balancing/rls/rls.h",
],
external_deps = [
"absl/base:core_headers",
"absl/hash",
"absl/random",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -4779,14 +4853,19 @@ grpc_cc_library(
"lb_policy",
"lb_policy_factory",
"lb_policy_registry",
"match",
"metrics",
"pollset_set",
"slice",
"slice_refcount",
"status_helper",
"time",
"uuid_v4",
"validation_errors",
"//:backoff",
"//:channel",
"//:channel_arg_names",
"//:channel_create",
"//:channelz",
"//:config",
"//:debug_location",
@ -5003,7 +5082,9 @@ grpc_cc_library(
"validation_errors",
"xds_type_upb",
"xds_type_upbdefs",
"//:channel",
"//:channel_arg_names",
"//:channel_create",
"//:config",
"//:debug_location",
"//:endpoint_addresses",
@ -5084,6 +5165,7 @@ grpc_cc_library(
"resolved_address",
"slice_refcount",
"unique_type_name",
"//:api_trace",
"//:config",
"//:debug_location",
"//:exec_ctx",
@ -5096,6 +5178,7 @@ grpc_cc_library(
"//:iomgr",
"//:parse_address",
"//:ref_counted_ptr",
"//:server",
"//:sockaddr_utils",
"//:uri_parser",
"//:xds_client",
@ -5213,6 +5296,7 @@ grpc_cc_library(
"lb_policy",
"lb_policy_factory",
"lb_policy_registry",
"match",
"pollset_set",
"ref_counted",
"resolved_address",
@ -5386,35 +5470,6 @@ grpc_cc_library(
],
)
grpc_cc_library(
name = "grpc_lb_subchannel_list",
hdrs = [
"load_balancing/subchannel_list.h",
],
external_deps = [
"absl/status",
"absl/types:optional",
],
language = "c++",
deps = [
"channel_args",
"connectivity_state",
"dual_ref_counted",
"gpr_manual_constructor",
"health_check_client",
"iomgr_fwd",
"lb_policy",
"subchannel_interface",
"//:debug_location",
"//:endpoint_addresses",
"//:gpr",
"//:grpc_base",
"//:ref_counted_ptr",
"//:server_address",
"//:work_serializer",
],
)
grpc_cc_library(
name = "lb_endpoint_list",
srcs = [
@ -5471,7 +5526,6 @@ grpc_cc_library(
deps = [
"channel_args",
"connectivity_state",
"experiments",
"health_check_client",
"iomgr_fwd",
"json",
@ -5638,13 +5692,10 @@ grpc_cc_library(
deps = [
"channel_args",
"connectivity_state",
"experiments",
"grpc_lb_subchannel_list",
"json",
"lb_endpoint_list",
"lb_policy",
"lb_policy_factory",
"subchannel_interface",
"//:config",
"//:debug_location",
"//:endpoint_addresses",
@ -5653,7 +5704,6 @@ grpc_cc_library(
"//:grpc_trace",
"//:orphanable",
"//:ref_counted_ptr",
"//:server_address",
"//:work_serializer",
],
)
@ -5697,7 +5747,6 @@ grpc_cc_library(
"experiments",
"grpc_backend_metric_data",
"grpc_lb_policy_weighted_target",
"grpc_lb_subchannel_list",
"json",
"json_args",
"json_object_loader",
@ -5723,8 +5772,6 @@ grpc_cc_library(
"//:oob_backend_metric",
"//:orphanable",
"//:ref_counted_ptr",
"//:server_address",
"//:sockaddr_utils",
"//:stats",
"//:work_serializer",
],
@ -5969,6 +6016,7 @@ grpc_cc_library(
language = "c++",
deps = [
"arena_promise",
"call_finalization",
"channel_args",
"channel_fwd",
"channel_stack_type",
@ -6636,7 +6684,10 @@ grpc_cc_library(
"tcp_connect_handshaker",
"time",
"unique_type_name",
"//:api_trace",
"//:channel",
"//:channel_arg_names",
"//:channel_create",
"//:channelz",
"//:config",
"//:debug_location",
@ -6678,6 +6729,7 @@ grpc_cc_library(
"channel_args",
"channel_args_endpoint_config",
"closure",
"connection_quota",
"error",
"error_utils",
"grpc_insecure_credentials",
@ -6690,6 +6742,7 @@ grpc_cc_library(
"status_helper",
"time",
"unique_type_name",
"//:api_trace",
"//:channel_arg_names",
"//:channelz",
"//:chttp2_legacy_frame",
@ -6705,6 +6758,7 @@ grpc_cc_library(
"//:iomgr",
"//:orphanable",
"//:ref_counted_ptr",
"//:server",
"//:sockaddr_utils",
"//:uri_parser",
],
@ -6744,7 +6798,10 @@ grpc_cc_library(
"status_helper",
"time",
"try_seq",
"//:api_trace",
"//:channel",
"//:channel_arg_names",
"//:channel_create",
"//:channelz",
"//:config",
"//:debug_location",
@ -6756,6 +6813,7 @@ grpc_cc_library(
"//:iomgr",
"//:promise",
"//:ref_counted_ptr",
"//:server",
],
)
@ -6916,6 +6974,7 @@ grpc_cc_library(
"slice",
"slice_buffer",
"time",
"//:call_tracer",
"//:channel_arg_names",
"//:config",
"//:gpr",
@ -7112,6 +7171,21 @@ grpc_cc_library(
],
)
grpc_cc_library(
name = "call_finalization",
hdrs = [
"lib/channel/call_finalization.h",
],
language = "c++",
visibility = ["@grpc:alt_grpc_base_legacy"],
deps = [
"arena",
"call_final_info",
"context",
"//:gpr_platform",
],
)
grpc_cc_library(
name = "call_filters",
srcs = [
@ -7266,7 +7340,7 @@ grpc_cc_library(
deps = [
"arena",
"chunked_vector",
"compression_internal",
"compression",
"experiments",
"if_list",
"metadata_compression_traits",
@ -7313,8 +7387,9 @@ grpc_cc_library(
)
grpc_cc_library(
name = "compression_internal",
name = "compression",
srcs = [
"lib/compression/compression.cc",
"lib/compression/compression_internal.cc",
],
hdrs = [
@ -7331,6 +7406,8 @@ grpc_cc_library(
"channel_args",
"ref_counted_string",
"slice",
"useful",
"//:api_trace",
"//:gpr",
"//:grpc_public_hdrs",
"//:grpc_trace",
@ -7369,6 +7446,8 @@ grpc_cc_library(
"error",
"error_utils",
"event_engine_common",
"event_engine_extensions",
"event_engine_query_extensions",
"event_engine_tcp_socket_utils",
"event_engine_wakeup_scheduler",
"grpc_promise_endpoint",
@ -7397,6 +7476,7 @@ grpc_cc_library(
"//:iomgr",
"//:orphanable",
"//:ref_counted_ptr",
"//:server",
],
)
@ -7429,6 +7509,8 @@ grpc_cc_library(
"default_event_engine",
"error",
"error_utils",
"event_engine_extensions",
"event_engine_query_extensions",
"event_engine_tcp_socket_utils",
"event_engine_wakeup_scheduler",
"grpc_promise_endpoint",
@ -7446,6 +7528,9 @@ grpc_cc_library(
"time",
"try_seq",
"wait_for_callback",
"//:api_trace",
"//:channel",
"//:channel_create",
"//:debug_location",
"//:exec_ctx",
"//:gpr",
@ -7470,6 +7555,7 @@ grpc_cc_library(
],
external_deps = [
"absl/container:flat_hash_map",
"absl/functional:any_invocable",
"absl/functional:function_ref",
"absl/strings",
"absl/types:span",
@ -7478,6 +7564,7 @@ grpc_cc_library(
deps = [
"channel_args",
"no_destruct",
"time",
"//:gpr",
],
)

@ -1,250 +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 <inttypes.h>
#include "absl/base/thread_annotations.h"
#include "absl/status/status.h"
#include "absl/types/optional.h"
#include <grpc/event_engine/event_engine.h>
#include <grpc/grpc.h>
#include <grpc/impl/connectivity_state.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include "src/core/client_channel/client_channel_filter.h"
#include "src/core/lib/channel/channel_fwd.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/dual_ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/completion_queue.h"
#include "src/core/lib/surface/lame_client.h"
namespace grpc_core {
namespace {
bool IsLameChannel(Channel* channel) {
grpc_channel_element* elem =
grpc_channel_stack_last_element(channel->channel_stack());
return elem->filter == &LameClientFilter::kFilter;
}
} // namespace
} // namespace grpc_core
grpc_connectivity_state grpc_channel_check_connectivity_state(
grpc_channel* c_channel, int try_to_connect) {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
GRPC_API_TRACE(
"grpc_channel_check_connectivity_state(channel=%p, try_to_connect=%d)", 2,
(c_channel, try_to_connect));
grpc_core::Channel* channel = grpc_core::Channel::FromC(c_channel);
// Forward through to the underlying client channel.
grpc_core::ClientChannelFilter* client_channel =
grpc_core::ClientChannelFilter::GetFromChannel(channel);
if (GPR_UNLIKELY(client_channel == nullptr)) {
if (grpc_core::IsLameChannel(channel)) {
return GRPC_CHANNEL_TRANSIENT_FAILURE;
}
gpr_log(GPR_ERROR,
"grpc_channel_check_connectivity_state called on something that is "
"not a client channel");
return GRPC_CHANNEL_SHUTDOWN;
}
return client_channel->CheckConnectivityState(try_to_connect);
}
int grpc_channel_support_connectivity_watcher(grpc_channel* channel) {
return grpc_core::ClientChannelFilter::GetFromChannel(
grpc_core::Channel::FromC(channel)) != nullptr;
}
namespace grpc_core {
namespace {
class StateWatcher : public DualRefCounted<StateWatcher> {
public:
StateWatcher(grpc_channel* c_channel, grpc_completion_queue* cq, void* tag,
grpc_connectivity_state last_observed_state,
gpr_timespec deadline)
: channel_(Channel::FromC(c_channel)->Ref()),
cq_(cq),
tag_(tag),
state_(last_observed_state) {
GPR_ASSERT(grpc_cq_begin_op(cq, tag));
GRPC_CLOSURE_INIT(&on_complete_, WatchComplete, this, nullptr);
ClientChannelFilter* client_channel =
ClientChannelFilter::GetFromChannel(channel_.get());
if (client_channel == nullptr) {
// If the target URI used to create the channel was invalid, channel
// stack initialization failed, and that caused us to create a lame
// channel. In that case, connectivity state will never change (it
// will always be TRANSIENT_FAILURE), so we don't actually start a
// watch, but we are hiding that fact from the application.
if (IsLameChannel(channel_.get())) {
// A ref is held by the timer callback.
StartTimer(Timestamp::FromTimespecRoundUp(deadline));
// Ref from object creation needs to be freed here since lame channel
// does not have a watcher.
Unref();
return;
}
Crash(
"grpc_channel_watch_connectivity_state called on something that is "
"not a client channel");
}
// Ref from object creation is held by the watcher callback.
auto* watcher_timer_init_state = new WatcherTimerInitState(
this, Timestamp::FromTimespecRoundUp(deadline));
client_channel->AddExternalConnectivityWatcher(
grpc_polling_entity_create_from_pollset(grpc_cq_pollset(cq)), &state_,
&on_complete_, watcher_timer_init_state->closure());
}
private:
// A fire-and-forget object used to delay starting the timer until the
// ClientChannelFilter actually starts the watch.
class WatcherTimerInitState {
public:
WatcherTimerInitState(StateWatcher* state_watcher, Timestamp deadline)
: state_watcher_(state_watcher), deadline_(deadline) {
GRPC_CLOSURE_INIT(&closure_, WatcherTimerInit, this, nullptr);
}
grpc_closure* closure() { return &closure_; }
private:
static void WatcherTimerInit(void* arg, grpc_error_handle /*error*/) {
auto* self = static_cast<WatcherTimerInitState*>(arg);
self->state_watcher_->StartTimer(self->deadline_);
delete self;
}
StateWatcher* state_watcher_;
Timestamp deadline_;
grpc_closure closure_;
};
void StartTimer(Timestamp deadline) {
const Duration timeout = deadline - Timestamp::Now();
MutexLock lock(&mu_);
timer_handle_ = channel_->channel_stack()->EventEngine()->RunAfter(
timeout, [self = Ref()]() mutable {
ApplicationCallbackExecCtx callback_exec_ctx;
ExecCtx exec_ctx;
self->TimeoutComplete();
// StateWatcher deletion might require an active ExecCtx.
self.reset();
});
}
static void WatchComplete(void* arg, grpc_error_handle error) {
auto* self = static_cast<StateWatcher*>(arg);
if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_operation_failures)) {
GRPC_LOG_IF_ERROR("watch_completion_error", error);
}
{
MutexLock lock(&self->mu_);
if (self->timer_handle_.has_value()) {
self->channel_->channel_stack()->EventEngine()->Cancel(
*self->timer_handle_);
}
}
// Watcher fired when either notified or cancelled, either way the state of
// this watcher has been cleared from the client channel. Thus there is no
// need to cancel the watch again.
self->Unref();
}
void TimeoutComplete() {
timer_fired_ = true;
// If this is a client channel (not a lame channel), cancel the watch.
ClientChannelFilter* client_channel =
ClientChannelFilter::GetFromChannel(channel_.get());
if (client_channel != nullptr) {
client_channel->CancelExternalConnectivityWatcher(&on_complete_);
}
}
// Invoked when both strong refs are released.
void Orphan() override {
WeakRef().release(); // Take a weak ref until completion is finished.
grpc_error_handle error =
timer_fired_
? GRPC_ERROR_CREATE("Timed out waiting for connection state change")
: absl::OkStatus();
grpc_cq_end_op(cq_, tag_, error, FinishedCompletion, this,
&completion_storage_);
}
// Called when the completion is returned to the CQ.
static void FinishedCompletion(void* arg, grpc_cq_completion* /*ignored*/) {
auto* self = static_cast<StateWatcher*>(arg);
self->WeakUnref();
}
RefCountedPtr<Channel> channel_;
grpc_completion_queue* cq_;
void* tag_;
grpc_connectivity_state state_;
grpc_cq_completion completion_storage_;
grpc_closure on_complete_;
// timer_handle_ might be accessed in parallel from multiple threads, e.g.
// timer callback fired immediately on an EventEngine thread before
// RunAfter() returns.
Mutex mu_;
absl::optional<grpc_event_engine::experimental::EventEngine::TaskHandle>
timer_handle_ ABSL_GUARDED_BY(mu_);
bool timer_fired_ = false;
};
} // namespace
} // namespace grpc_core
void grpc_channel_watch_connectivity_state(
grpc_channel* channel, grpc_connectivity_state last_observed_state,
gpr_timespec deadline, grpc_completion_queue* cq, void* tag) {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
GRPC_API_TRACE(
"grpc_channel_watch_connectivity_state("
"channel=%p, last_observed_state=%d, "
"deadline=gpr_timespec { tv_sec: %" PRId64
", tv_nsec: %d, clock_type: %d }, "
"cq=%p, tag=%p)",
7,
(channel, (int)last_observed_state, deadline.tv_sec, deadline.tv_nsec,
(int)deadline.clock_type, cq, tag));
new grpc_core::StateWatcher(channel, cq, tag, last_observed_state, deadline);
}

@ -94,7 +94,6 @@
#include "src/core/lib/slice/slice.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/call.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/error_utils.h"
#include "src/core/lib/transport/metadata_batch.h"
@ -1197,16 +1196,6 @@ class ClientChannelFilter::ClientChannelControlHelper
// ClientChannelFilter implementation
//
ClientChannelFilter* ClientChannelFilter::GetFromChannel(Channel* channel) {
grpc_channel_element* elem =
grpc_channel_stack_last_element(channel->channel_stack());
if (elem->filter != &kFilterVtableWithPromises &&
elem->filter != &kFilterVtableWithoutPromises) {
return nullptr;
}
return static_cast<ClientChannelFilter*>(elem->channel_data);
}
grpc_error_handle ClientChannelFilter::Init(grpc_channel_element* elem,
grpc_channel_element_args* args) {
GPR_ASSERT(args->is_last);

@ -65,7 +65,6 @@
#include "src/core/lib/resource_quota/arena.h"
#include "src/core/service_config/service_config.h"
#include "src/core/lib/slice/slice.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/transport/transport.h"
@ -115,10 +114,6 @@ class ClientChannelFilter {
struct RawPointerChannelArgTag {};
static absl::string_view ChannelArgName() { return GRPC_ARG_CLIENT_CHANNEL; }
// Returns the ClientChannelFilter object from channel, or null if channel
// is not a client channel.
static ClientChannelFilter* GetFromChannel(Channel* channel);
static ArenaPromise<ServerMetadataHandle> MakeCallPromise(
grpc_channel_element* elem, CallArgs call_args,
NextPromiseFactory next_promise_factory);

@ -64,12 +64,7 @@ const NoInterceptor ChannelIdleFilter::Call::OnServerToClientMessage;
namespace {
// TODO(roth): This can go back to being a constant when the experiment
// is removed.
Duration DefaultIdleTimeout() {
if (IsClientIdlenessEnabled()) return Duration::Minutes(30);
return Duration::Infinity();
}
constexpr Duration kDefaultIdleTimeout = Duration::Minutes(30);
// If these settings change, make sure that we are not sending a GOAWAY for
// inproc transport, since a GOAWAY to inproc ends up destroying the transport.
@ -92,7 +87,7 @@ namespace {
Duration GetClientIdleTimeout(const ChannelArgs& args) {
return args.GetDurationFromIntMillis(GRPC_ARG_CLIENT_IDLE_TIMEOUT_MS)
.value_or(DefaultIdleTimeout());
.value_or(kDefaultIdleTimeout);
}
} // namespace

@ -58,12 +58,7 @@ namespace grpc_core {
namespace {
// TODO(roth): This can go back to being a constant when the experiment
// is removed.
Duration DefaultIdleTimeout() {
if (IsClientIdlenessEnabled()) return Duration::Minutes(30);
return Duration::Infinity();
}
constexpr Duration kDefaultIdleTimeout = Duration::Minutes(30);
// If these settings change, make sure that we are not sending a GOAWAY for
// inproc transport, since a GOAWAY to inproc ends up destroying the transport.
@ -86,7 +81,7 @@ namespace {
Duration GetClientIdleTimeout(const ChannelArgs& args) {
return args.GetDurationFromIntMillis(GRPC_ARG_CLIENT_IDLE_TIMEOUT_MS)
.value_or(DefaultIdleTimeout());
.value_or(kDefaultIdleTimeout);
}
} // namespace

@ -169,7 +169,7 @@ MessageHandle ChannelCompression::CompressMessage(
}
absl::StatusOr<MessageHandle> ChannelCompression::DecompressMessage(
MessageHandle message, DecompressArgs args) const {
bool is_client, MessageHandle message, DecompressArgs args) const {
if (GRPC_TRACE_FLAG_ENABLED(grpc_compression_trace)) {
gpr_log(GPR_INFO, "DecompressMessage: len=%" PRIdPTR " max=%d alg=%d",
message->payload()->Length(),
@ -186,8 +186,9 @@ absl::StatusOr<MessageHandle> ChannelCompression::DecompressMessage(
message->payload()->Length() >
static_cast<size_t>(*args.max_recv_message_length)) {
return absl::ResourceExhaustedError(absl::StrFormat(
"Received message larger than max (%u vs. %d)",
message->payload()->Length(), *args.max_recv_message_length));
"%s: Received message larger than max (%u vs. %d)",
is_client ? "CLIENT" : "SERVER", message->payload()->Length(),
*args.max_recv_message_length));
}
// Check if decompression is enabled (if not, we can just pass the message
// up).
@ -264,8 +265,8 @@ void ClientCompressionFilter::Call::OnServerInitialMetadata(
absl::StatusOr<MessageHandle>
ClientCompressionFilter::Call::OnServerToClientMessage(
MessageHandle message, ClientCompressionFilter* filter) {
return filter->compression_engine_.DecompressMessage(std::move(message),
decompress_args_);
return filter->compression_engine_.DecompressMessage(
/*is_client=*/true, std::move(message), decompress_args_);
}
void ServerCompressionFilter::Call::OnClientInitialMetadata(
@ -276,8 +277,8 @@ void ServerCompressionFilter::Call::OnClientInitialMetadata(
absl::StatusOr<MessageHandle>
ServerCompressionFilter::Call::OnClientToServerMessage(
MessageHandle message, ServerCompressionFilter* filter) {
return filter->compression_engine_.DecompressMessage(std::move(message),
decompress_args_);
return filter->compression_engine_.DecompressMessage(
/*is_client=*/false, std::move(message), decompress_args_);
}
void ServerCompressionFilter::Call::OnServerInitialMetadata(

@ -87,7 +87,8 @@ class ChannelCompression {
MessageHandle CompressMessage(MessageHandle message,
grpc_compression_algorithm algorithm) const;
// Decompress one message synchronously.
absl::StatusOr<MessageHandle> DecompressMessage(MessageHandle message,
absl::StatusOr<MessageHandle> DecompressMessage(bool is_client,
MessageHandle message,
DecompressArgs args) const;
private:

@ -166,7 +166,7 @@ MessageHandle LegacyCompressionFilter::CompressMessage(
}
absl::StatusOr<MessageHandle> LegacyCompressionFilter::DecompressMessage(
MessageHandle message, DecompressArgs args) const {
bool is_client, MessageHandle message, DecompressArgs args) const {
if (GRPC_TRACE_FLAG_ENABLED(grpc_compression_trace)) {
gpr_log(GPR_INFO, "DecompressMessage: len=%" PRIdPTR " max=%d alg=%d",
message->payload()->Length(),
@ -183,8 +183,9 @@ absl::StatusOr<MessageHandle> LegacyCompressionFilter::DecompressMessage(
message->payload()->Length() >
static_cast<size_t>(*args.max_recv_message_length)) {
return absl::ResourceExhaustedError(absl::StrFormat(
"Received message larger than max (%u vs. %d)",
message->payload()->Length(), *args.max_recv_message_length));
"%s: Received message larger than max (%u vs. %d)",
is_client ? "CLIENT" : "SERVER", message->payload()->Length(),
*args.max_recv_message_length));
}
// Check if decompression is enabled (if not, we can just pass the message
// up).
@ -266,7 +267,8 @@ LegacyClientCompressionFilter::MakeCallPromise(
call_args.server_to_client_messages->InterceptAndMap(
[decompress_err, decompress_args,
this](MessageHandle message) -> absl::optional<MessageHandle> {
auto r = DecompressMessage(std::move(message), *decompress_args);
auto r = DecompressMessage(/*is_client=*/true, std::move(message),
*decompress_args);
if (!r.ok()) {
decompress_err->Set(ServerMetadataFromStatus(r.status()));
return absl::nullopt;
@ -288,7 +290,8 @@ LegacyServerCompressionFilter::MakeCallPromise(
call_args.client_to_server_messages->InterceptAndMap(
[decompress_err, decompress_args,
this](MessageHandle message) -> absl::optional<MessageHandle> {
auto r = DecompressMessage(std::move(message), decompress_args);
auto r = DecompressMessage(/*is_client=*/false, std::move(message),
decompress_args);
if (grpc_call_trace.enabled()) {
gpr_log(GPR_DEBUG, "%s[compression] DecompressMessage returned %s",
GetContext<Activity>()->DebugTag().c_str(),

@ -87,7 +87,8 @@ class LegacyCompressionFilter : public ChannelFilter {
MessageHandle CompressMessage(MessageHandle message,
grpc_compression_algorithm algorithm) const;
// Decompress one message synchronously.
absl::StatusOr<MessageHandle> DecompressMessage(MessageHandle message,
absl::StatusOr<MessageHandle> DecompressMessage(bool is_client,
MessageHandle message,
DecompressArgs args) const;
private:

@ -160,7 +160,7 @@ absl::StatusOr<ServerMessageSizeFilter> ServerMessageSizeFilter::Create(
namespace {
ServerMetadataHandle CheckPayload(const Message& msg,
absl::optional<uint32_t> max_length,
bool is_send) {
bool is_client, bool is_send) {
if (!max_length.has_value()) return nullptr;
if (GRPC_TRACE_FLAG_ENABLED(grpc_call_trace)) {
gpr_log(GPR_INFO, "%s[message_size] %s len:%" PRIdPTR " max:%d",
@ -170,10 +170,11 @@ ServerMetadataHandle CheckPayload(const Message& msg,
if (msg.payload()->Length() <= *max_length) return nullptr;
auto r = GetContext<Arena>()->MakePooled<ServerMetadata>(GetContext<Arena>());
r->Set(GrpcStatusMetadata(), GRPC_STATUS_RESOURCE_EXHAUSTED);
r->Set(GrpcMessageMetadata(), Slice::FromCopiedString(absl::StrFormat(
"%s message larger than max (%u vs. %d)",
is_send ? "Sent" : "Received",
msg.payload()->Length(), *max_length)));
r->Set(GrpcMessageMetadata(),
Slice::FromCopiedString(absl::StrFormat(
"%s: %s message larger than max (%u vs. %d)",
is_client ? "CLIENT" : "SERVER", is_send ? "Sent" : "Received",
msg.payload()->Length(), *max_length)));
return r;
}
} // namespace
@ -207,22 +208,26 @@ ClientMessageSizeFilter::Call::Call(ClientMessageSizeFilter* filter)
ServerMetadataHandle ServerMessageSizeFilter::Call::OnClientToServerMessage(
const Message& message, ServerMessageSizeFilter* filter) {
return CheckPayload(message, filter->parsed_config_.max_recv_size(), false);
return CheckPayload(message, filter->parsed_config_.max_recv_size(),
/*is_client=*/false, false);
}
ServerMetadataHandle ServerMessageSizeFilter::Call::OnServerToClientMessage(
const Message& message, ServerMessageSizeFilter* filter) {
return CheckPayload(message, filter->parsed_config_.max_send_size(), true);
return CheckPayload(message, filter->parsed_config_.max_send_size(),
/*is_client=*/false, true);
}
ServerMetadataHandle ClientMessageSizeFilter::Call::OnClientToServerMessage(
const Message& message) {
return CheckPayload(message, limits_.max_send_size(), true);
return CheckPayload(message, limits_.max_send_size(), /*is_client=*/true,
true);
}
ServerMetadataHandle ClientMessageSizeFilter::Call::OnServerToClientMessage(
const Message& message) {
return CheckPayload(message, limits_.max_recv_size(), false);
return CheckPayload(message, limits_.max_recv_size(), /*is_client=*/true,
false);
}
namespace {

@ -28,6 +28,7 @@
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/channel_create.h"
namespace {
@ -56,8 +57,8 @@ grpc_channel* CreateDirectBinderChannelImplForTesting(
.PreconditionChannelArgs(args)
.Set(GRPC_ARG_DEFAULT_AUTHORITY, "binder.authority");
auto channel =
grpc_core::Channel::Create("binder_target_placeholder", channel_args,
GRPC_CLIENT_DIRECT_CHANNEL, transport);
grpc_core::ChannelCreate("binder_target_placeholder", channel_args,
GRPC_CLIENT_DIRECT_CHANNEL, transport);
// TODO(mingcl): Handle error properly
GPR_ASSERT(channel.ok());
grpc_channel_args_destroy(args);
@ -75,8 +76,8 @@ grpc_channel* CreateClientBinderChannelImpl(const grpc_channel_args* args) {
.SetObject(g_factory);
auto channel =
grpc_core::Channel::Create("binder_channel_target_placeholder",
channel_args, GRPC_CLIENT_CHANNEL, nullptr);
grpc_core::ChannelCreate("binder_channel_target_placeholder",
channel_args, GRPC_CLIENT_CHANNEL, nullptr);
if (!channel.ok()) {
return grpc_lame_client_channel_create(

@ -35,6 +35,8 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/event_engine/channel_args_endpoint_config.h"
#include "src/core/lib/event_engine/default_event_engine.h"
#include "src/core/lib/event_engine/extensions/chaotic_good_extension.h"
#include "src/core/lib/event_engine/query_extensions.h"
#include "src/core/lib/event_engine/tcp_socket_utils.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/no_destruct.h"
@ -58,6 +60,7 @@
#include "src/core/lib/slice/slice_buffer.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/channel_create.h"
#include "src/core/lib/transport/error_utils.h"
#include "src/core/lib/transport/handshaker.h"
#include "src/core/lib/transport/promise_endpoint.h"
@ -129,6 +132,14 @@ auto ChaoticGoodConnector::WaitForDataEndpointSetup(
GRPC_ERROR_CREATE("connect endpoint failed"));
return;
}
auto* chaotic_good_ext =
grpc_event_engine::experimental::QueryExtension<
grpc_event_engine::experimental::ChaoticGoodExtension>(
endpoint.value().get());
if (chaotic_good_ext != nullptr) {
chaotic_good_ext->EnableStatsCollection(
/*is_control_channel=*/false);
}
self->data_endpoint_ =
PromiseEndpoint(std::move(endpoint.value()), SliceBuffer());
self->data_endpoint_ready_.Set();
@ -240,6 +251,13 @@ void ChaoticGoodConnector::Connect(const Args& args, Result* result,
return;
}
auto* p = self.release();
auto* chaotic_good_ext =
grpc_event_engine::experimental::QueryExtension<
grpc_event_engine::experimental::ChaoticGoodExtension>(
endpoint.value().get());
if (chaotic_good_ext != nullptr) {
chaotic_good_ext->EnableStatsCollection(/*is_control_channel=*/true);
}
p->handshake_mgr_->DoHandshake(
grpc_event_engine_endpoint_create(std::move(endpoint.value())),
p->args_.channel_args, p->args_.deadline, nullptr /* acceptor */,
@ -355,7 +373,7 @@ grpc_channel* grpc_chaotic_good_channel_create(const char* target,
std::string canonical_target = grpc_core::CoreConfiguration::Get()
.resolver_registry()
.AddDefaultPrefixIfNeeded(target);
auto r = grpc_core::Channel::Create(
auto r = grpc_core::ChannelCreate(
target,
grpc_core::CoreConfiguration::Get()
.channel_args_preconditioning()

@ -39,6 +39,8 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/event_engine/channel_args_endpoint_config.h"
#include "src/core/lib/event_engine/default_event_engine.h"
#include "src/core/lib/event_engine/extensions/chaotic_good_extension.h"
#include "src/core/lib/event_engine/query_extensions.h"
#include "src/core/lib/event_engine/resolved_address_internal.h"
#include "src/core/lib/event_engine/tcp_socket_utils.h"
#include "src/core/lib/gprpp/orphanable.h"
@ -397,22 +399,28 @@ void ChaoticGoodServerListener::ActiveConnection::HandshakingState::
}
GPR_ASSERT(grpc_event_engine::experimental::grpc_is_event_engine_endpoint(
args->endpoint));
self->connection_->endpoint_ = PromiseEndpoint(
auto ee_endpoint =
grpc_event_engine::experimental::grpc_take_wrapped_event_engine_endpoint(
args->endpoint),
SliceBuffer());
args->endpoint);
auto* chaotic_good_ext = grpc_event_engine::experimental::QueryExtension<
grpc_event_engine::experimental::ChaoticGoodExtension>(ee_endpoint.get());
self->connection_->endpoint_ =
PromiseEndpoint(std::move(ee_endpoint), SliceBuffer());
auto activity = MakeActivity(
[self]() {
return TrySeq(Race(EndpointReadSettingsFrame(self),
TrySeq(Sleep(Timestamp::Now() + kConnectionDeadline),
[]() -> absl::StatusOr<bool> {
return absl::DeadlineExceededError(
"Waiting for initial settings frame");
})),
[self](bool is_control_endpoint) {
return EndpointWriteSettingsFrame(self,
is_control_endpoint);
});
[self, chaotic_good_ext]() {
return TrySeq(
Race(EndpointReadSettingsFrame(self),
TrySeq(Sleep(Timestamp::Now() + kConnectionDeadline),
[]() -> absl::StatusOr<bool> {
return absl::DeadlineExceededError(
"Waiting for initial settings frame");
})),
[self, chaotic_good_ext](bool is_control_endpoint) {
if (chaotic_good_ext != nullptr) {
chaotic_good_ext->EnableStatsCollection(is_control_endpoint);
}
return EndpointWriteSettingsFrame(self, is_control_endpoint);
});
},
EventEngineWakeupScheduler(self->connection_->listener_->event_engine_),
[self](absl::Status status) {

@ -71,7 +71,8 @@ auto ChaoticGoodServerTransport::TransportWriteLoop(
}
auto ChaoticGoodServerTransport::PushFragmentIntoCall(
CallInitiator call_initiator, ClientFragmentFrame frame) {
CallInitiator call_initiator, ClientFragmentFrame frame,
uint32_t stream_id) {
auto& headers = frame.headers;
return TrySeq(
If(
@ -88,44 +89,61 @@ auto ChaoticGoodServerTransport::PushFragmentIntoCall(
},
[]() -> StatusFlag { return Success{}; });
},
[call_initiator,
end_of_stream = frame.end_of_stream]() mutable -> StatusFlag {
if (end_of_stream) call_initiator.FinishSends();
[this, call_initiator, end_of_stream = frame.end_of_stream,
stream_id]() mutable -> StatusFlag {
if (end_of_stream) {
call_initiator.FinishSends();
// We have received end_of_stream. It is now safe to remove the call
// from the stream map.
MutexLock lock(&mu_);
stream_map_.erase(stream_id);
}
return Success{};
});
}
auto ChaoticGoodServerTransport::MaybePushFragmentIntoCall(
absl::optional<CallInitiator> call_initiator, absl::Status error,
ClientFragmentFrame frame) {
ClientFragmentFrame frame, uint32_t stream_id) {
return If(
call_initiator.has_value() && error.ok(),
[this, &call_initiator, &frame]() {
[this, &call_initiator, &frame, &stream_id]() {
return Map(
call_initiator->SpawnWaitable(
"push-fragment",
[call_initiator, frame = std::move(frame), this]() mutable {
return call_initiator->CancelIfFails(
PushFragmentIntoCall(*call_initiator, std::move(frame)));
[call_initiator, frame = std::move(frame), stream_id,
this]() mutable {
return call_initiator->CancelIfFails(PushFragmentIntoCall(
*call_initiator, std::move(frame), stream_id));
}),
[](StatusFlag status) { return StatusCast<absl::Status>(status); });
},
[&error, &frame]() {
gpr_log(GPR_INFO,
"CHAOTIC_GOOD: Cannot pass frame to stream. Error:%s Frame:%s",
error.ToString().c_str(), frame.ToString().c_str());
// EOF frames may arrive after the call_initiator's OnDone callback
// has been invoked. In that case, the call_initiator would have
// already been removed from the stream_map and hence the EOF frame
// cannot be pushed into the call. No need to log such frames.
if (!frame.end_of_stream) {
gpr_log(
GPR_INFO,
"CHAOTIC_GOOD: Cannot pass frame to stream. Error:%s Frame:%s",
error.ToString().c_str(), frame.ToString().c_str());
}
return Immediate(std::move(error));
});
}
auto ChaoticGoodServerTransport::SendFragment(
ServerFragmentFrame frame, MpscSender<ServerFrame> outgoing_frames) {
ServerFragmentFrame frame, MpscSender<ServerFrame> outgoing_frames,
CallInitiator call_initiator) {
if (grpc_chaotic_good_trace.enabled()) {
gpr_log(GPR_INFO, "CHAOTIC_GOOD: SendFragment: frame=%s",
frame.ToString().c_str());
}
// Capture the call_initiator to ensure the underlying call spine is alive
// until the outgoing_frames.Send promise completes.
return Map(outgoing_frames.Send(std::move(frame)),
[](bool success) -> absl::Status {
[call_initiator](bool success) -> absl::Status {
if (!success) {
// Failed to send outgoing frame.
return absl::UnavailableError("Transport closed.");
@ -139,24 +157,27 @@ auto ChaoticGoodServerTransport::SendCallBody(
CallInitiator call_initiator) {
// Continuously send client frame with client to server
// messages.
return ForEach(OutgoingMessages(call_initiator),
[stream_id, outgoing_frames, aligned_bytes = aligned_bytes_](
MessageHandle message) mutable {
ServerFragmentFrame frame;
// Construct frame header (flags, header_length
// and trailer_length will be added in
// serialization).
const uint32_t message_length = message->payload()->Length();
const uint32_t padding =
message_length % aligned_bytes == 0
? 0
: aligned_bytes - message_length % aligned_bytes;
GPR_ASSERT((message_length + padding) % aligned_bytes == 0);
frame.message = FragmentMessage(std::move(message), padding,
message_length);
frame.stream_id = stream_id;
return SendFragment(std::move(frame), outgoing_frames);
});
return ForEach(
OutgoingMessages(call_initiator),
// Capture the call_initator to ensure the underlying call
// spine is alive until the SendFragment promise completes.
[stream_id, outgoing_frames, call_initiator,
aligned_bytes = aligned_bytes_](MessageHandle message) mutable {
ServerFragmentFrame frame;
// Construct frame header (flags, header_length
// and trailer_length will be added in
// serialization).
const uint32_t message_length = message->payload()->Length();
const uint32_t padding =
message_length % aligned_bytes == 0
? 0
: aligned_bytes - message_length % aligned_bytes;
GPR_ASSERT((message_length + padding) % aligned_bytes == 0);
frame.message =
FragmentMessage(std::move(message), padding, message_length);
frame.stream_id = stream_id;
return SendFragment(std::move(frame), outgoing_frames, call_initiator);
});
}
auto ChaoticGoodServerTransport::SendCallInitialMetadataAndBody(
@ -179,7 +200,8 @@ auto ChaoticGoodServerTransport::SendCallInitialMetadataAndBody(
frame.headers = std::move(*md);
frame.stream_id = stream_id;
return TrySeq(
SendFragment(std::move(frame), outgoing_frames),
SendFragment(std::move(frame), outgoing_frames,
call_initiator),
SendCallBody(stream_id, outgoing_frames, call_initiator));
},
[]() { return absl::OkStatus(); });
@ -201,11 +223,15 @@ auto ChaoticGoodServerTransport::CallOutboundLoop(
return Empty{};
}),
call_initiator.PullServerTrailingMetadata(),
[stream_id, outgoing_frames](ServerMetadataHandle md) mutable {
// Capture the call_initator to ensure the underlying call_spine
// is alive until the SendFragment promise completes.
[stream_id, outgoing_frames,
call_initiator](ServerMetadataHandle md) mutable {
ServerFragmentFrame frame;
frame.trailers = std::move(md);
frame.stream_id = stream_id;
return SendFragment(std::move(frame), outgoing_frames);
return SendFragment(std::move(frame), outgoing_frames,
call_initiator);
});
}
@ -247,7 +273,8 @@ auto ChaoticGoodServerTransport::DeserializeAndPushFragmentToNewCall(
}
}
return MaybePushFragmentIntoCall(std::move(call_initiator), std::move(status),
std::move(fragment_frame));
std::move(fragment_frame),
frame_header.stream_id);
}
auto ChaoticGoodServerTransport::DeserializeAndPushFragmentToExistingCall(
@ -262,7 +289,8 @@ auto ChaoticGoodServerTransport::DeserializeAndPushFragmentToExistingCall(
frame_header, std::move(buffers), arena, fragment_frame,
FrameLimits{1024 * 1024 * 1024, aligned_bytes_ - 1});
return MaybePushFragmentIntoCall(std::move(call_initiator), std::move(status),
std::move(fragment_frame));
std::move(fragment_frame),
frame_header.stream_id);
}
auto ChaoticGoodServerTransport::ReadOneFrame(ChaoticGoodTransport& transport) {
@ -421,7 +449,11 @@ absl::Status ChaoticGoodServerTransport::NewStream(
if (stream_id <= last_seen_new_stream_id_) {
return absl::InternalError("Stream id is not increasing");
}
stream_map_.emplace(stream_id, std::move(call_initiator));
stream_map_.emplace(stream_id, call_initiator);
call_initiator.OnDone([this, stream_id]() {
MutexLock lock(&mu_);
stream_map_.erase(stream_id);
});
return absl::OkStatus();
}

@ -115,7 +115,8 @@ class ChaoticGoodServerTransport final : public Transport,
auto SendCallBody(uint32_t stream_id, MpscSender<ServerFrame> outgoing_frames,
CallInitiator call_initiator);
static auto SendFragment(ServerFragmentFrame frame,
MpscSender<ServerFrame> outgoing_frames);
MpscSender<ServerFrame> outgoing_frames,
CallInitiator call_initiator);
auto CallOutboundLoop(uint32_t stream_id, CallInitiator call_initiator);
auto OnTransportActivityDone(absl::string_view activity);
auto TransportReadLoop(RefCountedPtr<ChaoticGoodTransport> transport);
@ -133,9 +134,10 @@ class ChaoticGoodServerTransport final : public Transport,
FrameHeader frame_header, BufferPair buffers,
ChaoticGoodTransport& transport);
auto MaybePushFragmentIntoCall(absl::optional<CallInitiator> call_initiator,
absl::Status error, ClientFragmentFrame frame);
absl::Status error, ClientFragmentFrame frame,
uint32_t stream_id);
auto PushFragmentIntoCall(CallInitiator call_initiator,
ClientFragmentFrame frame);
ClientFragmentFrame frame, uint32_t stream_id);
Acceptor* acceptor_ = nullptr;
InterActivityLatch<void> got_acceptor_;

@ -64,6 +64,7 @@
#include "src/core/lib/security/security_connector/security_connector.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/channel_create.h"
#include "src/core/lib/surface/channel_stack_type.h"
#include "src/core/lib/transport/error_utils.h"
#include "src/core/lib/transport/handshaker.h"
@ -307,7 +308,7 @@ class Chttp2SecureClientChannelFactory : public ClientChannelFactory {
}
};
absl::StatusOr<RefCountedPtr<Channel>> CreateChannel(const char* target,
absl::StatusOr<OrphanablePtr<Channel>> CreateChannel(const char* target,
const ChannelArgs& args) {
if (target == nullptr) {
gpr_log(GPR_ERROR, "cannot create channel with NULL target name");
@ -317,9 +318,8 @@ absl::StatusOr<RefCountedPtr<Channel>> CreateChannel(const char* target,
std::string canonical_target =
CoreConfiguration::Get().resolver_registry().AddDefaultPrefixIfNeeded(
target);
return Channel::Create(target,
args.Set(GRPC_ARG_SERVER_URI, canonical_target),
GRPC_CLIENT_CHANNEL, nullptr);
return ChannelCreate(target, args.Set(GRPC_ARG_SERVER_URI, canonical_target),
GRPC_CLIENT_CHANNEL, nullptr);
}
} // namespace
@ -410,7 +410,7 @@ grpc_channel* grpc_channel_create_from_fd(const char* target, int fd,
grpc_core::Transport* transport =
grpc_create_chttp2_transport(final_args, client, true);
GPR_ASSERT(transport);
auto channel = grpc_core::Channel::Create(
auto channel = grpc_core::ChannelCreate(
target, final_args, GRPC_CLIENT_DIRECT_CHANNEL, transport);
if (channel.ok()) {
grpc_chttp2_transport_start_reading(transport, nullptr, nullptr, nullptr);

@ -72,6 +72,7 @@
#include "src/core/lib/iomgr/tcp_server.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
#include "src/core/lib/iomgr/vsock.h"
#include "src/core/lib/resource_quota/connection_quota.h"
#include "src/core/lib/resource_quota/memory_quota.h"
#include "src/core/lib/resource_quota/resource_quota.h"
#include "src/core/lib/security/credentials/credentials.h"
@ -283,6 +284,7 @@ class Chttp2ServerListener : public Server::ListenerInterface {
grpc_closure* on_destroy_done_ ABSL_GUARDED_BY(mu_) = nullptr;
RefCountedPtr<channelz::ListenSocketNode> channelz_listen_socket_;
MemoryQuotaRefPtr memory_quota_;
ConnectionQuotaRefPtr connection_quota_;
};
//
@ -450,11 +452,13 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::OnHandshakeDone(
OrphanablePtr<HandshakingState> handshaking_state_ref;
RefCountedPtr<HandshakeManager> handshake_mgr;
bool cleanup_connection = false;
bool release_connection = false;
{
MutexLock connection_lock(&self->connection_->mu_);
if (!error.ok() || self->connection_->shutdown_) {
std::string error_str = StatusToString(error);
cleanup_connection = true;
release_connection = true;
if (error.ok() && args->endpoint != nullptr) {
// We were shut down or stopped serving after handshaking completed
// successfully, so destroy the endpoint here.
@ -504,6 +508,18 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::OnHandshakeDone(
} else {
// Remove the connection from the connections_ map since OnClose()
// will not be invoked when a config fetcher is set.
auto connection_quota =
self->connection_->listener_->connection_quota_->Ref()
.release();
auto on_close_transport = [](void* arg,
grpc_error_handle /*handle*/) {
ConnectionQuota* connection_quota =
static_cast<ConnectionQuota*>(arg);
connection_quota->ReleaseConnections(1);
connection_quota->Unref();
};
on_close = GRPC_CLOSURE_CREATE(on_close_transport, connection_quota,
grpc_schedule_on_exec_ctx_);
cleanup_connection = true;
}
grpc_chttp2_transport_start_reading(transport, args->read_buffer,
@ -526,9 +542,11 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::OnHandshakeDone(
grpc_slice_buffer_destroy(args->read_buffer);
gpr_free(args->read_buffer);
cleanup_connection = true;
release_connection = true;
}
} else {
cleanup_connection = true;
release_connection = true;
}
}
// Since the handshake manager is done, the connection no longer needs to
@ -543,6 +561,9 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::OnHandshakeDone(
OrphanablePtr<ActiveConnection> connection;
if (cleanup_connection) {
MutexLock listener_lock(&self->connection_->listener_->mu_);
if (release_connection) {
self->connection_->listener_->connection_quota_->ReleaseConnections(1);
}
auto it = self->connection_->listener_->connections_.find(
self->connection_.get());
if (it != self->connection_->listener_->connections_.end()) {
@ -658,6 +679,7 @@ void Chttp2ServerListener::ActiveConnection::OnClose(
self->drain_grace_timer_handle_.reset();
}
}
self->listener_->connection_quota_->ReleaseConnections(1);
self->Unref();
}
@ -762,7 +784,14 @@ Chttp2ServerListener::Chttp2ServerListener(
: server_(server),
args_modifier_(args_modifier),
args_(args),
memory_quota_(args.GetObject<ResourceQuota>()->memory_quota()) {
memory_quota_(args.GetObject<ResourceQuota>()->memory_quota()),
connection_quota_(MakeRefCounted<ConnectionQuota>()) {
auto max_allowed_incoming_connections =
args.GetInt(GRPC_ARG_MAX_ALLOWED_INCOMING_CONNECTIONS);
if (max_allowed_incoming_connections.has_value()) {
connection_quota_->SetMaxIncomingConnections(
max_allowed_incoming_connections.value());
}
GRPC_CLOSURE_INIT(&tcp_server_shutdown_complete_, TcpServerShutdownComplete,
this, grpc_schedule_on_exec_ctx);
}
@ -821,6 +850,14 @@ void Chttp2ServerListener::OnAccept(void* arg, grpc_endpoint* tcp,
grpc_endpoint_destroy(tcp);
gpr_free(acceptor);
};
if (!self->connection_quota_->AllowIncomingConnection(
self->memory_quota_, grpc_endpoint_get_peer(tcp))) {
grpc_error_handle error = GRPC_ERROR_CREATE(
"Rejected incoming connection because configured connection quota "
"limits have been exceeded.");
endpoint_cleanup(error);
return;
}
if (self->server_->config_fetcher() != nullptr) {
if (connection_manager == nullptr) {
grpc_error_handle error = GRPC_ERROR_CREATE(

@ -47,6 +47,8 @@ grpc_cc_library(
"client/secure/cronet_channel_create.h",
],
deps = [
"//:channel",
"//:channel_create",
"//:grpc_base",
"//:grpc_transport_chttp2",
"//src/core:channel_args",

@ -32,6 +32,7 @@
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/channel_create.h"
#include "src/core/lib/surface/channel_stack_type.h"
#include "src/core/lib/transport/transport.h"
@ -52,7 +53,7 @@ GRPCAPI grpc_channel* grpc_cronet_secure_channel_create(
engine, target, channel_args.ToC().get(), reserved);
grpc_core::ExecCtx exec_ctx;
auto channel = grpc_core::Channel::Create(target, channel_args,
GRPC_CLIENT_DIRECT_CHANNEL, ct);
auto channel = grpc_core::ChannelCreate(target, channel_args,
GRPC_CLIENT_DIRECT_CHANNEL, ct);
return channel.ok() ? channel->release()->c_ptr() : nullptr;
}

@ -26,6 +26,7 @@
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/promise/promise.h"
#include "src/core/lib/promise/try_seq.h"
#include "src/core/lib/surface/channel_create.h"
#include "src/core/lib/surface/server.h"
#include "src/core/lib/transport/transport.h"
@ -155,7 +156,7 @@ bool UsePromiseBasedTransport() {
return true;
}
RefCountedPtr<Channel> MakeLameChannel(absl::string_view why,
OrphanablePtr<Channel> MakeLameChannel(absl::string_view why,
absl::Status error) {
gpr_log(GPR_ERROR, "%s: %s", std::string(why).c_str(),
std::string(error.message()).c_str());
@ -164,11 +165,11 @@ RefCountedPtr<Channel> MakeLameChannel(absl::string_view why,
if (grpc_error_get_int(error, StatusIntProperty::kRpcStatus, &integer)) {
status = static_cast<grpc_status_code>(integer);
}
return RefCountedPtr<Channel>(Channel::FromC(grpc_lame_client_channel_create(
return OrphanablePtr<Channel>(Channel::FromC(grpc_lame_client_channel_create(
nullptr, status, std::string(why).c_str())));
}
RefCountedPtr<Channel> MakeInprocChannel(Server* server,
OrphanablePtr<Channel> MakeInprocChannel(Server* server,
ChannelArgs client_channel_args) {
auto transports = MakeInProcessTransportPair();
auto client_transport = std::move(transports.first);
@ -183,7 +184,7 @@ RefCountedPtr<Channel> MakeInprocChannel(Server* server,
return MakeLameChannel("Failed to create server channel", std::move(error));
}
std::ignore = server_transport.release(); // consumed by SetupTransport
auto channel = Channel::Create(
auto channel = ChannelCreate(
"inproc",
client_channel_args.Set(GRPC_ARG_DEFAULT_AUTHORITY, "inproc.authority"),
GRPC_CLIENT_DIRECT_CHANNEL, client_transport.release());

@ -61,6 +61,7 @@
#include "src/core/lib/slice/slice_buffer.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/channel_create.h"
#include "src/core/lib/surface/channel_stack_type.h"
#include "src/core/lib/surface/server.h"
#include "src/core/lib/transport/connectivity_state.h"
@ -1264,7 +1265,7 @@ grpc_channel* grpc_legacy_inproc_channel_create(grpc_server* server,
server_transport, nullptr, server_args, nullptr);
grpc_channel* channel = nullptr;
if (error.ok()) {
auto new_channel = grpc_core::Channel::Create(
auto new_channel = grpc_core::ChannelCreate(
"inproc", client_args, GRPC_CLIENT_DIRECT_CHANNEL, client_transport);
if (!new_channel.ok()) {
GPR_ASSERT(!channel);

@ -65,16 +65,14 @@ class XdsBootstrap {
public:
virtual ~Authority() = default;
virtual const XdsServer* server() const = 0;
virtual std::vector<const XdsServer*> servers() const = 0;
};
virtual ~XdsBootstrap() = default;
virtual std::string ToString() const = 0;
// TODO(roth): We currently support only one server. Fix this when we
// add support for fallback for the xds channel.
virtual const XdsServer& server() const = 0;
virtual std::vector<const XdsServer*> servers() const = 0;
// Returns the node information, or null if not present in the bootstrap
// config.

@ -22,6 +22,7 @@
#include <algorithm>
#include <set>
#include <string>
#include <utility>
#include <vector>
@ -330,11 +331,14 @@ std::string GrpcXdsBootstrap::ToString() const {
parts.push_back(
absl::StrFormat(" client_listener_resource_name_template=\"%s\",\n",
entry.second.client_listener_resource_name_template()));
if (entry.second.server() != nullptr) {
parts.push_back(absl::StrFormat(
" servers=[\n%s\n],\n",
JsonDump(static_cast<const GrpcXdsServer*>(entry.second.server())
->ToJson())));
std::vector<std::string> server_jsons;
for (const XdsServer* server : entry.second.servers()) {
server_jsons.emplace_back(
JsonDump(static_cast<const GrpcXdsServer*>(server)->ToJson()));
}
if (!server_jsons.empty()) {
parts.push_back(absl::StrFormat(" servers=[\n%s\n],\n",
absl::StrJoin(server_jsons, ",\n")));
}
parts.push_back(" },\n");
}

@ -104,8 +104,13 @@ class GrpcXdsBootstrap : public XdsBootstrap {
class GrpcAuthority : public Authority {
public:
const XdsServer* server() const override {
return servers_.empty() ? nullptr : &servers_[0];
std::vector<const XdsServer*> servers() const override {
std::vector<const XdsServer*> servers;
servers.reserve(servers_.size());
for (const auto& server : servers_) {
servers.emplace_back(&server);
}
return servers;
}
const std::string& client_listener_resource_name_template() const {
@ -129,7 +134,15 @@ class GrpcXdsBootstrap : public XdsBootstrap {
std::string ToString() const override;
const XdsServer& server() const override { return servers_[0]; }
std::vector<const XdsServer*> servers() const override {
std::vector<const XdsServer*> servers;
servers.reserve(servers_.size());
for (const auto& server : servers_) {
servers.emplace_back(&server);
}
return servers;
}
const Node* node() const override {
return node_.has_value() ? &*node_ : nullptr;
}

@ -1584,9 +1584,10 @@ void XdsClient::WatchResource(const XdsResourceType* type,
"\" not present in bootstrap config")));
return;
}
xds_server = authority->server();
xds_server =
authority->servers().empty() ? nullptr : authority->servers().front();
}
if (xds_server == nullptr) xds_server = &bootstrap_->server();
if (xds_server == nullptr) xds_server = bootstrap_->servers().front();
{
MutexLock lock(&mu_);
MaybeRegisterResourceTypeLocked(type);

@ -63,7 +63,11 @@ class XdsLocalityName : public RefCounted<XdsLocalityName> {
XdsLocalityName(std::string region, std::string zone, std::string sub_zone)
: region_(std::move(region)),
zone_(std::move(zone)),
sub_zone_(std::move(sub_zone)) {}
sub_zone_(std::move(sub_zone)),
locality_labels_(
std::make_shared<std::map<std::string, std::string>>()) {
locality_labels_->emplace("grpc.lb.locality", AsHumanReadableString());
}
bool operator==(const XdsLocalityName& other) const {
return region_ == other.region_ && zone_ == other.zone_ &&
@ -85,6 +89,9 @@ class XdsLocalityName : public RefCounted<XdsLocalityName> {
const std::string& region() const { return region_; }
const std::string& zone() const { return zone_; }
const std::string& sub_zone() const { return sub_zone_; }
std::shared_ptr<std::map<std::string, std::string>> locality_labels() const {
return locality_labels_;
}
std::string AsHumanReadableString() const {
return absl::StrFormat("{region=\"%s\", zone=\"%s\", sub_zone=\"%s\"}",
@ -104,6 +111,7 @@ class XdsLocalityName : public RefCounted<XdsLocalityName> {
std::string region_;
std::string zone_;
std::string sub_zone_;
std::shared_ptr<std::map<std::string, std::string>> locality_labels_;
};
// Drop stats for an xds cluster.
@ -223,6 +231,8 @@ class XdsClusterLocalityStats : public RefCounted<XdsClusterLocalityStats> {
void AddCallFinished(const std::map<absl::string_view, double>* named_metrics,
bool fail = false);
XdsLocalityName* locality_name() const { return name_.get(); }
private:
struct Stats {
std::atomic<uint64_t> total_successful_requests{0};

@ -69,15 +69,16 @@ namespace grpc_core {
//
GrpcXdsTransportFactory::GrpcXdsTransport::GrpcStreamingCall::GrpcStreamingCall(
RefCountedPtr<GrpcXdsTransportFactory> factory, grpc_channel* channel,
RefCountedPtr<GrpcXdsTransportFactory> factory, Channel* channel,
const char* method,
std::unique_ptr<StreamingCall::EventHandler> event_handler)
: factory_(std::move(factory)), event_handler_(std::move(event_handler)) {
// Create call.
call_ = grpc_channel_create_pollset_set_call(
channel, nullptr, GRPC_PROPAGATE_DEFAULTS, factory_->interested_parties(),
StaticSlice::FromStaticString(method).c_slice(), nullptr,
Timestamp::InfFuture(), nullptr);
call_ = channel->CreateCall(
/*parent_call=*/nullptr, GRPC_PROPAGATE_DEFAULTS, /*cq=*/nullptr,
factory_->interested_parties(), Slice::FromStaticString(method),
/*authority=*/absl::nullopt, Timestamp::InfFuture(),
/*registered_method=*/true);
GPR_ASSERT(call_ != nullptr);
// Init data associated with the call.
grpc_metadata_array_init(&initial_metadata_recv_);
@ -252,19 +253,13 @@ class GrpcXdsTransportFactory::GrpcXdsTransport::StateWatcher
namespace {
grpc_channel* CreateXdsChannel(const ChannelArgs& args,
const GrpcXdsBootstrap::GrpcXdsServer& server) {
OrphanablePtr<Channel> CreateXdsChannel(
const ChannelArgs& args, const GrpcXdsBootstrap::GrpcXdsServer& server) {
RefCountedPtr<grpc_channel_credentials> channel_creds =
CoreConfiguration::Get().channel_creds_registry().CreateChannelCreds(
server.channel_creds_config());
return grpc_channel_create(server.server_uri().c_str(), channel_creds.get(),
args.ToC().get());
}
bool IsLameChannel(grpc_channel* channel) {
grpc_channel_element* elem =
grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel));
return elem->filter == &LameClientFilter::kFilter;
return OrphanablePtr<Channel>(Channel::FromC(grpc_channel_create(
server.server_uri().c_str(), channel_creds.get(), args.ToC().get())));
}
} // namespace
@ -278,29 +273,19 @@ GrpcXdsTransportFactory::GrpcXdsTransport::GrpcXdsTransport(
factory->args_,
static_cast<const GrpcXdsBootstrap::GrpcXdsServer&>(server));
GPR_ASSERT(channel_ != nullptr);
if (IsLameChannel(channel_)) {
if (channel_->IsLame()) {
*status = absl::UnavailableError("xds client has a lame channel");
} else {
ClientChannelFilter* client_channel =
ClientChannelFilter::GetFromChannel(Channel::FromC(channel_));
GPR_ASSERT(client_channel != nullptr);
watcher_ = new StateWatcher(std::move(on_connectivity_failure));
client_channel->AddConnectivityWatcher(
channel_->AddConnectivityWatcher(
GRPC_CHANNEL_IDLE,
OrphanablePtr<AsyncConnectivityStateWatcherInterface>(watcher_));
}
}
GrpcXdsTransportFactory::GrpcXdsTransport::~GrpcXdsTransport() {
grpc_channel_destroy_internal(channel_);
}
void GrpcXdsTransportFactory::GrpcXdsTransport::Orphan() {
if (!IsLameChannel(channel_)) {
ClientChannelFilter* client_channel =
ClientChannelFilter::GetFromChannel(Channel::FromC(channel_));
GPR_ASSERT(client_channel != nullptr);
client_channel->RemoveConnectivityWatcher(watcher_);
if (!channel_->IsLame()) {
channel_->RemoveConnectivityWatcher(watcher_);
}
// Do an async hop before unreffing. This avoids a deadlock upon
// shutdown in the case where the xDS channel is itself an xDS channel
@ -319,11 +304,11 @@ GrpcXdsTransportFactory::GrpcXdsTransport::CreateStreamingCall(
return MakeOrphanable<GrpcStreamingCall>(
factory_->RefAsSubclass<GrpcXdsTransportFactory>(DEBUG_LOCATION,
"StreamingCall"),
channel_, method, std::move(event_handler));
channel_.get(), method, std::move(event_handler));
}
void GrpcXdsTransportFactory::GrpcXdsTransport::ResetBackoff() {
grpc_channel_reset_connect_backoff(channel_);
channel_->ResetConnectionBackoff();
}
//

@ -37,6 +37,7 @@
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/iomgr_fwd.h"
#include "src/core/lib/surface/channel.h"
namespace grpc_core {
@ -70,7 +71,6 @@ class GrpcXdsTransportFactory::GrpcXdsTransport
const XdsBootstrap::XdsServer& server,
std::function<void(absl::Status)> on_connectivity_failure,
absl::Status* status);
~GrpcXdsTransport() override;
void Orphan() override;
@ -84,7 +84,7 @@ class GrpcXdsTransportFactory::GrpcXdsTransport
class StateWatcher;
GrpcXdsTransportFactory* factory_; // Not owned.
grpc_channel* channel_;
OrphanablePtr<Channel> channel_;
StateWatcher* watcher_;
};
@ -92,7 +92,7 @@ class GrpcXdsTransportFactory::GrpcXdsTransport::GrpcStreamingCall
: public XdsTransportFactory::XdsTransport::StreamingCall {
public:
GrpcStreamingCall(RefCountedPtr<GrpcXdsTransportFactory> factory,
grpc_channel* channel, const char* method,
Channel* channel, const char* method,
std::unique_ptr<StreamingCall::EventHandler> event_handler);
~GrpcStreamingCall() override;

@ -19,9 +19,9 @@
#include <utility>
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/promise/context.h"
#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/transport/call_final_info.h"
namespace grpc_core {

@ -36,8 +36,8 @@
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/slice/slice_buffer.h"
#include "src/core/lib/transport/call_final_info.h"
#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/transport/transport.h"
namespace grpc_core {
@ -128,8 +128,9 @@ class ClientCallTracer : public CallTracerAnnotationInterface {
class CallAttemptTracer : public CallTracerInterface {
public:
enum class OptionalLabelComponent : std::uint8_t {
kXdsServiceLabels = 0,
kSize = 1, // keep last
kXdsServiceLabels,
kXdsLocalityLabels,
kSize, // keep last
};
~CallAttemptTracer() override {}

@ -191,6 +191,9 @@ class ChannelNode : public BaseNode {
static absl::string_view ChannelArgName() {
return GRPC_ARG_CHANNELZ_CHANNEL_NODE;
}
static int ChannelArgsCompare(const ChannelNode* a, const ChannelNode* b) {
return QsortCompare(a, b);
}
// Returns the string description of the given connectivity state.
static const char* GetChannelConnectivityStateChangeString(

@ -149,6 +149,122 @@ GlobalInstrumentsRegistry::RegisterDoubleHistogram(
return handle;
}
GlobalInstrumentsRegistry::GlobalInt64GaugeHandle
GlobalInstrumentsRegistry::RegisterInt64Gauge(
absl::string_view name, absl::string_view description,
absl::string_view unit, absl::Span<const absl::string_view> label_keys,
absl::Span<const absl::string_view> optional_label_keys,
bool enable_by_default) {
auto& instruments = GetInstrumentList();
if (instruments.find(name) != instruments.end()) {
Crash(absl::StrFormat("Metric name %s has already been registered.", name));
}
uint32_t index = instruments.size();
GPR_ASSERT(index < std::numeric_limits<uint32_t>::max());
GlobalInstrumentDescriptor descriptor;
descriptor.value_type = ValueType::kInt64;
descriptor.instrument_type = InstrumentType::kGauge;
descriptor.index = index;
descriptor.enable_by_default = enable_by_default;
descriptor.name = name;
descriptor.description = description;
descriptor.unit = unit;
descriptor.label_keys = {label_keys.begin(), label_keys.end()};
descriptor.optional_label_keys = {optional_label_keys.begin(),
optional_label_keys.end()};
instruments.emplace(name, std::move(descriptor));
GlobalInt64GaugeHandle handle;
handle.index = index;
return handle;
}
GlobalInstrumentsRegistry::GlobalDoubleGaugeHandle
GlobalInstrumentsRegistry::RegisterDoubleGauge(
absl::string_view name, absl::string_view description,
absl::string_view unit, absl::Span<const absl::string_view> label_keys,
absl::Span<const absl::string_view> optional_label_keys,
bool enable_by_default) {
auto& instruments = GetInstrumentList();
if (instruments.find(name) != instruments.end()) {
Crash(absl::StrFormat("Metric name %s has already been registered.", name));
}
uint32_t index = instruments.size();
GPR_ASSERT(index < std::numeric_limits<uint32_t>::max());
GlobalInstrumentDescriptor descriptor;
descriptor.value_type = ValueType::kDouble;
descriptor.instrument_type = InstrumentType::kGauge;
descriptor.index = index;
descriptor.enable_by_default = enable_by_default;
descriptor.name = name;
descriptor.description = description;
descriptor.unit = unit;
descriptor.label_keys = {label_keys.begin(), label_keys.end()};
descriptor.optional_label_keys = {optional_label_keys.begin(),
optional_label_keys.end()};
instruments.emplace(name, std::move(descriptor));
GlobalDoubleGaugeHandle handle;
handle.index = index;
return handle;
}
GlobalInstrumentsRegistry::GlobalCallbackInt64GaugeHandle
GlobalInstrumentsRegistry::RegisterCallbackInt64Gauge(
absl::string_view name, absl::string_view description,
absl::string_view unit, absl::Span<const absl::string_view> label_keys,
absl::Span<const absl::string_view> optional_label_keys,
bool enable_by_default) {
auto& instruments = GetInstrumentList();
if (instruments.find(name) != instruments.end()) {
Crash(absl::StrFormat("Metric name %s has already been registered.", name));
}
uint32_t index = instruments.size();
GPR_ASSERT(index < std::numeric_limits<uint32_t>::max());
GlobalInstrumentDescriptor descriptor;
descriptor.value_type = ValueType::kInt64;
descriptor.instrument_type = InstrumentType::kCallbackGauge;
descriptor.index = index;
descriptor.enable_by_default = enable_by_default;
descriptor.name = name;
descriptor.description = description;
descriptor.unit = unit;
descriptor.label_keys = {label_keys.begin(), label_keys.end()};
descriptor.optional_label_keys = {optional_label_keys.begin(),
optional_label_keys.end()};
instruments.emplace(name, std::move(descriptor));
GlobalCallbackInt64GaugeHandle handle;
handle.index = index;
return handle;
}
GlobalInstrumentsRegistry::GlobalCallbackDoubleGaugeHandle
GlobalInstrumentsRegistry::RegisterCallbackDoubleGauge(
absl::string_view name, absl::string_view description,
absl::string_view unit, absl::Span<const absl::string_view> label_keys,
absl::Span<const absl::string_view> optional_label_keys,
bool enable_by_default) {
auto& instruments = GetInstrumentList();
if (instruments.find(name) != instruments.end()) {
Crash(absl::StrFormat("Metric name %s has already been registered.", name));
}
uint32_t index = instruments.size();
GPR_ASSERT(index < std::numeric_limits<uint32_t>::max());
GlobalInstrumentDescriptor descriptor;
descriptor.value_type = ValueType::kDouble;
descriptor.instrument_type = InstrumentType::kCallbackGauge;
descriptor.index = index;
descriptor.enable_by_default = enable_by_default;
descriptor.name = name;
descriptor.description = description;
descriptor.unit = unit;
descriptor.label_keys = {label_keys.begin(), label_keys.end()};
descriptor.optional_label_keys = {optional_label_keys.begin(),
optional_label_keys.end()};
instruments.emplace(name, std::move(descriptor));
GlobalCallbackDoubleGaugeHandle handle;
handle.index = index;
return handle;
}
void GlobalInstrumentsRegistry::ForEach(
absl::FunctionRef<void(const GlobalInstrumentDescriptor&)> f) {
for (const auto& instrument : GetInstrumentList()) {
@ -156,6 +272,35 @@ void GlobalInstrumentsRegistry::ForEach(
}
}
RegisteredMetricCallback::RegisteredMetricCallback(
GlobalStatsPluginRegistry::StatsPluginGroup& stats_plugin_group,
absl::AnyInvocable<void(CallbackMetricReporter&)> callback,
std::vector<GlobalInstrumentsRegistry::GlobalCallbackHandle> metrics,
Duration min_interval)
: stats_plugin_group_(stats_plugin_group),
callback_(std::move(callback)),
metrics_(std::move(metrics)),
min_interval_(min_interval) {
for (auto& plugin : stats_plugin_group_.plugins_) {
plugin->AddCallback(this);
}
}
RegisteredMetricCallback::~RegisteredMetricCallback() {
for (auto& plugin : stats_plugin_group_.plugins_) {
plugin->RemoveCallback(this);
}
}
std::unique_ptr<RegisteredMetricCallback>
GlobalStatsPluginRegistry::StatsPluginGroup::RegisterCallback(
absl::AnyInvocable<void(CallbackMetricReporter&)> callback,
std::vector<GlobalInstrumentsRegistry::GlobalCallbackHandle> metrics,
Duration min_interval) {
return std::make_unique<RegisteredMetricCallback>(
*this, std::move(callback), std::move(metrics), min_interval);
}
NoDestruct<Mutex> GlobalStatsPluginRegistry::mutex_;
NoDestruct<std::vector<std::shared_ptr<StatsPlugin>>>
GlobalStatsPluginRegistry::plugins_;

@ -22,6 +22,7 @@
#include <vector>
#include "absl/container/flat_hash_map.h"
#include "absl/functional/any_invocable.h"
#include "absl/functional/function_ref.h"
#include "absl/strings/string_view.h"
#include "absl/types/span.h"
@ -31,20 +32,22 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/no_destruct.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/gprpp/time.h"
namespace grpc_core {
constexpr absl::string_view kMetricLabelTarget = "grpc.target";
// A global registry of instruments(metrics). This API is designed to be used to
// register instruments (Counter and Histogram) as part of program startup,
// before the execution of the main function (during dynamic initialization
// time). Using this API after the main function begins may result into missing
// instruments. This API is thread-unsafe.
// A global registry of instruments(metrics). This API is designed to be used
// to register instruments (Counter, Histogram, and Gauge) as part of program
// startup, before the execution of the main function (during dynamic
// initialization time). Using this API after the main function begins may
// result into missing instruments. This API is thread-unsafe.
class GlobalInstrumentsRegistry {
public:
enum class ValueType {
kUndefined,
kInt64,
kUInt64,
kDouble,
};
@ -52,6 +55,8 @@ class GlobalInstrumentsRegistry {
kUndefined,
kCounter,
kHistogram,
kGauge,
kCallbackGauge,
};
struct GlobalInstrumentDescriptor {
ValueType value_type;
@ -75,6 +80,11 @@ class GlobalInstrumentsRegistry {
struct GlobalDoubleCounterHandle : public GlobalHandle {};
struct GlobalUInt64HistogramHandle : public GlobalHandle {};
struct GlobalDoubleHistogramHandle : public GlobalHandle {};
struct GlobalInt64GaugeHandle : public GlobalHandle {};
struct GlobalDoubleGaugeHandle : public GlobalHandle {};
struct GlobalCallbackHandle : public GlobalHandle {};
struct GlobalCallbackInt64GaugeHandle : public GlobalCallbackHandle {};
struct GlobalCallbackDoubleGaugeHandle : public GlobalCallbackHandle {};
// Creates instrument in the GlobalInstrumentsRegistry.
static GlobalUInt64CounterHandle RegisterUInt64Counter(
@ -97,6 +107,27 @@ class GlobalInstrumentsRegistry {
absl::string_view unit, absl::Span<const absl::string_view> label_keys,
absl::Span<const absl::string_view> optional_label_keys,
bool enable_by_default);
static GlobalInt64GaugeHandle RegisterInt64Gauge(
absl::string_view name, absl::string_view description,
absl::string_view unit, absl::Span<const absl::string_view> label_keys,
absl::Span<const absl::string_view> optional_label_keys,
bool enable_by_default);
static GlobalDoubleGaugeHandle RegisterDoubleGauge(
absl::string_view name, absl::string_view description,
absl::string_view unit, absl::Span<const absl::string_view> label_keys,
absl::Span<const absl::string_view> optional_label_keys,
bool enable_by_default);
static GlobalCallbackInt64GaugeHandle RegisterCallbackInt64Gauge(
absl::string_view name, absl::string_view description,
absl::string_view unit, absl::Span<const absl::string_view> label_keys,
absl::Span<const absl::string_view> optional_label_keys,
bool enable_by_default);
static GlobalCallbackDoubleGaugeHandle RegisterCallbackDoubleGauge(
absl::string_view name, absl::string_view description,
absl::string_view unit, absl::Span<const absl::string_view> label_keys,
absl::Span<const absl::string_view> optional_label_keys,
bool enable_by_default);
static void ForEach(
absl::FunctionRef<void(const GlobalInstrumentDescriptor&)> f);
@ -110,6 +141,24 @@ class GlobalInstrumentsRegistry {
GetInstrumentList();
};
// An interface for implementing callback-style metrics.
// To be implemented by stats plugins.
class CallbackMetricReporter {
public:
virtual ~CallbackMetricReporter() = default;
virtual void Report(
GlobalInstrumentsRegistry::GlobalCallbackInt64GaugeHandle handle,
int64_t value, absl::Span<const absl::string_view> label_values,
absl::Span<const absl::string_view> optional_values) = 0;
virtual void Report(
GlobalInstrumentsRegistry::GlobalCallbackDoubleGaugeHandle handle,
double value, absl::Span<const absl::string_view> label_values,
absl::Span<const absl::string_view> optional_values) = 0;
};
class RegisteredMetricCallback;
// The StatsPlugin interface.
class StatsPlugin {
public:
@ -147,6 +196,22 @@ class StatsPlugin {
GlobalInstrumentsRegistry::GlobalDoubleHistogramHandle handle,
double value, absl::Span<const absl::string_view> label_values,
absl::Span<const absl::string_view> optional_values) = 0;
virtual void SetGauge(
GlobalInstrumentsRegistry::GlobalInt64GaugeHandle handle, int64_t value,
absl::Span<const absl::string_view> label_values,
absl::Span<const absl::string_view> optional_values) = 0;
virtual void SetGauge(
GlobalInstrumentsRegistry::GlobalDoubleGaugeHandle handle, double value,
absl::Span<const absl::string_view> label_values,
absl::Span<const absl::string_view> optional_values) = 0;
// Adds a callback to be invoked when the stats plugin wants to
// populate the corresponding metrics (see callback->metrics() for list).
virtual void AddCallback(RegisteredMetricCallback* callback) = 0;
// Removes a callback previously added via AddCallback(). The stats
// plugin may not use the callback after this method returns.
virtual void RemoveCallback(RegisteredMetricCallback* callback) = 0;
// TODO(yijiem): Details pending.
// std::unique_ptr<AsyncInstrument> GetObservableGauge(
// absl::string_view name, absl::string_view description,
@ -208,8 +273,39 @@ class GlobalStatsPluginRegistry {
plugin->RecordHistogram(handle, value, label_values, optional_values);
}
}
void SetGauge(GlobalInstrumentsRegistry::GlobalInt64GaugeHandle handle,
int64_t value,
absl::Span<const absl::string_view> label_values,
absl::Span<const absl::string_view> optional_values) {
for (auto& plugin : plugins_) {
plugin->SetGauge(handle, value, label_values, optional_values);
}
}
void SetGauge(GlobalInstrumentsRegistry::GlobalDoubleGaugeHandle handle,
double value,
absl::Span<const absl::string_view> label_values,
absl::Span<const absl::string_view> optional_values) {
for (auto& plugin : plugins_) {
plugin->SetGauge(handle, value, label_values, optional_values);
}
}
// Registers a callback to be used to populate callback metrics.
// The callback will update the specified metrics. The callback
// will be invoked no more often than min_interval.
//
// The returned object is a handle that allows the caller to control
// the lifetime of the callback; when the returned object is
// destroyed, the callback is de-registered. The returned object
// must not outlive the StatsPluginGroup object that created it.
std::unique_ptr<RegisteredMetricCallback> RegisterCallback(
absl::AnyInvocable<void(CallbackMetricReporter&)> callback,
std::vector<GlobalInstrumentsRegistry::GlobalCallbackHandle> metrics,
Duration min_interval = Duration::Seconds(5));
private:
friend class RegisteredMetricCallback;
std::vector<std::shared_ptr<StatsPlugin>> plugins_;
};
@ -231,6 +327,37 @@ class GlobalStatsPluginRegistry {
ABSL_GUARDED_BY(mutex_);
};
// A metric callback that is registered with a stats plugin group.
class RegisteredMetricCallback {
public:
RegisteredMetricCallback(
GlobalStatsPluginRegistry::StatsPluginGroup& stats_plugin_group,
absl::AnyInvocable<void(CallbackMetricReporter&)> callback,
std::vector<GlobalInstrumentsRegistry::GlobalCallbackHandle> metrics,
Duration min_interval);
~RegisteredMetricCallback();
// Invokes the callback. The callback will report metric data via reporter.
void Run(CallbackMetricReporter& reporter) { callback_(reporter); }
// Returns the set of metrics that this callback will modify.
const std::vector<GlobalInstrumentsRegistry::GlobalCallbackHandle>& metrics()
const {
return metrics_;
}
// Returns the minimum interval at which a stats plugin may invoke the
// callback.
Duration min_interval() const { return min_interval_; }
private:
GlobalStatsPluginRegistry::StatsPluginGroup& stats_plugin_group_;
absl::AnyInvocable<void(CallbackMetricReporter&)> callback_;
std::vector<GlobalInstrumentsRegistry::GlobalCallbackHandle> metrics_;
Duration min_interval_;
};
} // namespace grpc_core
#endif // GRPC_SRC_CORE_LIB_CHANNEL_METRICS_H

@ -29,6 +29,7 @@
#include "absl/strings/str_format.h"
#include "absl/strings/str_split.h"
#include <grpc/compression.h>
#include <grpc/support/log.h>
#include "src/core/lib/channel/channel_args.h"
@ -239,4 +240,36 @@ DefaultCompressionAlgorithmFromChannelArgs(const ChannelArgs& args) {
return absl::nullopt;
}
grpc_compression_options CompressionOptionsFromChannelArgs(
const ChannelArgs& args) {
// Set compression options.
grpc_compression_options compression_options;
grpc_compression_options_init(&compression_options);
auto default_level = args.GetInt(GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL);
if (default_level.has_value()) {
compression_options.default_level.is_set = true;
compression_options.default_level.level = Clamp(
static_cast<grpc_compression_level>(*default_level),
GRPC_COMPRESS_LEVEL_NONE,
static_cast<grpc_compression_level>(GRPC_COMPRESS_LEVEL_COUNT - 1));
}
auto default_algorithm =
args.GetInt(GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM);
if (default_algorithm.has_value()) {
compression_options.default_algorithm.is_set = true;
compression_options.default_algorithm.algorithm =
Clamp(static_cast<grpc_compression_algorithm>(*default_algorithm),
GRPC_COMPRESS_NONE,
static_cast<grpc_compression_algorithm>(
GRPC_COMPRESS_ALGORITHMS_COUNT - 1));
}
auto enabled_algorithms_bitset =
args.GetInt(GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET);
if (enabled_algorithms_bitset.has_value()) {
compression_options.enabled_algorithms_bitset =
*enabled_algorithms_bitset | 1 /* always support no compression */;
}
return compression_options;
}
} // namespace grpc_core

@ -88,6 +88,9 @@ class CompressionAlgorithmSet {
BitSet<GRPC_COMPRESS_ALGORITHMS_COUNT> set_;
};
grpc_compression_options CompressionOptionsFromChannelArgs(
const ChannelArgs& args);
} // namespace grpc_core
#endif // GRPC_SRC_CORE_LIB_COMPRESSION_COMPRESSION_INTERNAL_H

@ -20,11 +20,8 @@
#include "src/core/lib/config/config_vars.h"
#include <vector>
#include "absl/flags/flag.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_cat.h"
#include "src/core/lib/config/load_config.h"
@ -78,6 +75,8 @@ ABSL_FLAG(absl::optional<bool>, grpc_not_use_system_ssl_roots, {},
"Disable loading system root certificates.");
ABSL_FLAG(absl::optional<std::string>, grpc_ssl_cipher_suites, {},
"A colon separated list of cipher suites to use with OpenSSL");
ABSL_FLAG(absl::optional<bool>, grpc_absl_logging, {},
"Use absl logging from within gpr_log.");
namespace grpc_core {
@ -95,6 +94,8 @@ ConfigVars::ConfigVars(const Overrides& overrides)
not_use_system_ssl_roots_(LoadConfig(
FLAGS_grpc_not_use_system_ssl_roots, "GRPC_NOT_USE_SYSTEM_SSL_ROOTS",
overrides.not_use_system_ssl_roots, false)),
absl_logging_(LoadConfig(FLAGS_grpc_absl_logging, "GRPC_ABSL_LOGGING",
overrides.absl_logging, false)),
dns_resolver_(LoadConfig(FLAGS_grpc_dns_resolver, "GRPC_DNS_RESOLVER",
overrides.dns_resolver, "")),
verbosity_(LoadConfig(FLAGS_grpc_verbosity, "GRPC_VERBOSITY",
@ -146,7 +147,8 @@ std::string ConfigVars::ToString() const {
"\"", ", default_ssl_roots_file_path: ", "\"",
absl::CEscape(DefaultSslRootsFilePath()), "\"",
", not_use_system_ssl_roots: ", NotUseSystemSslRoots() ? "true" : "false",
", ssl_cipher_suites: ", "\"", absl::CEscape(SslCipherSuites()), "\"");
", ssl_cipher_suites: ", "\"", absl::CEscape(SslCipherSuites()), "\"",
", absl_logging: ", AbslLogging() ? "true" : "false");
}
} // namespace grpc_core

@ -38,6 +38,7 @@ class GPR_DLL ConfigVars {
absl::optional<bool> enable_fork_support;
absl::optional<bool> abort_on_leaks;
absl::optional<bool> not_use_system_ssl_roots;
absl::optional<bool> absl_logging;
absl::optional<std::string> dns_resolver;
absl::optional<std::string> verbosity;
absl::optional<std::string> stacktrace_minloglevel;
@ -102,6 +103,8 @@ class GPR_DLL ConfigVars {
bool NotUseSystemSslRoots() const { return not_use_system_ssl_roots_; }
// A colon separated list of cipher suites to use with OpenSSL
absl::string_view SslCipherSuites() const { return ssl_cipher_suites_; }
// Use absl logging from within gpr_log.
bool AbslLogging() const { return absl_logging_; }
private:
explicit ConfigVars(const Overrides& overrides);
@ -111,6 +114,7 @@ class GPR_DLL ConfigVars {
bool enable_fork_support_;
bool abort_on_leaks_;
bool not_use_system_ssl_roots_;
bool absl_logging_;
std::string dns_resolver_;
std::string verbosity_;
std::string stacktrace_minloglevel_;

@ -126,3 +126,8 @@
ECDHE-ECDSA-AES256-GCM-SHA384:\
ECDHE-RSA-AES128-GCM-SHA256:\
ECDHE-RSA-AES256-GCM-SHA384"
- name: absl_logging
type: bool
default: false
description:
Use absl logging from within gpr_log.

@ -53,6 +53,19 @@ Histogram_65536_26 operator-(const Histogram_65536_26& left,
}
return result;
}
void HistogramCollector_100_20::Collect(Histogram_100_20* result) const {
for (int i = 0; i < 20; i++) {
result->buckets_[i] += buckets_[i].load(std::memory_order_relaxed);
}
}
Histogram_100_20 operator-(const Histogram_100_20& left,
const Histogram_100_20& right) {
Histogram_100_20 result;
for (int i = 0; i < 20; i++) {
result.buckets_[i] = left.buckets_[i] - right.buckets_[i];
}
return result;
}
void HistogramCollector_16777216_20::Collect(
Histogram_16777216_20* result) const {
for (int i = 0; i < 20; i++) {
@ -185,6 +198,20 @@ const absl::string_view
"work_serializer_work_time_ms",
"work_serializer_work_time_per_item_ms",
"work_serializer_items_per_run",
"chaotic_good_sendmsgs_per_write_control",
"chaotic_good_recvmsgs_per_read_control",
"chaotic_good_sendmsgs_per_write_data",
"chaotic_good_recvmsgs_per_read_data",
"chaotic_good_thread_hops_per_write_control",
"chaotic_good_thread_hops_per_read_control",
"chaotic_good_thread_hops_per_write_data",
"chaotic_good_thread_hops_per_read_data",
"chaotic_good_tcp_read_size_data",
"chaotic_good_tcp_read_size_control",
"chaotic_good_tcp_read_offer_data",
"chaotic_good_tcp_read_offer_control",
"chaotic_good_tcp_write_size_data",
"chaotic_good_tcp_write_size_control",
};
const absl::string_view GlobalStats::histogram_doc[static_cast<int>(
Histogram::COUNT)] = {
@ -203,6 +230,20 @@ const absl::string_view GlobalStats::histogram_doc[static_cast<int>(
"work",
"How long do individual items take to process in work serializers",
"How many callbacks are executed when a work serializer runs",
"Number of sendmsgs per control channel endpoint write",
"Number of recvmsgs per control channel endpoint read",
"Number of sendmsgs per data channel endpoint write",
"Number of recvmsgs per data channel endpoint read",
"Number of thread hops per control channel endpoint write",
"Number of thread hops per control channel endpoint read",
"Number of thread hops per data channel endpoint write",
"Number of thread hops per data channel endpoint read",
"Number of bytes received by each syscall_read in the data channel",
"Number of bytes received by each syscall_read in the control channel",
"Number of bytes offered to each syscall_read in the data channel",
"Number of bytes offered to each syscall_read in the control channel",
"Number of bytes offered to each syscall_write in the data channel",
"Number of bytes offered to each syscall_write in the control channel",
};
namespace {
const int kStatsTable0[21] = {0, 1, 2, 4, 8, 15, 27,
@ -218,21 +259,25 @@ const int kStatsTable2[27] = {0, 1, 2, 4, 7, 11, 17,
const uint8_t kStatsTable3[29] = {3, 3, 4, 5, 6, 6, 7, 8, 9, 10,
11, 11, 12, 13, 14, 15, 16, 16, 17, 18,
19, 20, 21, 21, 22, 23, 24, 25, 26};
const int kStatsTable4[21] = {
const int kStatsTable4[21] = {0, 1, 2, 3, 4, 5, 7, 9, 11, 14, 17,
21, 25, 30, 36, 43, 51, 61, 72, 85, 100};
const uint8_t kStatsTable5[16] = {6, 6, 7, 8, 9, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19};
const int kStatsTable6[21] = {
0, 1, 3, 8, 19, 45, 106,
250, 588, 1383, 3252, 7646, 17976, 42262,
99359, 233593, 549177, 1291113, 3035402, 7136218, 16777216};
const uint8_t kStatsTable5[23] = {2, 3, 3, 4, 5, 6, 7, 8,
const uint8_t kStatsTable7[23] = {2, 3, 3, 4, 5, 6, 7, 8,
8, 9, 10, 11, 12, 12, 13, 14,
15, 16, 16, 17, 18, 19, 20};
const int kStatsTable6[11] = {0, 1, 2, 4, 7, 11, 17, 26, 38, 56, 80};
const uint8_t kStatsTable7[9] = {3, 3, 4, 5, 6, 6, 7, 8, 9};
const int kStatsTable8[21] = {0, 1, 2, 4, 7, 12, 19,
30, 47, 74, 116, 182, 285, 445,
695, 1084, 1691, 2637, 4113, 6414, 10000};
const uint8_t kStatsTable9[23] = {3, 3, 4, 5, 5, 6, 7, 8,
9, 9, 10, 11, 12, 12, 13, 14,
15, 15, 16, 17, 18, 18, 19};
const int kStatsTable8[11] = {0, 1, 2, 4, 7, 11, 17, 26, 38, 56, 80};
const uint8_t kStatsTable9[9] = {3, 3, 4, 5, 6, 6, 7, 8, 9};
const int kStatsTable10[21] = {0, 1, 2, 4, 7, 12, 19,
30, 47, 74, 116, 182, 285, 445,
695, 1084, 1691, 2637, 4113, 6414, 10000};
const uint8_t kStatsTable11[23] = {3, 3, 4, 5, 5, 6, 7, 8,
9, 9, 10, 11, 12, 12, 13, 14,
15, 15, 16, 17, 18, 18, 19};
} // namespace
int Histogram_100000_20::BucketFor(int value) {
if (value < 3) {
@ -272,6 +317,29 @@ int Histogram_65536_26::BucketFor(int value) {
}
}
}
int Histogram_100_20::BucketFor(int value) {
if (value < 6) {
if (value < 0) {
return 0;
} else {
return value;
}
} else {
if (value < 81) {
DblUint val;
val.dbl = value;
const int bucket =
kStatsTable5[((val.uint - 4618441417868443648ull) >> 50)];
return bucket - (value < kStatsTable4[bucket]);
} else {
if (value < 85) {
return 18;
} else {
return 19;
}
}
}
}
int Histogram_16777216_20::BucketFor(int value) {
if (value < 2) {
if (value < 0) {
@ -284,8 +352,8 @@ int Histogram_16777216_20::BucketFor(int value) {
DblUint val;
val.dbl = value;
const int bucket =
kStatsTable5[((val.uint - 4611686018427387904ull) >> 52)];
return bucket - (value < kStatsTable4[bucket]);
kStatsTable7[((val.uint - 4611686018427387904ull) >> 52)];
return bucket - (value < kStatsTable6[bucket]);
} else {
return 19;
}
@ -303,8 +371,8 @@ int Histogram_80_10::BucketFor(int value) {
DblUint val;
val.dbl = value;
const int bucket =
kStatsTable7[((val.uint - 4613937818241073152ull) >> 51)];
return bucket - (value < kStatsTable6[bucket]);
kStatsTable9[((val.uint - 4613937818241073152ull) >> 51)];
return bucket - (value < kStatsTable8[bucket]);
} else {
if (value < 56) {
return 8;
@ -326,8 +394,8 @@ int Histogram_10000_20::BucketFor(int value) {
DblUint val;
val.dbl = value;
const int bucket =
kStatsTable9[((val.uint - 4613937818241073152ull) >> 51)];
return bucket - (value < kStatsTable8[bucket]);
kStatsTable11[((val.uint - 4613937818241073152ull) >> 51)];
return bucket - (value < kStatsTable10[bucket]);
} else {
if (value < 6414) {
return 18;
@ -378,31 +446,31 @@ HistogramView GlobalStats::histogram(Histogram which) const {
return HistogramView{&Histogram_65536_26::BucketFor, kStatsTable2, 26,
call_initial_size.buckets()};
case Histogram::kTcpWriteSize:
return HistogramView{&Histogram_16777216_20::BucketFor, kStatsTable4, 20,
return HistogramView{&Histogram_16777216_20::BucketFor, kStatsTable6, 20,
tcp_write_size.buckets()};
case Histogram::kTcpWriteIovSize:
return HistogramView{&Histogram_80_10::BucketFor, kStatsTable6, 10,
return HistogramView{&Histogram_80_10::BucketFor, kStatsTable8, 10,
tcp_write_iov_size.buckets()};
case Histogram::kTcpReadSize:
return HistogramView{&Histogram_16777216_20::BucketFor, kStatsTable4, 20,
return HistogramView{&Histogram_16777216_20::BucketFor, kStatsTable6, 20,
tcp_read_size.buckets()};
case Histogram::kTcpReadOffer:
return HistogramView{&Histogram_16777216_20::BucketFor, kStatsTable4, 20,
return HistogramView{&Histogram_16777216_20::BucketFor, kStatsTable6, 20,
tcp_read_offer.buckets()};
case Histogram::kTcpReadOfferIovSize:
return HistogramView{&Histogram_80_10::BucketFor, kStatsTable6, 10,
return HistogramView{&Histogram_80_10::BucketFor, kStatsTable8, 10,
tcp_read_offer_iov_size.buckets()};
case Histogram::kHttp2SendMessageSize:
return HistogramView{&Histogram_16777216_20::BucketFor, kStatsTable4, 20,
return HistogramView{&Histogram_16777216_20::BucketFor, kStatsTable6, 20,
http2_send_message_size.buckets()};
case Histogram::kHttp2MetadataSize:
return HistogramView{&Histogram_65536_26::BucketFor, kStatsTable2, 26,
http2_metadata_size.buckets()};
case Histogram::kWrrSubchannelListSize:
return HistogramView{&Histogram_10000_20::BucketFor, kStatsTable8, 20,
return HistogramView{&Histogram_10000_20::BucketFor, kStatsTable10, 20,
wrr_subchannel_list_size.buckets()};
case Histogram::kWrrSubchannelReadySize:
return HistogramView{&Histogram_10000_20::BucketFor, kStatsTable8, 20,
return HistogramView{&Histogram_10000_20::BucketFor, kStatsTable10, 20,
wrr_subchannel_ready_size.buckets()};
case Histogram::kWorkSerializerRunTimeMs:
return HistogramView{&Histogram_100000_20::BucketFor, kStatsTable0, 20,
@ -414,8 +482,51 @@ HistogramView GlobalStats::histogram(Histogram which) const {
return HistogramView{&Histogram_100000_20::BucketFor, kStatsTable0, 20,
work_serializer_work_time_per_item_ms.buckets()};
case Histogram::kWorkSerializerItemsPerRun:
return HistogramView{&Histogram_10000_20::BucketFor, kStatsTable8, 20,
return HistogramView{&Histogram_10000_20::BucketFor, kStatsTable10, 20,
work_serializer_items_per_run.buckets()};
case Histogram::kChaoticGoodSendmsgsPerWriteControl:
return HistogramView{&Histogram_100_20::BucketFor, kStatsTable4, 20,
chaotic_good_sendmsgs_per_write_control.buckets()};
case Histogram::kChaoticGoodRecvmsgsPerReadControl:
return HistogramView{&Histogram_100_20::BucketFor, kStatsTable4, 20,
chaotic_good_recvmsgs_per_read_control.buckets()};
case Histogram::kChaoticGoodSendmsgsPerWriteData:
return HistogramView{&Histogram_100_20::BucketFor, kStatsTable4, 20,
chaotic_good_sendmsgs_per_write_data.buckets()};
case Histogram::kChaoticGoodRecvmsgsPerReadData:
return HistogramView{&Histogram_100_20::BucketFor, kStatsTable4, 20,
chaotic_good_recvmsgs_per_read_data.buckets()};
case Histogram::kChaoticGoodThreadHopsPerWriteControl:
return HistogramView{
&Histogram_100_20::BucketFor, kStatsTable4, 20,
chaotic_good_thread_hops_per_write_control.buckets()};
case Histogram::kChaoticGoodThreadHopsPerReadControl:
return HistogramView{&Histogram_100_20::BucketFor, kStatsTable4, 20,
chaotic_good_thread_hops_per_read_control.buckets()};
case Histogram::kChaoticGoodThreadHopsPerWriteData:
return HistogramView{&Histogram_100_20::BucketFor, kStatsTable4, 20,
chaotic_good_thread_hops_per_write_data.buckets()};
case Histogram::kChaoticGoodThreadHopsPerReadData:
return HistogramView{&Histogram_100_20::BucketFor, kStatsTable4, 20,
chaotic_good_thread_hops_per_read_data.buckets()};
case Histogram::kChaoticGoodTcpReadSizeData:
return HistogramView{&Histogram_16777216_20::BucketFor, kStatsTable6, 20,
chaotic_good_tcp_read_size_data.buckets()};
case Histogram::kChaoticGoodTcpReadSizeControl:
return HistogramView{&Histogram_16777216_20::BucketFor, kStatsTable6, 20,
chaotic_good_tcp_read_size_control.buckets()};
case Histogram::kChaoticGoodTcpReadOfferData:
return HistogramView{&Histogram_16777216_20::BucketFor, kStatsTable6, 20,
chaotic_good_tcp_read_offer_data.buckets()};
case Histogram::kChaoticGoodTcpReadOfferControl:
return HistogramView{&Histogram_16777216_20::BucketFor, kStatsTable6, 20,
chaotic_good_tcp_read_offer_control.buckets()};
case Histogram::kChaoticGoodTcpWriteSizeData:
return HistogramView{&Histogram_16777216_20::BucketFor, kStatsTable6, 20,
chaotic_good_tcp_write_size_data.buckets()};
case Histogram::kChaoticGoodTcpWriteSizeControl:
return HistogramView{&Histogram_16777216_20::BucketFor, kStatsTable6, 20,
chaotic_good_tcp_write_size_control.buckets()};
}
}
std::unique_ptr<GlobalStats> GlobalStatsCollector::Collect() const {
@ -497,6 +608,34 @@ std::unique_ptr<GlobalStats> GlobalStatsCollector::Collect() const {
&result->work_serializer_work_time_per_item_ms);
data.work_serializer_items_per_run.Collect(
&result->work_serializer_items_per_run);
data.chaotic_good_sendmsgs_per_write_control.Collect(
&result->chaotic_good_sendmsgs_per_write_control);
data.chaotic_good_recvmsgs_per_read_control.Collect(
&result->chaotic_good_recvmsgs_per_read_control);
data.chaotic_good_sendmsgs_per_write_data.Collect(
&result->chaotic_good_sendmsgs_per_write_data);
data.chaotic_good_recvmsgs_per_read_data.Collect(
&result->chaotic_good_recvmsgs_per_read_data);
data.chaotic_good_thread_hops_per_write_control.Collect(
&result->chaotic_good_thread_hops_per_write_control);
data.chaotic_good_thread_hops_per_read_control.Collect(
&result->chaotic_good_thread_hops_per_read_control);
data.chaotic_good_thread_hops_per_write_data.Collect(
&result->chaotic_good_thread_hops_per_write_data);
data.chaotic_good_thread_hops_per_read_data.Collect(
&result->chaotic_good_thread_hops_per_read_data);
data.chaotic_good_tcp_read_size_data.Collect(
&result->chaotic_good_tcp_read_size_data);
data.chaotic_good_tcp_read_size_control.Collect(
&result->chaotic_good_tcp_read_size_control);
data.chaotic_good_tcp_read_offer_data.Collect(
&result->chaotic_good_tcp_read_offer_data);
data.chaotic_good_tcp_read_offer_control.Collect(
&result->chaotic_good_tcp_read_offer_control);
data.chaotic_good_tcp_write_size_data.Collect(
&result->chaotic_good_tcp_write_size_data);
data.chaotic_good_tcp_write_size_control.Collect(
&result->chaotic_good_tcp_write_size_control);
}
return result;
}
@ -569,6 +708,45 @@ std::unique_ptr<GlobalStats> GlobalStats::Diff(const GlobalStats& other) const {
other.work_serializer_work_time_per_item_ms;
result->work_serializer_items_per_run =
work_serializer_items_per_run - other.work_serializer_items_per_run;
result->chaotic_good_sendmsgs_per_write_control =
chaotic_good_sendmsgs_per_write_control -
other.chaotic_good_sendmsgs_per_write_control;
result->chaotic_good_recvmsgs_per_read_control =
chaotic_good_recvmsgs_per_read_control -
other.chaotic_good_recvmsgs_per_read_control;
result->chaotic_good_sendmsgs_per_write_data =
chaotic_good_sendmsgs_per_write_data -
other.chaotic_good_sendmsgs_per_write_data;
result->chaotic_good_recvmsgs_per_read_data =
chaotic_good_recvmsgs_per_read_data -
other.chaotic_good_recvmsgs_per_read_data;
result->chaotic_good_thread_hops_per_write_control =
chaotic_good_thread_hops_per_write_control -
other.chaotic_good_thread_hops_per_write_control;
result->chaotic_good_thread_hops_per_read_control =
chaotic_good_thread_hops_per_read_control -
other.chaotic_good_thread_hops_per_read_control;
result->chaotic_good_thread_hops_per_write_data =
chaotic_good_thread_hops_per_write_data -
other.chaotic_good_thread_hops_per_write_data;
result->chaotic_good_thread_hops_per_read_data =
chaotic_good_thread_hops_per_read_data -
other.chaotic_good_thread_hops_per_read_data;
result->chaotic_good_tcp_read_size_data =
chaotic_good_tcp_read_size_data - other.chaotic_good_tcp_read_size_data;
result->chaotic_good_tcp_read_size_control =
chaotic_good_tcp_read_size_control -
other.chaotic_good_tcp_read_size_control;
result->chaotic_good_tcp_read_offer_data =
chaotic_good_tcp_read_offer_data - other.chaotic_good_tcp_read_offer_data;
result->chaotic_good_tcp_read_offer_control =
chaotic_good_tcp_read_offer_control -
other.chaotic_good_tcp_read_offer_control;
result->chaotic_good_tcp_write_size_data =
chaotic_good_tcp_write_size_data - other.chaotic_good_tcp_write_size_data;
result->chaotic_good_tcp_write_size_control =
chaotic_good_tcp_write_size_control -
other.chaotic_good_tcp_write_size_control;
return result;
}
} // namespace grpc_core

@ -76,6 +76,29 @@ class HistogramCollector_65536_26 {
private:
std::atomic<uint64_t> buckets_[26]{};
};
class HistogramCollector_100_20;
class Histogram_100_20 {
public:
static int BucketFor(int value);
const uint64_t* buckets() const { return buckets_; }
friend Histogram_100_20 operator-(const Histogram_100_20& left,
const Histogram_100_20& right);
private:
friend class HistogramCollector_100_20;
uint64_t buckets_[20]{};
};
class HistogramCollector_100_20 {
public:
void Increment(int value) {
buckets_[Histogram_100_20::BucketFor(value)].fetch_add(
1, std::memory_order_relaxed);
}
void Collect(Histogram_100_20* result) const;
private:
std::atomic<uint64_t> buckets_[20]{};
};
class HistogramCollector_16777216_20;
class Histogram_16777216_20 {
public:
@ -196,6 +219,20 @@ struct GlobalStats {
kWorkSerializerWorkTimeMs,
kWorkSerializerWorkTimePerItemMs,
kWorkSerializerItemsPerRun,
kChaoticGoodSendmsgsPerWriteControl,
kChaoticGoodRecvmsgsPerReadControl,
kChaoticGoodSendmsgsPerWriteData,
kChaoticGoodRecvmsgsPerReadData,
kChaoticGoodThreadHopsPerWriteControl,
kChaoticGoodThreadHopsPerReadControl,
kChaoticGoodThreadHopsPerWriteData,
kChaoticGoodThreadHopsPerReadData,
kChaoticGoodTcpReadSizeData,
kChaoticGoodTcpReadSizeControl,
kChaoticGoodTcpReadOfferData,
kChaoticGoodTcpReadOfferControl,
kChaoticGoodTcpWriteSizeData,
kChaoticGoodTcpWriteSizeControl,
COUNT
};
GlobalStats();
@ -256,6 +293,20 @@ struct GlobalStats {
Histogram_100000_20 work_serializer_work_time_ms;
Histogram_100000_20 work_serializer_work_time_per_item_ms;
Histogram_10000_20 work_serializer_items_per_run;
Histogram_100_20 chaotic_good_sendmsgs_per_write_control;
Histogram_100_20 chaotic_good_recvmsgs_per_read_control;
Histogram_100_20 chaotic_good_sendmsgs_per_write_data;
Histogram_100_20 chaotic_good_recvmsgs_per_read_data;
Histogram_100_20 chaotic_good_thread_hops_per_write_control;
Histogram_100_20 chaotic_good_thread_hops_per_read_control;
Histogram_100_20 chaotic_good_thread_hops_per_write_data;
Histogram_100_20 chaotic_good_thread_hops_per_read_data;
Histogram_16777216_20 chaotic_good_tcp_read_size_data;
Histogram_16777216_20 chaotic_good_tcp_read_size_control;
Histogram_16777216_20 chaotic_good_tcp_read_offer_data;
Histogram_16777216_20 chaotic_good_tcp_read_offer_control;
Histogram_16777216_20 chaotic_good_tcp_write_size_data;
Histogram_16777216_20 chaotic_good_tcp_write_size_control;
HistogramView histogram(Histogram which) const;
std::unique_ptr<GlobalStats> Diff(const GlobalStats& other) const;
};
@ -414,6 +465,49 @@ class GlobalStatsCollector {
void IncrementWorkSerializerItemsPerRun(int value) {
data_.this_cpu().work_serializer_items_per_run.Increment(value);
}
void IncrementChaoticGoodSendmsgsPerWriteControl(int value) {
data_.this_cpu().chaotic_good_sendmsgs_per_write_control.Increment(value);
}
void IncrementChaoticGoodRecvmsgsPerReadControl(int value) {
data_.this_cpu().chaotic_good_recvmsgs_per_read_control.Increment(value);
}
void IncrementChaoticGoodSendmsgsPerWriteData(int value) {
data_.this_cpu().chaotic_good_sendmsgs_per_write_data.Increment(value);
}
void IncrementChaoticGoodRecvmsgsPerReadData(int value) {
data_.this_cpu().chaotic_good_recvmsgs_per_read_data.Increment(value);
}
void IncrementChaoticGoodThreadHopsPerWriteControl(int value) {
data_.this_cpu().chaotic_good_thread_hops_per_write_control.Increment(
value);
}
void IncrementChaoticGoodThreadHopsPerReadControl(int value) {
data_.this_cpu().chaotic_good_thread_hops_per_read_control.Increment(value);
}
void IncrementChaoticGoodThreadHopsPerWriteData(int value) {
data_.this_cpu().chaotic_good_thread_hops_per_write_data.Increment(value);
}
void IncrementChaoticGoodThreadHopsPerReadData(int value) {
data_.this_cpu().chaotic_good_thread_hops_per_read_data.Increment(value);
}
void IncrementChaoticGoodTcpReadSizeData(int value) {
data_.this_cpu().chaotic_good_tcp_read_size_data.Increment(value);
}
void IncrementChaoticGoodTcpReadSizeControl(int value) {
data_.this_cpu().chaotic_good_tcp_read_size_control.Increment(value);
}
void IncrementChaoticGoodTcpReadOfferData(int value) {
data_.this_cpu().chaotic_good_tcp_read_offer_data.Increment(value);
}
void IncrementChaoticGoodTcpReadOfferControl(int value) {
data_.this_cpu().chaotic_good_tcp_read_offer_control.Increment(value);
}
void IncrementChaoticGoodTcpWriteSizeData(int value) {
data_.this_cpu().chaotic_good_tcp_write_size_data.Increment(value);
}
void IncrementChaoticGoodTcpWriteSizeControl(int value) {
data_.this_cpu().chaotic_good_tcp_write_size_control.Increment(value);
}
private:
struct Data {
@ -463,6 +557,20 @@ class GlobalStatsCollector {
HistogramCollector_100000_20 work_serializer_work_time_ms;
HistogramCollector_100000_20 work_serializer_work_time_per_item_ms;
HistogramCollector_10000_20 work_serializer_items_per_run;
HistogramCollector_100_20 chaotic_good_sendmsgs_per_write_control;
HistogramCollector_100_20 chaotic_good_recvmsgs_per_read_control;
HistogramCollector_100_20 chaotic_good_sendmsgs_per_write_data;
HistogramCollector_100_20 chaotic_good_recvmsgs_per_read_data;
HistogramCollector_100_20 chaotic_good_thread_hops_per_write_control;
HistogramCollector_100_20 chaotic_good_thread_hops_per_read_control;
HistogramCollector_100_20 chaotic_good_thread_hops_per_write_data;
HistogramCollector_100_20 chaotic_good_thread_hops_per_read_data;
HistogramCollector_16777216_20 chaotic_good_tcp_read_size_data;
HistogramCollector_16777216_20 chaotic_good_tcp_read_size_control;
HistogramCollector_16777216_20 chaotic_good_tcp_read_offer_data;
HistogramCollector_16777216_20 chaotic_good_tcp_read_offer_control;
HistogramCollector_16777216_20 chaotic_good_tcp_write_size_data;
HistogramCollector_16777216_20 chaotic_good_tcp_write_size_control;
};
PerCpu<Data> data_{PerCpuOptions().SetCpusPerShard(4).SetMaxShards(32)};
};

@ -141,3 +141,60 @@
doc: Number of uncommon io errors
- counter: msg_errqueue_error_count
doc: Number of uncommon errors returned by MSG_ERRQUEUE
- histogram: chaotic_good_sendmsgs_per_write_control
doc: Number of sendmsgs per control channel endpoint write
max: 100
buckets: 20
- histogram: chaotic_good_recvmsgs_per_read_control
doc: Number of recvmsgs per control channel endpoint read
max: 100
buckets: 20
- histogram: chaotic_good_sendmsgs_per_write_data
doc: Number of sendmsgs per data channel endpoint write
max: 100
buckets: 20
- histogram: chaotic_good_recvmsgs_per_read_data
doc: Number of recvmsgs per data channel endpoint read
max: 100
buckets: 20
- histogram: chaotic_good_thread_hops_per_write_control
doc: Number of thread hops per control channel endpoint write
max: 100
buckets: 20
- histogram: chaotic_good_thread_hops_per_read_control
doc: Number of thread hops per control channel endpoint read
max: 100
buckets: 20
- histogram: chaotic_good_thread_hops_per_write_data
doc: Number of thread hops per data channel endpoint write
max: 100
buckets: 20
- histogram: chaotic_good_thread_hops_per_read_data
doc: Number of thread hops per data channel endpoint read
max: 100
buckets: 20
- histogram: chaotic_good_tcp_read_size_data
max: 16777216
buckets: 20
doc: Number of bytes received by each syscall_read in the data channel
- histogram: chaotic_good_tcp_read_size_control
max: 16777216
buckets: 20
doc: Number of bytes received by each syscall_read in the control channel
- histogram: chaotic_good_tcp_read_offer_data
max: 16777216
buckets: 20
doc: Number of bytes offered to each syscall_read in the data channel
- histogram: chaotic_good_tcp_read_offer_control
max: 16777216
buckets: 20
doc: Number of bytes offered to each syscall_read in the control channel
- histogram: chaotic_good_tcp_write_size_data
max: 16777216
buckets: 20
doc: Number of bytes offered to each syscall_write in the data channel
- histogram: chaotic_good_tcp_write_size_control
max: 16777216
buckets: 20
doc: Number of bytes offered to each syscall_write in the control channel

@ -0,0 +1,45 @@
// Copyright 2024 The gRPC Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef GRPC_SRC_CORE_LIB_EVENT_ENGINE_EXTENSIONS_CHAOTIC_GOOD_EXTENSION_H
#define GRPC_SRC_CORE_LIB_EVENT_ENGINE_EXTENSIONS_CHAOTIC_GOOD_EXTENSION_H
#include <grpc/support/port_platform.h>
#include "absl/strings/string_view.h"
namespace grpc_event_engine {
namespace experimental {
/// An Endpoint extension class that will be supported by EventEngine endpoints
/// which need to work with the ChaoticGood transport.
class ChaoticGoodExtension {
public:
virtual ~ChaoticGoodExtension() = default;
static absl::string_view EndpointExtensionName() {
return "io.grpc.event_engine.extension.chaotic_good_extension";
}
/// If invoked, the endpoint begins collecting TCP stats. If the boolean
/// arg is_control_channel is true, then the collected stats are grouped into
/// histograms and counters specific to the chaotic good control channel.
/// Otherwise they are grouped into histograms and counters specific to the
/// chaotic good data channel.
virtual void EnableStatsCollection(bool is_control_channel) = 0;
};
} // namespace experimental
} // namespace grpc_event_engine
#endif // GRPC_SRC_CORE_LIB_EVENT_ENGINE_EXTENSIONS_CHAOTIC_GOOD_EXTENSION_H

@ -22,12 +22,20 @@
#include <grpc/event_engine/slice_buffer.h>
#include "src/core/lib/event_engine/extensions/can_track_errors.h"
#include "src/core/lib/event_engine/extensions/chaotic_good_extension.h"
#include "src/core/lib/event_engine/extensions/supports_fd.h"
#include "src/core/lib/event_engine/query_extensions.h"
namespace grpc_event_engine {
namespace experimental {
/// This defines an interface that posix specific EventEngines endpoints
/// may implement to support additional chaotic good related functionality.
class PosixEndpointWithChaoticGoodSupport
: public ExtendedType<EventEngine::Endpoint, ChaoticGoodExtension,
EndpointSupportsFdExtension,
EndpointCanTrackErrorsExtension> {};
/// This defines an interface that posix specific EventEngines endpoints
/// may implement to support additional file descriptor related functionality.
class PosixEndpointWithFdSupport

@ -36,9 +36,6 @@ const char* const additional_constraints_call_v3 = "{}";
const char* const description_canary_client_privacy =
"If set, canary client privacy";
const char* const additional_constraints_canary_client_privacy = "{}";
const char* const description_client_idleness =
"If enabled, client channel idleness is enabled by default.";
const char* const additional_constraints_client_idleness = "{}";
const char* const description_client_privacy = "If set, client privacy";
const char* const additional_constraints_client_privacy = "{}";
const char* const description_event_engine_client =
@ -83,9 +80,6 @@ const char* const description_pending_queue_cap =
"grpc_server_request_call or grpc_server_request_registered_call (or their "
"wrappers in the C++ API).";
const char* const additional_constraints_pending_queue_cap = "{}";
const char* const description_pick_first_happy_eyeballs =
"Use Happy Eyeballs in pick_first.";
const char* const additional_constraints_pick_first_happy_eyeballs = "{}";
const char* const description_promise_based_client_call =
"If set, use the new gRPC promise based call code when it's appropriate "
"(ie when all filters in a stack are promise based)";
@ -116,11 +110,6 @@ const uint8_t required_experiments_promise_based_inproc_transport[] = {
static_cast<uint8_t>(grpc_core::kExperimentIdPromiseBasedServerCall),
static_cast<uint8_t>(
grpc_core::kExperimentIdRegisteredMethodLookupInTransport)};
const char* const description_round_robin_delegate_to_pick_first =
"Change round_robin code to delegate to pick_first as per dualstack "
"backend design.";
const char* const additional_constraints_round_robin_delegate_to_pick_first =
"{}";
const char* const description_rstpit =
"On RST_STREAM on a server, reduce MAX_CONCURRENT_STREAMS for a short "
"duration";
@ -170,10 +159,6 @@ const char* const description_work_serializer_dispatch =
const char* const additional_constraints_work_serializer_dispatch = "{}";
const uint8_t required_experiments_work_serializer_dispatch[] = {
static_cast<uint8_t>(grpc_core::kExperimentIdEventEngineClient)};
const char* const description_wrr_delegate_to_pick_first =
"Change WRR code to delegate to pick_first as per dualstack backend "
"design.";
const char* const additional_constraints_wrr_delegate_to_pick_first = "{}";
#ifdef NDEBUG
const bool kDefaultForDebugOnly = false;
#else
@ -194,8 +179,6 @@ const ExperimentMetadata g_experiment_metadata[] = {
false, true},
{"canary_client_privacy", description_canary_client_privacy,
additional_constraints_canary_client_privacy, nullptr, 0, false, false},
{"client_idleness", description_client_idleness,
additional_constraints_client_idleness, nullptr, 0, true, true},
{"client_privacy", description_client_privacy,
additional_constraints_client_privacy, nullptr, 0, false, false},
{"event_engine_client", description_event_engine_client,
@ -220,8 +203,6 @@ const ExperimentMetadata g_experiment_metadata[] = {
additional_constraints_peer_state_based_framing, nullptr, 0, false, true},
{"pending_queue_cap", description_pending_queue_cap,
additional_constraints_pending_queue_cap, nullptr, 0, true, true},
{"pick_first_happy_eyeballs", description_pick_first_happy_eyeballs,
additional_constraints_pick_first_happy_eyeballs, nullptr, 0, true, true},
{"promise_based_client_call", description_promise_based_client_call,
additional_constraints_promise_based_client_call,
required_experiments_promise_based_client_call, 2, false, true},
@ -238,10 +219,6 @@ const ExperimentMetadata g_experiment_metadata[] = {
description_promise_based_inproc_transport,
additional_constraints_promise_based_inproc_transport,
required_experiments_promise_based_inproc_transport, 3, false, false},
{"round_robin_delegate_to_pick_first",
description_round_robin_delegate_to_pick_first,
additional_constraints_round_robin_delegate_to_pick_first, nullptr, 0,
true, true},
{"rstpit", description_rstpit, additional_constraints_rstpit, nullptr, 0,
false, true},
{"schedule_cancellation_over_write",
@ -275,8 +252,6 @@ const ExperimentMetadata g_experiment_metadata[] = {
{"work_serializer_dispatch", description_work_serializer_dispatch,
additional_constraints_work_serializer_dispatch,
required_experiments_work_serializer_dispatch, 1, false, true},
{"wrr_delegate_to_pick_first", description_wrr_delegate_to_pick_first,
additional_constraints_wrr_delegate_to_pick_first, nullptr, 0, true, true},
};
} // namespace grpc_core
@ -295,9 +270,6 @@ const char* const additional_constraints_call_v3 = "{}";
const char* const description_canary_client_privacy =
"If set, canary client privacy";
const char* const additional_constraints_canary_client_privacy = "{}";
const char* const description_client_idleness =
"If enabled, client channel idleness is enabled by default.";
const char* const additional_constraints_client_idleness = "{}";
const char* const description_client_privacy = "If set, client privacy";
const char* const additional_constraints_client_privacy = "{}";
const char* const description_event_engine_client =
@ -342,9 +314,6 @@ const char* const description_pending_queue_cap =
"grpc_server_request_call or grpc_server_request_registered_call (or their "
"wrappers in the C++ API).";
const char* const additional_constraints_pending_queue_cap = "{}";
const char* const description_pick_first_happy_eyeballs =
"Use Happy Eyeballs in pick_first.";
const char* const additional_constraints_pick_first_happy_eyeballs = "{}";
const char* const description_promise_based_client_call =
"If set, use the new gRPC promise based call code when it's appropriate "
"(ie when all filters in a stack are promise based)";
@ -375,11 +344,6 @@ const uint8_t required_experiments_promise_based_inproc_transport[] = {
static_cast<uint8_t>(grpc_core::kExperimentIdPromiseBasedServerCall),
static_cast<uint8_t>(
grpc_core::kExperimentIdRegisteredMethodLookupInTransport)};
const char* const description_round_robin_delegate_to_pick_first =
"Change round_robin code to delegate to pick_first as per dualstack "
"backend design.";
const char* const additional_constraints_round_robin_delegate_to_pick_first =
"{}";
const char* const description_rstpit =
"On RST_STREAM on a server, reduce MAX_CONCURRENT_STREAMS for a short "
"duration";
@ -429,10 +393,6 @@ const char* const description_work_serializer_dispatch =
const char* const additional_constraints_work_serializer_dispatch = "{}";
const uint8_t required_experiments_work_serializer_dispatch[] = {
static_cast<uint8_t>(grpc_core::kExperimentIdEventEngineClient)};
const char* const description_wrr_delegate_to_pick_first =
"Change WRR code to delegate to pick_first as per dualstack backend "
"design.";
const char* const additional_constraints_wrr_delegate_to_pick_first = "{}";
#ifdef NDEBUG
const bool kDefaultForDebugOnly = false;
#else
@ -453,8 +413,6 @@ const ExperimentMetadata g_experiment_metadata[] = {
false, true},
{"canary_client_privacy", description_canary_client_privacy,
additional_constraints_canary_client_privacy, nullptr, 0, false, false},
{"client_idleness", description_client_idleness,
additional_constraints_client_idleness, nullptr, 0, true, true},
{"client_privacy", description_client_privacy,
additional_constraints_client_privacy, nullptr, 0, false, false},
{"event_engine_client", description_event_engine_client,
@ -479,8 +437,6 @@ const ExperimentMetadata g_experiment_metadata[] = {
additional_constraints_peer_state_based_framing, nullptr, 0, false, true},
{"pending_queue_cap", description_pending_queue_cap,
additional_constraints_pending_queue_cap, nullptr, 0, true, true},
{"pick_first_happy_eyeballs", description_pick_first_happy_eyeballs,
additional_constraints_pick_first_happy_eyeballs, nullptr, 0, true, true},
{"promise_based_client_call", description_promise_based_client_call,
additional_constraints_promise_based_client_call,
required_experiments_promise_based_client_call, 2, false, true},
@ -497,10 +453,6 @@ const ExperimentMetadata g_experiment_metadata[] = {
description_promise_based_inproc_transport,
additional_constraints_promise_based_inproc_transport,
required_experiments_promise_based_inproc_transport, 3, false, false},
{"round_robin_delegate_to_pick_first",
description_round_robin_delegate_to_pick_first,
additional_constraints_round_robin_delegate_to_pick_first, nullptr, 0,
true, true},
{"rstpit", description_rstpit, additional_constraints_rstpit, nullptr, 0,
false, true},
{"schedule_cancellation_over_write",
@ -534,8 +486,6 @@ const ExperimentMetadata g_experiment_metadata[] = {
{"work_serializer_dispatch", description_work_serializer_dispatch,
additional_constraints_work_serializer_dispatch,
required_experiments_work_serializer_dispatch, 1, false, true},
{"wrr_delegate_to_pick_first", description_wrr_delegate_to_pick_first,
additional_constraints_wrr_delegate_to_pick_first, nullptr, 0, true, true},
};
} // namespace grpc_core
@ -554,9 +504,6 @@ const char* const additional_constraints_call_v3 = "{}";
const char* const description_canary_client_privacy =
"If set, canary client privacy";
const char* const additional_constraints_canary_client_privacy = "{}";
const char* const description_client_idleness =
"If enabled, client channel idleness is enabled by default.";
const char* const additional_constraints_client_idleness = "{}";
const char* const description_client_privacy = "If set, client privacy";
const char* const additional_constraints_client_privacy = "{}";
const char* const description_event_engine_client =
@ -601,9 +548,6 @@ const char* const description_pending_queue_cap =
"grpc_server_request_call or grpc_server_request_registered_call (or their "
"wrappers in the C++ API).";
const char* const additional_constraints_pending_queue_cap = "{}";
const char* const description_pick_first_happy_eyeballs =
"Use Happy Eyeballs in pick_first.";
const char* const additional_constraints_pick_first_happy_eyeballs = "{}";
const char* const description_promise_based_client_call =
"If set, use the new gRPC promise based call code when it's appropriate "
"(ie when all filters in a stack are promise based)";
@ -634,11 +578,6 @@ const uint8_t required_experiments_promise_based_inproc_transport[] = {
static_cast<uint8_t>(grpc_core::kExperimentIdPromiseBasedServerCall),
static_cast<uint8_t>(
grpc_core::kExperimentIdRegisteredMethodLookupInTransport)};
const char* const description_round_robin_delegate_to_pick_first =
"Change round_robin code to delegate to pick_first as per dualstack "
"backend design.";
const char* const additional_constraints_round_robin_delegate_to_pick_first =
"{}";
const char* const description_rstpit =
"On RST_STREAM on a server, reduce MAX_CONCURRENT_STREAMS for a short "
"duration";
@ -688,10 +627,6 @@ const char* const description_work_serializer_dispatch =
const char* const additional_constraints_work_serializer_dispatch = "{}";
const uint8_t required_experiments_work_serializer_dispatch[] = {
static_cast<uint8_t>(grpc_core::kExperimentIdEventEngineClient)};
const char* const description_wrr_delegate_to_pick_first =
"Change WRR code to delegate to pick_first as per dualstack backend "
"design.";
const char* const additional_constraints_wrr_delegate_to_pick_first = "{}";
#ifdef NDEBUG
const bool kDefaultForDebugOnly = false;
#else
@ -712,8 +647,6 @@ const ExperimentMetadata g_experiment_metadata[] = {
false, true},
{"canary_client_privacy", description_canary_client_privacy,
additional_constraints_canary_client_privacy, nullptr, 0, false, false},
{"client_idleness", description_client_idleness,
additional_constraints_client_idleness, nullptr, 0, true, true},
{"client_privacy", description_client_privacy,
additional_constraints_client_privacy, nullptr, 0, false, false},
{"event_engine_client", description_event_engine_client,
@ -738,8 +671,6 @@ const ExperimentMetadata g_experiment_metadata[] = {
additional_constraints_peer_state_based_framing, nullptr, 0, false, true},
{"pending_queue_cap", description_pending_queue_cap,
additional_constraints_pending_queue_cap, nullptr, 0, true, true},
{"pick_first_happy_eyeballs", description_pick_first_happy_eyeballs,
additional_constraints_pick_first_happy_eyeballs, nullptr, 0, true, true},
{"promise_based_client_call", description_promise_based_client_call,
additional_constraints_promise_based_client_call,
required_experiments_promise_based_client_call, 2, false, true},
@ -756,10 +687,6 @@ const ExperimentMetadata g_experiment_metadata[] = {
description_promise_based_inproc_transport,
additional_constraints_promise_based_inproc_transport,
required_experiments_promise_based_inproc_transport, 3, false, false},
{"round_robin_delegate_to_pick_first",
description_round_robin_delegate_to_pick_first,
additional_constraints_round_robin_delegate_to_pick_first, nullptr, 0,
true, true},
{"rstpit", description_rstpit, additional_constraints_rstpit, nullptr, 0,
false, true},
{"schedule_cancellation_over_write",
@ -793,8 +720,6 @@ const ExperimentMetadata g_experiment_metadata[] = {
{"work_serializer_dispatch", description_work_serializer_dispatch,
additional_constraints_work_serializer_dispatch,
required_experiments_work_serializer_dispatch, 1, true, true},
{"wrr_delegate_to_pick_first", description_wrr_delegate_to_pick_first,
additional_constraints_wrr_delegate_to_pick_first, nullptr, 0, true, true},
};
} // namespace grpc_core

@ -71,8 +71,6 @@ inline bool IsCallStatusOverrideOnCancellationEnabled() {
}
inline bool IsCallV3Enabled() { return false; }
inline bool IsCanaryClientPrivacyEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_CLIENT_IDLENESS
inline bool IsClientIdlenessEnabled() { return true; }
inline bool IsClientPrivacyEnabled() { return false; }
inline bool IsEventEngineClientEnabled() { return false; }
inline bool IsEventEngineDnsEnabled() { return false; }
@ -88,16 +86,12 @@ inline bool IsMultipingEnabled() { return false; }
inline bool IsPeerStateBasedFramingEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_PENDING_QUEUE_CAP
inline bool IsPendingQueueCapEnabled() { return true; }
#define GRPC_EXPERIMENT_IS_INCLUDED_PICK_FIRST_HAPPY_EYEBALLS
inline bool IsPickFirstHappyEyeballsEnabled() { return true; }
inline bool IsPromiseBasedClientCallEnabled() { return false; }
inline bool IsPromiseBasedServerCallEnabled() { return false; }
inline bool IsChaoticGoodEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_REGISTERED_METHOD_LOOKUP_IN_TRANSPORT
inline bool IsRegisteredMethodLookupInTransportEnabled() { return true; }
inline bool IsPromiseBasedInprocTransportEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_ROUND_ROBIN_DELEGATE_TO_PICK_FIRST
inline bool IsRoundRobinDelegateToPickFirstEnabled() { return true; }
inline bool IsRstpitEnabled() { return false; }
inline bool IsScheduleCancellationOverWriteEnabled() { return false; }
inline bool IsServerPrivacyEnabled() { return false; }
@ -112,8 +106,6 @@ inline bool IsV3ServerAuthFilterEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_WORK_SERIALIZER_CLEARS_TIME_CACHE
inline bool IsWorkSerializerClearsTimeCacheEnabled() { return true; }
inline bool IsWorkSerializerDispatchEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_WRR_DELEGATE_TO_PICK_FIRST
inline bool IsWrrDelegateToPickFirstEnabled() { return true; }
#elif defined(GPR_WINDOWS)
#define GRPC_EXPERIMENT_IS_INCLUDED_ABSL_BASE64
@ -130,8 +122,6 @@ inline bool IsCallStatusOverrideOnCancellationEnabled() {
}
inline bool IsCallV3Enabled() { return false; }
inline bool IsCanaryClientPrivacyEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_CLIENT_IDLENESS
inline bool IsClientIdlenessEnabled() { return true; }
inline bool IsClientPrivacyEnabled() { return false; }
inline bool IsEventEngineClientEnabled() { return false; }
inline bool IsEventEngineDnsEnabled() { return false; }
@ -148,16 +138,12 @@ inline bool IsMultipingEnabled() { return false; }
inline bool IsPeerStateBasedFramingEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_PENDING_QUEUE_CAP
inline bool IsPendingQueueCapEnabled() { return true; }
#define GRPC_EXPERIMENT_IS_INCLUDED_PICK_FIRST_HAPPY_EYEBALLS
inline bool IsPickFirstHappyEyeballsEnabled() { return true; }
inline bool IsPromiseBasedClientCallEnabled() { return false; }
inline bool IsPromiseBasedServerCallEnabled() { return false; }
inline bool IsChaoticGoodEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_REGISTERED_METHOD_LOOKUP_IN_TRANSPORT
inline bool IsRegisteredMethodLookupInTransportEnabled() { return true; }
inline bool IsPromiseBasedInprocTransportEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_ROUND_ROBIN_DELEGATE_TO_PICK_FIRST
inline bool IsRoundRobinDelegateToPickFirstEnabled() { return true; }
inline bool IsRstpitEnabled() { return false; }
inline bool IsScheduleCancellationOverWriteEnabled() { return false; }
inline bool IsServerPrivacyEnabled() { return false; }
@ -172,8 +158,6 @@ inline bool IsV3ServerAuthFilterEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_WORK_SERIALIZER_CLEARS_TIME_CACHE
inline bool IsWorkSerializerClearsTimeCacheEnabled() { return true; }
inline bool IsWorkSerializerDispatchEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_WRR_DELEGATE_TO_PICK_FIRST
inline bool IsWrrDelegateToPickFirstEnabled() { return true; }
#else
#define GRPC_EXPERIMENT_IS_INCLUDED_ABSL_BASE64
@ -190,8 +174,6 @@ inline bool IsCallStatusOverrideOnCancellationEnabled() {
}
inline bool IsCallV3Enabled() { return false; }
inline bool IsCanaryClientPrivacyEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_CLIENT_IDLENESS
inline bool IsClientIdlenessEnabled() { return true; }
inline bool IsClientPrivacyEnabled() { return false; }
inline bool IsEventEngineClientEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_EVENT_ENGINE_DNS
@ -209,16 +191,12 @@ inline bool IsMultipingEnabled() { return false; }
inline bool IsPeerStateBasedFramingEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_PENDING_QUEUE_CAP
inline bool IsPendingQueueCapEnabled() { return true; }
#define GRPC_EXPERIMENT_IS_INCLUDED_PICK_FIRST_HAPPY_EYEBALLS
inline bool IsPickFirstHappyEyeballsEnabled() { return true; }
inline bool IsPromiseBasedClientCallEnabled() { return false; }
inline bool IsPromiseBasedServerCallEnabled() { return false; }
inline bool IsChaoticGoodEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_REGISTERED_METHOD_LOOKUP_IN_TRANSPORT
inline bool IsRegisteredMethodLookupInTransportEnabled() { return true; }
inline bool IsPromiseBasedInprocTransportEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_ROUND_ROBIN_DELEGATE_TO_PICK_FIRST
inline bool IsRoundRobinDelegateToPickFirstEnabled() { return true; }
inline bool IsRstpitEnabled() { return false; }
inline bool IsScheduleCancellationOverWriteEnabled() { return false; }
inline bool IsServerPrivacyEnabled() { return false; }
@ -234,8 +212,6 @@ inline bool IsV3ServerAuthFilterEnabled() { return false; }
inline bool IsWorkSerializerClearsTimeCacheEnabled() { return true; }
#define GRPC_EXPERIMENT_IS_INCLUDED_WORK_SERIALIZER_DISPATCH
inline bool IsWorkSerializerDispatchEnabled() { return true; }
#define GRPC_EXPERIMENT_IS_INCLUDED_WRR_DELEGATE_TO_PICK_FIRST
inline bool IsWrrDelegateToPickFirstEnabled() { return true; }
#endif
#else
@ -244,7 +220,6 @@ enum ExperimentIds {
kExperimentIdCallStatusOverrideOnCancellation,
kExperimentIdCallV3,
kExperimentIdCanaryClientPrivacy,
kExperimentIdClientIdleness,
kExperimentIdClientPrivacy,
kExperimentIdEventEngineClient,
kExperimentIdEventEngineDns,
@ -257,13 +232,11 @@ enum ExperimentIds {
kExperimentIdMultiping,
kExperimentIdPeerStateBasedFraming,
kExperimentIdPendingQueueCap,
kExperimentIdPickFirstHappyEyeballs,
kExperimentIdPromiseBasedClientCall,
kExperimentIdPromiseBasedServerCall,
kExperimentIdChaoticGood,
kExperimentIdRegisteredMethodLookupInTransport,
kExperimentIdPromiseBasedInprocTransport,
kExperimentIdRoundRobinDelegateToPickFirst,
kExperimentIdRstpit,
kExperimentIdScheduleCancellationOverWrite,
kExperimentIdServerPrivacy,
@ -277,7 +250,6 @@ enum ExperimentIds {
kExperimentIdV3ServerAuthFilter,
kExperimentIdWorkSerializerClearsTimeCache,
kExperimentIdWorkSerializerDispatch,
kExperimentIdWrrDelegateToPickFirst,
kNumExperiments
};
#define GRPC_EXPERIMENT_IS_INCLUDED_ABSL_BASE64
@ -296,10 +268,6 @@ inline bool IsCallV3Enabled() {
inline bool IsCanaryClientPrivacyEnabled() {
return IsExperimentEnabled(kExperimentIdCanaryClientPrivacy);
}
#define GRPC_EXPERIMENT_IS_INCLUDED_CLIENT_IDLENESS
inline bool IsClientIdlenessEnabled() {
return IsExperimentEnabled(kExperimentIdClientIdleness);
}
#define GRPC_EXPERIMENT_IS_INCLUDED_CLIENT_PRIVACY
inline bool IsClientPrivacyEnabled() {
return IsExperimentEnabled(kExperimentIdClientPrivacy);
@ -348,10 +316,6 @@ inline bool IsPeerStateBasedFramingEnabled() {
inline bool IsPendingQueueCapEnabled() {
return IsExperimentEnabled(kExperimentIdPendingQueueCap);
}
#define GRPC_EXPERIMENT_IS_INCLUDED_PICK_FIRST_HAPPY_EYEBALLS
inline bool IsPickFirstHappyEyeballsEnabled() {
return IsExperimentEnabled(kExperimentIdPickFirstHappyEyeballs);
}
#define GRPC_EXPERIMENT_IS_INCLUDED_PROMISE_BASED_CLIENT_CALL
inline bool IsPromiseBasedClientCallEnabled() {
return IsExperimentEnabled(kExperimentIdPromiseBasedClientCall);
@ -372,10 +336,6 @@ inline bool IsRegisteredMethodLookupInTransportEnabled() {
inline bool IsPromiseBasedInprocTransportEnabled() {
return IsExperimentEnabled(kExperimentIdPromiseBasedInprocTransport);
}
#define GRPC_EXPERIMENT_IS_INCLUDED_ROUND_ROBIN_DELEGATE_TO_PICK_FIRST
inline bool IsRoundRobinDelegateToPickFirstEnabled() {
return IsExperimentEnabled(kExperimentIdRoundRobinDelegateToPickFirst);
}
#define GRPC_EXPERIMENT_IS_INCLUDED_RSTPIT
inline bool IsRstpitEnabled() {
return IsExperimentEnabled(kExperimentIdRstpit);
@ -428,10 +388,6 @@ inline bool IsWorkSerializerClearsTimeCacheEnabled() {
inline bool IsWorkSerializerDispatchEnabled() {
return IsExperimentEnabled(kExperimentIdWorkSerializerDispatch);
}
#define GRPC_EXPERIMENT_IS_INCLUDED_WRR_DELEGATE_TO_PICK_FIRST
inline bool IsWrrDelegateToPickFirstEnabled() {
return IsExperimentEnabled(kExperimentIdWrrDelegateToPickFirst);
}
extern const ExperimentMetadata g_experiment_metadata[kNumExperiments];

@ -71,11 +71,6 @@
owner: ctiller@google.com
requires: [promise_based_client_call, promise_based_server_call]
test_tags: [core_end2end_test]
- name: client_idleness
description: If enabled, client channel idleness is enabled by default.
expiry: 2024/03/15
owner: roth@google.com
test_tags: []
- name: client_privacy
description:
If set, client privacy
@ -160,12 +155,6 @@
expiry: 2024/05/05
owner: ctiller@google.com
test_tags: []
- name: pick_first_happy_eyeballs
description:
Use Happy Eyeballs in pick_first.
expiry: 2024/03/15
owner: roth@google.com
test_tags: ["lb_unit_test", "cpp_lb_end2end_test", "xds_end2end_test"]
- name: promise_based_client_call
description:
If set, use the new gRPC promise based call code when it's appropriate
@ -195,13 +184,6 @@
expiry: 2024/03/31
owner: yashkt@google.com
test_tags: ["surface_registered_method_lookup"]
- name: round_robin_delegate_to_pick_first
description:
Change round_robin code to delegate to pick_first as per dualstack
backend design.
expiry: 2024/03/15
owner: roth@google.com
test_tags: ["lb_unit_test", "cpp_lb_end2end_test", "xds_end2end_test"]
- name: rstpit
description:
On RST_STREAM on a server, reduce MAX_CONCURRENT_STREAMS for a short duration
@ -282,10 +264,3 @@
expiry: 2024/03/31
owner: ysseung@google.com
test_tags: ["core_end2end_test", "cpp_end2end_test", "xds_end2end_test", "lb_unit_test"]
- name: wrr_delegate_to_pick_first
description:
Change WRR code to delegate to pick_first as per dualstack
backend design.
expiry: 2024/03/15
owner: roth@google.com
test_tags: ["lb_unit_test", "cpp_lb_end2end_test", "xds_end2end_test"]

@ -53,8 +53,6 @@
ios: broken
posix: false
windows: broken
- name: client_idleness
default: true
- name: client_privacy
default: false
- name: event_engine_client
@ -93,8 +91,6 @@
default: false
- name: pending_queue_cap
default: true
- name: pick_first_happy_eyeballs
default: true
- name: promise_based_client_call
default:
ios: broken
@ -104,8 +100,6 @@
default: false
- name: registered_method_lookup_in_transport
default: true
- name: round_robin_delegate_to_pick_first
default: true
- name: rstpit
default: false
- name: schedule_cancellation_over_write
@ -130,5 +124,3 @@
posix: true
# TODO(ysseung): Test flakes not fully resolved.
windows: broken
- name: wrr_delegate_to_pick_first
default: true

@ -57,7 +57,7 @@ void gpr_log(const char* file, int line, gpr_log_severity severity,
free(message);
}
void gpr_default_log(gpr_log_func_args* args) {
void gpr_platform_log(gpr_log_func_args* args) {
const char* final_slash;
const char* display_file;
char* output = NULL;

@ -70,7 +70,7 @@ void gpr_log(const char* file, int line, gpr_log_severity severity,
free(message);
}
void gpr_default_log(gpr_log_func_args* args) {
void gpr_platform_log(gpr_log_func_args* args) {
const char* final_slash;
const char* display_file;
char time_buffer[64];

@ -18,6 +18,8 @@
#include <grpc/support/port_platform.h>
#include "absl/log/log.h"
#include <stdio.h>
#include <string.h>
@ -40,6 +42,7 @@ static constexpr gpr_atm GPR_LOG_SEVERITY_UNSET = GPR_LOG_SEVERITY_ERROR + 10;
static constexpr gpr_atm GPR_LOG_SEVERITY_NONE = GPR_LOG_SEVERITY_ERROR + 11;
void gpr_default_log(gpr_log_func_args* args);
void gpr_platform_log(gpr_log_func_args* args);
static gpr_atm g_log_func = reinterpret_cast<gpr_atm>(gpr_default_log);
static gpr_atm g_min_severity_to_print = GPR_LOG_SEVERITY_UNSET;
static gpr_atm g_min_severity_to_print_stacktrace = GPR_LOG_SEVERITY_UNSET;
@ -73,6 +76,29 @@ int gpr_should_log(gpr_log_severity severity) {
: 0;
}
void gpr_default_log(gpr_log_func_args* args) {
if (!grpc_core::ConfigVars::Get().AbslLogging()) {
gpr_platform_log(args);
return;
}
switch (args->severity) {
case GPR_LOG_SEVERITY_DEBUG:
// Log DEBUG messages as VLOG(2).
VLOG(2).AtLocation(args->file, args->line) << args->message;
return;
case GPR_LOG_SEVERITY_INFO:
LOG(INFO).AtLocation(args->file, args->line) << args->message;
return;
case GPR_LOG_SEVERITY_ERROR:
LOG(ERROR).AtLocation(args->file, args->line) << args->message;
return;
default:
LOG(ERROR) << __func__ << ": unknown gpr log severity(" << args->severity
<< "), using ERROR";
LOG(ERROR).AtLocation(args->file, args->line) << args->message;
}
}
int gpr_should_log_stacktrace(gpr_log_severity severity) {
return static_cast<gpr_atm>(severity) >=
gpr_atm_no_barrier_load(&g_min_severity_to_print_stacktrace)

@ -70,7 +70,7 @@ void gpr_log(const char* file, int line, gpr_log_severity severity,
gpr_free(allocated);
}
void gpr_default_log(gpr_log_func_args* args) {
void gpr_platform_log(gpr_log_func_args* args) {
const char* final_slash;
const char* display_file;
char time_buffer[64];

@ -45,7 +45,6 @@ static struct timespec timespec_from_gpr(gpr_timespec gts) {
return rv;
}
#if _POSIX_TIMERS > 0 || defined(__OpenBSD__)
static gpr_timespec gpr_from_timespec(struct timespec ts,
gpr_clock_type clock_type) {
//
@ -83,65 +82,6 @@ static gpr_timespec now_impl(gpr_clock_type clock_type) {
return gpr_from_timespec(now, clock_type);
}
}
#else
// For some reason Apple's OSes haven't implemented clock_gettime.
#include <mach/mach.h>
#include <mach/mach_time.h>
#include <sys/time.h>
static double g_time_scale = []() {
mach_timebase_info_data_t tb = {0, 1};
mach_timebase_info(&tb);
return static_cast<double>(tb.numer) / static_cast<double>(tb.denom);
}();
static uint64_t g_time_start = mach_absolute_time();
void gpr_time_init(void) { gpr_precise_clock_init(); }
static gpr_timespec now_impl(gpr_clock_type clock) {
gpr_timespec now;
struct timeval now_tv;
double now_dbl;
now.clock_type = clock;
switch (clock) {
case GPR_CLOCK_REALTIME:
// gettimeofday(...) function may return with a value whose tv_usec is
// greater than 1e6 on iOS The case is resolved with the guard at end of
// this function.
gettimeofday(&now_tv, nullptr);
now.tv_sec = now_tv.tv_sec;
now.tv_nsec = now_tv.tv_usec * 1000;
break;
case GPR_CLOCK_MONOTONIC:
// Add 5 seconds arbitrarily: avoids weird conditions in gprpp/time.cc
// when there's a small number of seconds returned.
now_dbl = 5.0e9 +
((double)(mach_absolute_time() - g_time_start)) * g_time_scale;
now.tv_sec = (int64_t)(now_dbl * 1e-9);
now.tv_nsec = (int32_t)(now_dbl - ((double)now.tv_sec) * 1e9);
break;
case GPR_CLOCK_PRECISE:
gpr_precise_clock_now(&now);
break;
case GPR_TIMESPAN:
abort();
}
// Guard the tv_nsec field in valid range for all clock types
while (GPR_UNLIKELY(now.tv_nsec >= 1e9)) {
now.tv_sec++;
now.tv_nsec -= 1e9;
}
while (GPR_UNLIKELY(now.tv_nsec < 0)) {
now.tv_sec--;
now.tv_nsec += 1e9;
}
return now;
}
#endif
gpr_timespec (*gpr_now_impl)(gpr_clock_type clock_type) = now_impl;

@ -73,7 +73,7 @@ void gpr_log(const char* file, int line, gpr_log_severity severity,
}
// Simple starter implementation
void gpr_default_log(gpr_log_func_args* args) {
void gpr_platform_log(gpr_log_func_args* args) {
const char* final_slash;
const char* display_file;
char time_buffer[64];

@ -0,0 +1,71 @@
// 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.
#include <grpc/support/port_platform.h>
#include "src/core/lib/resource_quota/connection_quota.h"
#include <atomic>
#include <cstdint>
#include <grpc/support/log.h>
namespace grpc_core {
ConnectionQuota::ConnectionQuota() = default;
void ConnectionQuota::SetMaxIncomingConnections(int max_incoming_connections) {
// The maximum can only be configured once.
GPR_ASSERT(max_incoming_connections < INT_MAX);
GPR_ASSERT(max_incoming_connections_.exchange(max_incoming_connections,
std::memory_order_release) ==
INT_MAX);
}
// Returns true if the incoming connection is allowed to be accepted on the
// server.
bool ConnectionQuota::AllowIncomingConnection(MemoryQuotaRefPtr mem_quota,
absl::string_view /*peer*/) {
if (mem_quota->IsMemoryPressureHigh()) {
return false;
}
if (max_incoming_connections_.load(std::memory_order_relaxed) == INT_MAX) {
return true;
}
int curr_active_connections =
active_incoming_connections_.load(std::memory_order_acquire);
do {
if (curr_active_connections >=
max_incoming_connections_.load(std::memory_order_relaxed)) {
return false;
}
} while (!active_incoming_connections_.compare_exchange_weak(
curr_active_connections, curr_active_connections + 1,
std::memory_order_acq_rel, std::memory_order_relaxed));
return true;
}
// Mark connections as closed.
void ConnectionQuota::ReleaseConnections(int num_connections) {
if (max_incoming_connections_.load(std::memory_order_relaxed) == INT_MAX) {
return;
}
GPR_ASSERT(active_incoming_connections_.fetch_sub(
num_connections, std::memory_order_acq_rel) >=
num_connections);
}
} // namespace grpc_core

@ -0,0 +1,61 @@
// 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_LIB_RESOURCE_QUOTA_CONNECTION_QUOTA_H
#define GRPC_SRC_CORE_LIB_RESOURCE_QUOTA_CONNECTION_QUOTA_H
#include <grpc/support/port_platform.h>
#include <cstddef>
#include <limits>
#include "absl/base/thread_annotations.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/resource_quota/memory_quota.h"
namespace grpc_core {
// Tracks the amount of threads in a resource quota.
class ConnectionQuota : public RefCounted<ConnectionQuota> {
public:
ConnectionQuota();
~ConnectionQuota() override = default;
ConnectionQuota(const ConnectionQuota&) = delete;
ConnectionQuota& operator=(const ConnectionQuota&) = delete;
// Set the maximum number of allowed incoming connections on the server.
void SetMaxIncomingConnections(int max_incoming_connections);
// Returns true if the incoming connection is allowed to be accepted on the
// server.
bool AllowIncomingConnection(MemoryQuotaRefPtr mem_quota,
absl::string_view peer);
// Mark connections as closed.
void ReleaseConnections(int num_connections);
private:
std::atomic<int> active_incoming_connections_{0};
std::atomic<int> max_incoming_connections_{std::numeric_limits<int>::max()};
};
using ConnectionQuotaRefPtr = RefCountedPtr<ConnectionQuota>;
} // namespace grpc_core
#endif // GRPC_SRC_CORE_LIB_RESOURCE_QUOTA_CONNECTION_QUOTA_H

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save