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

pull/36523/head
Mark D. Roth 6 months ago
commit b289c399fe
  1. 57
      BUILD
  2. 1
      BoringSSL-Package.swift
  3. 263
      CMakeLists.txt
  4. 1
      MAINTAINERS.md
  5. 12
      Makefile
  6. 23
      Package.swift
  7. 13
      bazel/experiments.bzl
  8. 14
      bazel/grpc_deps.bzl
  9. 2
      bazel/grpc_extra_deps.bzl
  10. 123
      build_autogenerated.yaml
  11. 15
      config.m4
  12. 15
      config.w32
  13. 2
      doc/grpc_xds_features.md
  14. 24
      gRPC-C++.podspec
  15. 37
      gRPC-Core.podspec
  16. 27
      grpc.gemspec
  17. 2669
      grpc.gyp
  18. 8
      include/grpc/impl/channel_arg_names.h
  19. 27
      package.xml
  20. 20
      src/boringssl/boringssl_prefix_symbols.h
  21. 23
      src/core/BUILD
  22. 1387
      src/core/client_channel/client_channel.cc
  23. 243
      src/core/client_channel/client_channel.h
  24. 27
      src/core/client_channel/client_channel_filter.cc
  25. 13
      src/core/client_channel/client_channel_filter.h
  26. 8
      src/core/client_channel/client_channel_internal.h
  27. 335
      src/core/client_channel/load_balanced_call_destination.cc
  28. 49
      src/core/client_channel/load_balanced_call_destination.h
  29. 335
      src/core/client_channel/subchannel.cc
  30. 47
      src/core/client_channel/subchannel.h
  31. 9
      src/core/client_channel/subchannel_stream_client.cc
  32. 4
      src/core/client_channel/subchannel_stream_client.h
  33. 4
      src/core/ext/filters/channel_idle/legacy_channel_idle_filter.cc
  34. 2
      src/core/ext/filters/channel_idle/legacy_channel_idle_filter.h
  35. 4
      src/core/ext/gcp/metadata_query.h
  36. 2
      src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc
  37. 5
      src/core/ext/transport/chaotic_good/client/chaotic_good_connector.h
  38. 7
      src/core/ext/transport/chaotic_good/client_transport.cc
  39. 6
      src/core/ext/transport/chaotic_good/server/chaotic_good_server.cc
  40. 11
      src/core/ext/transport/chaotic_good/server/chaotic_good_server.h
  41. 7
      src/core/ext/transport/chaotic_good/server_transport.cc
  42. 23
      src/core/ext/transport/chttp2/server/chttp2_server.cc
  43. 2
      src/core/ext/transport/chttp2/transport/chttp2_transport.cc
  44. 42
      src/core/ext/transport/chttp2/transport/ping_rate_policy.cc
  45. 9
      src/core/ext/transport/chttp2/transport/ping_rate_policy.h
  46. 6
      src/core/ext/transport/inproc/inproc_transport.cc
  47. 4
      src/core/handshaker/http_connect/http_connect_handshaker.cc
  48. 25
      src/core/lib/channel/channel_args.h
  49. 6
      src/core/lib/channel/channel_stack.h
  50. 25
      src/core/lib/channel/context.h
  51. 62
      src/core/lib/experiments/experiments.cc
  52. 27
      src/core/lib/experiments/experiments.h
  53. 10
      src/core/lib/experiments/experiments.yaml
  54. 4
      src/core/lib/experiments/rollouts.yaml
  55. 18
      src/core/lib/gprpp/dual_ref_counted.h
  56. 31
      src/core/lib/promise/activity.h
  57. 5
      src/core/lib/promise/context.h
  58. 17
      src/core/lib/promise/map.h
  59. 1
      src/core/lib/promise/observable.h
  60. 6
      src/core/lib/promise/party.cc
  61. 5
      src/core/lib/promise/party.h
  62. 1
      src/core/lib/promise/promise.h
  63. 131
      src/core/lib/resource_quota/arena.cc
  64. 317
      src/core/lib/resource_quota/arena.h
  65. 6
      src/core/lib/resource_quota/memory_quota.cc
  66. 2
      src/core/lib/security/credentials/channel_creds_registry_init.cc
  67. 2
      src/core/lib/security/credentials/external/aws_external_account_credentials.cc
  68. 4
      src/core/lib/security/credentials/external/aws_external_account_credentials.h
  69. 4
      src/core/lib/security/credentials/external/external_account_credentials.cc
  70. 4
      src/core/lib/security/credentials/external/external_account_credentials.h
  71. 4
      src/core/lib/security/credentials/external/url_external_account_credentials.cc
  72. 2
      src/core/lib/security/credentials/external/url_external_account_credentials.h
  73. 4
      src/core/lib/security/credentials/google_default/google_default_credentials.cc
  74. 6
      src/core/lib/security/credentials/jwt/jwt_verifier.cc
  75. 2
      src/core/lib/security/credentials/oauth2/oauth2_credentials.cc
  76. 4
      src/core/lib/security/credentials/oauth2/oauth2_credentials.h
  77. 47
      src/core/lib/surface/call.cc
  78. 4
      src/core/lib/surface/call.h
  79. 7
      src/core/lib/surface/channel.cc
  80. 24
      src/core/lib/surface/channel.h
  81. 12
      src/core/lib/surface/channel_create.cc
  82. 5
      src/core/lib/surface/legacy_channel.cc
  83. 13
      src/core/lib/surface/legacy_channel.h
  84. 16
      src/core/lib/transport/call_arena_allocator.h
  85. 2
      src/core/lib/transport/call_destination.h
  86. 20
      src/core/lib/transport/call_filters.cc
  87. 7
      src/core/lib/transport/call_filters.h
  88. 12
      src/core/lib/transport/call_spine.cc
  89. 86
      src/core/lib/transport/call_spine.h
  90. 2
      src/core/lib/transport/interception_chain.cc
  91. 11
      src/core/lib/transport/metadata_batch.h
  92. 10
      src/core/load_balancing/lb_policy.h
  93. 16
      src/core/telemetry/call_tracer.h
  94. 7
      src/core/util/http_client/format_request.cc
  95. 11
      src/core/util/http_client/format_request.h
  96. 9
      src/core/util/http_client/httpcli.cc
  97. 11
      src/core/util/http_client/httpcli.h
  98. 3
      src/core/util/http_client/httpcli_security_connector.cc
  99. 9
      src/core/util/http_client/httpcli_ssl_credentials.h
  100. 5
      src/core/util/http_client/parser.cc
  101. Some files were not shown because too many files have changed in this diff Show More

57
BUILD

@ -1797,16 +1797,17 @@ grpc_cc_library(
"gpr",
"grpc_public_hdrs",
"grpc_trace",
"orphanable",
"ref_counted_ptr",
"stats",
"//src/core:arena",
"//src/core:call_arena_allocator",
"//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:resource_quota",
"//src/core:slice",
"//src/core:stats_data",
"//src/core:time",
@ -1885,6 +1886,7 @@ grpc_cc_library(
"config",
"gpr",
"grpc_base",
"grpc_client_channel",
"grpc_public_hdrs",
"legacy_channel",
"ref_counted_ptr",
@ -1892,6 +1894,7 @@ grpc_cc_library(
"//src/core:arena",
"//src/core:channel_args",
"//src/core:channel_stack_type",
"//src/core:experiments",
"//src/core:iomgr_fwd",
"//src/core:ref_counted",
"//src/core:slice",
@ -3696,11 +3699,13 @@ grpc_cc_library(
grpc_cc_library(
name = "grpc_client_channel",
srcs = [
"//src/core:client_channel/client_channel.cc",
"//src/core:client_channel/client_channel_factory.cc",
"//src/core:client_channel/client_channel_filter.cc",
"//src/core:client_channel/client_channel_plugin.cc",
"//src/core:client_channel/dynamic_filters.cc",
"//src/core:client_channel/global_subchannel_pool.cc",
"//src/core:client_channel/load_balanced_call_destination.cc",
"//src/core:client_channel/local_subchannel_pool.cc",
"//src/core:client_channel/retry_filter.cc",
"//src/core:client_channel/retry_filter_legacy_call_data.cc",
@ -3708,10 +3713,12 @@ grpc_cc_library(
"//src/core:client_channel/subchannel_stream_client.cc",
],
hdrs = [
"//src/core:client_channel/client_channel.h",
"//src/core:client_channel/client_channel_factory.h",
"//src/core:client_channel/client_channel_filter.h",
"//src/core:client_channel/dynamic_filters.h",
"//src/core:client_channel/global_subchannel_pool.h",
"//src/core:client_channel/load_balanced_call_destination.h",
"//src/core:client_channel/local_subchannel_pool.h",
"//src/core:client_channel/retry_filter.h",
"//src/core:client_channel/retry_filter_legacy_call_data.h",
@ -3733,21 +3740,17 @@ grpc_cc_library(
"absl/strings:cord",
"absl/types:optional",
"absl/types:variant",
"@com_google_protobuf//upb:base",
"@com_google_protobuf//upb:mem",
"@com_google_protobuf//upb:message",
],
language = "c++",
visibility = ["@grpc:client_channel"],
deps = [
"api_trace",
"backoff",
"call_combiner",
"call_tracer",
"channel",
"channel_arg_names",
"channelz",
"config",
"config_vars",
"debug_location",
"endpoint_addresses",
"exec_ctx",
@ -3758,26 +3761,23 @@ grpc_cc_library(
"grpc_security_base",
"grpc_service_config_impl",
"grpc_trace",
"http_connect_handshaker",
"iomgr",
"iomgr_timer",
"lb_child_policy_handler",
"legacy_context",
"orphanable",
"parse_address",
"promise",
"protobuf_duration_upb",
"ref_counted_ptr",
"sockaddr_utils",
"stats",
"uri_parser",
"work_serializer",
"xds_orca_service_upb",
"xds_orca_upb",
"//src/core:activity",
"//src/core:arena",
"//src/core:arena_promise",
"//src/core:backend_metric_parser",
"//src/core:call_destination",
"//src/core:call_filters",
"//src/core:call_spine",
"//src/core:cancel_callback",
"//src/core:channel_args",
"//src/core:channel_fwd",
@ -3791,33 +3791,33 @@ grpc_cc_library(
"//src/core:connectivity_state",
"//src/core:construct_destruct",
"//src/core:context",
"//src/core:delegating_helper",
"//src/core:dual_ref_counted",
"//src/core:env",
"//src/core:error",
"//src/core:error_utils",
"//src/core:exec_ctx_wakeup_scheduler",
"//src/core:experiments",
"//src/core:gpr_atm",
"//src/core:gpr_manual_constructor",
"//src/core:grpc_backend_metric_data",
"//src/core:grpc_message_size_filter",
"//src/core:grpc_channel_idle_filter",
"//src/core:grpc_service_config",
"//src/core:idle_filter_state",
"//src/core:init_internally",
"//src/core:interception_chain",
"//src/core:iomgr_fwd",
"//src/core:json",
"//src/core:json_args",
"//src/core:json_channel_args",
"//src/core:json_object_loader",
"//src/core:latch",
"//src/core:lb_policy",
"//src/core:lb_policy_registry",
"//src/core:loop",
"//src/core:map",
"//src/core:memory_quota",
"//src/core:metadata",
"//src/core:metadata_batch",
"//src/core:metrics",
"//src/core:observable",
"//src/core:pipe",
"//src/core:poll",
"//src/core:pollset_set",
"//src/core:proxy_mapper",
"//src/core:proxy_mapper_registry",
"//src/core:ref_counted",
"//src/core:resolved_address",
@ -3825,11 +3825,13 @@ grpc_cc_library(
"//src/core:retry_service_config",
"//src/core:retry_throttle",
"//src/core:seq",
"//src/core:service_config_parser",
"//src/core:single_set_ptr",
"//src/core:sleep",
"//src/core:slice",
"//src/core:slice_buffer",
"//src/core:slice_refcount",
"//src/core:stats_data",
"//src/core:status_flag",
"//src/core:status_helper",
"//src/core:subchannel_connector",
"//src/core:subchannel_interface",
@ -3838,7 +3840,6 @@ grpc_cc_library(
"//src/core:try_seq",
"//src/core:unique_type_name",
"//src/core:useful",
"//src/core:validation_errors",
],
)
@ -3913,14 +3914,14 @@ grpc_cc_library(
grpc_cc_library(
name = "httpcli",
srcs = [
"//src/core:lib/http/format_request.cc",
"//src/core:lib/http/httpcli.cc",
"//src/core:lib/http/parser.cc",
"//src/core:util/http_client/format_request.cc",
"//src/core:util/http_client/httpcli.cc",
"//src/core:util/http_client/parser.cc",
],
hdrs = [
"//src/core:lib/http/format_request.h",
"//src/core:lib/http/httpcli.h",
"//src/core:lib/http/parser.h",
"//src/core:util/http_client/format_request.h",
"//src/core:util/http_client/httpcli.h",
"//src/core:util/http_client/parser.h",
],
external_deps = [
"absl/base:core_headers",

@ -104,6 +104,7 @@ let package = Package(
"src/crypto/dh_extra/dh_asn1.c",
"src/crypto/dh_extra/params.c",
"src/crypto/digest_extra/digest_extra.c",
"src/crypto/dilithium/dilithium.c",
"src/crypto/dsa/dsa.c",
"src/crypto/dsa/dsa_asn1.c",
"src/crypto/ec_extra/ec_asn1.c",

263
CMakeLists.txt generated

@ -1002,7 +1002,9 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_cxx client_authority_filter_test)
add_dependencies(buildtests_cxx client_callback_end2end_test)
add_dependencies(buildtests_cxx client_channel_service_config_test)
add_dependencies(buildtests_cxx client_channel_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx client_channel_test)
endif()
add_dependencies(buildtests_cxx client_context_test_peer_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx client_fork_test)
@ -1026,6 +1028,9 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_cxx compressed_payload_test)
add_dependencies(buildtests_cxx compression_test)
add_dependencies(buildtests_cxx concurrent_connectivity_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx connected_subchannel_test)
endif()
add_dependencies(buildtests_cxx connection_prefix_bad_client_test)
add_dependencies(buildtests_cxx connection_refused_test)
add_dependencies(buildtests_cxx connectivity_state_test)
@ -1194,6 +1199,9 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_cxx latch_test)
add_dependencies(buildtests_cxx lb_get_cpu_stats_test)
add_dependencies(buildtests_cxx lb_load_data_store_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx load_balanced_call_destination_test)
endif()
add_dependencies(buildtests_cxx load_config_test)
add_dependencies(buildtests_cxx load_file_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
@ -1436,6 +1444,7 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_cxx streams_not_seen_test)
add_dependencies(buildtests_cxx string_ref_test)
add_dependencies(buildtests_cxx string_test)
add_dependencies(buildtests_cxx subchannel_args_test)
add_dependencies(buildtests_cxx switch_test)
add_dependencies(buildtests_cxx sync_test)
add_dependencies(buildtests_cxx system_roots_test)
@ -1830,6 +1839,7 @@ add_library(grpc
src/core/channelz/channelz.cc
src/core/channelz/channelz_registry.cc
src/core/client_channel/backup_poller.cc
src/core/client_channel/client_channel.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
@ -1837,6 +1847,7 @@ add_library(grpc
src/core/client_channel/config_selector.cc
src/core/client_channel/dynamic_filters.cc
src/core/client_channel/global_subchannel_pool.cc
src/core/client_channel/load_balanced_call_destination.cc
src/core/client_channel/local_subchannel_pool.cc
src/core/client_channel/retry_filter.cc
src/core/client_channel/retry_filter_legacy_call_data.cc
@ -2291,6 +2302,7 @@ add_library(grpc
src/core/lib/event_engine/work_queue/basic_work_queue.cc
src/core/lib/experiments/config.cc
src/core/lib/experiments/experiments.cc
src/core/lib/gprpp/dump_args.cc
src/core/lib/gprpp/load_file.cc
src/core/lib/gprpp/per_cpu.cc
src/core/lib/gprpp/posix/directory_reader.cc
@ -2302,10 +2314,6 @@ add_library(grpc
src/core/lib/gprpp/validation_errors.cc
src/core/lib/gprpp/windows/directory_reader.cc
src/core/lib/gprpp/work_serializer.cc
src/core/lib/http/format_request.cc
src/core/lib/http/httpcli.cc
src/core/lib/http/httpcli_security_connector.cc
src/core/lib/http/parser.cc
src/core/lib/iomgr/buffer_list.cc
src/core/lib/iomgr/call_combiner.cc
src/core/lib/iomgr/cfstream_handle.cc
@ -2595,6 +2603,10 @@ add_library(grpc
src/core/tsi/ssl_transport_security_utils.cc
src/core/tsi/transport_security.cc
src/core/tsi/transport_security_grpc.cc
src/core/util/http_client/format_request.cc
src/core/util/http_client/httpcli.cc
src/core/util/http_client/httpcli_security_connector.cc
src/core/util/http_client/parser.cc
src/core/util/json/json_object_loader.cc
src/core/util/json/json_reader.cc
src/core/util/json/json_util.cc
@ -2926,6 +2938,7 @@ add_library(grpc_unsecure
src/core/channelz/channelz.cc
src/core/channelz/channelz_registry.cc
src/core/client_channel/backup_poller.cc
src/core/client_channel/client_channel.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
@ -2933,6 +2946,7 @@ add_library(grpc_unsecure
src/core/client_channel/config_selector.cc
src/core/client_channel/dynamic_filters.cc
src/core/client_channel/global_subchannel_pool.cc
src/core/client_channel/load_balanced_call_destination.cc
src/core/client_channel/local_subchannel_pool.cc
src/core/client_channel/retry_filter.cc
src/core/client_channel/retry_filter_legacy_call_data.cc
@ -3083,6 +3097,7 @@ add_library(grpc_unsecure
src/core/lib/event_engine/work_queue/basic_work_queue.cc
src/core/lib/experiments/config.cc
src/core/lib/experiments/experiments.cc
src/core/lib/gprpp/dump_args.cc
src/core/lib/gprpp/load_file.cc
src/core/lib/gprpp/per_cpu.cc
src/core/lib/gprpp/ref_counted_string.cc
@ -3092,9 +3107,6 @@ add_library(grpc_unsecure
src/core/lib/gprpp/uuid_v4.cc
src/core/lib/gprpp/validation_errors.cc
src/core/lib/gprpp/work_serializer.cc
src/core/lib/http/format_request.cc
src/core/lib/http/httpcli.cc
src/core/lib/http/parser.cc
src/core/lib/iomgr/buffer_list.cc
src/core/lib/iomgr/call_combiner.cc
src/core/lib/iomgr/cfstream_handle.cc
@ -3312,6 +3324,9 @@ add_library(grpc_unsecure
src/core/tsi/local_transport_security.cc
src/core/tsi/transport_security.cc
src/core/tsi/transport_security_grpc.cc
src/core/util/http_client/format_request.cc
src/core/util/http_client/httpcli.cc
src/core/util/http_client/parser.cc
src/core/util/json/json_object_loader.cc
src/core/util/json/json_reader.cc
src/core/util/json/json_writer.cc
@ -5200,6 +5215,7 @@ add_library(grpc_authorization_provider
src/core/lib/event_engine/work_queue/basic_work_queue.cc
src/core/lib/experiments/config.cc
src/core/lib/experiments/experiments.cc
src/core/lib/gprpp/dump_args.cc
src/core/lib/gprpp/load_file.cc
src/core/lib/gprpp/per_cpu.cc
src/core/lib/gprpp/ref_counted_string.cc
@ -8503,6 +8519,7 @@ add_executable(call_filters_test
src/core/lib/debug/trace.cc
src/core/lib/experiments/config.cc
src/core/lib/experiments/experiments.cc
src/core/lib/gprpp/dump_args.cc
src/core/lib/gprpp/ref_counted_string.cc
src/core/lib/gprpp/status_helper.cc
src/core/lib/gprpp/time.cc
@ -8515,8 +8532,11 @@ add_executable(call_filters_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
src/core/lib/resource_quota/thread_quota.cc
src/core/lib/resource_quota/trace.cc
src/core/lib/slice/percent_encoding.cc
src/core/lib/slice/slice.cc
@ -10523,46 +10543,56 @@ target_link_libraries(client_channel_service_config_test
endif()
if(gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
add_executable(client_channel_test
test/core/client_channel/client_channel_test.cc
)
if(WIN32 AND MSVC)
if(BUILD_SHARED_LIBS)
target_compile_definitions(client_channel_test
PRIVATE
"GPR_DLL_IMPORTS"
"GRPC_DLL_IMPORTS"
)
add_executable(client_channel_test
${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.pb.cc
${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.pb.h
${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.grpc.pb.h
test/core/call/yodel/test_main.cc
test/core/call/yodel/yodel_test.cc
test/core/client_channel/client_channel_test.cc
test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc
)
if(WIN32 AND MSVC)
if(BUILD_SHARED_LIBS)
target_compile_definitions(client_channel_test
PRIVATE
"GPR_DLL_IMPORTS"
"GRPC_DLL_IMPORTS"
)
endif()
endif()
endif()
target_compile_features(client_channel_test PUBLIC cxx_std_14)
target_include_directories(client_channel_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_compile_features(client_channel_test PUBLIC cxx_std_14)
target_include_directories(client_channel_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(client_channel_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
grpc_test_util
)
target_link_libraries(client_channel_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
${_gRPC_PROTOBUF_LIBRARIES}
grpc_test_util
)
endif()
endif()
if(gRPC_BUILD_TESTS)
@ -11337,6 +11367,58 @@ target_link_libraries(concurrent_connectivity_test
)
endif()
if(gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
add_executable(connected_subchannel_test
${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.pb.cc
${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.pb.h
${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.grpc.pb.h
test/core/call/yodel/test_main.cc
test/core/call/yodel/yodel_test.cc
test/core/client_channel/connected_subchannel_test.cc
test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc
)
if(WIN32 AND MSVC)
if(BUILD_SHARED_LIBS)
target_compile_definitions(connected_subchannel_test
PRIVATE
"GPR_DLL_IMPORTS"
"GRPC_DLL_IMPORTS"
)
endif()
endif()
target_compile_features(connected_subchannel_test PUBLIC cxx_std_14)
target_include_directories(connected_subchannel_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(connected_subchannel_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
${_gRPC_PROTOBUF_LIBRARIES}
grpc_test_util
)
endif()
endif()
if(gRPC_BUILD_TESTS)
@ -17829,6 +17911,7 @@ add_executable(interception_chain_test
src/core/lib/event_engine/work_queue/basic_work_queue.cc
src/core/lib/experiments/config.cc
src/core/lib/experiments/experiments.cc
src/core/lib/gprpp/dump_args.cc
src/core/lib/gprpp/load_file.cc
src/core/lib/gprpp/per_cpu.cc
src/core/lib/gprpp/ref_counted_string.cc
@ -18982,6 +19065,58 @@ target_link_libraries(lb_load_data_store_test
)
endif()
if(gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
add_executable(load_balanced_call_destination_test
${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.pb.cc
${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.pb.h
${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.grpc.pb.h
test/core/call/yodel/test_main.cc
test/core/call/yodel/yodel_test.cc
test/core/client_channel/load_balanced_call_destination_test.cc
test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc
)
if(WIN32 AND MSVC)
if(BUILD_SHARED_LIBS)
target_compile_definitions(load_balanced_call_destination_test
PRIVATE
"GPR_DLL_IMPORTS"
"GRPC_DLL_IMPORTS"
)
endif()
endif()
target_compile_features(load_balanced_call_destination_test PUBLIC cxx_std_14)
target_include_directories(load_balanced_call_destination_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(load_balanced_call_destination_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
${_gRPC_PROTOBUF_LIBRARIES}
grpc_test_util
)
endif()
endif()
if(gRPC_BUILD_TESTS)
@ -29321,6 +29456,48 @@ target_link_libraries(string_test
)
endif()
if(gRPC_BUILD_TESTS)
add_executable(subchannel_args_test
test/core/client_channel/subchannel_args_test.cc
)
if(WIN32 AND MSVC)
if(BUILD_SHARED_LIBS)
target_compile_definitions(subchannel_args_test
PRIVATE
"GPR_DLL_IMPORTS"
"GRPC_DLL_IMPORTS"
)
endif()
endif()
target_compile_features(subchannel_args_test PUBLIC cxx_std_14)
target_include_directories(subchannel_args_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(subchannel_args_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
grpc_test_util
)
endif()
if(gRPC_BUILD_TESTS)

@ -31,6 +31,7 @@ for general contribution guidelines.
- [pfreixes](https://github.com/pfreixes), Skyscanner Ltd
- [ran-su](https://github.com/ran-su), Google LLC
- [sanjaypujare](https://github.com/sanjaypujare), Google LLC
- [sastryvp](https://github.com/sastryvp), Google LLC
- [sergiitk](https://github.com/sergiitk), Google LLC
- [soheilhy](https://github.com/soheilhy), Google LLC
- [stanley-cheung](https://github.com/stanley-cheung), Google LLC

12
Makefile generated

@ -670,6 +670,7 @@ LIBGRPC_SRC = \
src/core/channelz/channelz.cc \
src/core/channelz/channelz_registry.cc \
src/core/client_channel/backup_poller.cc \
src/core/client_channel/client_channel.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 \
@ -677,6 +678,7 @@ LIBGRPC_SRC = \
src/core/client_channel/config_selector.cc \
src/core/client_channel/dynamic_filters.cc \
src/core/client_channel/global_subchannel_pool.cc \
src/core/client_channel/load_balanced_call_destination.cc \
src/core/client_channel/local_subchannel_pool.cc \
src/core/client_channel/retry_filter.cc \
src/core/client_channel/retry_filter_legacy_call_data.cc \
@ -1136,6 +1138,7 @@ LIBGRPC_SRC = \
src/core/lib/experiments/config.cc \
src/core/lib/experiments/experiments.cc \
src/core/lib/gprpp/crash.cc \
src/core/lib/gprpp/dump_args.cc \
src/core/lib/gprpp/examine_stack.cc \
src/core/lib/gprpp/fork.cc \
src/core/lib/gprpp/host_port.cc \
@ -1161,10 +1164,6 @@ LIBGRPC_SRC = \
src/core/lib/gprpp/windows/stat.cc \
src/core/lib/gprpp/windows/thd.cc \
src/core/lib/gprpp/work_serializer.cc \
src/core/lib/http/format_request.cc \
src/core/lib/http/httpcli.cc \
src/core/lib/http/httpcli_security_connector.cc \
src/core/lib/http/parser.cc \
src/core/lib/iomgr/buffer_list.cc \
src/core/lib/iomgr/call_combiner.cc \
src/core/lib/iomgr/cfstream_handle.cc \
@ -1457,6 +1456,10 @@ LIBGRPC_SRC = \
src/core/util/alloc.cc \
src/core/util/android/log.cc \
src/core/util/atm.cc \
src/core/util/http_client/format_request.cc \
src/core/util/http_client/httpcli.cc \
src/core/util/http_client/httpcli_security_connector.cc \
src/core/util/http_client/parser.cc \
src/core/util/iphone/cpu.cc \
src/core/util/json/json_object_loader.cc \
src/core/util/json/json_reader.cc \
@ -1934,6 +1937,7 @@ LIBBORINGSSL_SRC = \
third_party/boringssl-with-bazel/src/crypto/dh_extra/dh_asn1.c \
third_party/boringssl-with-bazel/src/crypto/dh_extra/params.c \
third_party/boringssl-with-bazel/src/crypto/digest_extra/digest_extra.c \
third_party/boringssl-with-bazel/src/crypto/dilithium/dilithium.c \
third_party/boringssl-with-bazel/src/crypto/dsa/dsa.c \
third_party/boringssl-with-bazel/src/crypto/dsa/dsa_asn1.c \
third_party/boringssl-with-bazel/src/crypto/ec_extra/ec_asn1.c \

23
Package.swift generated

@ -126,6 +126,8 @@ let package = Package(
"src/core/channelz/channelz_registry.h",
"src/core/client_channel/backup_poller.cc",
"src/core/client_channel/backup_poller.h",
"src/core/client_channel/client_channel.cc",
"src/core/client_channel/client_channel.h",
"src/core/client_channel/client_channel_factory.cc",
"src/core/client_channel/client_channel_factory.h",
"src/core/client_channel/client_channel_filter.cc",
@ -141,6 +143,8 @@ let package = Package(
"src/core/client_channel/dynamic_filters.h",
"src/core/client_channel/global_subchannel_pool.cc",
"src/core/client_channel/global_subchannel_pool.h",
"src/core/client_channel/load_balanced_call_destination.cc",
"src/core/client_channel/load_balanced_call_destination.h",
"src/core/client_channel/local_subchannel_pool.cc",
"src/core/client_channel/local_subchannel_pool.h",
"src/core/client_channel/retry_filter.cc",
@ -1253,6 +1257,8 @@ let package = Package(
"src/core/lib/gprpp/directory_reader.h",
"src/core/lib/gprpp/down_cast.h",
"src/core/lib/gprpp/dual_ref_counted.h",
"src/core/lib/gprpp/dump_args.cc",
"src/core/lib/gprpp/dump_args.h",
"src/core/lib/gprpp/env.h",
"src/core/lib/gprpp/examine_stack.cc",
"src/core/lib/gprpp/examine_stack.h",
@ -1315,14 +1321,6 @@ let package = Package(
"src/core/lib/gprpp/work_serializer.cc",
"src/core/lib/gprpp/work_serializer.h",
"src/core/lib/gprpp/xxhash_inline.h",
"src/core/lib/http/format_request.cc",
"src/core/lib/http/format_request.h",
"src/core/lib/http/httpcli.cc",
"src/core/lib/http/httpcli.h",
"src/core/lib/http/httpcli_security_connector.cc",
"src/core/lib/http/httpcli_ssl_credentials.h",
"src/core/lib/http/parser.cc",
"src/core/lib/http/parser.h",
"src/core/lib/iomgr/block_annotate.h",
"src/core/lib/iomgr/buffer_list.cc",
"src/core/lib/iomgr/buffer_list.h",
@ -1486,6 +1484,7 @@ let package = Package(
"src/core/lib/promise/latch.h",
"src/core/lib/promise/loop.h",
"src/core/lib/promise/map.h",
"src/core/lib/promise/observable.h",
"src/core/lib/promise/party.cc",
"src/core/lib/promise/party.h",
"src/core/lib/promise/pipe.h",
@ -1915,6 +1914,14 @@ let package = Package(
"src/core/util/alloc.h",
"src/core/util/android/log.cc",
"src/core/util/atm.cc",
"src/core/util/http_client/format_request.cc",
"src/core/util/http_client/format_request.h",
"src/core/util/http_client/httpcli.cc",
"src/core/util/http_client/httpcli.h",
"src/core/util/http_client/httpcli_security_connector.cc",
"src/core/util/http_client/httpcli_ssl_credentials.h",
"src/core/util/http_client/parser.cc",
"src/core/util/http_client/parser.h",
"src/core/util/iphone/cpu.cc",
"src/core/util/json/json.h",
"src/core/util/json/json_args.h",

@ -18,7 +18,6 @@
EXPERIMENT_ENABLES = {
"call_status_override_on_cancellation": "call_status_override_on_cancellation",
"call_v3": "call_v3",
"canary_client_privacy": "canary_client_privacy",
"client_privacy": "client_privacy",
"event_engine_client": "event_engine_client",
@ -28,6 +27,7 @@ EXPERIMENT_ENABLES = {
"http2_stats_fix": "http2_stats_fix",
"keepalive_fix": "keepalive_fix",
"keepalive_server_fix": "keepalive_server_fix",
"max_pings_wo_data_throttle": "max_pings_wo_data_throttle",
"monitoring_experiment": "monitoring_experiment",
"multiping": "multiping",
"peer_state_based_framing": "peer_state_based_framing",
@ -44,6 +44,7 @@ EXPERIMENT_ENABLES = {
"unconstrained_max_quota_buffer_size": "unconstrained_max_quota_buffer_size",
"work_serializer_clears_time_cache": "work_serializer_clears_time_cache",
"work_serializer_dispatch": "event_engine_client,work_serializer_dispatch",
"call_v3": "call_v3,event_engine_client,event_engine_listener,work_serializer_dispatch",
}
EXPERIMENT_POLLERS = [
@ -57,10 +58,16 @@ EXPERIMENTS = {
"dbg": {
},
"off": {
"core_end2end_test": [
"event_engine_client",
],
"endpoint_test": [
"tcp_frame_size_tuning",
"tcp_rcv_lowat",
],
"event_engine_client_test": [
"event_engine_client",
],
"flow_control_test": [
"multiping",
"peer_state_based_framing",
@ -78,15 +85,11 @@ EXPERIMENTS = {
"event_engine_dns",
],
"core_end2end_test": [
"event_engine_client",
"event_engine_listener",
],
"cpp_lb_end2end_test": [
"pick_first_new",
],
"event_engine_client_test": [
"event_engine_client",
],
"event_engine_listener_test": [
"event_engine_listener",
],

@ -190,11 +190,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 = "c4cccc0ea8b149d2853da77254655c0d5a5739dd4bbdff9a5b586c06a627de6c",
strip_prefix = "boringssl-5a2bca2124800f2861263959b72bc35cdf18949b",
sha256 = "9f441d72fccb9a3faf96470478c8ccfaaeb8db1cffd4d78b698f782124dad1b0",
strip_prefix = "boringssl-b8a2bffc598f230484ff48a247526a9820facfc2",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/boringssl/archive/5a2bca2124800f2861263959b72bc35cdf18949b.tar.gz",
"https://github.com/google/boringssl/archive/5a2bca2124800f2861263959b72bc35cdf18949b.tar.gz",
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/boringssl/archive/b8a2bffc598f230484ff48a247526a9820facfc2.tar.gz",
"https://github.com/google/boringssl/archive/b8a2bffc598f230484ff48a247526a9820facfc2.tar.gz",
],
)
@ -406,10 +406,10 @@ def grpc_deps():
if "bazel_gazelle" not in native.existing_rules():
http_archive(
name = "bazel_gazelle",
sha256 = "de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb",
sha256 = "d76bf7a60fd8b050444090dfa2837a4eaf9829e1165618ee35dceca5cbdf58d5",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.37.0/bazel-gazelle-v0.37.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.37.0/bazel-gazelle-v0.37.0.tar.gz",
],
)

@ -52,7 +52,7 @@ def grpc_extra_deps(ignore_version_differences = False):
api_dependencies()
go_rules_dependencies()
go_register_toolchains(version = "1.18")
go_register_toolchains(version = "1.20")
gazelle_dependencies()
# Pull-in the go 3rd party dependencies for protoc_gen_validate, which is

@ -227,6 +227,7 @@ libs:
- src/core/channelz/channelz.h
- src/core/channelz/channelz_registry.h
- src/core/client_channel/backup_poller.h
- src/core/client_channel/client_channel.h
- src/core/client_channel/client_channel_factory.h
- src/core/client_channel/client_channel_filter.h
- src/core/client_channel/client_channel_internal.h
@ -235,6 +236,7 @@ libs:
- src/core/client_channel/connector.h
- src/core/client_channel/dynamic_filters.h
- src/core/client_channel/global_subchannel_pool.h
- src/core/client_channel/load_balanced_call_destination.h
- src/core/client_channel/local_subchannel_pool.h
- src/core/client_channel/retry_filter.h
- src/core/client_channel/retry_filter_legacy_call_data.h
@ -882,6 +884,7 @@ libs:
- src/core/lib/gprpp/directory_reader.h
- src/core/lib/gprpp/down_cast.h
- src/core/lib/gprpp/dual_ref_counted.h
- src/core/lib/gprpp/dump_args.h
- src/core/lib/gprpp/if_list.h
- src/core/lib/gprpp/load_file.h
- src/core/lib/gprpp/manual_constructor.h
@ -906,10 +909,6 @@ libs:
- src/core/lib/gprpp/validation_errors.h
- src/core/lib/gprpp/work_serializer.h
- src/core/lib/gprpp/xxhash_inline.h
- src/core/lib/http/format_request.h
- src/core/lib/http/httpcli.h
- src/core/lib/http/httpcli_ssl_credentials.h
- src/core/lib/http/parser.h
- src/core/lib/iomgr/block_annotate.h
- src/core/lib/iomgr/buffer_list.h
- src/core/lib/iomgr/call_combiner.h
@ -994,6 +993,7 @@ libs:
- src/core/lib/promise/latch.h
- src/core/lib/promise/loop.h
- src/core/lib/promise/map.h
- src/core/lib/promise/observable.h
- src/core/lib/promise/party.h
- src/core/lib/promise/pipe.h
- src/core/lib/promise/poll.h
@ -1205,6 +1205,10 @@ libs:
- src/core/tsi/transport_security.h
- src/core/tsi/transport_security_grpc.h
- src/core/tsi/transport_security_interface.h
- src/core/util/http_client/format_request.h
- src/core/util/http_client/httpcli.h
- src/core/util/http_client/httpcli_ssl_credentials.h
- src/core/util/http_client/parser.h
- src/core/util/json/json.h
- src/core/util/json/json_args.h
- src/core/util/json/json_channel_args.h
@ -1250,6 +1254,7 @@ libs:
- src/core/channelz/channelz.cc
- src/core/channelz/channelz_registry.cc
- src/core/client_channel/backup_poller.cc
- src/core/client_channel/client_channel.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
@ -1257,6 +1262,7 @@ libs:
- src/core/client_channel/config_selector.cc
- src/core/client_channel/dynamic_filters.cc
- src/core/client_channel/global_subchannel_pool.cc
- src/core/client_channel/load_balanced_call_destination.cc
- src/core/client_channel/local_subchannel_pool.cc
- src/core/client_channel/retry_filter.cc
- src/core/client_channel/retry_filter_legacy_call_data.cc
@ -1711,6 +1717,7 @@ libs:
- src/core/lib/event_engine/work_queue/basic_work_queue.cc
- src/core/lib/experiments/config.cc
- src/core/lib/experiments/experiments.cc
- src/core/lib/gprpp/dump_args.cc
- src/core/lib/gprpp/load_file.cc
- src/core/lib/gprpp/per_cpu.cc
- src/core/lib/gprpp/posix/directory_reader.cc
@ -1722,10 +1729,6 @@ libs:
- src/core/lib/gprpp/validation_errors.cc
- src/core/lib/gprpp/windows/directory_reader.cc
- src/core/lib/gprpp/work_serializer.cc
- src/core/lib/http/format_request.cc
- src/core/lib/http/httpcli.cc
- src/core/lib/http/httpcli_security_connector.cc
- src/core/lib/http/parser.cc
- src/core/lib/iomgr/buffer_list.cc
- src/core/lib/iomgr/call_combiner.cc
- src/core/lib/iomgr/cfstream_handle.cc
@ -2015,6 +2018,10 @@ libs:
- src/core/tsi/ssl_transport_security_utils.cc
- src/core/tsi/transport_security.cc
- src/core/tsi/transport_security_grpc.cc
- src/core/util/http_client/format_request.cc
- src/core/util/http_client/httpcli.cc
- src/core/util/http_client/httpcli_security_connector.cc
- src/core/util/http_client/parser.cc
- src/core/util/json/json_object_loader.cc
- src/core/util/json/json_reader.cc
- src/core/util/json/json_util.cc
@ -2213,6 +2220,7 @@ libs:
- src/core/channelz/channelz.h
- src/core/channelz/channelz_registry.h
- src/core/client_channel/backup_poller.h
- src/core/client_channel/client_channel.h
- src/core/client_channel/client_channel_factory.h
- src/core/client_channel/client_channel_filter.h
- src/core/client_channel/client_channel_internal.h
@ -2221,6 +2229,7 @@ libs:
- src/core/client_channel/connector.h
- src/core/client_channel/dynamic_filters.h
- src/core/client_channel/global_subchannel_pool.h
- src/core/client_channel/load_balanced_call_destination.h
- src/core/client_channel/local_subchannel_pool.h
- src/core/client_channel/retry_filter.h
- src/core/client_channel/retry_filter_legacy_call_data.h
@ -2417,6 +2426,7 @@ libs:
- src/core/lib/gprpp/cpp_impl_of.h
- src/core/lib/gprpp/down_cast.h
- src/core/lib/gprpp/dual_ref_counted.h
- src/core/lib/gprpp/dump_args.h
- src/core/lib/gprpp/if_list.h
- src/core/lib/gprpp/load_file.h
- src/core/lib/gprpp/manual_constructor.h
@ -2440,9 +2450,6 @@ libs:
- src/core/lib/gprpp/uuid_v4.h
- src/core/lib/gprpp/validation_errors.h
- src/core/lib/gprpp/work_serializer.h
- src/core/lib/http/format_request.h
- src/core/lib/http/httpcli.h
- src/core/lib/http/parser.h
- src/core/lib/iomgr/block_annotate.h
- src/core/lib/iomgr/buffer_list.h
- src/core/lib/iomgr/call_combiner.h
@ -2526,6 +2533,7 @@ libs:
- src/core/lib/promise/latch.h
- src/core/lib/promise/loop.h
- src/core/lib/promise/map.h
- src/core/lib/promise/observable.h
- src/core/lib/promise/party.h
- src/core/lib/promise/pipe.h
- src/core/lib/promise/poll.h
@ -2674,6 +2682,9 @@ libs:
- src/core/tsi/transport_security.h
- src/core/tsi/transport_security_grpc.h
- src/core/tsi/transport_security_interface.h
- src/core/util/http_client/format_request.h
- src/core/util/http_client/httpcli.h
- src/core/util/http_client/parser.h
- src/core/util/json/json.h
- src/core/util/json/json_args.h
- src/core/util/json/json_channel_args.h
@ -2705,6 +2716,7 @@ libs:
- src/core/channelz/channelz.cc
- src/core/channelz/channelz_registry.cc
- src/core/client_channel/backup_poller.cc
- src/core/client_channel/client_channel.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
@ -2712,6 +2724,7 @@ libs:
- src/core/client_channel/config_selector.cc
- src/core/client_channel/dynamic_filters.cc
- src/core/client_channel/global_subchannel_pool.cc
- src/core/client_channel/load_balanced_call_destination.cc
- src/core/client_channel/local_subchannel_pool.cc
- src/core/client_channel/retry_filter.cc
- src/core/client_channel/retry_filter_legacy_call_data.cc
@ -2862,6 +2875,7 @@ libs:
- src/core/lib/event_engine/work_queue/basic_work_queue.cc
- src/core/lib/experiments/config.cc
- src/core/lib/experiments/experiments.cc
- src/core/lib/gprpp/dump_args.cc
- src/core/lib/gprpp/load_file.cc
- src/core/lib/gprpp/per_cpu.cc
- src/core/lib/gprpp/ref_counted_string.cc
@ -2871,9 +2885,6 @@ libs:
- src/core/lib/gprpp/uuid_v4.cc
- src/core/lib/gprpp/validation_errors.cc
- src/core/lib/gprpp/work_serializer.cc
- src/core/lib/http/format_request.cc
- src/core/lib/http/httpcli.cc
- src/core/lib/http/parser.cc
- src/core/lib/iomgr/buffer_list.cc
- src/core/lib/iomgr/call_combiner.cc
- src/core/lib/iomgr/cfstream_handle.cc
@ -3091,6 +3102,9 @@ libs:
- src/core/tsi/local_transport_security.cc
- src/core/tsi/transport_security.cc
- src/core/tsi/transport_security_grpc.cc
- src/core/util/http_client/format_request.cc
- src/core/util/http_client/httpcli.cc
- src/core/util/http_client/parser.cc
- src/core/util/json/json_object_loader.cc
- src/core/util/json/json_reader.cc
- src/core/util/json/json_writer.cc
@ -4505,6 +4519,7 @@ libs:
- src/core/lib/gprpp/cpp_impl_of.h
- src/core/lib/gprpp/down_cast.h
- src/core/lib/gprpp/dual_ref_counted.h
- src/core/lib/gprpp/dump_args.h
- src/core/lib/gprpp/if_list.h
- src/core/lib/gprpp/load_file.h
- src/core/lib/gprpp/manual_constructor.h
@ -4613,6 +4628,7 @@ libs:
- src/core/lib/promise/party.h
- src/core/lib/promise/pipe.h
- src/core/lib/promise/poll.h
- src/core/lib/promise/prioritized_race.h
- src/core/lib/promise/promise.h
- src/core/lib/promise/race.h
- src/core/lib/promise/seq.h
@ -4827,6 +4843,7 @@ libs:
- src/core/lib/event_engine/work_queue/basic_work_queue.cc
- src/core/lib/experiments/config.cc
- src/core/lib/experiments/experiments.cc
- src/core/lib/gprpp/dump_args.cc
- src/core/lib/gprpp/load_file.cc
- src/core/lib/gprpp/per_cpu.cc
- src/core/lib/gprpp/ref_counted_string.cc
@ -6370,8 +6387,10 @@ targets:
- src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/chunked_vector.h
- src/core/lib/gprpp/cpp_impl_of.h
- src/core/lib/gprpp/down_cast.h
- src/core/lib/gprpp/dual_ref_counted.h
- src/core/lib/gprpp/dump_args.h
- src/core/lib/gprpp/if_list.h
- src/core/lib/gprpp/manual_constructor.h
- src/core/lib/gprpp/orphanable.h
@ -6408,8 +6427,11 @@ targets:
- src/core/lib/promise/status_flag.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
- src/core/lib/resource_quota/thread_quota.h
- src/core/lib/resource_quota/trace.h
- src/core/lib/slice/percent_encoding.h
- src/core/lib/slice/slice.h
@ -6462,6 +6484,7 @@ targets:
- src/core/lib/debug/trace.cc
- src/core/lib/experiments/config.cc
- src/core/lib/experiments/experiments.cc
- src/core/lib/gprpp/dump_args.cc
- src/core/lib/gprpp/ref_counted_string.cc
- src/core/lib/gprpp/status_helper.cc
- src/core/lib/gprpp/time.cc
@ -6474,8 +6497,11 @@ 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
- src/core/lib/resource_quota/thread_quota.cc
- src/core/lib/resource_quota/trace.cc
- src/core/lib/slice/percent_encoding.cc
- src/core/lib/slice/slice.cc
@ -7863,12 +7889,22 @@ targets:
gtest: true
build: test
language: c++
headers: []
headers:
- test/core/call/yodel/yodel_test.h
- test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.h
src:
- test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.proto
- test/core/call/yodel/test_main.cc
- test/core/call/yodel/yodel_test.cc
- test/core/client_channel/client_channel_test.cc
- test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc
deps:
- gtest
- protobuf
- grpc_test_util
platforms:
- linux
- posix
uses_polling: false
- name: client_context_test_peer_test
gtest: true
@ -8219,6 +8255,27 @@ targets:
deps:
- gtest
- grpc_test_util
- name: connected_subchannel_test
gtest: true
build: test
language: c++
headers:
- test/core/call/yodel/yodel_test.h
- test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.h
src:
- test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.proto
- test/core/call/yodel/test_main.cc
- test/core/call/yodel/yodel_test.cc
- test/core/client_channel/connected_subchannel_test.cc
- test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc
deps:
- gtest
- protobuf
- grpc_test_util
platforms:
- linux
- posix
uses_polling: false
- name: connection_prefix_bad_client_test
gtest: true
build: test
@ -11663,6 +11720,7 @@ targets:
- src/core/lib/gprpp/cpp_impl_of.h
- src/core/lib/gprpp/down_cast.h
- src/core/lib/gprpp/dual_ref_counted.h
- src/core/lib/gprpp/dump_args.h
- src/core/lib/gprpp/if_list.h
- src/core/lib/gprpp/load_file.h
- src/core/lib/gprpp/manual_constructor.h
@ -11770,6 +11828,7 @@ targets:
- src/core/lib/promise/party.h
- src/core/lib/promise/pipe.h
- src/core/lib/promise/poll.h
- src/core/lib/promise/prioritized_race.h
- src/core/lib/promise/promise.h
- src/core/lib/promise/race.h
- src/core/lib/promise/seq.h
@ -11955,6 +12014,7 @@ targets:
- src/core/lib/event_engine/work_queue/basic_work_queue.cc
- src/core/lib/experiments/config.cc
- src/core/lib/experiments/experiments.cc
- src/core/lib/gprpp/dump_args.cc
- src/core/lib/gprpp/load_file.cc
- src/core/lib/gprpp/per_cpu.cc
- src/core/lib/gprpp/ref_counted_string.cc
@ -12727,6 +12787,27 @@ targets:
- gtest
- grpc++
- grpc_test_util
- name: load_balanced_call_destination_test
gtest: true
build: test
language: c++
headers:
- test/core/call/yodel/yodel_test.h
- test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.h
src:
- test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.proto
- test/core/call/yodel/test_main.cc
- test/core/call/yodel/yodel_test.cc
- test/core/client_channel/load_balanced_call_destination_test.cc
- test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc
deps:
- gtest
- protobuf
- grpc_test_util
platforms:
- linux
- posix
uses_polling: false
- name: load_config_test
gtest: true
build: test
@ -14633,6 +14714,7 @@ targets:
- src/core/lib/promise/map.h
- src/core/lib/promise/poll.h
- src/core/lib/promise/promise.h
- test/core/promise/poll_matcher.h
src:
- test/core/promise/map_test.cc
deps:
@ -18987,6 +19069,17 @@ targets:
- gtest
- grpc_test_util
uses_polling: false
- name: subchannel_args_test
gtest: true
build: test
language: c++
headers: []
src:
- test/core/client_channel/subchannel_args_test.cc
deps:
- gtest
- grpc_test_util
uses_polling: false
- name: switch_test
gtest: true
build: test

15
config.m4 generated

@ -45,6 +45,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/channelz/channelz.cc \
src/core/channelz/channelz_registry.cc \
src/core/client_channel/backup_poller.cc \
src/core/client_channel/client_channel.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 \
@ -52,6 +53,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/client_channel/config_selector.cc \
src/core/client_channel/dynamic_filters.cc \
src/core/client_channel/global_subchannel_pool.cc \
src/core/client_channel/load_balanced_call_destination.cc \
src/core/client_channel/local_subchannel_pool.cc \
src/core/client_channel/retry_filter.cc \
src/core/client_channel/retry_filter_legacy_call_data.cc \
@ -511,6 +513,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/experiments/config.cc \
src/core/lib/experiments/experiments.cc \
src/core/lib/gprpp/crash.cc \
src/core/lib/gprpp/dump_args.cc \
src/core/lib/gprpp/examine_stack.cc \
src/core/lib/gprpp/fork.cc \
src/core/lib/gprpp/host_port.cc \
@ -536,10 +539,6 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/gprpp/windows/stat.cc \
src/core/lib/gprpp/windows/thd.cc \
src/core/lib/gprpp/work_serializer.cc \
src/core/lib/http/format_request.cc \
src/core/lib/http/httpcli.cc \
src/core/lib/http/httpcli_security_connector.cc \
src/core/lib/http/parser.cc \
src/core/lib/iomgr/buffer_list.cc \
src/core/lib/iomgr/call_combiner.cc \
src/core/lib/iomgr/cfstream_handle.cc \
@ -832,6 +831,10 @@ if test "$PHP_GRPC" != "no"; then
src/core/util/alloc.cc \
src/core/util/android/log.cc \
src/core/util/atm.cc \
src/core/util/http_client/format_request.cc \
src/core/util/http_client/httpcli.cc \
src/core/util/http_client/httpcli_security_connector.cc \
src/core/util/http_client/parser.cc \
src/core/util/iphone/cpu.cc \
src/core/util/json/json_object_loader.cc \
src/core/util/json/json_reader.cc \
@ -1111,6 +1114,7 @@ if test "$PHP_GRPC" != "no"; then
third_party/boringssl-with-bazel/src/crypto/dh_extra/dh_asn1.c \
third_party/boringssl-with-bazel/src/crypto/dh_extra/params.c \
third_party/boringssl-with-bazel/src/crypto/digest_extra/digest_extra.c \
third_party/boringssl-with-bazel/src/crypto/dilithium/dilithium.c \
third_party/boringssl-with-bazel/src/crypto/dsa/dsa.c \
third_party/boringssl-with-bazel/src/crypto/dsa/dsa_asn1.c \
third_party/boringssl-with-bazel/src/crypto/ec_extra/ec_asn1.c \
@ -1529,7 +1533,6 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gprpp/linux)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gprpp/posix)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gprpp/windows)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/http)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/iomgr)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/iomgr/event_engine_shims)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/matchers)
@ -1600,6 +1603,7 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/tsi/ssl/session_cache)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/util)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/util/android)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/util/http_client)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/util/iphone)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/util/json)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/util/linux)
@ -1651,6 +1655,7 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl-with-bazel/src/crypto/des)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl-with-bazel/src/crypto/dh_extra)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl-with-bazel/src/crypto/digest_extra)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl-with-bazel/src/crypto/dilithium)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl-with-bazel/src/crypto/dsa)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl-with-bazel/src/crypto/ec_extra)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl-with-bazel/src/crypto/ecdh_extra)

15
config.w32 generated

@ -10,6 +10,7 @@ if (PHP_GRPC != "no") {
"src\\core\\channelz\\channelz.cc " +
"src\\core\\channelz\\channelz_registry.cc " +
"src\\core\\client_channel\\backup_poller.cc " +
"src\\core\\client_channel\\client_channel.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 " +
@ -17,6 +18,7 @@ if (PHP_GRPC != "no") {
"src\\core\\client_channel\\config_selector.cc " +
"src\\core\\client_channel\\dynamic_filters.cc " +
"src\\core\\client_channel\\global_subchannel_pool.cc " +
"src\\core\\client_channel\\load_balanced_call_destination.cc " +
"src\\core\\client_channel\\local_subchannel_pool.cc " +
"src\\core\\client_channel\\retry_filter.cc " +
"src\\core\\client_channel\\retry_filter_legacy_call_data.cc " +
@ -476,6 +478,7 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\experiments\\config.cc " +
"src\\core\\lib\\experiments\\experiments.cc " +
"src\\core\\lib\\gprpp\\crash.cc " +
"src\\core\\lib\\gprpp\\dump_args.cc " +
"src\\core\\lib\\gprpp\\examine_stack.cc " +
"src\\core\\lib\\gprpp\\fork.cc " +
"src\\core\\lib\\gprpp\\host_port.cc " +
@ -501,10 +504,6 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\gprpp\\windows\\stat.cc " +
"src\\core\\lib\\gprpp\\windows\\thd.cc " +
"src\\core\\lib\\gprpp\\work_serializer.cc " +
"src\\core\\lib\\http\\format_request.cc " +
"src\\core\\lib\\http\\httpcli.cc " +
"src\\core\\lib\\http\\httpcli_security_connector.cc " +
"src\\core\\lib\\http\\parser.cc " +
"src\\core\\lib\\iomgr\\buffer_list.cc " +
"src\\core\\lib\\iomgr\\call_combiner.cc " +
"src\\core\\lib\\iomgr\\cfstream_handle.cc " +
@ -797,6 +796,10 @@ if (PHP_GRPC != "no") {
"src\\core\\util\\alloc.cc " +
"src\\core\\util\\android\\log.cc " +
"src\\core\\util\\atm.cc " +
"src\\core\\util\\http_client\\format_request.cc " +
"src\\core\\util\\http_client\\httpcli.cc " +
"src\\core\\util\\http_client\\httpcli_security_connector.cc " +
"src\\core\\util\\http_client\\parser.cc " +
"src\\core\\util\\iphone\\cpu.cc " +
"src\\core\\util\\json\\json_object_loader.cc " +
"src\\core\\util\\json\\json_reader.cc " +
@ -1076,6 +1079,7 @@ if (PHP_GRPC != "no") {
"third_party\\boringssl-with-bazel\\src\\crypto\\dh_extra\\dh_asn1.c " +
"third_party\\boringssl-with-bazel\\src\\crypto\\dh_extra\\params.c " +
"third_party\\boringssl-with-bazel\\src\\crypto\\digest_extra\\digest_extra.c " +
"third_party\\boringssl-with-bazel\\src\\crypto\\dilithium\\dilithium.c " +
"third_party\\boringssl-with-bazel\\src\\crypto\\dsa\\dsa.c " +
"third_party\\boringssl-with-bazel\\src\\crypto\\dsa\\dsa_asn1.c " +
"third_party\\boringssl-with-bazel\\src\\crypto\\ec_extra\\ec_asn1.c " +
@ -1666,7 +1670,6 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gprpp\\linux");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gprpp\\posix");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gprpp\\windows");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\http");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\iomgr");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\iomgr\\event_engine_shims");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\matchers");
@ -1740,6 +1743,7 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\tsi\\ssl\\session_cache");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util\\android");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util\\http_client");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util\\iphone");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util\\json");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util\\linux");
@ -1804,6 +1808,7 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl-with-bazel\\src\\crypto\\des");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl-with-bazel\\src\\crypto\\dh_extra");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl-with-bazel\\src\\crypto\\digest_extra");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl-with-bazel\\src\\crypto\\dilithium");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl-with-bazel\\src\\crypto\\dsa");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl-with-bazel\\src\\crypto\\ec_extra");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\boringssl-with-bazel\\src\\crypto\\ecdh_extra");

@ -77,5 +77,5 @@ Aggregate Cluster Behavior Fixes | [A75](https://github.com/grpc/proposal/blob/m
Pick First | [A62](https://github.com/grpc/proposal/blob/master/A62-pick-first.md) | v1.58.0 | v1.58.1 | v1.56.0 | |
[StringMatcher for Header Matching](https://github.com/envoyproxy/envoy/blob/3fe4b8d335fa339ef6f17325c8d31f87ade7bb1a/api/envoy/config/route/v3/route_components.proto#L2280) | [A63](https://github.com/grpc/proposal/blob/master/A63-xds-string-matcher-in-header-matching.md) | v1.56.0 | v1.53.0 | v1.56.0 | v1.9.0 |
LRS Custom Metrics Support | [A64](https://github.com/grpc/proposal/blob/master/A64-lrs-custom-metrics.md) | v1.54.0 | | | |
mTLS Credentials in xDS Bootstrap File | [A65](https://github.com/grpc/proposal/blob/master/A65-xds-mtls-creds-in-bootstrap.md) | v1.57.0 | | v1.61.0 | |
mTLS Credentials in xDS Bootstrap File | [A65](https://github.com/grpc/proposal/blob/master/A65-xds-mtls-creds-in-bootstrap.md) | v1.65.0 | | v1.61.0 | |
Stateful Session Affinity | [A55](https://github.com/grpc/proposal/blob/master/A55-xds-stateful-session-affinity.md), [A60](https://github.com/grpc/proposal/blob/master/A60-xds-stateful-session-affinity-weighted-clusters.md), [A75](https://github.com/grpc/proposal/blob/master/A75-xds-aggregate-cluster-behavior-fixes.md) | v1.61.0 | | | |

24
gRPC-C++.podspec generated

@ -268,6 +268,7 @@ Pod::Spec.new do |s|
'src/core/channelz/channelz.h',
'src/core/channelz/channelz_registry.h',
'src/core/client_channel/backup_poller.h',
'src/core/client_channel/client_channel.h',
'src/core/client_channel/client_channel_factory.h',
'src/core/client_channel/client_channel_filter.h',
'src/core/client_channel/client_channel_internal.h',
@ -276,6 +277,7 @@ Pod::Spec.new do |s|
'src/core/client_channel/connector.h',
'src/core/client_channel/dynamic_filters.h',
'src/core/client_channel/global_subchannel_pool.h',
'src/core/client_channel/load_balanced_call_destination.h',
'src/core/client_channel/local_subchannel_pool.h',
'src/core/client_channel/retry_filter.h',
'src/core/client_channel/retry_filter_legacy_call_data.h',
@ -967,6 +969,7 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/directory_reader.h',
'src/core/lib/gprpp/down_cast.h',
'src/core/lib/gprpp/dual_ref_counted.h',
'src/core/lib/gprpp/dump_args.h',
'src/core/lib/gprpp/env.h',
'src/core/lib/gprpp/examine_stack.h',
'src/core/lib/gprpp/fork.h',
@ -1004,10 +1007,6 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/validation_errors.h',
'src/core/lib/gprpp/work_serializer.h',
'src/core/lib/gprpp/xxhash_inline.h',
'src/core/lib/http/format_request.h',
'src/core/lib/http/httpcli.h',
'src/core/lib/http/httpcli_ssl_credentials.h',
'src/core/lib/http/parser.h',
'src/core/lib/iomgr/block_annotate.h',
'src/core/lib/iomgr/buffer_list.h',
'src/core/lib/iomgr/call_combiner.h',
@ -1092,6 +1091,7 @@ Pod::Spec.new do |s|
'src/core/lib/promise/latch.h',
'src/core/lib/promise/loop.h',
'src/core/lib/promise/map.h',
'src/core/lib/promise/observable.h',
'src/core/lib/promise/party.h',
'src/core/lib/promise/pipe.h',
'src/core/lib/promise/poll.h',
@ -1304,6 +1304,10 @@ Pod::Spec.new do |s|
'src/core/tsi/transport_security_grpc.h',
'src/core/tsi/transport_security_interface.h',
'src/core/util/alloc.h',
'src/core/util/http_client/format_request.h',
'src/core/util/http_client/httpcli.h',
'src/core/util/http_client/httpcli_ssl_credentials.h',
'src/core/util/http_client/parser.h',
'src/core/util/json/json.h',
'src/core/util/json/json_args.h',
'src/core/util/json/json_channel_args.h',
@ -1556,6 +1560,7 @@ Pod::Spec.new do |s|
'src/core/channelz/channelz.h',
'src/core/channelz/channelz_registry.h',
'src/core/client_channel/backup_poller.h',
'src/core/client_channel/client_channel.h',
'src/core/client_channel/client_channel_factory.h',
'src/core/client_channel/client_channel_filter.h',
'src/core/client_channel/client_channel_internal.h',
@ -1564,6 +1569,7 @@ Pod::Spec.new do |s|
'src/core/client_channel/connector.h',
'src/core/client_channel/dynamic_filters.h',
'src/core/client_channel/global_subchannel_pool.h',
'src/core/client_channel/load_balanced_call_destination.h',
'src/core/client_channel/local_subchannel_pool.h',
'src/core/client_channel/retry_filter.h',
'src/core/client_channel/retry_filter_legacy_call_data.h',
@ -2237,6 +2243,7 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/directory_reader.h',
'src/core/lib/gprpp/down_cast.h',
'src/core/lib/gprpp/dual_ref_counted.h',
'src/core/lib/gprpp/dump_args.h',
'src/core/lib/gprpp/env.h',
'src/core/lib/gprpp/examine_stack.h',
'src/core/lib/gprpp/fork.h',
@ -2274,10 +2281,6 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/validation_errors.h',
'src/core/lib/gprpp/work_serializer.h',
'src/core/lib/gprpp/xxhash_inline.h',
'src/core/lib/http/format_request.h',
'src/core/lib/http/httpcli.h',
'src/core/lib/http/httpcli_ssl_credentials.h',
'src/core/lib/http/parser.h',
'src/core/lib/iomgr/block_annotate.h',
'src/core/lib/iomgr/buffer_list.h',
'src/core/lib/iomgr/call_combiner.h',
@ -2362,6 +2365,7 @@ Pod::Spec.new do |s|
'src/core/lib/promise/latch.h',
'src/core/lib/promise/loop.h',
'src/core/lib/promise/map.h',
'src/core/lib/promise/observable.h',
'src/core/lib/promise/party.h',
'src/core/lib/promise/pipe.h',
'src/core/lib/promise/poll.h',
@ -2574,6 +2578,10 @@ Pod::Spec.new do |s|
'src/core/tsi/transport_security_grpc.h',
'src/core/tsi/transport_security_interface.h',
'src/core/util/alloc.h',
'src/core/util/http_client/format_request.h',
'src/core/util/http_client/httpcli.h',
'src/core/util/http_client/httpcli_ssl_credentials.h',
'src/core/util/http_client/parser.h',
'src/core/util/json/json.h',
'src/core/util/json/json_args.h',
'src/core/util/json/json_channel_args.h',

37
gRPC-Core.podspec generated

@ -199,7 +199,7 @@ 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.34'
ss.dependency 'BoringSSL-GRPC', '0.0.35'
ss.dependency 'abseil/algorithm/container', abseil_version
ss.dependency 'abseil/base/base', abseil_version
ss.dependency 'abseil/base/config', abseil_version
@ -245,6 +245,8 @@ Pod::Spec.new do |s|
'src/core/channelz/channelz_registry.h',
'src/core/client_channel/backup_poller.cc',
'src/core/client_channel/backup_poller.h',
'src/core/client_channel/client_channel.cc',
'src/core/client_channel/client_channel.h',
'src/core/client_channel/client_channel_factory.cc',
'src/core/client_channel/client_channel_factory.h',
'src/core/client_channel/client_channel_filter.cc',
@ -260,6 +262,8 @@ Pod::Spec.new do |s|
'src/core/client_channel/dynamic_filters.h',
'src/core/client_channel/global_subchannel_pool.cc',
'src/core/client_channel/global_subchannel_pool.h',
'src/core/client_channel/load_balanced_call_destination.cc',
'src/core/client_channel/load_balanced_call_destination.h',
'src/core/client_channel/local_subchannel_pool.cc',
'src/core/client_channel/local_subchannel_pool.h',
'src/core/client_channel/retry_filter.cc',
@ -1372,6 +1376,8 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/directory_reader.h',
'src/core/lib/gprpp/down_cast.h',
'src/core/lib/gprpp/dual_ref_counted.h',
'src/core/lib/gprpp/dump_args.cc',
'src/core/lib/gprpp/dump_args.h',
'src/core/lib/gprpp/env.h',
'src/core/lib/gprpp/examine_stack.cc',
'src/core/lib/gprpp/examine_stack.h',
@ -1434,14 +1440,6 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/work_serializer.cc',
'src/core/lib/gprpp/work_serializer.h',
'src/core/lib/gprpp/xxhash_inline.h',
'src/core/lib/http/format_request.cc',
'src/core/lib/http/format_request.h',
'src/core/lib/http/httpcli.cc',
'src/core/lib/http/httpcli.h',
'src/core/lib/http/httpcli_security_connector.cc',
'src/core/lib/http/httpcli_ssl_credentials.h',
'src/core/lib/http/parser.cc',
'src/core/lib/http/parser.h',
'src/core/lib/iomgr/block_annotate.h',
'src/core/lib/iomgr/buffer_list.cc',
'src/core/lib/iomgr/buffer_list.h',
@ -1605,6 +1603,7 @@ Pod::Spec.new do |s|
'src/core/lib/promise/latch.h',
'src/core/lib/promise/loop.h',
'src/core/lib/promise/map.h',
'src/core/lib/promise/observable.h',
'src/core/lib/promise/party.cc',
'src/core/lib/promise/party.h',
'src/core/lib/promise/pipe.h',
@ -2030,6 +2029,14 @@ Pod::Spec.new do |s|
'src/core/util/alloc.h',
'src/core/util/android/log.cc',
'src/core/util/atm.cc',
'src/core/util/http_client/format_request.cc',
'src/core/util/http_client/format_request.h',
'src/core/util/http_client/httpcli.cc',
'src/core/util/http_client/httpcli.h',
'src/core/util/http_client/httpcli_security_connector.cc',
'src/core/util/http_client/httpcli_ssl_credentials.h',
'src/core/util/http_client/parser.cc',
'src/core/util/http_client/parser.h',
'src/core/util/iphone/cpu.cc',
'src/core/util/json/json.h',
'src/core/util/json/json_args.h',
@ -2355,6 +2362,7 @@ Pod::Spec.new do |s|
'src/core/channelz/channelz.h',
'src/core/channelz/channelz_registry.h',
'src/core/client_channel/backup_poller.h',
'src/core/client_channel/client_channel.h',
'src/core/client_channel/client_channel_factory.h',
'src/core/client_channel/client_channel_filter.h',
'src/core/client_channel/client_channel_internal.h',
@ -2363,6 +2371,7 @@ Pod::Spec.new do |s|
'src/core/client_channel/connector.h',
'src/core/client_channel/dynamic_filters.h',
'src/core/client_channel/global_subchannel_pool.h',
'src/core/client_channel/load_balanced_call_destination.h',
'src/core/client_channel/local_subchannel_pool.h',
'src/core/client_channel/retry_filter.h',
'src/core/client_channel/retry_filter_legacy_call_data.h',
@ -3016,6 +3025,7 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/directory_reader.h',
'src/core/lib/gprpp/down_cast.h',
'src/core/lib/gprpp/dual_ref_counted.h',
'src/core/lib/gprpp/dump_args.h',
'src/core/lib/gprpp/env.h',
'src/core/lib/gprpp/examine_stack.h',
'src/core/lib/gprpp/fork.h',
@ -3053,10 +3063,6 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/validation_errors.h',
'src/core/lib/gprpp/work_serializer.h',
'src/core/lib/gprpp/xxhash_inline.h',
'src/core/lib/http/format_request.h',
'src/core/lib/http/httpcli.h',
'src/core/lib/http/httpcli_ssl_credentials.h',
'src/core/lib/http/parser.h',
'src/core/lib/iomgr/block_annotate.h',
'src/core/lib/iomgr/buffer_list.h',
'src/core/lib/iomgr/call_combiner.h',
@ -3141,6 +3147,7 @@ Pod::Spec.new do |s|
'src/core/lib/promise/latch.h',
'src/core/lib/promise/loop.h',
'src/core/lib/promise/map.h',
'src/core/lib/promise/observable.h',
'src/core/lib/promise/party.h',
'src/core/lib/promise/pipe.h',
'src/core/lib/promise/poll.h',
@ -3353,6 +3360,10 @@ Pod::Spec.new do |s|
'src/core/tsi/transport_security_grpc.h',
'src/core/tsi/transport_security_interface.h',
'src/core/util/alloc.h',
'src/core/util/http_client/format_request.h',
'src/core/util/http_client/httpcli.h',
'src/core/util/http_client/httpcli_ssl_credentials.h',
'src/core/util/http_client/parser.h',
'src/core/util/json/json.h',
'src/core/util/json/json_args.h',
'src/core/util/json/json_channel_args.h',

27
grpc.gemspec generated

@ -132,6 +132,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/channelz/channelz_registry.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/client_channel.cc )
s.files += %w( src/core/client_channel/client_channel.h )
s.files += %w( src/core/client_channel/client_channel_factory.cc )
s.files += %w( src/core/client_channel/client_channel_factory.h )
s.files += %w( src/core/client_channel/client_channel_filter.cc )
@ -147,6 +149,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/client_channel/dynamic_filters.h )
s.files += %w( src/core/client_channel/global_subchannel_pool.cc )
s.files += %w( src/core/client_channel/global_subchannel_pool.h )
s.files += %w( src/core/client_channel/load_balanced_call_destination.cc )
s.files += %w( src/core/client_channel/load_balanced_call_destination.h )
s.files += %w( src/core/client_channel/local_subchannel_pool.cc )
s.files += %w( src/core/client_channel/local_subchannel_pool.h )
s.files += %w( src/core/client_channel/retry_filter.cc )
@ -1259,6 +1263,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/gprpp/directory_reader.h )
s.files += %w( src/core/lib/gprpp/down_cast.h )
s.files += %w( src/core/lib/gprpp/dual_ref_counted.h )
s.files += %w( src/core/lib/gprpp/dump_args.cc )
s.files += %w( src/core/lib/gprpp/dump_args.h )
s.files += %w( src/core/lib/gprpp/env.h )
s.files += %w( src/core/lib/gprpp/examine_stack.cc )
s.files += %w( src/core/lib/gprpp/examine_stack.h )
@ -1321,14 +1327,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/gprpp/work_serializer.cc )
s.files += %w( src/core/lib/gprpp/work_serializer.h )
s.files += %w( src/core/lib/gprpp/xxhash_inline.h )
s.files += %w( src/core/lib/http/format_request.cc )
s.files += %w( src/core/lib/http/format_request.h )
s.files += %w( src/core/lib/http/httpcli.cc )
s.files += %w( src/core/lib/http/httpcli.h )
s.files += %w( src/core/lib/http/httpcli_security_connector.cc )
s.files += %w( src/core/lib/http/httpcli_ssl_credentials.h )
s.files += %w( src/core/lib/http/parser.cc )
s.files += %w( src/core/lib/http/parser.h )
s.files += %w( src/core/lib/iomgr/block_annotate.h )
s.files += %w( src/core/lib/iomgr/buffer_list.cc )
s.files += %w( src/core/lib/iomgr/buffer_list.h )
@ -1492,6 +1490,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/promise/latch.h )
s.files += %w( src/core/lib/promise/loop.h )
s.files += %w( src/core/lib/promise/map.h )
s.files += %w( src/core/lib/promise/observable.h )
s.files += %w( src/core/lib/promise/party.cc )
s.files += %w( src/core/lib/promise/party.h )
s.files += %w( src/core/lib/promise/pipe.h )
@ -1917,6 +1916,14 @@ Gem::Specification.new do |s|
s.files += %w( src/core/util/alloc.h )
s.files += %w( src/core/util/android/log.cc )
s.files += %w( src/core/util/atm.cc )
s.files += %w( src/core/util/http_client/format_request.cc )
s.files += %w( src/core/util/http_client/format_request.h )
s.files += %w( src/core/util/http_client/httpcli.cc )
s.files += %w( src/core/util/http_client/httpcli.h )
s.files += %w( src/core/util/http_client/httpcli_security_connector.cc )
s.files += %w( src/core/util/http_client/httpcli_ssl_credentials.h )
s.files += %w( src/core/util/http_client/parser.cc )
s.files += %w( src/core/util/http_client/parser.h )
s.files += %w( src/core/util/iphone/cpu.cc )
s.files += %w( src/core/util/json/json.h )
s.files += %w( src/core/util/json/json_args.h )
@ -2515,7 +2522,6 @@ Gem::Specification.new do |s|
s.files += %w( third_party/boringssl-with-bazel/src/crypto/cipher_extra/internal.h )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/cipher_extra/tls_cbc.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/conf/conf.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/conf/conf_def.h )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/conf/internal.h )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_apple.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_fuchsia.c )
@ -2538,6 +2544,8 @@ Gem::Specification.new do |s|
s.files += %w( third_party/boringssl-with-bazel/src/crypto/dh_extra/dh_asn1.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/dh_extra/params.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/digest_extra/digest_extra.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/dilithium/dilithium.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/dilithium/internal.h )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/dsa/dsa.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/dsa/dsa_asn1.c )
s.files += %w( third_party/boringssl-with-bazel/src/crypto/dsa/internal.h )
@ -2858,6 +2866,7 @@ Gem::Specification.new do |s|
s.files += %w( third_party/boringssl-with-bazel/src/include/openssl/evp.h )
s.files += %w( third_party/boringssl-with-bazel/src/include/openssl/evp_errors.h )
s.files += %w( third_party/boringssl-with-bazel/src/include/openssl/ex_data.h )
s.files += %w( third_party/boringssl-with-bazel/src/include/openssl/experimental/dilithium.h )
s.files += %w( third_party/boringssl-with-bazel/src/include/openssl/experimental/kyber.h )
s.files += %w( third_party/boringssl-with-bazel/src/include/openssl/experimental/spx.h )
s.files += %w( third_party/boringssl-with-bazel/src/include/openssl/hkdf.h )

2669
grpc.gyp

File diff suppressed because it is too large Load Diff

@ -111,9 +111,11 @@
"grpc.server_max_unrequested_time_in_server"
/** Channel arg to override the http2 :scheme header */
#define GRPC_ARG_HTTP2_SCHEME "grpc.http2_scheme"
/** How many pings can the client send before needing to send a
data/header frame? (0 indicates that an infinite number of
pings can be sent without sending a data frame or header frame) */
/** How many pings can the client send before needing to send a data/header
frame? (0 indicates that an infinite number of pings can be sent without
sending a data frame or header frame).
If experiment "max_pings_wo_data_throttle" is enabled, instead of pings being
completely blocked, they are throttled. */
#define GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA \
"grpc.http2.max_pings_without_data"
/** How many misbehaving pings the server can bear before sending goaway and

27
package.xml generated

@ -114,6 +114,8 @@
<file baseinstalldir="/" name="src/core/channelz/channelz_registry.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/client_channel.cc" role="src" />
<file baseinstalldir="/" name="src/core/client_channel/client_channel.h" role="src" />
<file baseinstalldir="/" name="src/core/client_channel/client_channel_factory.cc" role="src" />
<file baseinstalldir="/" name="src/core/client_channel/client_channel_factory.h" role="src" />
<file baseinstalldir="/" name="src/core/client_channel/client_channel_filter.cc" role="src" />
@ -129,6 +131,8 @@
<file baseinstalldir="/" name="src/core/client_channel/dynamic_filters.h" role="src" />
<file baseinstalldir="/" name="src/core/client_channel/global_subchannel_pool.cc" role="src" />
<file baseinstalldir="/" name="src/core/client_channel/global_subchannel_pool.h" role="src" />
<file baseinstalldir="/" name="src/core/client_channel/load_balanced_call_destination.cc" role="src" />
<file baseinstalldir="/" name="src/core/client_channel/load_balanced_call_destination.h" role="src" />
<file baseinstalldir="/" name="src/core/client_channel/local_subchannel_pool.cc" role="src" />
<file baseinstalldir="/" name="src/core/client_channel/local_subchannel_pool.h" role="src" />
<file baseinstalldir="/" name="src/core/client_channel/retry_filter.cc" role="src" />
@ -1241,6 +1245,8 @@
<file baseinstalldir="/" name="src/core/lib/gprpp/directory_reader.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/down_cast.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/dual_ref_counted.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/dump_args.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/dump_args.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/env.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/examine_stack.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/examine_stack.h" role="src" />
@ -1303,14 +1309,6 @@
<file baseinstalldir="/" name="src/core/lib/gprpp/work_serializer.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/work_serializer.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/xxhash_inline.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/http/format_request.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/http/format_request.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/http/httpcli.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/http/httpcli.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/http/httpcli_security_connector.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/http/httpcli_ssl_credentials.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/http/parser.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/http/parser.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/block_annotate.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/buffer_list.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/iomgr/buffer_list.h" role="src" />
@ -1474,6 +1472,7 @@
<file baseinstalldir="/" name="src/core/lib/promise/latch.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/promise/loop.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/promise/map.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/promise/observable.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/promise/party.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/promise/party.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/promise/pipe.h" role="src" />
@ -1899,6 +1898,14 @@
<file baseinstalldir="/" name="src/core/util/alloc.h" role="src" />
<file baseinstalldir="/" name="src/core/util/android/log.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/atm.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/http_client/format_request.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/http_client/format_request.h" role="src" />
<file baseinstalldir="/" name="src/core/util/http_client/httpcli.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/http_client/httpcli.h" role="src" />
<file baseinstalldir="/" name="src/core/util/http_client/httpcli_security_connector.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/http_client/httpcli_ssl_credentials.h" role="src" />
<file baseinstalldir="/" name="src/core/util/http_client/parser.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/http_client/parser.h" role="src" />
<file baseinstalldir="/" name="src/core/util/iphone/cpu.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/json/json.h" role="src" />
<file baseinstalldir="/" name="src/core/util/json/json_args.h" role="src" />
@ -2519,7 +2526,6 @@
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/cipher_extra/internal.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/cipher_extra/tls_cbc.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/conf/conf.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/conf/conf_def.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/conf/internal.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_apple.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_fuchsia.c" role="src" />
@ -2542,6 +2548,8 @@
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/dh_extra/dh_asn1.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/dh_extra/params.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/digest_extra/digest_extra.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/dilithium/dilithium.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/dilithium/internal.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/dsa/dsa.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/dsa/dsa_asn1.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/crypto/dsa/internal.h" role="src" />
@ -2862,6 +2870,7 @@
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/include/openssl/evp.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/include/openssl/evp_errors.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/include/openssl/ex_data.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/include/openssl/experimental/dilithium.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/include/openssl/experimental/kyber.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/include/openssl/experimental/spx.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl-with-bazel/src/include/openssl/hkdf.h" role="src" />

@ -1,4 +1,4 @@
// generated by generate_boringssl_prefix_header.sh on BoringSSL commit: 5a2bca2124800f2861263959b72bc35cdf18949b
// generated by generate_boringssl_prefix_header.sh on BoringSSL commit: b8a2bffc598f230484ff48a247526a9820facfc2
// Copyright (c) 2018, Google Inc.
//
@ -1344,6 +1344,15 @@
#define DH_size BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DH_size)
#define DH_up_ref BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DH_up_ref)
#define DHparams_dup BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DHparams_dup)
#define DILITHIUM_generate_key BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DILITHIUM_generate_key)
#define DILITHIUM_generate_key_external_entropy BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DILITHIUM_generate_key_external_entropy)
#define DILITHIUM_marshal_private_key BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DILITHIUM_marshal_private_key)
#define DILITHIUM_marshal_public_key BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DILITHIUM_marshal_public_key)
#define DILITHIUM_parse_private_key BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DILITHIUM_parse_private_key)
#define DILITHIUM_parse_public_key BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DILITHIUM_parse_public_key)
#define DILITHIUM_sign BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DILITHIUM_sign)
#define DILITHIUM_sign_deterministic BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DILITHIUM_sign_deterministic)
#define DILITHIUM_verify BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DILITHIUM_verify)
#define DIRECTORYSTRING_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DIRECTORYSTRING_free)
#define DIRECTORYSTRING_it BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DIRECTORYSTRING_it)
#define DIRECTORYSTRING_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, DIRECTORYSTRING_new)
@ -2697,11 +2706,9 @@
#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)
#define X509_STORE_set_check_crl BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_STORE_set_check_crl)
#define X509_STORE_set_default_paths BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_STORE_set_default_paths)
#define X509_STORE_set_depth BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_STORE_set_depth)
#define X509_STORE_set_flags BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_STORE_set_flags)
#define X509_STORE_set_get_crl BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_STORE_set_get_crl)
#define X509_STORE_set_purpose BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_STORE_set_purpose)
#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)
@ -2957,19 +2964,22 @@
#define bn_mont_ctx_set_RR_consttime BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, bn_mont_ctx_set_RR_consttime)
#define bn_mont_n0 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, bn_mont_n0)
#define bn_mul4x_mont BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, bn_mul4x_mont)
#define bn_mul4x_mont_gather5 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, bn_mul4x_mont_gather5)
#define bn_mul_add_words BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, bn_mul_add_words)
#define bn_mul_comba4 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, bn_mul_comba4)
#define bn_mul_comba8 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, bn_mul_comba8)
#define bn_mul_consttime BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, bn_mul_consttime)
#define bn_mul_mont BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, bn_mul_mont)
#define bn_mul_mont_gather5 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, bn_mul_mont_gather5)
#define bn_mul_mont_gather5_nohw BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, bn_mul_mont_gather5_nohw)
#define bn_mul_mont_nohw BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, bn_mul_mont_nohw)
#define bn_mul_small BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, bn_mul_small)
#define bn_mul_words BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, bn_mul_words)
#define bn_mulx4x_mont BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, bn_mulx4x_mont)
#define bn_mulx4x_mont_gather5 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, bn_mulx4x_mont_gather5)
#define bn_odd_number_is_obviously_composite BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, bn_odd_number_is_obviously_composite)
#define bn_one_to_montgomery BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, bn_one_to_montgomery)
#define bn_power5 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, bn_power5)
#define bn_power5_nohw BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, bn_power5_nohw)
#define bn_powerx5 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, bn_powerx5)
#define bn_rand_range_words BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, bn_rand_range_words)
#define bn_rand_secret_range BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, bn_rand_secret_range)
#define bn_reduce_once BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, bn_reduce_once)

@ -1236,6 +1236,7 @@ grpc_cc_library(
public_hdrs = ["lib/gprpp/dual_ref_counted.h"],
deps = [
"down_cast",
"ref_counted",
"//:debug_location",
"//:gpr",
"//:orphanable",
@ -1488,6 +1489,7 @@ grpc_cc_library(
"context",
"event_engine_memory_allocator",
"memory_quota",
"resource_quota",
"//:gpr",
],
)
@ -3282,12 +3284,12 @@ grpc_cc_library(
language = "c++",
deps = [
"arena",
"call_destination",
"grpc_service_config",
"lb_policy",
"unique_type_name",
"//:call_tracer",
"//:gpr_public_hdrs",
"//:grpc_base",
"//:gpr",
"//:legacy_context",
],
)
@ -4421,10 +4423,10 @@ grpc_cc_library(
grpc_cc_library(
name = "httpcli_ssl_credentials",
srcs = [
"lib/http/httpcli_security_connector.cc",
"util/http_client/httpcli_security_connector.cc",
],
hdrs = [
"lib/http/httpcli_ssl_credentials.h",
"util/http_client/httpcli_ssl_credentials.h",
],
external_deps = [
"absl/log:log",
@ -7510,12 +7512,10 @@ grpc_cc_library(
hdrs = [
"lib/transport/call_filters.h",
],
external_deps = [
"absl/log:check",
"absl/log:log",
],
external_deps = ["absl/log:check"],
deps = [
"call_final_info",
"dump_args",
"latch",
"map",
"message",
@ -7621,20 +7621,19 @@ grpc_cc_library(
hdrs = [
"lib/transport/call_spine.h",
],
external_deps = [
"absl/log:check",
"absl/log:log",
],
external_deps = ["absl/log:check"],
deps = [
"1999",
"call_arena_allocator",
"call_filters",
"dual_ref_counted",
"for_each",
"if",
"latch",
"message",
"metadata",
"pipe",
"prioritized_race",
"promise_status",
"status_flag",
"try_seq",

File diff suppressed because it is too large Load Diff

@ -0,0 +1,243 @@
//
// Copyright 2015 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef GRPC_SRC_CORE_CLIENT_CHANNEL_CLIENT_CHANNEL_H
#define GRPC_SRC_CORE_CLIENT_CHANNEL_CLIENT_CHANNEL_H
#include <grpc/support/port_platform.h>
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/string_view.h"
#include "src/core/client_channel/client_channel_factory.h"
#include "src/core/client_channel/config_selector.h"
#include "src/core/client_channel/subchannel.h"
#include "src/core/ext/filters/channel_idle/idle_filter_state.h"
#include "src/core/lib/gprpp/single_set_ptr.h"
#include "src/core/lib/promise/observable.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/transport/metadata.h"
#include "src/core/load_balancing/lb_policy.h"
#include "src/core/resolver/resolver.h"
#include "src/core/service_config/service_config.h"
namespace grpc_core {
class ClientChannel : public Channel {
public:
using PickerObservable =
Observable<RefCountedPtr<LoadBalancingPolicy::SubchannelPicker>>;
class CallDestinationFactory {
public:
struct RawPointerChannelArgTag {};
static absl::string_view ChannelArgName() {
return "grpc.internal.client_channel_call_destination";
}
virtual RefCountedPtr<UnstartedCallDestination> CreateCallDestination(
PickerObservable) = 0;
protected:
~CallDestinationFactory() = default;
};
static absl::StatusOr<OrphanablePtr<Channel>> Create(
std::string target, ChannelArgs channel_args);
// Do not instantiate directly -- use Create() instead.
ClientChannel(std::string target_uri, ChannelArgs args,
std::string uri_to_resolve,
RefCountedPtr<ServiceConfig> default_service_config,
ClientChannelFactory* client_channel_factory,
CallDestinationFactory* call_destination_factory);
~ClientChannel() override;
void Orphan() override;
grpc_call* CreateCall(grpc_call* parent_call, uint32_t propagation_mask,
grpc_completion_queue* cq,
grpc_pollset_set* /*pollset_set_alternative*/,
Slice path, absl::optional<Slice> authority,
Timestamp deadline, bool registered_method) override;
CallInitiator CreateCall(ClientMetadataHandle client_initial_metadata);
grpc_event_engine::experimental::EventEngine* event_engine() const override {
return event_engine_.get();
}
// TODO(ctiller): lame channels
bool IsLame() const override { return false; }
bool SupportsConnectivityWatcher() const override { return true; }
// Returns the current connectivity state. If try_to_connect is true,
// triggers a connection attempt if not already connected.
grpc_connectivity_state CheckConnectivityState(bool try_to_connect) override;
void WatchConnectivityState(grpc_connectivity_state last_observed_state,
Timestamp deadline, grpc_completion_queue* cq,
void* tag) override;
// Starts and stops a connectivity watch. The watcher will be initially
// notified as soon as the state changes from initial_state and then on
// every subsequent state change until either the watch is stopped or
// it is notified that the state has changed to SHUTDOWN.
//
// This is intended to be used when starting watches from code inside of
// C-core (e.g., for a nested control plane channel for things like xds).
void AddConnectivityWatcher(
grpc_connectivity_state initial_state,
OrphanablePtr<AsyncConnectivityStateWatcherInterface> watcher) override;
void RemoveConnectivityWatcher(
AsyncConnectivityStateWatcherInterface* watcher) override;
void GetInfo(const grpc_channel_info* channel_info) override;
void ResetConnectionBackoff() override;
void Ping(grpc_completion_queue* cq, void* tag) override;
// Flag that this object gets stored in channel args as a raw pointer.
struct RawPointerChannelArgTag {};
static absl::string_view ChannelArgName() {
return "grpc.internal.client_channel";
}
private:
class ClientChannelControlHelper;
class ResolverResultHandler;
class SubchannelWrapper;
void CreateResolverLocked() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_);
void DestroyResolverAndLbPolicyLocked()
ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_);
void TryToConnectLocked() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_);
void OnResolverResultChangedLocked(Resolver::Result result)
ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_);
void OnResolverErrorLocked(absl::Status status)
ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_);
absl::Status CreateOrUpdateLbPolicyLocked(
RefCountedPtr<LoadBalancingPolicy::Config> lb_policy_config,
const absl::optional<std::string>& health_check_service_name,
Resolver::Result result) ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_);
OrphanablePtr<LoadBalancingPolicy> CreateLbPolicyLocked(
const ChannelArgs& args) ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_);
void UpdateServiceConfigInControlPlaneLocked(
RefCountedPtr<ServiceConfig> service_config,
RefCountedPtr<ConfigSelector> config_selector, std::string lb_policy_name)
ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_);
void UpdateServiceConfigInDataPlaneLocked()
ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_);
void UpdateStateLocked(grpc_connectivity_state state,
const absl::Status& status, const char* reason)
ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_);
void UpdateStateAndPickerLocked(
grpc_connectivity_state state, const absl::Status& status,
const char* reason,
RefCountedPtr<LoadBalancingPolicy::SubchannelPicker> picker)
ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_);
void StartIdleTimer();
// Applies service config settings from config_selector to the call.
// May modify call context and client_initial_metadata.
absl::Status ApplyServiceConfigToCall(
ConfigSelector& config_selector,
ClientMetadata& client_initial_metadata) const;
const ChannelArgs channel_args_;
const std::shared_ptr<grpc_event_engine::experimental::EventEngine>
event_engine_;
const std::string uri_to_resolve_;
const size_t service_config_parser_index_;
const RefCountedPtr<ServiceConfig> default_service_config_;
ClientChannelFactory* const client_channel_factory_;
const std::string default_authority_;
channelz::ChannelNode* const channelz_node_;
GlobalStatsPluginRegistry::StatsPluginGroup stats_plugin_group_;
//
// Idleness state.
//
const Duration idle_timeout_;
IdleFilterState idle_state_{false};
SingleSetPtr<Activity, typename ActivityPtr::deleter_type> idle_activity_;
//
// Fields related to name resolution.
//
struct ResolverDataForCalls {
RefCountedPtr<ConfigSelector> config_selector;
RefCountedPtr<UnstartedCallDestination> call_destination;
};
Observable<absl::StatusOr<ResolverDataForCalls>> resolver_data_for_calls_;
//
// Fields related to LB picks.
//
PickerObservable picker_;
const RefCountedPtr<UnstartedCallDestination> call_destination_;
//
// Fields used in the control plane. Guarded by work_serializer.
//
std::shared_ptr<WorkSerializer> work_serializer_;
ConnectivityStateTracker state_tracker_ ABSL_GUARDED_BY(*work_serializer_);
OrphanablePtr<Resolver> resolver_ ABSL_GUARDED_BY(*work_serializer_);
bool previous_resolution_contained_addresses_
ABSL_GUARDED_BY(*work_serializer_) = false;
RefCountedPtr<ServiceConfig> saved_service_config_
ABSL_GUARDED_BY(*work_serializer_);
RefCountedPtr<ConfigSelector> saved_config_selector_
ABSL_GUARDED_BY(*work_serializer_);
OrphanablePtr<LoadBalancingPolicy> lb_policy_
ABSL_GUARDED_BY(*work_serializer_);
RefCountedPtr<SubchannelPoolInterface> subchannel_pool_
ABSL_GUARDED_BY(*work_serializer_);
// The number of SubchannelWrapper instances referencing a given Subchannel.
std::map<Subchannel*, int> subchannel_refcount_map_
ABSL_GUARDED_BY(*work_serializer_);
// The set of SubchannelWrappers that currently exist.
// No need to hold a ref, since the set is updated in the control-plane
// work_serializer when the SubchannelWrappers are created and destroyed.
absl::flat_hash_set<SubchannelWrapper*> subchannel_wrappers_
ABSL_GUARDED_BY(*work_serializer_);
int keepalive_time_ ABSL_GUARDED_BY(*work_serializer_) = -1;
absl::Status disconnect_error_ ABSL_GUARDED_BY(*work_serializer_);
//
// Fields accessed via GetChannelInfo().
//
Mutex info_mu_;
std::string info_lb_policy_name_ ABSL_GUARDED_BY(info_mu_);
std::string info_service_config_json_ ABSL_GUARDED_BY(info_mu_);
};
} // namespace grpc_core
#endif // GRPC_SRC_CORE_CLIENT_CHANNEL_CLIENT_CHANNEL_H

@ -1109,7 +1109,7 @@ class ClientChannelFilter::ClientChannelControlHelper final
const ChannelArgs& args) override
ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
if (chand_->resolver_ == nullptr) return nullptr; // Shutting down.
ChannelArgs subchannel_args = ClientChannelFilter::MakeSubchannelArgs(
ChannelArgs subchannel_args = Subchannel::MakeSubchannelArgs(
args, per_address_args, chand_->subchannel_pool_,
chand_->default_authority_);
// Create subchannel.
@ -1359,31 +1359,6 @@ ClientChannelFilter::CreateLoadBalancedCallPromise(
return call_ptr->MakeCallPromise(std::move(call_args), std::move(lb_call));
}
ChannelArgs ClientChannelFilter::MakeSubchannelArgs(
const ChannelArgs& channel_args, const ChannelArgs& address_args,
const RefCountedPtr<SubchannelPoolInterface>& subchannel_pool,
const std::string& channel_default_authority) {
// Note that we start with the channel-level args and then apply the
// per-address args, so that if a value is present in both, the one
// in the channel-level args is used. This is particularly important
// for the GRPC_ARG_DEFAULT_AUTHORITY arg, which we want to allow
// resolvers to set on a per-address basis only if the application
// did not explicitly set it at the channel level.
return channel_args.UnionWith(address_args)
.SetObject(subchannel_pool)
// If we haven't already set the default authority arg (i.e., it
// was not explicitly set by the application nor overridden by
// the resolver), add it from the channel's default.
.SetIfUnset(GRPC_ARG_DEFAULT_AUTHORITY, channel_default_authority)
// Remove channel args that should not affect subchannel
// uniqueness.
.Remove(GRPC_ARG_HEALTH_CHECK_SERVICE_NAME)
.Remove(GRPC_ARG_INHIBIT_HEALTH_CHECKING)
.Remove(GRPC_ARG_CHANNELZ_CHANNEL_NODE)
// Remove all keys with the no-subchannel prefix.
.RemoveAllKeysWithPrefix(GRPC_ARG_NO_SUBCHANNEL_PREFIX);
}
void ClientChannelFilter::ReprocessQueuedResolverCalls() {
for (CallData* calld : resolver_queued_calls_) {
calld->RemoveCallFromResolverQueuedCallsLocked();

@ -86,9 +86,6 @@
// Channel arg key for server URI string.
#define GRPC_ARG_SERVER_URI "grpc.server_uri"
// Channel arg containing a pointer to the ClientChannelFilter object.
#define GRPC_ARG_CLIENT_CHANNEL "grpc.internal.client_channel_filter"
// Max number of batches that can be pending on a call at any given
// time. This includes one batch for each of the following ops:
// recv_initial_metadata
@ -112,7 +109,9 @@ class ClientChannelFilter final {
// Flag that this object gets stored in channel args as a raw pointer.
struct RawPointerChannelArgTag {};
static absl::string_view ChannelArgName() { return GRPC_ARG_CLIENT_CHANNEL; }
static absl::string_view ChannelArgName() {
return "grpc.internal.client_channel_filter";
}
static ArenaPromise<ServerMetadataHandle> MakeCallPromise(
grpc_channel_element* elem, CallArgs call_args,
@ -166,12 +165,6 @@ class ClientChannelFilter final {
CallArgs call_args, absl::AnyInvocable<void()> on_commit,
bool is_transparent_retry);
// Exposed for testing only.
static ChannelArgs MakeSubchannelArgs(
const ChannelArgs& channel_args, const ChannelArgs& address_args,
const RefCountedPtr<SubchannelPoolInterface>& subchannel_pool,
const std::string& channel_default_authority);
private:
class CallData;
class FilterBasedCallData;

@ -29,6 +29,7 @@
#include "src/core/lib/channel/context.h"
#include "src/core/lib/gprpp/unique_type_name.h"
#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/transport/call_destination.h"
#include "src/core/load_balancing/lb_policy.h"
#include "src/core/service_config/service_config_call_data.h"
#include "src/core/telemetry/call_tracer.h"
@ -75,6 +76,13 @@ class ClientChannelServiceConfigCallData final : public ServiceConfigCallData {
absl::AnyInvocable<void()> on_commit_;
};
class SubchannelInterfaceWithCallDestination : public SubchannelInterface {
public:
using SubchannelInterface::SubchannelInterface;
// Obtain the call destination for this subchannel.
virtual RefCountedPtr<UnstartedCallDestination> call_destination() = 0;
};
} // namespace grpc_core
#endif // GRPC_SRC_CORE_CLIENT_CHANNEL_CLIENT_CHANNEL_INTERNAL_H

@ -0,0 +1,335 @@
// 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 "src/core/client_channel/load_balanced_call_destination.h"
#include "src/core/client_channel/client_channel.h"
#include "src/core/client_channel/client_channel_internal.h"
#include "src/core/client_channel/subchannel.h"
#include "src/core/lib/channel/status_util.h"
#include "src/core/lib/promise/loop.h"
#include "src/core/telemetry/call_tracer.h"
namespace grpc_core {
// Defined in legacy client channel filter.
// TODO(roth): Move these here when we remove the legacy filter.
extern TraceFlag grpc_client_channel_trace;
extern TraceFlag grpc_client_channel_call_trace;
extern TraceFlag grpc_client_channel_lb_call_trace;
namespace {
class LbMetadata : public LoadBalancingPolicy::MetadataInterface {
public:
explicit LbMetadata(grpc_metadata_batch* batch) : batch_(batch) {}
void Add(absl::string_view key, absl::string_view value) override {
if (batch_ == nullptr) return;
// Gross, egregious hack to support legacy grpclb behavior.
// TODO(ctiller): Use a promise context for this once that plumbing is done.
if (key == GrpcLbClientStatsMetadata::key()) {
batch_->Set(
GrpcLbClientStatsMetadata(),
const_cast<GrpcLbClientStats*>(
reinterpret_cast<const GrpcLbClientStats*>(value.data())));
return;
}
batch_->Append(key, Slice::FromStaticString(value),
[key](absl::string_view error, const Slice& value) {
gpr_log(GPR_ERROR, "%s",
absl::StrCat(error, " key:", key,
" value:", value.as_string_view())
.c_str());
});
}
std::vector<std::pair<std::string, std::string>> TestOnlyCopyToVector()
override {
if (batch_ == nullptr) return {};
Encoder encoder;
batch_->Encode(&encoder);
return encoder.Take();
}
absl::optional<absl::string_view> Lookup(absl::string_view key,
std::string* buffer) const override {
if (batch_ == nullptr) return absl::nullopt;
return batch_->GetStringValue(key, buffer);
}
private:
class Encoder {
public:
void Encode(const Slice& key, const Slice& value) {
out_.emplace_back(std::string(key.as_string_view()),
std::string(value.as_string_view()));
}
template <class Which>
void Encode(Which, const typename Which::ValueType& value) {
auto value_slice = Which::Encode(value);
out_.emplace_back(std::string(Which::key()),
std::string(value_slice.as_string_view()));
}
void Encode(GrpcTimeoutMetadata,
const typename GrpcTimeoutMetadata::ValueType&) {}
void Encode(HttpPathMetadata, const Slice&) {}
void Encode(HttpMethodMetadata,
const typename HttpMethodMetadata::ValueType&) {}
std::vector<std::pair<std::string, std::string>> Take() {
return std::move(out_);
}
private:
std::vector<std::pair<std::string, std::string>> out_;
};
grpc_metadata_batch* batch_;
};
void MaybeCreateCallAttemptTracer(bool is_transparent_retry) {
auto* call_tracer = MaybeGetContext<ClientCallTracer>();
if (call_tracer == nullptr) return;
auto* tracer = call_tracer->StartNewAttempt(is_transparent_retry);
SetContext<CallTracerInterface>(tracer);
}
class LbCallState : public ClientChannelLbCallState {
public:
void* Alloc(size_t size) override { return GetContext<Arena>()->Alloc(size); }
// Internal API to allow first-party LB policies to access per-call
// attributes set by the ConfigSelector.
ServiceConfigCallData::CallAttributeInterface* GetCallAttribute(
UniqueTypeName type) const override {
auto* service_config_call_data = GetContext<ServiceConfigCallData>();
return service_config_call_data->GetCallAttribute(type);
}
ClientCallTracer::CallAttemptTracer* GetCallAttemptTracer() const override {
auto* legacy_context = GetContext<grpc_call_context_element>();
return static_cast<ClientCallTracer::CallAttemptTracer*>(
legacy_context[GRPC_CONTEXT_CALL_TRACER].value);
}
};
// TODO(roth): Remove this in favor of the gprpp Match() function once
// we can do that without breaking lock annotations.
template <typename T>
T HandlePickResult(
LoadBalancingPolicy::PickResult* result,
std::function<T(LoadBalancingPolicy::PickResult::Complete*)> complete_func,
std::function<T(LoadBalancingPolicy::PickResult::Queue*)> queue_func,
std::function<T(LoadBalancingPolicy::PickResult::Fail*)> fail_func,
std::function<T(LoadBalancingPolicy::PickResult::Drop*)> drop_func) {
auto* complete_pick =
absl::get_if<LoadBalancingPolicy::PickResult::Complete>(&result->result);
if (complete_pick != nullptr) {
return complete_func(complete_pick);
}
auto* queue_pick =
absl::get_if<LoadBalancingPolicy::PickResult::Queue>(&result->result);
if (queue_pick != nullptr) {
return queue_func(queue_pick);
}
auto* fail_pick =
absl::get_if<LoadBalancingPolicy::PickResult::Fail>(&result->result);
if (fail_pick != nullptr) {
return fail_func(fail_pick);
}
auto* drop_pick =
absl::get_if<LoadBalancingPolicy::PickResult::Drop>(&result->result);
CHECK(drop_pick != nullptr);
return drop_func(drop_pick);
}
// Does an LB pick for a call. Returns one of the following things:
// - Continue{}, meaning to queue the pick
// - a non-OK status, meaning to fail the call
// - a call destination, meaning that the pick is complete
// When the pick is complete, pushes client_initial_metadata onto
// call_initiator. Also adds the subchannel call tracker (if any) to
// context.
LoopCtl<absl::StatusOr<RefCountedPtr<UnstartedCallDestination>>> PickSubchannel(
LoadBalancingPolicy::SubchannelPicker& picker,
UnstartedCallHandler& unstarted_handler) {
// Perform LB pick.
auto& client_initial_metadata =
unstarted_handler.UnprocessedClientInitialMetadata();
LoadBalancingPolicy::PickArgs pick_args;
Slice* path = client_initial_metadata.get_pointer(HttpPathMetadata());
CHECK(path != nullptr);
pick_args.path = path->as_string_view();
LbCallState lb_call_state;
pick_args.call_state = &lb_call_state;
LbMetadata initial_metadata(&client_initial_metadata);
pick_args.initial_metadata = &initial_metadata;
auto result = picker.Pick(pick_args);
// Handle result.
return HandlePickResult<
LoopCtl<absl::StatusOr<RefCountedPtr<UnstartedCallDestination>>>>(
&result,
// CompletePick
[&](LoadBalancingPolicy::PickResult::Complete* complete_pick)
-> LoopCtl<absl::StatusOr<RefCountedPtr<UnstartedCallDestination>>> {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
gpr_log(GPR_INFO,
"client_channel: %sLB pick succeeded: subchannel=%p",
GetContext<Activity>()->DebugTag().c_str(),
complete_pick->subchannel.get());
}
CHECK(complete_pick->subchannel != nullptr);
// Grab a ref to the call destination while we're still
// holding the data plane mutex.
auto call_destination =
DownCast<SubchannelInterfaceWithCallDestination*>(
complete_pick->subchannel.get())
->call_destination();
// If the subchannel has no call destination (e.g., if the
// subchannel has moved out of state READY but the LB policy hasn't
// yet seen that change and given us a new picker), then just
// queue the pick. We'll try again as soon as we get a new picker.
if (call_destination == nullptr) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
gpr_log(GPR_INFO,
"client_channel: %ssubchannel returned by LB picker "
"has no connected subchannel; queueing pick",
GetContext<Activity>()->DebugTag().c_str());
}
return Continue{};
}
// If the LB policy returned a call tracker, inform it that the
// call is starting and add it to context, so that we can notify
// it when the call finishes.
if (complete_pick->subchannel_call_tracker != nullptr) {
complete_pick->subchannel_call_tracker->Start();
SetContext(complete_pick->subchannel_call_tracker.release());
}
// Return the connected subchannel.
return call_destination;
},
// QueuePick
[&](LoadBalancingPolicy::PickResult::Queue* /*queue_pick*/) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
gpr_log(GPR_INFO, "client_channel: %sLB pick queued",
GetContext<Activity>()->DebugTag().c_str());
}
return Continue{};
},
// FailPick
[&](LoadBalancingPolicy::PickResult::Fail* fail_pick)
-> LoopCtl<absl::StatusOr<RefCountedPtr<UnstartedCallDestination>>> {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
gpr_log(GPR_INFO, "client_channel: %sLB pick failed: %s",
GetContext<Activity>()->DebugTag().c_str(),
fail_pick->status.ToString().c_str());
}
// If wait_for_ready is false, then the error indicates the RPC
// attempt's final status.
if (!unstarted_handler.UnprocessedClientInitialMetadata()
.GetOrCreatePointer(WaitForReady())
->value) {
return MaybeRewriteIllegalStatusCode(std::move(fail_pick->status),
"LB pick");
}
// If wait_for_ready is true, then queue to retry when we get a new
// picker.
return Continue{};
},
// DropPick
[&](LoadBalancingPolicy::PickResult::Drop* drop_pick)
-> LoopCtl<absl::StatusOr<RefCountedPtr<UnstartedCallDestination>>> {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
gpr_log(GPR_INFO, "client_channel: %sLB pick dropped: %s",
GetContext<Activity>()->DebugTag().c_str(),
drop_pick->status.ToString().c_str());
}
return grpc_error_set_int(MaybeRewriteIllegalStatusCode(
std::move(drop_pick->status), "LB drop"),
StatusIntProperty::kLbPolicyDrop, 1);
});
}
} // namespace
void LoadBalancedCallDestination::StartCall(
UnstartedCallHandler unstarted_handler) {
// If there is a call tracer, create a call attempt tracer.
bool* is_transparent_retry_metadata =
unstarted_handler.UnprocessedClientInitialMetadata().get_pointer(
IsTransparentRetry());
bool is_transparent_retry = is_transparent_retry_metadata != nullptr
? *is_transparent_retry_metadata
: false;
MaybeCreateCallAttemptTracer(is_transparent_retry);
// Spawn a promise to do the LB pick.
// This will eventually start the call.
unstarted_handler.SpawnGuardedUntilCallCompletes(
"lb_pick", [unstarted_handler, picker = picker_]() mutable {
return Map(
// Wait for the LB picker.
CheckDelayed(Loop(
[last_picker =
RefCountedPtr<LoadBalancingPolicy::SubchannelPicker>(),
unstarted_handler, picker]() mutable {
return Map(
picker.Next(last_picker),
[unstarted_handler, &last_picker](
RefCountedPtr<LoadBalancingPolicy::SubchannelPicker>
picker) mutable {
last_picker = std::move(picker);
// Returns 3 possible things:
// - Continue to queue the pick
// - non-OK status to fail the pick
// - a connected subchannel to complete the pick
return PickSubchannel(*last_picker, unstarted_handler);
});
})),
// Create call stack on the connected subchannel.
[unstarted_handler](
std::tuple<
absl::StatusOr<RefCountedPtr<UnstartedCallDestination>>,
bool>
pick_result) {
auto& call_destination = std::get<0>(pick_result);
const bool was_queued = std::get<1>(pick_result);
if (!call_destination.ok()) {
return call_destination.status();
}
// LB pick is done, so indicate that we've committed.
auto* on_commit = MaybeGetContext<LbOnCommit>();
if (on_commit != nullptr && *on_commit != nullptr) {
(*on_commit)();
}
// If it was queued, add a trace annotation.
if (was_queued) {
auto* tracer =
MaybeGetContext<ClientCallTracer::CallAttemptTracer>();
if (tracer != nullptr) {
tracer->RecordAnnotation("Delayed LB pick complete.");
}
}
// Delegate to connected subchannel.
// TODO(ctiller): need to insert LbCallTracingFilter at the top of
// the stack
(*call_destination)->StartCall(unstarted_handler);
return absl::OkStatus();
});
});
}
} // namespace grpc_core

@ -0,0 +1,49 @@
// 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_CLIENT_CHANNEL_LOAD_BALANCED_CALL_DESTINATION_H
#define GRPC_SRC_CORE_CLIENT_CHANNEL_LOAD_BALANCED_CALL_DESTINATION_H
#include "absl/functional/any_invocable.h"
#include "src/core/client_channel/client_channel.h"
#include "src/core/lib/promise/context.h"
#include "src/core/lib/transport/call_destination.h"
#include "src/core/load_balancing/lb_policy.h"
namespace grpc_core {
// Context type for LB on_commit callback.
// TODO(ctiller): make this a struct, so we don't accidentally alias context
// types
using LbOnCommit = absl::AnyInvocable<void()>;
template <>
struct ContextType<LbOnCommit> {};
class LoadBalancedCallDestination final : public UnstartedCallDestination {
public:
explicit LoadBalancedCallDestination(ClientChannel::PickerObservable picker)
: picker_(std::move(picker)) {}
void Orphaned() override {}
void StartCall(UnstartedCallHandler unstarted_handler) override;
private:
ClientChannel::PickerObservable picker_;
};
} // namespace grpc_core
#endif // GRPC_SRC_CORE_CLIENT_CHANNEL_LOAD_BALANCED_CALL_DESTINATION_H

@ -41,6 +41,7 @@
#include "src/core/channelz/channel_trace.h"
#include "src/core/channelz/channelz.h"
#include "src/core/client_channel/client_channel_internal.h"
#include "src/core/client_channel/subchannel_pool_interface.h"
#include "src/core/handshaker/proxy_mapper_registry.h"
#include "src/core/lib/address_utils/sockaddr_utils.h"
@ -50,7 +51,10 @@
#include "src/core/lib/channel/channel_stack_builder_impl.h"
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/experiments/experiments.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/gprpp/sync.h"
@ -64,6 +68,7 @@
#include "src/core/lib/surface/init_internally.h"
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/error_utils.h"
#include "src/core/lib/transport/interception_chain.h"
#include "src/core/lib/transport/transport.h"
#include "src/core/telemetry/stats.h"
#include "src/core/telemetry/stats_data.h"
@ -97,75 +102,168 @@ DebugOnlyTraceFlag grpc_trace_subchannel_refcount(false, "subchannel_refcount");
//
ConnectedSubchannel::ConnectedSubchannel(
grpc_channel_stack* channel_stack, const ChannelArgs& args,
const ChannelArgs& args,
RefCountedPtr<channelz::SubchannelNode> channelz_subchannel)
: RefCounted<ConnectedSubchannel>(
GRPC_TRACE_FLAG_ENABLED(grpc_trace_subchannel_refcount)
? "ConnectedSubchannel"
: nullptr),
channel_stack_(channel_stack),
args_(args),
channelz_subchannel_(std::move(channelz_subchannel)) {}
ConnectedSubchannel::~ConnectedSubchannel() {
GRPC_CHANNEL_STACK_UNREF(channel_stack_, "connected_subchannel_dtor");
}
void ConnectedSubchannel::StartWatch(
grpc_pollset_set* interested_parties,
OrphanablePtr<ConnectivityStateWatcherInterface> watcher) {
grpc_transport_op* op = grpc_make_transport_op(nullptr);
op->start_connectivity_watch = std::move(watcher);
op->start_connectivity_watch_state = GRPC_CHANNEL_READY;
op->bind_pollset_set = interested_parties;
grpc_channel_element* elem = grpc_channel_stack_element(channel_stack_, 0);
elem->filter->start_transport_op(elem, op);
}
void ConnectedSubchannel::Ping(grpc_closure* on_initiate,
grpc_closure* on_ack) {
grpc_transport_op* op = grpc_make_transport_op(nullptr);
grpc_channel_element* elem;
op->send_ping.on_initiate = on_initiate;
op->send_ping.on_ack = on_ack;
elem = grpc_channel_stack_element(channel_stack_, 0);
elem->filter->start_transport_op(elem, op);
}
size_t ConnectedSubchannel::GetInitialCallSizeEstimate() const {
return GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(SubchannelCall)) +
channel_stack_->call_stack_size;
}
ArenaPromise<ServerMetadataHandle> ConnectedSubchannel::MakeCallPromise(
CallArgs call_args) {
// If not using channelz, we just need to call the channel stack.
if (channelz_subchannel() == nullptr) {
return channel_stack_->MakeClientCallPromise(std::move(call_args));
}
// Otherwise, we need to wrap the channel stack promise with code that
// handles the channelz updates.
return OnCancel(
Seq(channel_stack_->MakeClientCallPromise(std::move(call_args)),
[self = Ref()](ServerMetadataHandle metadata) {
channelz::SubchannelNode* channelz_subchannel =
self->channelz_subchannel();
CHECK_NE(channelz_subchannel, nullptr);
if (metadata->get(GrpcStatusMetadata())
.value_or(GRPC_STATUS_UNKNOWN) != GRPC_STATUS_OK) {
channelz_subchannel->RecordCallFailed();
} else {
channelz_subchannel->RecordCallSucceeded();
}
return metadata;
}),
[self = Ref()]() {
channelz::SubchannelNode* channelz_subchannel =
self->channelz_subchannel();
CHECK_NE(channelz_subchannel, nullptr);
channelz_subchannel->RecordCallFailed();
});
}
//
// LegacyConnectedSubchannel
//
class LegacyConnectedSubchannel : public ConnectedSubchannel {
public:
LegacyConnectedSubchannel(
RefCountedPtr<grpc_channel_stack> channel_stack, const ChannelArgs& args,
RefCountedPtr<channelz::SubchannelNode> channelz_subchannel)
: ConnectedSubchannel(args, std::move(channelz_subchannel)),
channel_stack_(std::move(channel_stack)) {}
~LegacyConnectedSubchannel() override {
channel_stack_.reset(DEBUG_LOCATION, "ConnectedSubchannel");
}
void StartWatch(
grpc_pollset_set* interested_parties,
OrphanablePtr<ConnectivityStateWatcherInterface> watcher) override {
grpc_transport_op* op = grpc_make_transport_op(nullptr);
op->start_connectivity_watch = std::move(watcher);
op->start_connectivity_watch_state = GRPC_CHANNEL_READY;
op->bind_pollset_set = interested_parties;
grpc_channel_element* elem =
grpc_channel_stack_element(channel_stack_.get(), 0);
elem->filter->start_transport_op(elem, op);
}
void Ping(absl::AnyInvocable<void(absl::Status)>) override {
Crash("call v3 ping method called in legacy impl");
}
RefCountedPtr<UnstartedCallDestination> unstarted_call_destination()
const override {
Crash("call v3 unstarted_call_destination method called in legacy impl");
}
grpc_channel_stack* channel_stack() const override {
return channel_stack_.get();
}
size_t GetInitialCallSizeEstimate() const override {
return GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(SubchannelCall)) +
channel_stack_->call_stack_size;
}
ArenaPromise<ServerMetadataHandle> MakeCallPromise(
CallArgs call_args) override {
// If not using channelz, we just need to call the channel stack.
if (channelz_subchannel() == nullptr) {
return channel_stack_->MakeClientCallPromise(std::move(call_args));
}
// Otherwise, we need to wrap the channel stack promise with code that
// handles the channelz updates.
return OnCancel(
Seq(channel_stack_->MakeClientCallPromise(std::move(call_args)),
[self = Ref()](ServerMetadataHandle metadata) {
channelz::SubchannelNode* channelz_subchannel =
self->channelz_subchannel();
CHECK(channelz_subchannel != nullptr);
if (metadata->get(GrpcStatusMetadata())
.value_or(GRPC_STATUS_UNKNOWN) != GRPC_STATUS_OK) {
channelz_subchannel->RecordCallFailed();
} else {
channelz_subchannel->RecordCallSucceeded();
}
return metadata;
}),
[self = Ref()]() {
channelz::SubchannelNode* channelz_subchannel =
self->channelz_subchannel();
CHECK(channelz_subchannel != nullptr);
channelz_subchannel->RecordCallFailed();
});
}
void Ping(grpc_closure* on_initiate, grpc_closure* on_ack) override {
grpc_transport_op* op = grpc_make_transport_op(nullptr);
op->send_ping.on_initiate = on_initiate;
op->send_ping.on_ack = on_ack;
grpc_channel_element* elem =
grpc_channel_stack_element(channel_stack_.get(), 0);
elem->filter->start_transport_op(elem, op);
}
private:
RefCountedPtr<grpc_channel_stack> channel_stack_;
};
//
// NewConnectedSubchannel
//
class NewConnectedSubchannel : public ConnectedSubchannel {
public:
class TransportCallDestination final : public CallDestination {
public:
explicit TransportCallDestination(OrphanablePtr<ClientTransport> transport)
: transport_(std::move(transport)) {}
ClientTransport* transport() { return transport_.get(); }
void HandleCall(CallHandler handler) override {
transport_->StartCall(std::move(handler));
}
void Orphaned() override { transport_.reset(); }
private:
OrphanablePtr<ClientTransport> transport_;
};
NewConnectedSubchannel(
RefCountedPtr<UnstartedCallDestination> call_destination,
RefCountedPtr<TransportCallDestination> transport,
const ChannelArgs& args,
RefCountedPtr<channelz::SubchannelNode> channelz_subchannel)
: ConnectedSubchannel(args, std::move(channelz_subchannel)),
call_destination_(std::move(call_destination)),
transport_(std::move(transport)) {}
void StartWatch(
grpc_pollset_set*,
OrphanablePtr<ConnectivityStateWatcherInterface> watcher) override {
transport_->transport()->StartConnectivityWatch(std::move(watcher));
}
void Ping(absl::AnyInvocable<void(absl::Status)>) override {
// TODO(ctiller): add new transport API for this in v3 stack
Crash("not implemented");
}
RefCountedPtr<UnstartedCallDestination> unstarted_call_destination()
const override {
return call_destination_;
}
grpc_channel_stack* channel_stack() const override { return nullptr; }
size_t GetInitialCallSizeEstimate() const override { return 0; }
ArenaPromise<ServerMetadataHandle> MakeCallPromise(CallArgs) override {
Crash("legacy MakeCallPromise() method called in call v3 impl");
}
void Ping(grpc_closure*, grpc_closure*) override {
Crash("legacy ping method called in call v3 impl");
}
private:
RefCountedPtr<UnstartedCallDestination> call_destination_;
RefCountedPtr<TransportCallDestination> transport_;
};
//
// SubchannelCall
@ -255,8 +353,8 @@ void SubchannelCall::Destroy(void* arg, grpc_error_handle /*error*/) {
// Destroy the subchannel call.
self->~SubchannelCall();
// Destroy the call stack. This should be after destroying the subchannel
// call, because call->after_call_stack_destroy(), if not null, will free the
// call arena.
// call, because call->after_call_stack_destroy(), if not null, will free
// the call arena.
grpc_call_stack_destroy(SUBCHANNEL_CALL_TO_CALL_STACK(self), nullptr,
after_call_stack_destroy);
// Automatically reset connected_subchannel. This should be after destroying
@ -474,8 +572,8 @@ Subchannel::Subchannel(SubchannelKey key,
// result the subchannel destruction happens asynchronously to channel
// destruction. If the last channel destruction triggers a grpc_shutdown
// before the last subchannel destruction, then there maybe race conditions
// triggering segmentation faults. To prevent this issue, we call a grpc_init
// here and a grpc_shutdown in the subchannel destructor.
// triggering segmentation faults. To prevent this issue, we call a
// grpc_init here and a grpc_shutdown in the subchannel destructor.
InitInternally();
global_stats().IncrementClientSubchannelsCreated();
GRPC_CLOSURE_INIT(&on_connecting_finished_, OnConnectingFinished, this,
@ -587,7 +685,8 @@ void Subchannel::CancelConnectivityStateWatch(
watcher_list_.RemoveWatcherLocked(watcher);
}
// Drain any connectivity state notifications after releasing the mutex.
// (Shouldn't actually be necessary in this case, but better safe than sorry.)
// (Shouldn't actually be necessary in this case, but better safe than
// sorry.)
work_serializer_.DrainQueue();
}
@ -758,11 +857,11 @@ void Subchannel::OnConnectingFinishedLocked(grpc_error_handle error) {
ExecCtx exec_ctx;
self->OnRetryTimer();
// Subchannel deletion might require an active ExecCtx. So if
// self.reset() is not called here, the WeakRefCountedPtr destructor
// may run after the ExecCtx declared in the callback is destroyed.
// Since subchannel may get destroyed when the WeakRefCountedPtr
// destructor runs, it may not have an active ExecCtx - thus leading
// to crashes.
// self.reset() is not called here, the WeakRefCountedPtr
// destructor may run after the ExecCtx declared in the callback
// is destroyed. Since subchannel may get destroyed when the
// WeakRefCountedPtr destructor runs, it may not have an active
// ExecCtx - thus leading to crashes.
self.reset();
}
});
@ -770,37 +869,60 @@ void Subchannel::OnConnectingFinishedLocked(grpc_error_handle error) {
}
bool Subchannel::PublishTransportLocked() {
// Construct channel stack.
// Builder takes ownership of transport.
ChannelStackBuilderImpl builder(
"subchannel", GRPC_CLIENT_SUBCHANNEL,
connecting_result_.channel_args.SetObject(
std::exchange(connecting_result_.transport, nullptr)));
if (!CoreConfiguration::Get().channel_init().CreateStack(&builder)) {
return false;
}
absl::StatusOr<RefCountedPtr<grpc_channel_stack>> stk = builder.Build();
if (!stk.ok()) {
auto error = absl_status_to_grpc_error(stk.status());
connecting_result_.Reset();
gpr_log(GPR_ERROR,
"subchannel %p %s: error initializing subchannel stack: %s", this,
key_.ToString().c_str(), StatusToString(error).c_str());
return false;
auto socket_node = std::move(connecting_result_.socket_node);
if (connecting_result_.transport->filter_stack_transport() != nullptr ||
IsChaoticGoodEnabled()) {
// Construct channel stack.
// Builder takes ownership of transport.
ChannelStackBuilderImpl builder(
"subchannel", GRPC_CLIENT_SUBCHANNEL,
connecting_result_.channel_args.SetObject(
std::exchange(connecting_result_.transport, nullptr)));
if (!CoreConfiguration::Get().channel_init().CreateStack(&builder)) {
return false;
}
absl::StatusOr<RefCountedPtr<grpc_channel_stack>> stack = builder.Build();
if (!stack.ok()) {
connecting_result_.Reset();
gpr_log(GPR_ERROR,
"subchannel %p %s: error initializing subchannel stack: %s", this,
key_.ToString().c_str(), stack.status().ToString().c_str());
return false;
}
connected_subchannel_ = MakeRefCounted<LegacyConnectedSubchannel>(
std::move(*stack), args_, channelz_node_);
} else {
OrphanablePtr<ClientTransport> transport(
std::exchange(connecting_result_.transport, nullptr)
->client_transport());
InterceptionChainBuilder builder(
connecting_result_.channel_args.SetObject(transport.get()));
CoreConfiguration::Get().channel_init().AddToInterceptionChainBuilder(
GRPC_CLIENT_SUBCHANNEL, builder);
auto transport_destination =
MakeRefCounted<NewConnectedSubchannel::TransportCallDestination>(
std::move(transport));
auto call_destination = builder.Build(transport_destination);
if (!call_destination.ok()) {
connecting_result_.Reset();
gpr_log(GPR_ERROR,
"subchannel %p %s: error initializing subchannel stack: %s", this,
key_.ToString().c_str(),
call_destination.status().ToString().c_str());
return false;
}
connected_subchannel_ = MakeRefCounted<NewConnectedSubchannel>(
std::move(*call_destination), std::move(transport_destination), args_,
channelz_node_);
}
RefCountedPtr<channelz::SocketNode> socket =
std::move(connecting_result_.socket_node);
connecting_result_.Reset();
if (shutdown_) return false;
// Publish.
connected_subchannel_.reset(
new ConnectedSubchannel(stk->release(), args_, channelz_node_));
if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_subchannel)) {
gpr_log(GPR_INFO, "subchannel %p %s: new connected subchannel at %p", this,
key_.ToString().c_str(), connected_subchannel_.get());
}
if (channelz_node_ != nullptr) {
channelz_node_->SetChildSocket(std::move(socket));
channelz_node_->SetChildSocket(std::move(socket_node));
}
// Start watching connected subchannel.
connected_subchannel_->StartWatch(
@ -811,4 +933,29 @@ bool Subchannel::PublishTransportLocked() {
return true;
}
ChannelArgs Subchannel::MakeSubchannelArgs(
const ChannelArgs& channel_args, const ChannelArgs& address_args,
const RefCountedPtr<SubchannelPoolInterface>& subchannel_pool,
const std::string& channel_default_authority) {
// Note that we start with the channel-level args and then apply the
// per-address args, so that if a value is present in both, the one
// in the channel-level args is used. This is particularly important
// for the GRPC_ARG_DEFAULT_AUTHORITY arg, which we want to allow
// resolvers to set on a per-address basis only if the application
// did not explicitly set it at the channel level.
return channel_args.UnionWith(address_args)
.SetObject(subchannel_pool)
// If we haven't already set the default authority arg (i.e., it
// was not explicitly set by the application nor overridden by
// the resolver), add it from the channel's default.
.SetIfUnset(GRPC_ARG_DEFAULT_AUTHORITY, channel_default_authority)
// Remove channel args that should not affect subchannel
// uniqueness.
.Remove(GRPC_ARG_HEALTH_CHECK_SERVICE_NAME)
.Remove(GRPC_ARG_INHIBIT_HEALTH_CHECKING)
.Remove(GRPC_ARG_CHANNELZ_CHANNEL_NODE)
// Remove all keys with the no-subchannel prefix.
.RemoveAllKeysWithPrefix(GRPC_ARG_NO_SUBCHANNEL_PREFIX);
}
} // namespace grpc_core

@ -64,30 +64,35 @@ namespace grpc_core {
class SubchannelCall;
class ConnectedSubchannel final : public RefCounted<ConnectedSubchannel> {
class ConnectedSubchannel : public RefCounted<ConnectedSubchannel> {
public:
ConnectedSubchannel(
grpc_channel_stack* channel_stack, const ChannelArgs& args,
RefCountedPtr<channelz::SubchannelNode> channelz_subchannel);
~ConnectedSubchannel() override;
void StartWatch(grpc_pollset_set* interested_parties,
OrphanablePtr<ConnectivityStateWatcherInterface> watcher);
void Ping(grpc_closure* on_initiate, grpc_closure* on_ack);
grpc_channel_stack* channel_stack() const { return channel_stack_; }
const ChannelArgs& args() const { return args_; }
channelz::SubchannelNode* channelz_subchannel() const {
return channelz_subchannel_.get();
}
size_t GetInitialCallSizeEstimate() const;
virtual void StartWatch(
grpc_pollset_set* interested_parties,
OrphanablePtr<ConnectivityStateWatcherInterface> watcher) = 0;
// Methods for v3 stack.
virtual void Ping(absl::AnyInvocable<void(absl::Status)> on_ack) = 0;
virtual RefCountedPtr<UnstartedCallDestination> unstarted_call_destination()
const = 0;
ArenaPromise<ServerMetadataHandle> MakeCallPromise(CallArgs call_args);
// Methods for legacy stack.
virtual grpc_channel_stack* channel_stack() const = 0;
virtual size_t GetInitialCallSizeEstimate() const = 0;
virtual ArenaPromise<ServerMetadataHandle> MakeCallPromise(
CallArgs call_args) = 0;
virtual void Ping(grpc_closure* on_initiate, grpc_closure* on_ack) = 0;
protected:
ConnectedSubchannel(
const ChannelArgs& args,
RefCountedPtr<channelz::SubchannelNode> channelz_subchannel);
private:
grpc_channel_stack* channel_stack_;
ChannelArgs args_;
// ref counted pointer to the channelz node in this connected subchannel's
// owning subchannel.
@ -243,6 +248,12 @@ class Subchannel final : public DualRefCounted<Subchannel> {
return connected_subchannel_;
}
RefCountedPtr<UnstartedCallDestination> call_destination() {
MutexLock lock(&mu_);
if (connected_subchannel_ == nullptr) return nullptr;
return connected_subchannel_->unstarted_call_destination();
}
// Attempt to connect to the backend. Has no effect if already connected.
void RequestConnection() ABSL_LOCKS_EXCLUDED(mu_);
@ -272,6 +283,12 @@ class Subchannel final : public DualRefCounted<Subchannel> {
return event_engine_;
}
// Exposed for testing purposes only.
static ChannelArgs MakeSubchannelArgs(
const ChannelArgs& channel_args, const ChannelArgs& address_args,
const RefCountedPtr<SubchannelPoolInterface>& subchannel_pool,
const std::string& channel_default_authority);
private:
// Tears down any existing connection, and arranges for destruction
void Orphaned() override ABSL_LOCKS_EXCLUDED(mu_);

@ -59,12 +59,13 @@ SubchannelStreamClient::SubchannelStreamClient(
connected_subchannel_(std::move(connected_subchannel)),
interested_parties_(interested_parties),
tracer_(tracer),
call_allocator_(
call_allocator_(MakeRefCounted<CallArenaAllocator>(
connected_subchannel_->args()
.GetObject<ResourceQuota>()
->memory_quota()
->CreateMemoryAllocator(
(tracer != nullptr) ? tracer : "SubchannelStreamClient")),
(tracer != nullptr) ? tracer : "SubchannelStreamClient"),
1024)),
event_handler_(std::move(event_handler)),
retry_backoff_(
BackOff::Options()
@ -171,9 +172,7 @@ SubchannelStreamClient::CallState::CallState(
grpc_pollset_set* interested_parties)
: subchannel_stream_client_(std::move(health_check_client)),
pollent_(grpc_polling_entity_create_from_pollset_set(interested_parties)),
arena_(Arena::Create(subchannel_stream_client_->connected_subchannel_
->GetInitialCallSizeEstimate(),
&subchannel_stream_client_->call_allocator_)),
arena_(subchannel_stream_client_->call_allocator_->MakeArena()),
payload_(context_) {}
SubchannelStreamClient::CallState::~CallState() {

@ -146,7 +146,7 @@ class SubchannelStreamClient final
RefCountedPtr<SubchannelStreamClient> subchannel_stream_client_;
grpc_polling_entity pollent_;
ScopedArenaPtr arena_;
RefCountedPtr<Arena> arena_;
CallCombiner call_combiner_;
grpc_call_context_element context_[GRPC_CONTEXT_COUNT] = {};
@ -201,7 +201,7 @@ class SubchannelStreamClient final
RefCountedPtr<ConnectedSubchannel> connected_subchannel_;
grpc_pollset_set* interested_parties_; // Do not own.
const char* tracer_;
MemoryAllocator call_allocator_;
RefCountedPtr<CallArenaAllocator> call_allocator_;
Mutex mu_;
std::unique_ptr<CallEventHandler> event_handler_ ABSL_GUARDED_BY(mu_);

@ -78,15 +78,11 @@ TraceFlag grpc_trace_client_idle_filter(false, "client_idle_filter");
} \
} while (0)
namespace {
Duration GetClientIdleTimeout(const ChannelArgs& args) {
return args.GetDurationFromIntMillis(GRPC_ARG_CLIENT_IDLE_TIMEOUT_MS)
.value_or(kDefaultIdleTimeout);
}
} // namespace
struct LegacyMaxAgeFilter::Config {
Duration max_connection_age;
Duration max_connection_idle;

@ -40,6 +40,8 @@
namespace grpc_core {
Duration GetClientIdleTimeout(const ChannelArgs& args);
class LegacyChannelIdleFilter : public ChannelFilter {
public:
LegacyChannelIdleFilter(grpc_channel_stack* channel_stack,

@ -26,11 +26,11 @@
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/http/httpcli.h"
#include "src/core/lib/http/parser.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/util/http_client/httpcli.h"
#include "src/core/util/http_client/parser.h"
namespace grpc_core {

@ -333,7 +333,7 @@ void ChaoticGoodConnector::OnHandshakeDone(void* arg, grpc_error_handle error) {
status);
}
},
self->arena_.get(), self->event_engine_.get());
self->arena_, self->event_engine_.get());
MutexLock lock(&self->mu_);
if (!self->is_shutdown_) {
self->connect_activity_ = std::move(activity);

@ -79,10 +79,7 @@ class ChaoticGoodConnector : public SubchannelConnector {
RefCountedPtr<ChaoticGoodConnector> self);
static void OnHandshakeDone(void* arg, grpc_error_handle error);
grpc_event_engine::experimental::MemoryAllocator memory_allocator_ =
ResourceQuota::Default()->memory_quota()->CreateMemoryAllocator(
"connect_activity");
ScopedArenaPtr arena_ = MakeScopedArena(1024, &memory_allocator_);
RefCountedPtr<Arena> arena_ = SimpleArenaAllocator()->MakeArena();
Mutex mu_;
Args args_;
Result* result_ ABSL_GUARDED_BY(mu_);

@ -146,10 +146,9 @@ auto ChaoticGoodClientTransport::TransportReadLoop(
frame_limits);
} else {
// Stream not found, skip the frame.
auto arena = MakeScopedArena(1024, &allocator_);
deserialize_status =
transport->DeserializeFrame(frame_header, std::move(buffers),
arena.get(), frame, frame_limits);
deserialize_status = transport->DeserializeFrame(
frame_header, std::move(buffers),
SimpleArenaAllocator()->MakeArena().get(), frame, frame_limits);
}
return If(
deserialize_status.ok() && call_handler.has_value(),

@ -149,8 +149,7 @@ absl::Status ChaoticGoodServerListener::StartListening() {
ChaoticGoodServerListener::ActiveConnection::ActiveConnection(
RefCountedPtr<ChaoticGoodServerListener> listener,
std::unique_ptr<EventEngine::Endpoint> endpoint)
: memory_allocator_(listener->memory_allocator_),
listener_(std::move(listener)) {
: listener_(std::move(listener)) {
handshaking_state_ = MakeRefCounted<HandshakingState>(Ref());
handshaking_state_->Start(std::move(endpoint));
}
@ -208,8 +207,7 @@ void ChaoticGoodServerListener::ActiveConnection::Done(
ChaoticGoodServerListener::ActiveConnection::HandshakingState::HandshakingState(
RefCountedPtr<ActiveConnection> connection)
: memory_allocator_(connection->memory_allocator_),
connection_(std::move(connection)),
: connection_(std::move(connection)),
handshake_mgr_(MakeRefCounted<HandshakeManager>()) {}
void ChaoticGoodServerListener::ActiveConnection::HandshakingState::Start(

@ -106,8 +106,6 @@ class ChaoticGoodServerListener final : public Server::ListenerInterface {
static void OnHandshakeDone(void* arg, grpc_error_handle error);
Timestamp GetConnectionDeadline();
const std::shared_ptr<grpc_event_engine::experimental::MemoryAllocator>
memory_allocator_;
const RefCountedPtr<ActiveConnection> connection_;
const RefCountedPtr<HandshakeManager> handshake_mgr_;
};
@ -115,9 +113,7 @@ class ChaoticGoodServerListener final : public Server::ListenerInterface {
private:
void Done(absl::optional<absl::string_view> error = absl::nullopt);
void NewConnectionID();
const std::shared_ptr<grpc_event_engine::experimental::MemoryAllocator>
memory_allocator_;
ScopedArenaPtr arena_ = MakeScopedArena(1024, memory_allocator_.get());
RefCountedPtr<Arena> arena_ = SimpleArenaAllocator()->MakeArena();
const RefCountedPtr<ChaoticGoodServerListener> listener_;
RefCountedPtr<HandshakingState> handshaking_state_;
Mutex mu_;
@ -161,11 +157,6 @@ class ChaoticGoodServerListener final : public Server::ListenerInterface {
absl::AnyInvocable<std::string()> connection_id_generator_
ABSL_GUARDED_BY(mu_);
grpc_closure* on_destroy_done_ ABSL_GUARDED_BY(mu_) = nullptr;
std::shared_ptr<grpc_event_engine::experimental::MemoryAllocator>
memory_allocator_ =
std::make_shared<grpc_event_engine::experimental::MemoryAllocator>(
ResourceQuota::Default()->memory_quota()->CreateMemoryAllocator(
"server_connection"));
};
} // namespace chaotic_good

@ -235,15 +235,14 @@ auto ChaoticGoodServerTransport::DeserializeAndPushFragmentToNewCall(
FrameHeader frame_header, BufferPair buffers,
ChaoticGoodTransport& transport) {
ClientFragmentFrame fragment_frame;
ScopedArenaPtr arena(call_arena_allocator_->MakeArena());
RefCountedPtr<Arena> arena(call_arena_allocator_->MakeArena());
absl::Status status = transport.DeserializeFrame(
frame_header, std::move(buffers), arena.get(), fragment_frame,
FrameLimits{1024 * 1024 * 1024, aligned_bytes_ - 1});
absl::optional<CallInitiator> call_initiator;
if (status.ok()) {
auto call =
MakeCallPair(std::move(fragment_frame.headers), event_engine_.get(),
arena.release(), call_arena_allocator_, nullptr);
auto call = MakeCallPair(std::move(fragment_frame.headers),
event_engine_.get(), std::move(arena), nullptr);
call_initiator.emplace(std::move(call.initiator));
auto add_result = NewStream(frame_header.stream_id, *call_initiator);
if (add_result.ok()) {

@ -474,23 +474,18 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::OnHandshakeDone(
// handshaker may have handed off the connection to some external
// code, so we can just clean up here without creating a transport.
if (args->endpoint != nullptr) {
Transport* transport =
grpc_create_chttp2_transport(args->args, args->endpoint, false);
RefCountedPtr<Transport> transport =
grpc_create_chttp2_transport(args->args, args->endpoint, false)
->Ref();
grpc_error_handle channel_init_err =
self->connection_->listener_->server_->SetupTransport(
transport, self->accepting_pollset_, args->args,
grpc_chttp2_transport_get_socket_node(transport));
transport.get(), self->accepting_pollset_, args->args,
grpc_chttp2_transport_get_socket_node(transport.get()));
if (channel_init_err.ok()) {
// Use notify_on_receive_settings callback to enforce the
// handshake deadline.
// Note: The reinterpret_cast<>s here are safe, because
// grpc_chttp2_transport is a C-style extension of
// Transport, so this is morally equivalent of a
// static_cast<> to a derived class.
// TODO(roth): Change to static_cast<> when we C++-ify the
// transport API.
self->connection_->transport_ =
reinterpret_cast<grpc_chttp2_transport*>(transport)->Ref();
DownCast<grpc_chttp2_transport*>(transport.get())->Ref();
self->Ref().release(); // Held by OnReceiveSettings().
GRPC_CLOSURE_INIT(&self->on_receive_settings_, OnReceiveSettings,
self, grpc_schedule_on_exec_ctx);
@ -520,9 +515,9 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::OnHandshakeDone(
grpc_schedule_on_exec_ctx_);
cleanup_connection = true;
}
grpc_chttp2_transport_start_reading(transport, args->read_buffer,
&self->on_receive_settings_,
on_close);
grpc_chttp2_transport_start_reading(
transport.get(), args->read_buffer, &self->on_receive_settings_,
on_close);
self->timer_handle_ = self->connection_->event_engine_->RunAfter(
self->deadline_ - Timestamp::Now(),
[self = self->Ref()]() mutable {

@ -82,7 +82,6 @@
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/http/parser.h"
#include "src/core/lib/iomgr/combiner.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/exec_ctx.h"
@ -108,6 +107,7 @@
#include "src/core/telemetry/stats.h"
#include "src/core/telemetry/stats_data.h"
#include "src/core/telemetry/tcp_tracer.h"
#include "src/core/util/http_client/parser.h"
#include "src/core/util/string.h"
#include "src/core/util/useful.h"

@ -35,16 +35,18 @@
namespace grpc_core {
namespace {
int g_default_max_pings_without_data = 2;
int g_default_max_pings_without_data_sent = 2;
constexpr Duration kThrottleIntervalWithoutDataSent = Duration::Minutes(1);
absl::optional<int> g_default_max_inflight_pings;
} // namespace
Chttp2PingRatePolicy::Chttp2PingRatePolicy(const ChannelArgs& args,
bool is_client)
: max_pings_without_data_(
: max_pings_without_data_sent_(
is_client
? std::max(0, args.GetInt(GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA)
.value_or(g_default_max_pings_without_data))
? std::max(0,
args.GetInt(GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA)
.value_or(g_default_max_pings_without_data_sent))
: 0),
// Configuration via channel arg dominates, otherwise if the multiping
// experiment is enabled we use 100, otherwise 1.
@ -54,18 +56,15 @@ Chttp2PingRatePolicy::Chttp2PingRatePolicy(const ChannelArgs& args,
IsMultipingEnabled() ? 100 : 1)))) {}
void Chttp2PingRatePolicy::SetDefaults(const ChannelArgs& args) {
g_default_max_pings_without_data =
g_default_max_pings_without_data_sent =
std::max(0, args.GetInt(GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA)
.value_or(g_default_max_pings_without_data));
.value_or(g_default_max_pings_without_data_sent));
g_default_max_inflight_pings = args.GetInt(GRPC_ARG_HTTP2_MAX_INFLIGHT_PINGS);
}
Chttp2PingRatePolicy::RequestSendPingResult
Chttp2PingRatePolicy::RequestSendPing(Duration next_allowed_ping_interval,
size_t inflight_pings) const {
if (max_pings_without_data_ != 0 && pings_before_data_required_ == 0) {
return TooManyRecentPings{};
}
if (max_inflight_pings_ > 0 &&
inflight_pings > static_cast<size_t>(max_inflight_pings_)) {
return TooManyRecentPings{};
@ -77,12 +76,29 @@ Chttp2PingRatePolicy::RequestSendPing(Duration next_allowed_ping_interval,
return TooSoon{next_allowed_ping_interval, last_ping_sent_time_,
next_allowed_ping - now};
}
// Throttle pings to 1 minute if we haven't sent any data recently
if (max_pings_without_data_sent_ != 0 &&
pings_before_data_sending_required_ == 0) {
if (IsMaxPingsWoDataThrottleEnabled()) {
const Timestamp next_allowed_ping =
last_ping_sent_time_ + kThrottleIntervalWithoutDataSent;
if (next_allowed_ping > now) {
return TooSoon{kThrottleIntervalWithoutDataSent, last_ping_sent_time_,
next_allowed_ping - now};
}
} else {
return TooManyRecentPings{};
}
}
return SendGranted{};
}
void Chttp2PingRatePolicy::SentPing() {
last_ping_sent_time_ = Timestamp::Now();
if (pings_before_data_required_) --pings_before_data_required_;
if (pings_before_data_sending_required_ > 0) {
--pings_before_data_sending_required_;
}
}
void Chttp2PingRatePolicy::ReceivedDataFrame() {
@ -90,13 +106,13 @@ void Chttp2PingRatePolicy::ReceivedDataFrame() {
}
void Chttp2PingRatePolicy::ResetPingsBeforeDataRequired() {
pings_before_data_required_ = max_pings_without_data_;
pings_before_data_sending_required_ = max_pings_without_data_sent_;
}
std::string Chttp2PingRatePolicy::GetDebugString() const {
return absl::StrCat(
"max_pings_without_data: ", max_pings_without_data_,
", pings_before_data_required: ", pings_before_data_required_,
"max_pings_without_data: ", max_pings_without_data_sent_,
", pings_before_data_required: ", pings_before_data_sending_required_,
", last_ping_sent_time_: ", last_ping_sent_time_.ToString());
}

@ -70,13 +70,14 @@ class Chttp2PingRatePolicy {
void ReceivedDataFrame();
std::string GetDebugString() const;
int TestOnlyMaxPingsWithoutData() const { return max_pings_without_data_; }
int TestOnlyMaxPingsWithoutData() const {
return max_pings_without_data_sent_;
}
private:
const int max_pings_without_data_;
const int max_pings_without_data_sent_;
const int max_inflight_pings_;
// No pings allowed before receiving a header or data frame.
int pings_before_data_required_ = 0;
int pings_before_data_sending_required_ = 0;
Timestamp last_ping_sent_time_ = Timestamp::InfPast();
};

@ -105,9 +105,9 @@ class InprocServerTransport final : public ServerTransport {
case ConnectionState::kReady:
break;
}
auto* arena = call_arena_allocator_->MakeArena();
auto server_call = MakeCallPair(std::move(md), event_engine_.get(), arena,
call_arena_allocator_, nullptr);
auto server_call =
MakeCallPair(std::move(md), event_engine_.get(),
call_arena_allocator_->MakeArena(), nullptr);
unstarted_call_handler_->StartCall(std::move(server_call.handler));
return std::move(server_call.initiator);
}

@ -44,14 +44,14 @@
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/http/format_request.h"
#include "src/core/lib/http/parser.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/iomgr_fwd.h"
#include "src/core/lib/iomgr/tcp_server.h"
#include "src/core/util/http_client/format_request.h"
#include "src/core/util/http_client/parser.h"
#include "src/core/util/string.h"
namespace grpc_core {

@ -83,6 +83,16 @@ inline int PointerCompare(void* a_ptr, const grpc_arg_pointer_vtable* a_vtable,
// before the crt refcount base class.
template <typename T>
using RefType = absl::remove_cvref_t<decltype(*std::declval<T>().Ref())>;
template <typename T, typename Ignored = void /* for SFINAE */>
struct IsRawPointerTagged {
static constexpr bool kValue = false;
};
template <typename T>
struct IsRawPointerTagged<T,
absl::void_t<typename T::RawPointerChannelArgTag>> {
static constexpr bool kValue = true;
};
} // namespace channel_args_detail
// Specialization for ref-counted pointers.
@ -91,13 +101,14 @@ using RefType = absl::remove_cvref_t<decltype(*std::declval<T>().Ref())>;
template <typename T>
struct ChannelArgTypeTraits<
T, absl::enable_if_t<
std::is_base_of<RefCounted<channel_args_detail::RefType<T>>,
channel_args_detail::RefType<T>>::value ||
std::is_base_of<RefCounted<channel_args_detail::RefType<T>,
NonPolymorphicRefCount>,
channel_args_detail::RefType<T>>::value ||
std::is_base_of<DualRefCounted<channel_args_detail::RefType<T>>,
channel_args_detail::RefType<T>>::value,
!channel_args_detail::IsRawPointerTagged<T>::kValue &&
(std::is_base_of<RefCounted<channel_args_detail::RefType<T>>,
channel_args_detail::RefType<T>>::value ||
std::is_base_of<RefCounted<channel_args_detail::RefType<T>,
NonPolymorphicRefCount>,
channel_args_detail::RefType<T>>::value ||
std::is_base_of<DualRefCounted<channel_args_detail::RefType<T>>,
channel_args_detail::RefType<T>>::value),
void>> {
static const grpc_arg_pointer_vtable* VTable() {
static const grpc_arg_pointer_vtable tbl = {

@ -230,6 +230,7 @@ struct grpc_channel_stack {
// full C++-ification for now.
void IncrementRefCount();
void Unref();
void Unref(const grpc_core::DebugLocation& location, const char* reason);
grpc_core::RefCountedPtr<grpc_channel_stack> Ref() {
IncrementRefCount();
return grpc_core::RefCountedPtr<grpc_channel_stack>(this);
@ -345,6 +346,11 @@ inline void grpc_channel_stack::Unref() {
GRPC_CHANNEL_STACK_UNREF(this, "smart_pointer");
}
inline void grpc_channel_stack::Unref(const grpc_core::DebugLocation&,
const char* reason) {
GRPC_CHANNEL_STACK_UNREF(this, reason);
}
inline void grpc_call_stack::IncrementRefCount() {
GRPC_CALL_STACK_REF(this, "smart_pointer");
}

@ -59,6 +59,9 @@ typedef enum {
/// the server.
GRPC_CONTEXT_BACKEND_METRIC_PROVIDER,
/// A LoadBalancingPolicy::SubchannelCallTrackerInterface
GRPC_SUBCHANNEL_CALL_TRACKER_INTERFACE,
/// Special Google context
GRPC_CONTEXT_GOOGLE,
@ -73,6 +76,8 @@ struct grpc_call_context_element {
namespace grpc_core {
class Call;
class CallTracerAnnotationInterface;
class CallTracerInterface;
class ServiceConfigCallData;
// Bind the legacy context array into the new style structure
// TODO(ctiller): remove as we migrate these contexts to the new system.
@ -96,6 +101,17 @@ struct OldStyleContext<CallTracerAnnotationInterface> {
GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE;
};
template <>
struct OldStyleContext<CallTracerInterface> {
static constexpr grpc_context_index kIndex = GRPC_CONTEXT_CALL_TRACER;
};
template <>
struct OldStyleContext<ServiceConfigCallData> {
static constexpr grpc_context_index kIndex =
GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA;
};
template <typename T>
class Context<T, absl::void_t<decltype(OldStyleContext<T>::kIndex)>> {
public:
@ -104,6 +120,15 @@ class Context<T, absl::void_t<decltype(OldStyleContext<T>::kIndex)>> {
GetContext<grpc_call_context_element>()[OldStyleContext<T>::kIndex]
.value);
}
static void set(T* value) {
auto& elem =
GetContext<grpc_call_context_element>()[OldStyleContext<T>::kIndex];
if (elem.destroy != nullptr) {
elem.destroy(elem.value);
elem.destroy = nullptr;
}
elem.value = value;
}
};
} // namespace promise_detail

@ -29,8 +29,6 @@ const char* const description_call_status_override_on_cancellation =
"with cancellation.";
const char* const additional_constraints_call_status_override_on_cancellation =
"{}";
const char* const description_call_v3 = "Promise-based call version 3.";
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 = "{}";
@ -59,6 +57,11 @@ const char* const description_keepalive_server_fix =
"Allows overriding keepalive_permit_without_calls for servers. Refer "
"https://github.com/grpc/grpc/pull/33917 for more information.";
const char* const additional_constraints_keepalive_server_fix = "{}";
const char* const description_max_pings_wo_data_throttle =
"Experiment to throttle pings to a period of 1 min when "
"GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA limit has reached (instead of "
"completely blocking).";
const char* const additional_constraints_max_pings_wo_data_throttle = "{}";
const char* const description_monitoring_experiment =
"Placeholder experiment to prove/disprove our monitoring is working";
const char* const additional_constraints_monitoring_experiment = "{}";
@ -128,6 +131,12 @@ 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_call_v3 = "Promise-based call version 3.";
const char* const additional_constraints_call_v3 = "{}";
const uint8_t required_experiments_call_v3[] = {
static_cast<uint8_t>(grpc_core::kExperimentIdEventEngineClient),
static_cast<uint8_t>(grpc_core::kExperimentIdEventEngineListener),
static_cast<uint8_t>(grpc_core::kExperimentIdWorkSerializerDispatch)};
} // namespace
namespace grpc_core {
@ -137,8 +146,6 @@ const ExperimentMetadata g_experiment_metadata[] = {
description_call_status_override_on_cancellation,
additional_constraints_call_status_override_on_cancellation, nullptr, 0,
true, true},
{"call_v3", description_call_v3, additional_constraints_call_v3, nullptr, 0,
false, true},
{"canary_client_privacy", description_canary_client_privacy,
additional_constraints_canary_client_privacy, nullptr, 0, false, false},
{"client_privacy", description_client_privacy,
@ -157,6 +164,9 @@ const ExperimentMetadata g_experiment_metadata[] = {
additional_constraints_keepalive_fix, nullptr, 0, false, false},
{"keepalive_server_fix", description_keepalive_server_fix,
additional_constraints_keepalive_server_fix, nullptr, 0, false, false},
{"max_pings_wo_data_throttle", description_max_pings_wo_data_throttle,
additional_constraints_max_pings_wo_data_throttle, nullptr, 0, false,
true},
{"monitoring_experiment", description_monitoring_experiment,
additional_constraints_monitoring_experiment, nullptr, 0, true, true},
{"multiping", description_multiping, additional_constraints_multiping,
@ -200,6 +210,8 @@ 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},
{"call_v3", description_call_v3, additional_constraints_call_v3,
required_experiments_call_v3, 3, false, false},
};
} // namespace grpc_core
@ -211,8 +223,6 @@ const char* const description_call_status_override_on_cancellation =
"with cancellation.";
const char* const additional_constraints_call_status_override_on_cancellation =
"{}";
const char* const description_call_v3 = "Promise-based call version 3.";
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 = "{}";
@ -241,6 +251,11 @@ const char* const description_keepalive_server_fix =
"Allows overriding keepalive_permit_without_calls for servers. Refer "
"https://github.com/grpc/grpc/pull/33917 for more information.";
const char* const additional_constraints_keepalive_server_fix = "{}";
const char* const description_max_pings_wo_data_throttle =
"Experiment to throttle pings to a period of 1 min when "
"GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA limit has reached (instead of "
"completely blocking).";
const char* const additional_constraints_max_pings_wo_data_throttle = "{}";
const char* const description_monitoring_experiment =
"Placeholder experiment to prove/disprove our monitoring is working";
const char* const additional_constraints_monitoring_experiment = "{}";
@ -310,6 +325,12 @@ 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_call_v3 = "Promise-based call version 3.";
const char* const additional_constraints_call_v3 = "{}";
const uint8_t required_experiments_call_v3[] = {
static_cast<uint8_t>(grpc_core::kExperimentIdEventEngineClient),
static_cast<uint8_t>(grpc_core::kExperimentIdEventEngineListener),
static_cast<uint8_t>(grpc_core::kExperimentIdWorkSerializerDispatch)};
} // namespace
namespace grpc_core {
@ -319,14 +340,12 @@ const ExperimentMetadata g_experiment_metadata[] = {
description_call_status_override_on_cancellation,
additional_constraints_call_status_override_on_cancellation, nullptr, 0,
true, true},
{"call_v3", description_call_v3, additional_constraints_call_v3, nullptr, 0,
false, true},
{"canary_client_privacy", description_canary_client_privacy,
additional_constraints_canary_client_privacy, nullptr, 0, false, false},
{"client_privacy", description_client_privacy,
additional_constraints_client_privacy, nullptr, 0, false, false},
{"event_engine_client", description_event_engine_client,
additional_constraints_event_engine_client, nullptr, 0, true, true},
additional_constraints_event_engine_client, nullptr, 0, false, true},
{"event_engine_dns", description_event_engine_dns,
additional_constraints_event_engine_dns, nullptr, 0, true, false},
{"event_engine_listener", description_event_engine_listener,
@ -339,6 +358,9 @@ const ExperimentMetadata g_experiment_metadata[] = {
additional_constraints_keepalive_fix, nullptr, 0, false, false},
{"keepalive_server_fix", description_keepalive_server_fix,
additional_constraints_keepalive_server_fix, nullptr, 0, false, false},
{"max_pings_wo_data_throttle", description_max_pings_wo_data_throttle,
additional_constraints_max_pings_wo_data_throttle, nullptr, 0, false,
true},
{"monitoring_experiment", description_monitoring_experiment,
additional_constraints_monitoring_experiment, nullptr, 0, true, true},
{"multiping", description_multiping, additional_constraints_multiping,
@ -382,6 +404,8 @@ 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},
{"call_v3", description_call_v3, additional_constraints_call_v3,
required_experiments_call_v3, 3, false, false},
};
} // namespace grpc_core
@ -393,8 +417,6 @@ const char* const description_call_status_override_on_cancellation =
"with cancellation.";
const char* const additional_constraints_call_status_override_on_cancellation =
"{}";
const char* const description_call_v3 = "Promise-based call version 3.";
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 = "{}";
@ -423,6 +445,11 @@ const char* const description_keepalive_server_fix =
"Allows overriding keepalive_permit_without_calls for servers. Refer "
"https://github.com/grpc/grpc/pull/33917 for more information.";
const char* const additional_constraints_keepalive_server_fix = "{}";
const char* const description_max_pings_wo_data_throttle =
"Experiment to throttle pings to a period of 1 min when "
"GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA limit has reached (instead of "
"completely blocking).";
const char* const additional_constraints_max_pings_wo_data_throttle = "{}";
const char* const description_monitoring_experiment =
"Placeholder experiment to prove/disprove our monitoring is working";
const char* const additional_constraints_monitoring_experiment = "{}";
@ -492,6 +519,12 @@ 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_call_v3 = "Promise-based call version 3.";
const char* const additional_constraints_call_v3 = "{}";
const uint8_t required_experiments_call_v3[] = {
static_cast<uint8_t>(grpc_core::kExperimentIdEventEngineClient),
static_cast<uint8_t>(grpc_core::kExperimentIdEventEngineListener),
static_cast<uint8_t>(grpc_core::kExperimentIdWorkSerializerDispatch)};
} // namespace
namespace grpc_core {
@ -501,8 +534,6 @@ const ExperimentMetadata g_experiment_metadata[] = {
description_call_status_override_on_cancellation,
additional_constraints_call_status_override_on_cancellation, nullptr, 0,
true, true},
{"call_v3", description_call_v3, additional_constraints_call_v3, nullptr, 0,
false, true},
{"canary_client_privacy", description_canary_client_privacy,
additional_constraints_canary_client_privacy, nullptr, 0, false, false},
{"client_privacy", description_client_privacy,
@ -521,6 +552,9 @@ const ExperimentMetadata g_experiment_metadata[] = {
additional_constraints_keepalive_fix, nullptr, 0, false, false},
{"keepalive_server_fix", description_keepalive_server_fix,
additional_constraints_keepalive_server_fix, nullptr, 0, false, false},
{"max_pings_wo_data_throttle", description_max_pings_wo_data_throttle,
additional_constraints_max_pings_wo_data_throttle, nullptr, 0, false,
true},
{"monitoring_experiment", description_monitoring_experiment,
additional_constraints_monitoring_experiment, nullptr, 0, true, true},
{"multiping", description_multiping, additional_constraints_multiping,
@ -564,6 +598,8 @@ 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},
{"call_v3", description_call_v3, additional_constraints_call_v3,
required_experiments_call_v3, 3, false, false},
};
} // namespace grpc_core

@ -59,7 +59,6 @@ namespace grpc_core {
#if defined(GRPC_CFSTREAM)
#define GRPC_EXPERIMENT_IS_INCLUDED_CALL_STATUS_OVERRIDE_ON_CANCELLATION
inline bool IsCallStatusOverrideOnCancellationEnabled() { return true; }
inline bool IsCallV3Enabled() { return false; }
inline bool IsCanaryClientPrivacyEnabled() { return false; }
inline bool IsClientPrivacyEnabled() { return false; }
inline bool IsEventEngineClientEnabled() { return false; }
@ -70,6 +69,7 @@ inline bool IsFreeLargeAllocatorEnabled() { return false; }
inline bool IsHttp2StatsFixEnabled() { return true; }
inline bool IsKeepaliveFixEnabled() { return false; }
inline bool IsKeepaliveServerFixEnabled() { return false; }
inline bool IsMaxPingsWoDataThrottleEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_MONITORING_EXPERIMENT
inline bool IsMonitoringExperimentEnabled() { return true; }
inline bool IsMultipingEnabled() { return false; }
@ -90,15 +90,14 @@ inline bool IsUnconstrainedMaxQuotaBufferSizeEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_WORK_SERIALIZER_CLEARS_TIME_CACHE
inline bool IsWorkSerializerClearsTimeCacheEnabled() { return true; }
inline bool IsWorkSerializerDispatchEnabled() { return false; }
inline bool IsCallV3Enabled() { return false; }
#elif defined(GPR_WINDOWS)
#define GRPC_EXPERIMENT_IS_INCLUDED_CALL_STATUS_OVERRIDE_ON_CANCELLATION
inline bool IsCallStatusOverrideOnCancellationEnabled() { return true; }
inline bool IsCallV3Enabled() { return false; }
inline bool IsCanaryClientPrivacyEnabled() { return false; }
inline bool IsClientPrivacyEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_EVENT_ENGINE_CLIENT
inline bool IsEventEngineClientEnabled() { return true; }
inline bool IsEventEngineClientEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_EVENT_ENGINE_DNS
inline bool IsEventEngineDnsEnabled() { return true; }
#define GRPC_EXPERIMENT_IS_INCLUDED_EVENT_ENGINE_LISTENER
@ -108,6 +107,7 @@ inline bool IsFreeLargeAllocatorEnabled() { return false; }
inline bool IsHttp2StatsFixEnabled() { return true; }
inline bool IsKeepaliveFixEnabled() { return false; }
inline bool IsKeepaliveServerFixEnabled() { return false; }
inline bool IsMaxPingsWoDataThrottleEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_MONITORING_EXPERIMENT
inline bool IsMonitoringExperimentEnabled() { return true; }
inline bool IsMultipingEnabled() { return false; }
@ -128,11 +128,11 @@ inline bool IsUnconstrainedMaxQuotaBufferSizeEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_WORK_SERIALIZER_CLEARS_TIME_CACHE
inline bool IsWorkSerializerClearsTimeCacheEnabled() { return true; }
inline bool IsWorkSerializerDispatchEnabled() { return false; }
inline bool IsCallV3Enabled() { return false; }
#else
#define GRPC_EXPERIMENT_IS_INCLUDED_CALL_STATUS_OVERRIDE_ON_CANCELLATION
inline bool IsCallStatusOverrideOnCancellationEnabled() { return true; }
inline bool IsCallV3Enabled() { return false; }
inline bool IsCanaryClientPrivacyEnabled() { return false; }
inline bool IsClientPrivacyEnabled() { return false; }
inline bool IsEventEngineClientEnabled() { return false; }
@ -145,6 +145,7 @@ inline bool IsFreeLargeAllocatorEnabled() { return false; }
inline bool IsHttp2StatsFixEnabled() { return true; }
inline bool IsKeepaliveFixEnabled() { return false; }
inline bool IsKeepaliveServerFixEnabled() { return false; }
inline bool IsMaxPingsWoDataThrottleEnabled() { return false; }
#define GRPC_EXPERIMENT_IS_INCLUDED_MONITORING_EXPERIMENT
inline bool IsMonitoringExperimentEnabled() { return true; }
inline bool IsMultipingEnabled() { return false; }
@ -166,12 +167,12 @@ inline bool IsUnconstrainedMaxQuotaBufferSizeEnabled() { return false; }
inline bool IsWorkSerializerClearsTimeCacheEnabled() { return true; }
#define GRPC_EXPERIMENT_IS_INCLUDED_WORK_SERIALIZER_DISPATCH
inline bool IsWorkSerializerDispatchEnabled() { return true; }
inline bool IsCallV3Enabled() { return false; }
#endif
#else
enum ExperimentIds {
kExperimentIdCallStatusOverrideOnCancellation,
kExperimentIdCallV3,
kExperimentIdCanaryClientPrivacy,
kExperimentIdClientPrivacy,
kExperimentIdEventEngineClient,
@ -181,6 +182,7 @@ enum ExperimentIds {
kExperimentIdHttp2StatsFix,
kExperimentIdKeepaliveFix,
kExperimentIdKeepaliveServerFix,
kExperimentIdMaxPingsWoDataThrottle,
kExperimentIdMonitoringExperiment,
kExperimentIdMultiping,
kExperimentIdPeerStateBasedFraming,
@ -197,16 +199,13 @@ enum ExperimentIds {
kExperimentIdUnconstrainedMaxQuotaBufferSize,
kExperimentIdWorkSerializerClearsTimeCache,
kExperimentIdWorkSerializerDispatch,
kExperimentIdCallV3,
kNumExperiments
};
#define GRPC_EXPERIMENT_IS_INCLUDED_CALL_STATUS_OVERRIDE_ON_CANCELLATION
inline bool IsCallStatusOverrideOnCancellationEnabled() {
return IsExperimentEnabled(kExperimentIdCallStatusOverrideOnCancellation);
}
#define GRPC_EXPERIMENT_IS_INCLUDED_CALL_V3
inline bool IsCallV3Enabled() {
return IsExperimentEnabled(kExperimentIdCallV3);
}
#define GRPC_EXPERIMENT_IS_INCLUDED_CANARY_CLIENT_PRIVACY
inline bool IsCanaryClientPrivacyEnabled() {
return IsExperimentEnabled(kExperimentIdCanaryClientPrivacy);
@ -243,6 +242,10 @@ inline bool IsKeepaliveFixEnabled() {
inline bool IsKeepaliveServerFixEnabled() {
return IsExperimentEnabled(kExperimentIdKeepaliveServerFix);
}
#define GRPC_EXPERIMENT_IS_INCLUDED_MAX_PINGS_WO_DATA_THROTTLE
inline bool IsMaxPingsWoDataThrottleEnabled() {
return IsExperimentEnabled(kExperimentIdMaxPingsWoDataThrottle);
}
#define GRPC_EXPERIMENT_IS_INCLUDED_MONITORING_EXPERIMENT
inline bool IsMonitoringExperimentEnabled() {
return IsExperimentEnabled(kExperimentIdMonitoringExperiment);
@ -307,6 +310,10 @@ inline bool IsWorkSerializerClearsTimeCacheEnabled() {
inline bool IsWorkSerializerDispatchEnabled() {
return IsExperimentEnabled(kExperimentIdWorkSerializerDispatch);
}
#define GRPC_EXPERIMENT_IS_INCLUDED_CALL_V3
inline bool IsCallV3Enabled() {
return IsExperimentEnabled(kExperimentIdCallV3);
}
extern const ExperimentMetadata g_experiment_metadata[kNumExperiments];

@ -52,6 +52,8 @@
expiry: 2024/06/01
owner: ctiller@google.com
test_tags: []
requires: ["work_serializer_dispatch", "event_engine_listener", "event_engine_client"]
allow_in_fuzzing_config: false
- name: canary_client_privacy
description:
If set, canary client privacy
@ -120,6 +122,14 @@
owner: yashkt@google.com
test_tags: []
allow_in_fuzzing_config: false
- name: max_pings_wo_data_throttle
description:
Experiment to throttle pings to a period of 1 min when
GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA limit has reached (instead of
completely blocking).
expiry: 2024/12/31
owner: yashkt@google.com
test_tags: []
- name: monitoring_experiment
description: Placeholder experiment to prove/disprove our monitoring is working
expiry: never-ever

@ -58,7 +58,7 @@
# not tested on iOS at all
ios: broken
posix: false
windows: true
windows: false
- name: event_engine_dns
default:
# not tested on iOS at all
@ -79,6 +79,8 @@
default: false
- name: keepalive_server_fix
default: false
- name: max_pings_wo_data_throttle
default: false
- name: monitoring_experiment
default: true
- name: peer_state_based_framing

@ -28,6 +28,7 @@
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/down_cast.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
namespace grpc_core {
@ -46,15 +47,16 @@ namespace grpc_core {
//
// This will be used by CRTP (curiously-recurring template pattern), e.g.:
// class MyClass : public RefCounted<MyClass> { ... };
template <typename Child>
class DualRefCounted {
//
// Impl & UnrefBehavior are as per RefCounted.
template <typename Child, typename Impl = PolymorphicRefCount,
typename UnrefBehavior = UnrefDelete>
class DualRefCounted : public Impl {
public:
// Not copyable nor movable.
DualRefCounted(const DualRefCounted&) = delete;
DualRefCounted& operator=(const DualRefCounted&) = delete;
virtual ~DualRefCounted() = default;
GRPC_MUST_USE_RESULT RefCountedPtr<Child> Ref() {
IncrementRefCount();
return RefCountedPtr<Child>(static_cast<Child*>(this));
@ -215,7 +217,7 @@ class DualRefCounted {
CHECK_GT(weak_refs, 0u);
#endif
if (GPR_UNLIKELY(prev_ref_pair == MakeRefPair(0, 1))) {
delete static_cast<Child*>(this);
unref_behavior_(static_cast<Child*>(this));
}
}
void WeakUnref(const DebugLocation& location, const char* reason) {
@ -242,7 +244,7 @@ class DualRefCounted {
(void)reason;
#endif
if (GPR_UNLIKELY(prev_ref_pair == MakeRefPair(0, 1))) {
delete static_cast<Child*>(this);
unref_behavior_(static_cast<const Child*>(this));
}
}
@ -266,6 +268,9 @@ class DualRefCounted {
// Ref count has dropped to zero, so the object is now orphaned.
virtual void Orphaned() = 0;
// Note: Depending on the Impl used, this dtor can be implicitly virtual.
~DualRefCounted() = default;
private:
// Allow RefCountedPtr<> to access IncrementRefCount().
template <typename T>
@ -358,6 +363,7 @@ class DualRefCounted {
const char* trace_;
#endif
std::atomic<uint64_t> refs_{0};
GPR_NO_UNIQUE_ADDRESS UnrefBehavior unref_behavior_;
};
} // namespace grpc_core

@ -26,6 +26,7 @@
#include "absl/base/thread_annotations.h"
#include "absl/log/check.h"
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include "absl/types/optional.h"
#include <grpc/support/log.h>
@ -121,6 +122,11 @@ class Waker {
return wakeable_and_arg_.ActivityDebugTag();
}
std::string DebugString() {
return absl::StrFormat("Waker{%p, %d}", wakeable_and_arg_.wakeable,
wakeable_and_arg_.wakeup_mask);
}
// This is for tests to assert that a waker is occupied or not.
bool is_unwakeable() const {
return wakeable_and_arg_.wakeable == promise_detail::unwakeable();
@ -283,6 +289,19 @@ class ContextHolder<std::unique_ptr<Context, Deleter>> {
std::unique_ptr<Context, Deleter> value_;
};
template <typename Context>
class ContextHolder<RefCountedPtr<Context>> {
public:
using ContextType = Context;
explicit ContextHolder(RefCountedPtr<Context> value)
: value_(std::move(value)) {}
Context* GetContext() { return value_.get(); }
private:
RefCountedPtr<Context> value_;
};
template <>
class Context<Activity> {
public:
@ -290,19 +309,23 @@ class Context<Activity> {
};
template <typename HeldContext>
using ContextTypeFromHeld = typename ContextHolder<HeldContext>::ContextType;
using ContextTypeFromHeld = typename ContextHolder<
typename std::remove_reference<HeldContext>::type>::ContextType;
template <typename... Contexts>
class ActivityContexts : public ContextHolder<Contexts>... {
class ActivityContexts
: public ContextHolder<typename std::remove_reference<Contexts>::type>... {
public:
explicit ActivityContexts(Contexts&&... contexts)
: ContextHolder<Contexts>(std::forward<Contexts>(contexts))... {}
: ContextHolder<typename std::remove_reference<Contexts>::type>(
std::forward<Contexts>(contexts))... {}
class ScopedContext : public Context<ContextTypeFromHeld<Contexts>>... {
public:
explicit ScopedContext(ActivityContexts* contexts)
: Context<ContextTypeFromHeld<Contexts>>(
static_cast<ContextHolder<Contexts>*>(contexts)
static_cast<ContextHolder<
typename std::remove_reference<Contexts>::type>*>(contexts)
->GetContext())... {
// Silence `unused-but-set-parameter` in case of Contexts = {}
(void)contexts;

@ -125,6 +125,11 @@ T* MaybeGetContext() {
return promise_detail::Context<T>::get();
}
template <typename T>
void SetContext(T* p) {
promise_detail::Context<T>::set(p);
}
// Given a promise and a context, return a promise that has that context set.
template <typename T, typename F>
promise_detail::WithContext<T, F> WithContext(F f, T* context) {

@ -72,6 +72,23 @@ promise_detail::Map<Promise, Fn> Map(Promise promise, Fn fn) {
return promise_detail::Map<Promise, Fn>(std::move(promise), std::move(fn));
}
// Maps a promise to a new promise that returns a tuple of the original result
// and a bool indicating whether there was ever a Pending{} value observed from
// polling.
template <typename Promise>
auto CheckDelayed(Promise promise) {
using P = promise_detail::PromiseLike<Promise>;
return [delayed = false, promise = P(std::move(promise))]() mutable
-> Poll<std::tuple<typename P::Result, bool>> {
auto r = promise();
if (r.pending()) {
delayed = true;
return Pending{};
}
return std::make_tuple(r.value(), delayed);
};
}
// Callable that takes a tuple and returns one element
template <size_t kElem>
struct JustElem {

@ -125,6 +125,7 @@ class Observable {
Observer& operator=(const Observer&) = delete;
Observer(Observer&& other) noexcept : state_(std::move(other.state_)) {
CHECK(other.waker_.is_unwakeable());
DCHECK(waker_.is_unwakeable());
CHECK(!other.saw_pending_);
}
Observer& operator=(Observer&& other) noexcept = delete;

@ -308,8 +308,10 @@ void Party::AddParticipants(Participant** participants, size_t count) {
for (size_t i = 0; i < count; i++) {
if (grpc_trace_party_state.enabled()) {
gpr_log(GPR_INFO,
"Party %p AddParticipant: %s @ %" PRIdPTR,
&sync_, std::string(participants[i]->name()).c_str(), slots[i]);
"Party %p AddParticipant: %s @ %" PRIdPTR
" [participant=%p]",
&sync_, std::string(participants[i]->name()).c_str(), slots[i],
participants[i]);
}
participants_[slots[i]].store(participants[i], std::memory_order_release);
}

@ -379,6 +379,11 @@ class Party : public Activity, private Wakeable {
// The on_complete callback will be called with the result of the promise if
// it completes.
// A maximum of sixteen promises can be spawned onto a party.
// promise_factory called to create the promise with the party lock taken;
// after the promise is created the factory is destroyed.
// This means that pointers or references to factory members will be
// invalidated after the promise is created - so the promise should not retain
// any of these.
template <typename Factory, typename OnComplete>
void Spawn(absl::string_view name, Factory promise_factory,
OnComplete on_complete);

@ -18,6 +18,7 @@
#include <type_traits>
#include "absl/functional/any_invocable.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
#include "absl/types/optional.h"

@ -21,17 +21,23 @@
#include <atomic>
#include <new>
#include "absl/log/log.h"
#include <grpc/support/alloc.h>
#include <grpc/support/port_platform.h>
#include "src/core/lib/resource_quota/resource_quota.h"
#include "src/core/util/alloc.h"
namespace grpc_core {
namespace {
void* ArenaStorage(size_t initial_size) {
void* ArenaStorage(size_t& initial_size) {
static constexpr size_t base_size =
GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(grpc_core::Arena));
GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(Arena));
initial_size = GPR_ROUND_UP_TO_ALIGNMENT_SIZE(initial_size);
initial_size = std::max(initial_size,
arena_detail::BaseArenaContextTraits::ContextSize());
size_t alloc_size = base_size + initial_size;
static constexpr size_t alignment =
(GPR_CACHELINE_SIZE > GPR_MAX_ALIGNMENT &&
@ -43,9 +49,15 @@ void* ArenaStorage(size_t initial_size) {
} // namespace
namespace grpc_core {
Arena::~Arena() {
for (size_t i = 0; i < arena_detail::BaseArenaContextTraits::NumContexts();
++i) {
arena_detail::BaseArenaContextTraits::Destroy(i, contexts()[i]);
}
DestroyManagedNewObjects();
arena_factory_->FinalizeArena(this);
arena_factory_->allocator().Release(
total_allocated_.load(std::memory_order_relaxed));
Zone* z = last_zone_;
while (z) {
Zone* prev_z = z->prev;
@ -53,24 +65,25 @@ Arena::~Arena() {
gpr_free_aligned(z);
z = prev_z;
}
#ifdef GRPC_ARENA_TRACE_POOLED_ALLOCATIONS
gpr_log(GPR_ERROR, "DESTRUCT_ARENA %p", this);
#endif
}
Arena* Arena::Create(size_t initial_size, MemoryAllocator* memory_allocator) {
return new (ArenaStorage(initial_size))
Arena(initial_size, 0, memory_allocator);
RefCountedPtr<Arena> Arena::Create(size_t initial_size,
RefCountedPtr<ArenaFactory> arena_factory) {
void* p = ArenaStorage(initial_size);
return RefCountedPtr<Arena>(
new (p) Arena(initial_size, std::move(arena_factory)));
}
std::pair<Arena*, void*> Arena::CreateWithAlloc(
size_t initial_size, size_t alloc_size, MemoryAllocator* memory_allocator) {
static constexpr size_t base_size =
GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(Arena));
auto* new_arena = new (ArenaStorage(initial_size))
Arena(initial_size, alloc_size, memory_allocator);
void* first_alloc = reinterpret_cast<char*>(new_arena) + base_size;
return std::make_pair(new_arena, first_alloc);
Arena::Arena(size_t initial_size, RefCountedPtr<ArenaFactory> arena_factory)
: initial_zone_size_(initial_size),
total_used_(arena_detail::BaseArenaContextTraits::ContextSize()),
arena_factory_(std::move(arena_factory)) {
for (size_t i = 0; i < arena_detail::BaseArenaContextTraits::NumContexts();
++i) {
contexts()[i] = nullptr;
}
CHECK_GE(initial_size, arena_detail::BaseArenaContextTraits::ContextSize());
arena_factory_->allocator().Reserve(initial_size);
}
void Arena::DestroyManagedNewObjects() {
@ -86,11 +99,9 @@ void Arena::DestroyManagedNewObjects() {
}
}
void Arena::Destroy() {
DestroyManagedNewObjects();
memory_allocator_->Release(total_allocated_.load(std::memory_order_relaxed));
void Arena::Destroy() const {
this->~Arena();
gpr_free_aligned(this);
gpr_free_aligned(const_cast<Arena*>(this));
}
void* Arena::AllocZone(size_t size) {
@ -102,7 +113,7 @@ void* Arena::AllocZone(size_t size) {
static constexpr size_t zone_base_size =
GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(Zone));
size_t alloc_size = zone_base_size + size;
memory_allocator_->Reserve(alloc_size);
arena_factory_->allocator().Reserve(alloc_size);
total_allocated_.fetch_add(alloc_size, std::memory_order_relaxed);
Zone* z = new (gpr_malloc_aligned(alloc_size, GPR_MAX_ALIGNMENT)) Zone();
auto* prev = last_zone_.load(std::memory_order_relaxed);
@ -120,63 +131,27 @@ void Arena::ManagedNewObject::Link(std::atomic<ManagedNewObject*>* head) {
}
}
#ifndef GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC
void* Arena::AllocPooled(size_t obj_size, size_t alloc_size,
std::atomic<FreePoolNode*>* head) {
// ABA mitigation:
// AllocPooled may be called by multiple threads, and to remove a node from
// the free list we need to manipulate the next pointer, which may be done
// differently by each thread in a naive implementation.
// The literature contains various ways of dealing with this. Here we expect
// to be mostly single threaded - Arena's are owned by calls and calls don't
// do a lot of concurrent work with the pooled allocator. The place that they
// do is allocating metadata batches for decoding HPACK headers in chttp2.
// So we adopt an approach that is simple and fast for the single threaded
// case, and that is also correct in the multi threaded case.
// First, take ownership of the entire free list. At this point we know that
// no other thread can see free nodes and will be forced to allocate.
// We think we're mostly single threaded and so that's ok.
FreePoolNode* p = head->exchange(nullptr, std::memory_order_acquire);
// If there are no nodes in the free list, then go ahead and allocate from the
// arena.
if (p == nullptr) {
void* r = Alloc(alloc_size);
TracePoolAlloc(obj_size, r);
return r;
}
// We had a non-empty free list... but we own the *entire* free list.
// We only want one node, so if there are extras we'd better give them back.
if (p->next != nullptr) {
// We perform an exchange to do so, but if there were concurrent frees with
// this allocation then there'll be a free list that needs to be merged with
// ours.
FreePoolNode* extra = head->exchange(p->next, std::memory_order_acq_rel);
// If there was a free list concurrently created, we merge it into the
// overall free list here by simply freeing each node in turn. This is O(n),
// but only O(n) in the number of nodes that were freed concurrently, and
// again: we think real world use cases are going to see this as mostly
// single threaded.
while (extra != nullptr) {
FreePoolNode* next = extra->next;
FreePooled(extra, head);
extra = next;
RefCountedPtr<ArenaFactory> SimpleArenaAllocator(size_t initial_size) {
class Allocator : public ArenaFactory {
public:
explicit Allocator(size_t initial_size)
: ArenaFactory(
ResourceQuota::Default()->memory_quota()->CreateMemoryAllocator(
"simple-arena-allocator")),
initial_size_(initial_size) {}
RefCountedPtr<Arena> MakeArena() override {
return Arena::Create(initial_size_, Ref());
}
}
TracePoolAlloc(obj_size, p);
return p;
}
void Arena::FreePooled(void* p, std::atomic<FreePoolNode*>* head) {
// May spuriously trace a free of an already freed object - see AllocPooled
// ABA mitigation.
TracePoolFree(p);
FreePoolNode* node = static_cast<FreePoolNode*>(p);
node->next = head->load(std::memory_order_acquire);
while (!head->compare_exchange_weak(
node->next, node, std::memory_order_acq_rel, std::memory_order_relaxed)) {
}
void FinalizeArena(Arena*) override {
// No-op.
}
private:
size_t initial_size_;
};
return MakeRefCounted<Allocator>(initial_size);
}
#endif
} // namespace grpc_core

@ -40,76 +40,63 @@
#include "src/core/lib/resource_quota/memory_quota.h"
#include "src/core/util/alloc.h"
#define GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC
// #define GRPC_ARENA_TRACE_POOLED_ALLOCATIONS
namespace grpc_core {
namespace arena_detail {
class Arena;
#ifndef GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC
struct PoolAndSize {
size_t alloc_size;
size_t pool_index;
};
template <typename T>
struct ArenaContextType;
template <typename Void, size_t kIndex, size_t kObjectSize,
size_t... kBucketSize>
struct PoolIndexForSize;
template <size_t kObjectSize, size_t kIndex, size_t kSmallestRemainingBucket,
size_t... kBucketSizes>
struct PoolIndexForSize<
absl::enable_if_t<kObjectSize <= kSmallestRemainingBucket>, kIndex,
kObjectSize, kSmallestRemainingBucket, kBucketSizes...> {
static constexpr size_t kPool = kIndex;
static constexpr size_t kSize = kSmallestRemainingBucket;
};
namespace arena_detail {
template <size_t kObjectSize, size_t kIndex, size_t kSmallestRemainingBucket,
size_t... kBucketSizes>
struct PoolIndexForSize<
absl::enable_if_t<(kObjectSize > kSmallestRemainingBucket)>, kIndex,
kObjectSize, kSmallestRemainingBucket, kBucketSizes...>
: public PoolIndexForSize<void, kIndex + 1, kObjectSize, kBucketSizes...> {
};
// Tracks all registered arena context types (these should only be registered
// via ArenaContextTraits at static initialization time).
class BaseArenaContextTraits {
public:
// Count of number of contexts that have been allocated.
static uint16_t NumContexts() {
return static_cast<uint16_t>(RegisteredTraits().size());
}
template <size_t kObjectSize, size_t... kBucketSizes>
constexpr size_t PoolFromObjectSize(
absl::integer_sequence<size_t, kBucketSizes...>) {
return PoolIndexForSize<void, 0, kObjectSize, kBucketSizes...>::kPool;
}
// Number of bytes required to store the context pointers on an arena.
static size_t ContextSize() { return NumContexts() * sizeof(void*); }
template <size_t kObjectSize, size_t... kBucketSizes>
constexpr size_t AllocationSizeFromObjectSize(
absl::integer_sequence<size_t, kBucketSizes...>) {
return PoolIndexForSize<void, 0, kObjectSize, kBucketSizes...>::kSize;
}
// Call the registered destruction function for a context.
static void Destroy(uint16_t id, void* ptr) {
if (ptr == nullptr) return;
RegisteredTraits()[id](ptr);
}
template <size_t kIndex, size_t... kBucketSizes>
struct ChoosePoolForAllocationSizeImpl;
protected:
// Allocate a new context id and register the destruction function.
static uint16_t MakeId(void (*destroy)(void* ptr)) {
auto& traits = RegisteredTraits();
const uint16_t id = static_cast<uint16_t>(traits.size());
traits.push_back(destroy);
return id;
}
template <size_t kIndex, size_t kBucketSize, size_t... kBucketSizes>
struct ChoosePoolForAllocationSizeImpl<kIndex, kBucketSize, kBucketSizes...> {
static PoolAndSize Fn(size_t n) {
if (n <= kBucketSize) return {kBucketSize, kIndex};
return ChoosePoolForAllocationSizeImpl<kIndex + 1, kBucketSizes...>::Fn(n);
private:
static std::vector<void (*)(void*)>& RegisteredTraits() {
static NoDestruct<std::vector<void (*)(void*)>> registered_traits;
return *registered_traits;
}
};
template <size_t kIndex>
struct ChoosePoolForAllocationSizeImpl<kIndex> {
static PoolAndSize Fn(size_t n) {
return PoolAndSize{n, std::numeric_limits<size_t>::max()};
}
// Traits for a specific context type.
template <typename T>
class ArenaContextTraits : public BaseArenaContextTraits {
public:
static uint16_t id() { return id_; }
private:
static const uint16_t id_;
};
template <size_t... kBucketSizes>
PoolAndSize ChoosePoolForAllocationSize(
size_t n, absl::integer_sequence<size_t, kBucketSizes...>) {
return ChoosePoolForAllocationSizeImpl<0, kBucketSizes...>::Fn(n);
}
#else
template <typename T>
const uint16_t ArenaContextTraits<T>::id_ = BaseArenaContextTraits::MakeId(
[](void* ptr) { ArenaContextType<T>::Destroy(static_cast<T*>(ptr)); });
template <typename T, typename A, typename B>
struct IfArray {
using Result = A;
@ -119,30 +106,36 @@ template <typename T, typename A, typename B>
struct IfArray<T[], A, B> {
using Result = B;
};
#endif
struct UnrefDestroy {
void operator()(const Arena* arena) const;
};
} // namespace arena_detail
class Arena {
#ifndef GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC
// Selected pool sizes.
// How to tune: see tools/codegen/core/optimize_arena_pool_sizes.py
using PoolSizes = absl::integer_sequence<size_t, 80, 304, 528, 1024>;
struct FreePoolNode {
FreePoolNode* next;
};
#endif
class ArenaFactory : public RefCounted<ArenaFactory> {
public:
virtual RefCountedPtr<Arena> MakeArena() = 0;
virtual void FinalizeArena(Arena* arena) = 0;
MemoryAllocator& allocator() { return allocator_; }
protected:
explicit ArenaFactory(MemoryAllocator allocator)
: allocator_(std::move(allocator)) {}
private:
MemoryAllocator allocator_;
};
RefCountedPtr<ArenaFactory> SimpleArenaAllocator(size_t initial_size = 1024);
class Arena final : public RefCounted<Arena, NonPolymorphicRefCount,
arena_detail::UnrefDestroy> {
public:
// Create an arena, with \a initial_size bytes in the first allocated buffer.
static Arena* Create(size_t initial_size, MemoryAllocator* memory_allocator);
// Create an arena, with \a initial_size bytes in the first allocated buffer,
// and return both a void pointer to the returned arena and a void* with the
// first allocation.
static std::pair<Arena*, void*> CreateWithAlloc(
size_t initial_size, size_t alloc_size,
MemoryAllocator* memory_allocator);
static RefCountedPtr<Arena> Create(size_t initial_size,
RefCountedPtr<ArenaFactory> arena_factory);
// Destroy all `ManagedNew` allocated objects.
// Allows safe destruction of these objects even if they need context held by
@ -151,9 +144,6 @@ class Arena {
// TODO(ctiller): eliminate ManagedNew.
void DestroyManagedNewObjects();
// Destroy an arena.
void Destroy();
// Return the total amount of memory allocated by this arena.
size_t TotalUsedBytes() const {
return total_used_.load(std::memory_order_relaxed);
@ -194,95 +184,6 @@ class Arena {
return &p->t;
}
#ifndef GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC
class PooledDeleter {
public:
explicit PooledDeleter(std::atomic<FreePoolNode*>* free_list)
: free_list_(free_list) {}
PooledDeleter() = default;
template <typename T>
void operator()(T* p) {
// TODO(ctiller): promise based filter hijacks ownership of some pointers
// to make them appear as PoolPtr without really transferring ownership,
// by setting the arena to nullptr.
// This is a transitional hack and should be removed once promise based
// filter is removed.
if (free_list_ != nullptr) {
p->~T();
FreePooled(p, free_list_);
}
}
bool has_freelist() const { return free_list_ != nullptr; }
private:
std::atomic<FreePoolNode*>* free_list_;
};
template <typename T>
using PoolPtr = std::unique_ptr<T, PooledDeleter>;
// Make a unique_ptr to T that is allocated from the arena.
// When the pointer is released, the memory may be reused for other
// MakePooled(.*) calls.
// CAUTION: The amount of memory allocated is rounded up to the nearest
// value in Arena::PoolSizes, and so this may pessimize total
// arena size.
template <typename T, typename... Args>
PoolPtr<T> MakePooled(Args&&... args) {
auto* free_list =
&pools_[arena_detail::PoolFromObjectSize<sizeof(T)>(PoolSizes())];
return PoolPtr<T>(
new (AllocPooled(
sizeof(T),
arena_detail::AllocationSizeFromObjectSize<sizeof(T)>(PoolSizes()),
free_list)) T(std::forward<Args>(args)...),
PooledDeleter(free_list));
}
// Make a unique_ptr to an array of T that is allocated from the arena.
// When the pointer is released, the memory may be reused for other
// MakePooled(.*) calls.
// One can use MakePooledArray<char> to allocate a buffer of bytes.
// CAUTION: The amount of memory allocated is rounded up to the nearest
// value in Arena::PoolSizes, and so this may pessimize total
// arena size.
template <typename T>
PoolPtr<T[]> MakePooledArray(size_t n) {
auto where =
arena_detail::ChoosePoolForAllocationSize(n * sizeof(T), PoolSizes());
if (where.pool_index == std::numeric_limits<size_t>::max()) {
return PoolPtr<T[]>(new (Alloc(where.alloc_size)) T[n],
PooledDeleter(nullptr));
} else {
return PoolPtr<T[]>(new (AllocPooled(where.alloc_size, where.alloc_size,
&pools_[where.pool_index])) T[n],
PooledDeleter(&pools_[where.pool_index]));
}
}
// Like MakePooled, but with manual memory management.
// The caller is responsible for calling DeletePooled() on the returned
// pointer, and expected to call it with the same type T as was passed to this
// function (else the free list returned to the arena will be corrupted).
template <typename T, typename... Args>
T* NewPooled(Args&&... args) {
auto* free_list =
&pools_[arena_detail::PoolFromObjectSize<sizeof(T)>(PoolSizes())];
return new (AllocPooled(
sizeof(T),
arena_detail::AllocationSizeFromObjectSize<sizeof(T)>(PoolSizes()),
free_list)) T(std::forward<Args>(args)...);
}
template <typename T>
void DeletePooled(T* p) {
auto* free_list =
&pools_[arena_detail::PoolFromObjectSize<sizeof(T)>(PoolSizes())];
p->~T();
FreePooled(p, free_list);
}
#else
class PooledDeleter {
public:
PooledDeleter() = default;
@ -364,9 +265,25 @@ class Arena {
void DeletePooled(T* p) {
delete p;
}
#endif
template <typename T>
T* GetContext() {
return static_cast<T*>(
contexts()[arena_detail::ArenaContextTraits<T>::id()]);
}
template <typename T>
void SetContext(T* context) {
void*& slot = contexts()[arena_detail::ArenaContextTraits<T>::id()];
if (slot != nullptr) {
ArenaContextType<T>::Destroy(static_cast<T*>(slot));
}
slot = context;
}
private:
friend struct arena_detail::UnrefDestroy;
struct Zone {
Zone* prev;
};
@ -396,41 +313,20 @@ class Arena {
// quick optimization (avoiding an atomic fetch-add) for the common case
// where we wish to create an arena and then perform an immediate
// allocation.
explicit Arena(size_t initial_size, size_t initial_alloc,
MemoryAllocator* memory_allocator)
: total_used_(GPR_ROUND_UP_TO_ALIGNMENT_SIZE(initial_alloc)),
initial_zone_size_(initial_size),
memory_allocator_(memory_allocator) {}
explicit Arena(size_t initial_size,
RefCountedPtr<ArenaFactory> arena_factory);
~Arena();
void* AllocZone(size_t size);
#ifndef GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC
void* AllocPooled(size_t obj_size, size_t alloc_size,
std::atomic<FreePoolNode*>* head);
static void FreePooled(void* p, std::atomic<FreePoolNode*>* head);
#endif
void TracePoolAlloc(size_t size, void* ptr) {
(void)size;
(void)ptr;
#ifdef GRPC_ARENA_TRACE_POOLED_ALLOCATIONS
gpr_log(GPR_ERROR, "ARENA %p ALLOC %" PRIdPTR " @ %p", this, size, ptr);
#endif
}
static void TracePoolFree(void* ptr) {
(void)ptr;
#ifdef GRPC_ARENA_TRACE_POOLED_ALLOCATIONS
gpr_log(GPR_ERROR, "FREE %p", ptr);
#endif
}
void Destroy() const;
void** contexts() { return reinterpret_cast<void**>(this + 1); }
// Keep track of the total used size. We use this in our call sizing
// hysteresis.
std::atomic<size_t> total_used_{0};
std::atomic<size_t> total_allocated_{0};
const size_t initial_zone_size_;
std::atomic<size_t> total_used_;
std::atomic<size_t> total_allocated_{initial_zone_size_};
// If the initial arena allocation wasn't enough, we allocate additional zones
// in a reverse linked list. Each additional zone consists of (1) a pointer to
// the zone added before this zone (null if this is the first additional zone)
@ -438,27 +334,30 @@ class Arena {
// last zone; the zone list is reverse-walked during arena destruction only.
std::atomic<Zone*> last_zone_{nullptr};
std::atomic<ManagedNewObject*> managed_new_head_{nullptr};
#ifndef GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC
std::atomic<FreePoolNode*> pools_[PoolSizes::size()]{};
#endif
// The backing memory quota
MemoryAllocator* const memory_allocator_;
};
// Smart pointer for arenas when the final size is not required.
struct ScopedArenaDeleter {
void operator()(Arena* arena) { arena->Destroy(); }
RefCountedPtr<ArenaFactory> arena_factory_;
};
using ScopedArenaPtr = std::unique_ptr<Arena, ScopedArenaDeleter>;
inline ScopedArenaPtr MakeScopedArena(size_t initial_size,
MemoryAllocator* memory_allocator) {
return ScopedArenaPtr(Arena::Create(initial_size, memory_allocator));
}
// Arenas form a context for activities
template <>
struct ContextType<Arena> {};
namespace arena_detail {
inline void UnrefDestroy::operator()(const Arena* arena) const {
arena->Destroy();
}
} // namespace arena_detail
namespace promise_detail {
template <typename T>
class Context<T, absl::void_t<decltype(ArenaContextType<T>::Destroy)>> {
public:
static T* get() { return GetContext<Arena>()->GetContext<T>(); }
static void set(T* value) { GetContext<Arena>()->SetContext(value); }
};
} // namespace promise_detail
} // namespace grpc_core
#endif // GRPC_SRC_CORE_LIB_RESOURCE_QUOTA_ARENA_H

@ -253,9 +253,9 @@ GrpcMemoryAllocatorImpl::GrpcMemoryAllocatorImpl(
}
GrpcMemoryAllocatorImpl::~GrpcMemoryAllocatorImpl() {
CHECK(free_bytes_.load(std::memory_order_acquire) +
sizeof(GrpcMemoryAllocatorImpl) ==
taken_bytes_.load(std::memory_order_relaxed));
CHECK_EQ(free_bytes_.load(std::memory_order_acquire) +
sizeof(GrpcMemoryAllocatorImpl),
taken_bytes_.load(std::memory_order_relaxed));
memory_quota_->Return(taken_bytes_.load(std::memory_order_relaxed));
}

@ -96,6 +96,8 @@ class TlsChannelCredsFactory : public ChannelCredsFactory<> {
}
options->set_watch_root_cert(!config->ca_certificate_file().empty());
options->set_watch_identity_pair(!config->certificate_file().empty());
options->set_certificate_verifier(
MakeRefCounted<HostNameCertificateVerifier>());
return MakeRefCounted<TlsCredentials>(std::move(options));
}

@ -39,10 +39,10 @@
#include <grpc/support/string_util.h>
#include "src/core/lib/gprpp/env.h"
#include "src/core/lib/http/httpcli_ssl_credentials.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/uri/uri_parser.h"
#include "src/core/util/http_client/httpcli_ssl_credentials.h"
#include "src/core/util/json/json.h"
#include "src/core/util/json/json_reader.h"
#include "src/core/util/json/json_writer.h"

@ -28,11 +28,11 @@
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/http/httpcli.h"
#include "src/core/lib/http/parser.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/security/credentials/external/aws_request_signer.h"
#include "src/core/lib/security/credentials/external/external_account_credentials.h"
#include "src/core/util/http_client/httpcli.h"
#include "src/core/util/http_client/parser.h"
namespace grpc_core {

@ -46,14 +46,14 @@
#include <grpc/support/string_util.h>
#include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/http/httpcli_ssl_credentials.h"
#include "src/core/lib/http/parser.h"
#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/security/credentials/external/aws_external_account_credentials.h"
#include "src/core/lib/security/credentials/external/file_external_account_credentials.h"
#include "src/core/lib/security/credentials/external/url_external_account_credentials.h"
#include "src/core/lib/security/util/json_util.h"
#include "src/core/lib/uri/uri_parser.h"
#include "src/core/util/http_client/httpcli_ssl_credentials.h"
#include "src/core/util/http_client/parser.h"
#include "src/core/util/json/json_reader.h"
#include "src/core/util/json/json_writer.h"

@ -30,12 +30,12 @@
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/http/httpcli.h"
#include "src/core/lib/http/parser.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/security/credentials/oauth2/oauth2_credentials.h"
#include "src/core/util/http_client/httpcli.h"
#include "src/core/util/http_client/parser.h"
#include "src/core/util/json/json.h"
namespace grpc_core {

@ -37,11 +37,11 @@
#include <grpc/support/port_platform.h>
#include <grpc/support/string_util.h>
#include "src/core/lib/http/httpcli_ssl_credentials.h"
#include "src/core/lib/http/parser.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/transport/error_utils.h"
#include "src/core/util/http_client/httpcli_ssl_credentials.h"
#include "src/core/util/http_client/parser.h"
#include "src/core/util/json/json.h"
#include "src/core/util/json/json_reader.h"

@ -28,10 +28,10 @@
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/http/httpcli.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/security/credentials/external/external_account_credentials.h"
#include "src/core/lib/uri/uri_parser.h"
#include "src/core/util/http_client/httpcli.h"
namespace grpc_core {

@ -50,8 +50,6 @@
#include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/http/httpcli.h"
#include "src/core/lib/http/parser.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/exec_ctx.h"
@ -71,6 +69,8 @@
#include "src/core/lib/uri/uri_parser.h"
#include "src/core/load_balancing/grpclb/grpclb.h"
#include "src/core/load_balancing/xds/xds_channel_args.h"
#include "src/core/util/http_client/httpcli.h"
#include "src/core/util/http_client/parser.h"
#include "src/core/util/json/json.h"
#include "src/core/util/json/json_reader.h"

@ -58,9 +58,6 @@
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/http/httpcli.h"
#include "src/core/lib/http/httpcli_ssl_credentials.h"
#include "src/core/lib/http/parser.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/exec_ctx.h"
@ -71,6 +68,9 @@
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/uri/uri_parser.h"
#include "src/core/tsi/ssl_types.h"
#include "src/core/util/http_client/httpcli.h"
#include "src/core/util/http_client/httpcli_ssl_credentials.h"
#include "src/core/util/http_client/parser.h"
#include "src/core/util/json/json_reader.h"
#include "src/core/util/string.h"

@ -51,7 +51,6 @@
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/http/httpcli_ssl_credentials.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/pollset_set.h"
#include "src/core/lib/promise/context.h"
@ -62,6 +61,7 @@
#include "src/core/lib/transport/error_utils.h"
#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/uri/uri_parser.h"
#include "src/core/util/http_client/httpcli_ssl_credentials.h"
#include "src/core/util/json/json.h"
#include "src/core/util/json/json_reader.h"

@ -37,8 +37,6 @@
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/gprpp/unique_type_name.h"
#include "src/core/lib/http/httpcli.h"
#include "src/core/lib/http/parser.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/polling_entity.h"
@ -48,6 +46,8 @@
#include "src/core/lib/slice/slice.h"
#include "src/core/lib/transport/transport.h"
#include "src/core/lib/uri/uri_parser.h"
#include "src/core/util/http_client/httpcli.h"
#include "src/core/util/http_client/parser.h"
#include "src/core/util/json/json.h"
#include "src/core/util/useful.h"

@ -380,15 +380,15 @@ void Call::Run() {
class ChannelBasedCall : public Call {
protected:
ChannelBasedCall(Arena* arena, bool is_client, Timestamp send_deadline,
RefCountedPtr<Channel> channel)
ChannelBasedCall(RefCountedPtr<Arena> arena, bool is_client,
Timestamp send_deadline, RefCountedPtr<Channel> channel)
: Call(is_client, send_deadline, channel->event_engine()),
arena_(arena),
arena_(std::move(arena)),
channel_(std::move(channel)) {
DCHECK_NE(arena_, nullptr);
DCHECK_NE(arena_.get(), nullptr);
}
Arena* arena() final { return arena_; }
Arena* arena() final { return arena_.get(); }
char* GetPeer() final {
Slice peer_slice = GetPeerString();
@ -415,18 +415,17 @@ class ChannelBasedCall : public Call {
void DeleteThis() {
RefCountedPtr<Channel> channel = std::move(channel_);
Arena* arena = arena_;
RefCountedPtr<Arena> arena = arena_;
this->~ChannelBasedCall();
channel->DestroyArena(arena);
}
Channel* channel() const { return channel_.get(); }
// Non-virtual arena accessor -- needed by PipeBasedCall
Arena* GetArena() { return arena_; }
Arena* GetArena() { return arena_.get(); }
private:
Arena* const arena_;
const RefCountedPtr<Arena> arena_;
RefCountedPtr<Channel> channel_;
};
@ -597,8 +596,9 @@ class FilterStackCall final : public ChannelBasedCall {
void FinishBatch(grpc_error_handle error);
};
FilterStackCall(Arena* arena, const grpc_call_create_args& args)
: ChannelBasedCall(arena, args.server_transport_data == nullptr,
FilterStackCall(RefCountedPtr<Arena> arena, const grpc_call_create_args& args)
: ChannelBasedCall(std::move(arena),
args.server_transport_data == nullptr,
args.send_deadline, args.channel->Ref()),
cq_(args.cq),
stream_op_payload_(context_) {
@ -732,7 +732,7 @@ grpc_error_handle FilterStackCall::Create(grpc_call_create_args* args,
GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(FilterStackCall)) +
channel_stack->call_stack_size;
Arena* arena = channel->CreateArena();
RefCountedPtr<Arena> arena = channel->call_arena_allocator()->MakeArena();
call = new (arena->Alloc(call_alloc_size)) FilterStackCall(arena, *args);
DCHECK(FromC(call->c_ptr()) == call);
DCHECK(FromCallStack(call->call_stack()) == call);
@ -771,7 +771,7 @@ grpc_error_handle FilterStackCall::Create(grpc_call_create_args* args,
args->server->server_call_tracer_factory() != nullptr) {
auto* server_call_tracer =
args->server->server_call_tracer_factory()->CreateNewServerCallTracer(
arena, args->server->channel_args());
arena.get(), args->server->channel_args());
if (server_call_tracer != nullptr) {
// Note that we are setting both
// GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE and
@ -1906,10 +1906,12 @@ class BasicPromiseBasedCall : public ChannelBasedCall, public Party {
public:
using Call::arena;
BasicPromiseBasedCall(Arena* arena, uint32_t initial_external_refs,
BasicPromiseBasedCall(RefCountedPtr<Arena> arena,
uint32_t initial_external_refs,
uint32_t initial_internal_refs,
const grpc_call_create_args& args)
: ChannelBasedCall(arena, args.server_transport_data == nullptr,
: ChannelBasedCall(std::move(arena),
args.server_transport_data == nullptr,
args.send_deadline, args.channel->Ref()),
Party(initial_internal_refs),
external_refs_(initial_external_refs),
@ -2067,7 +2069,7 @@ class BasicPromiseBasedCall : public ChannelBasedCall, public Party {
class PromiseBasedCall : public BasicPromiseBasedCall {
public:
PromiseBasedCall(Arena* arena, uint32_t initial_external_refs,
PromiseBasedCall(RefCountedPtr<Arena> arena, uint32_t initial_external_refs,
const grpc_call_create_args& args);
bool Completed() final { return finished_.IsSet(); }
@ -2348,17 +2350,17 @@ template <typename T>
grpc_error_handle MakePromiseBasedCall(grpc_call_create_args* args,
grpc_call** out_call) {
Channel* channel = args->channel.get();
auto* arena = channel->CreateArena();
auto arena = channel->call_arena_allocator()->MakeArena();
PromiseBasedCall* call = arena->New<T>(arena, args);
*out_call = call->c_ptr();
DCHECK(Call::FromC(*out_call) == call);
return absl::OkStatus();
}
PromiseBasedCall::PromiseBasedCall(Arena* arena, uint32_t initial_external_refs,
PromiseBasedCall::PromiseBasedCall(RefCountedPtr<Arena> arena,
uint32_t initial_external_refs,
const grpc_call_create_args& args)
: BasicPromiseBasedCall(arena, initial_external_refs,
: BasicPromiseBasedCall(std::move(arena), initial_external_refs,
initial_external_refs != 0 ? 1 : 0, args) {}
static void CToMetadata(grpc_metadata* metadata, size_t count,
@ -2591,8 +2593,9 @@ void PublishMetadataArray(grpc_metadata_batch* md, grpc_metadata_array* array,
#ifdef GRPC_EXPERIMENT_IS_INCLUDED_PROMISE_BASED_CLIENT_CALL
class ClientPromiseBasedCall final : public PromiseBasedCall {
public:
ClientPromiseBasedCall(Arena* arena, grpc_call_create_args* args)
: PromiseBasedCall(arena, 1, *args),
ClientPromiseBasedCall(RefCountedPtr<Arena> arena,
grpc_call_create_args* args)
: PromiseBasedCall(std::move(arena), 1, *args),
polling_entity_(
args->cq != nullptr
? grpc_polling_entity_create_from_pollset(

@ -130,6 +130,8 @@ class Call : public CppImplOf<Call, grpc_call>,
// Implementation of EventEngine::Closure, called when deadline expires
void Run() final;
gpr_cycle_counter start_time() const { return start_time_; }
protected:
// The maximum number of concurrent batches possible.
// Based upon the maximum number of individually queueable ops in the batch
@ -209,8 +211,6 @@ class Call : public CppImplOf<Call, grpc_call>,
void HandleCompressionAlgorithmNotAccepted(
grpc_compression_algorithm compression_algorithm) GPR_ATTRIBUTE_NOINLINE;
gpr_cycle_counter start_time() const { return start_time_; }
virtual grpc_compression_options compression_options() = 0;
private:

@ -65,7 +65,12 @@ Channel::RegisteredCall::~RegisteredCall() {}
Channel::Channel(std::string target, const ChannelArgs& channel_args)
: target_(std::move(target)),
channelz_node_(channel_args.GetObjectRef<channelz::ChannelNode>()),
compression_options_(CompressionOptionsFromChannelArgs(channel_args)) {}
compression_options_(CompressionOptionsFromChannelArgs(channel_args)),
call_arena_allocator_(MakeRefCounted<CallArenaAllocator>(
channel_args.GetObject<ResourceQuota>()
->memory_quota()
->CreateMemoryOwner(),
1024)) {}
Channel::RegisteredCall* Channel::RegisterCall(const char* method,
const char* host) {

@ -40,8 +40,10 @@
#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/iomgr/iomgr_fwd.h"
#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/resource_quota/resource_quota.h"
#include "src/core/lib/slice/slice.h"
#include "src/core/lib/surface/channel_stack_type.h"
#include "src/core/lib/transport/call_arena_allocator.h"
#include "src/core/lib/transport/connectivity_state.h"
// Forward declaration to avoid dependency loop.
@ -52,7 +54,7 @@ namespace grpc_core {
// Forward declaration to avoid dependency loop.
class Transport;
class Channel : public RefCounted<Channel>,
class Channel : public InternallyRefCounted<Channel>,
public CppImplOf<Channel, grpc_channel> {
public:
struct RegisteredCall {
@ -66,10 +68,17 @@ class Channel : public RefCounted<Channel>,
~RegisteredCall();
};
virtual void Orphan() = 0;
virtual Arena* CreateArena() = 0;
virtual void DestroyArena(Arena* arena) = 0;
// Though internally ref counted channels expose their "Ref" method to
// create a RefCountedPtr to themselves. The OrphanablePtr owner is the
// singleton decision maker on whether the channel should be destroyed or
// not.
// TODO(ctiller): in a future change (I have it written) these will be removed
// and substituted with DualRefCounted<Channel> as a base.
RefCountedPtr<Channel> Ref() { return InternallyRefCounted<Channel>::Ref(); }
template <typename T>
RefCountedPtr<T> RefAsSubclass() {
return InternallyRefCounted<Channel>::RefAsSubclass<T>();
}
virtual bool IsLame() const = 0;
@ -129,6 +138,10 @@ class Channel : public RefCounted<Channel>,
virtual bool is_client() const { return true; }
virtual bool is_promising() const { return true; }
CallArenaAllocator* call_arena_allocator() const {
return call_arena_allocator_.get();
}
protected:
Channel(std::string target, const ChannelArgs& channel_args);
@ -143,6 +156,7 @@ class Channel : public RefCounted<Channel>,
// the C++ or other wrapped language Channel that registered these calls).
std::map<std::pair<std::string, std::string>, RegisteredCall>
registration_table_ ABSL_GUARDED_BY(mu_);
const RefCountedPtr<CallArenaAllocator> call_arena_allocator_;
};
} // namespace grpc_core

@ -22,8 +22,10 @@
#include <grpc/support/port_platform.h>
#include "src/core/channelz/channelz.h"
#include "src/core/client_channel/client_channel.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/experiments/experiments.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/lame_client.h"
#include "src/core/lib/surface/legacy_channel.h"
@ -77,9 +79,13 @@ absl::StatusOr<OrphanablePtr<Channel>> ChannelCreate(
if (optional_transport != nullptr) {
args = args.SetObject(optional_transport);
}
// Delegate to legacy channel impl.
return LegacyChannel::Create(std::move(target), std::move(args),
channel_stack_type);
// Delegate to appropriate channel impl.
if (!IsCallV3Enabled()) {
return LegacyChannel::Create(std::move(target), std::move(args),
channel_stack_type);
}
CHECK_EQ(channel_stack_type, GRPC_CLIENT_CHANNEL);
return ClientChannel::Create(std::move(target), std::move(args));
}
} // namespace grpc_core

@ -113,10 +113,7 @@ LegacyChannel::LegacyChannel(bool is_client, bool is_promising,
: Channel(std::move(target), channel_args),
is_client_(is_client),
is_promising_(is_promising),
channel_stack_(std::move(channel_stack)),
allocator_(channel_args.GetObject<ResourceQuota>()
->memory_quota()
->CreateMemoryOwner()) {
channel_stack_(std::move(channel_stack)) {
// We need to make sure that grpc_shutdown() does not shut things down
// until after the channel is destroyed. However, the channel may not
// actually be destroyed by the time grpc_channel_destroy() returns,

@ -39,6 +39,7 @@
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/channel_stack_type.h"
#include "src/core/lib/transport/call_arena_allocator.h"
#include "src/core/lib/transport/transport.h"
#include "src/core/telemetry/stats.h"
namespace grpc_core {
@ -56,16 +57,6 @@ class LegacyChannel final : public Channel {
void Orphan() override;
Arena* CreateArena() override {
const size_t initial_size = call_size_estimator_.CallSizeEstimate();
global_stats().IncrementCallInitialSize(initial_size);
return Arena::Create(initial_size, &allocator_);
}
void DestroyArena(Arena* arena) override {
call_size_estimator_.UpdateCallSizeEstimate(arena->TotalUsedBytes());
arena->Destroy();
}
bool IsLame() const override;
grpc_call* CreateCall(grpc_call* parent_call, uint32_t propagation_mask,
@ -114,8 +105,6 @@ class LegacyChannel final : public Channel {
const bool is_client_;
const bool is_promising_;
RefCountedPtr<grpc_channel_stack> channel_stack_;
CallSizeEstimator call_size_estimator_{1024};
grpc_event_engine::experimental::MemoryAllocator allocator_;
};
} // namespace grpc_core

@ -28,7 +28,7 @@
namespace grpc_core {
class CallSizeEstimator {
class CallSizeEstimator final {
public:
explicit CallSizeEstimator(size_t initial_estimate)
: call_size_estimate_(initial_estimate) {}
@ -52,19 +52,21 @@ class CallSizeEstimator {
std::atomic<size_t> call_size_estimate_;
};
class CallArenaAllocator : public RefCounted<CallArenaAllocator> {
class CallArenaAllocator final : public ArenaFactory {
public:
CallArenaAllocator(MemoryAllocator allocator, size_t initial_size)
: allocator_(std::move(allocator)), call_size_estimator_(initial_size) {}
: ArenaFactory(std::move(allocator)),
call_size_estimator_(initial_size) {}
Arena* MakeArena() {
return Arena::Create(call_size_estimator_.CallSizeEstimate(), &allocator_);
RefCountedPtr<Arena> MakeArena() override {
return Arena::Create(call_size_estimator_.CallSizeEstimate(), Ref());
}
void Destroy(Arena* arena) { arena->Destroy(); }
void FinalizeArena(Arena* arena) override {
call_size_estimator_.UpdateCallSizeEstimate(arena->TotalUsedBytes());
}
private:
MemoryAllocator allocator_;
CallSizeEstimator call_size_estimator_;
};

@ -31,6 +31,8 @@ namespace grpc_core {
class UnstartedCallDestination
: public DualRefCounted<UnstartedCallDestination> {
public:
using DualRefCounted::DualRefCounted;
~UnstartedCallDestination() override = default;
// Start a call. The UnstartedCallHandler will be consumed by the Destination
// and started.

@ -170,8 +170,15 @@ Poll<T> InfallibleOperationExecutor<T>::ContinueStep(void* call_data) {
template class OperationExecutor<ClientMetadataHandle>;
template class OperationExecutor<MessageHandle>;
template class InfallibleOperationExecutor<ServerMetadataHandle>;
} // namespace filters_detail
namespace {
// Call data for those calls that don't have any call data
// (we form pointers to this that aren't allowed to be nullptr)
char g_empty_call_data;
} // namespace
///////////////////////////////////////////////////////////////////////////////
// CallFilters
@ -181,7 +188,7 @@ CallFilters::CallFilters(ClientMetadataHandle client_initial_metadata)
client_initial_metadata_(std::move(client_initial_metadata)) {}
CallFilters::~CallFilters() {
if (call_data_ != nullptr) {
if (call_data_ != nullptr && call_data_ != &g_empty_call_data) {
for (const auto& destructor : stack_->data_.filter_destructor) {
destructor.call_destroy(Offset(call_data_, destructor.call_offset));
}
@ -192,8 +199,12 @@ CallFilters::~CallFilters() {
void CallFilters::SetStack(RefCountedPtr<Stack> stack) {
CHECK_EQ(call_data_, nullptr);
stack_ = std::move(stack);
call_data_ = gpr_malloc_aligned(stack_->data_.call_data_size,
stack_->data_.call_data_alignment);
if (stack_->data_.call_data_size != 0) {
call_data_ = gpr_malloc_aligned(stack_->data_.call_data_size,
stack_->data_.call_data_alignment);
} else {
call_data_ = &g_empty_call_data;
}
for (const auto& constructor : stack_->data_.filter_constructor) {
constructor.call_init(Offset(call_data_, constructor.call_offset),
constructor.channel_data);
@ -232,7 +243,8 @@ void CallFilters::PushServerTrailingMetadata(ServerMetadataHandle md) {
md->DebugString().c_str(), DebugString().c_str());
}
CHECK(md != nullptr);
if (server_trailing_metadata_ != nullptr) return;
if (cancelled_.is_set()) return;
cancelled_.Set(md->get(GrpcCallWasCancelled()).value_or(false));
server_trailing_metadata_ = std::move(md);
client_initial_metadata_state_.CloseWithError();
server_initial_metadata_state_.CloseSending();

@ -23,6 +23,7 @@
#include <grpc/support/port_platform.h>
#include "src/core/lib/gprpp/dump_args.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/promise/latch.h"
@ -1944,11 +1945,7 @@ inline auto CallFilters::PullServerToClientMessage() {
}
inline auto CallFilters::PullServerTrailingMetadata() {
return Map(PullServerTrailingMetadataPromise(this),
[this](ServerMetadataHandle h) {
cancelled_.Set(h->get(GrpcCallWasCancelled()).value_or(false));
return h;
});
return PullServerTrailingMetadataPromise(this);
}
inline auto CallFilters::WasCancelled() { return cancelled_.Wait(); }

@ -94,12 +94,12 @@ void ForwardCall(CallHandler call_handler, CallInitiator call_initiator) {
CallInitiatorAndHandler MakeCallPair(
ClientMetadataHandle client_initial_metadata,
grpc_event_engine::experimental::EventEngine* event_engine, Arena* arena,
RefCountedPtr<CallArenaAllocator> call_arena_allocator_if_arena_is_owned,
grpc_call_context_element* legacy_context) {
auto spine = CallSpine::Create(
std::move(client_initial_metadata), event_engine, arena,
std::move(call_arena_allocator_if_arena_is_owned), legacy_context);
grpc_event_engine::experimental::EventEngine* event_engine,
RefCountedPtr<Arena> arena, grpc_call_context_element* legacy_context) {
CHECK_NE(arena.get(), nullptr);
auto spine =
CallSpine::Create(std::move(client_initial_metadata), event_engine,
std::move(arena), legacy_context);
return {CallInitiator(spine), UnstartedCallHandler(spine)};
}

@ -21,13 +21,16 @@
#include <grpc/support/port_platform.h>
#include "src/core/lib/channel/context.h"
#include "src/core/lib/gprpp/dual_ref_counted.h"
#include "src/core/lib/promise/detail/status.h"
#include "src/core/lib/promise/if.h"
#include "src/core/lib/promise/latch.h"
#include "src/core/lib/promise/party.h"
#include "src/core/lib/promise/pipe.h"
#include "src/core/lib/promise/prioritized_race.h"
#include "src/core/lib/promise/promise.h"
#include "src/core/lib/promise/status_flag.h"
#include "src/core/lib/promise/try_seq.h"
#include "src/core/lib/transport/call_arena_allocator.h"
#include "src/core/lib/transport/call_filters.h"
#include "src/core/lib/transport/message.h"
@ -135,6 +138,23 @@ class CallSpineInterface {
});
}
// Wrap a promise so that if the call completes that promise is cancelled.
template <typename Promise>
auto UntilCallCompletes(Promise promise) {
using Result = PromiseResult<Promise>;
return PrioritizedRace(std::move(promise), Map(WasCancelled(), [](bool) {
return FailureStatusCast<Result>(Failure{});
}));
}
template <typename PromiseFactory>
void SpawnGuardedUntilCallCompletes(absl::string_view name,
PromiseFactory promise_factory) {
SpawnGuarded(name, [this, promise_factory]() mutable {
return UntilCallCompletes(promise_factory());
});
}
private:
absl::AnyInvocable<void()> on_done_{nullptr};
};
@ -260,19 +280,19 @@ class CallSpine final : public CallSpineInterface, public Party {
public:
static RefCountedPtr<CallSpine> Create(
ClientMetadataHandle client_initial_metadata,
grpc_event_engine::experimental::EventEngine* event_engine, Arena* arena,
RefCountedPtr<CallArenaAllocator> call_arena_allocator_if_arena_is_owned,
grpc_call_context_element* legacy_context) {
return RefCountedPtr<CallSpine>(arena->New<CallSpine>(
std::move(client_initial_metadata), event_engine, arena,
std::move(call_arena_allocator_if_arena_is_owned), legacy_context));
grpc_event_engine::experimental::EventEngine* event_engine,
RefCountedPtr<Arena> arena, grpc_call_context_element* legacy_context) {
auto* arena_ptr = arena.get();
return RefCountedPtr<CallSpine>(arena_ptr->New<CallSpine>(
std::move(client_initial_metadata), event_engine, std::move(arena),
legacy_context));
}
~CallSpine() override {
if (legacy_context_is_owned_) {
for (size_t i = 0; i < GRPC_CONTEXT_COUNT; i++) {
grpc_call_context_element& elem = legacy_context_[i];
if (elem.destroy != nullptr) elem.destroy(&elem);
if (elem.destroy != nullptr) elem.destroy(elem.value);
}
}
}
@ -281,7 +301,7 @@ class CallSpine final : public CallSpineInterface, public Party {
Party& party() override { return *this; }
Arena* arena() override { return arena_; }
Arena* arena() override { return arena_.get(); }
void IncrementRefCount() override { Party::IncrementRefCount(); }
@ -365,18 +385,15 @@ class CallSpine final : public CallSpineInterface, public Party {
friend class Arena;
CallSpine(ClientMetadataHandle client_initial_metadata,
grpc_event_engine::experimental::EventEngine* event_engine,
Arena* arena,
RefCountedPtr<CallArenaAllocator> call_arena_allocator,
RefCountedPtr<Arena> arena,
grpc_call_context_element* legacy_context)
: Party(1),
arena_(std::move(arena)),
call_filters_(std::move(client_initial_metadata)),
arena_(arena),
event_engine_(event_engine),
call_arena_allocator_if_arena_is_owned_(
std::move(call_arena_allocator)) {
event_engine_(event_engine) {
if (legacy_context == nullptr) {
legacy_context_ = static_cast<grpc_call_context_element*>(
arena->Alloc(sizeof(grpc_call_context_element) * GRPC_CONTEXT_COUNT));
legacy_context_ = static_cast<grpc_call_context_element*>(arena_->Alloc(
sizeof(grpc_call_context_element) * GRPC_CONTEXT_COUNT));
memset(legacy_context_, 0,
sizeof(grpc_call_context_element) * GRPC_CONTEXT_COUNT);
legacy_context_is_owned_ = true;
@ -395,7 +412,7 @@ class CallSpine final : public CallSpineInterface, public Party {
public:
explicit ScopedContext(CallSpine* spine)
: ScopedActivity(spine),
Context<Arena>(spine->arena_),
Context<Arena>(spine->arena_.get()),
Context<grpc_event_engine::experimental::EventEngine>(
spine->event_engine()),
Context<grpc_call_context_element>(spine->legacy_context_) {}
@ -407,29 +424,23 @@ class CallSpine final : public CallSpineInterface, public Party {
}
void PartyOver() override {
Arena* a = arena_;
RefCountedPtr<CallArenaAllocator> call_arena_allocator_if_arena_is_owned =
std::move(call_arena_allocator_if_arena_is_owned_);
auto arena = arena_;
{
ScopedContext context(this);
CancelRemainingParticipants();
a->DestroyManagedNewObjects();
arena->DestroyManagedNewObjects();
}
this->~CallSpine();
if (call_arena_allocator_if_arena_is_owned != nullptr) {
call_arena_allocator_if_arena_is_owned->Destroy(a);
}
}
const RefCountedPtr<Arena> arena_;
// Call filters/pipes part of the spine
CallFilters call_filters_;
Arena* const arena_;
// Event engine associated with this call
grpc_event_engine::experimental::EventEngine* const event_engine_;
// Legacy context
// TODO(ctiller): remove
grpc_call_context_element* legacy_context_;
RefCountedPtr<CallArenaAllocator> call_arena_allocator_if_arena_is_owned_;
bool legacy_context_is_owned_;
};
@ -472,6 +483,12 @@ class CallInitiator {
spine_->SpawnGuarded(name, std::move(promise_factory));
}
template <typename PromiseFactory>
void SpawnGuardedUntilCallCompletes(absl::string_view name,
PromiseFactory promise_factory) {
spine_->SpawnGuardedUntilCallCompletes(name, std::move(promise_factory));
}
template <typename PromiseFactory>
void SpawnInfallible(absl::string_view name, PromiseFactory promise_factory) {
spine_->SpawnInfallible(name, std::move(promise_factory));
@ -526,6 +543,12 @@ class CallHandler {
spine_->SpawnGuarded(name, std::move(promise_factory), whence);
}
template <typename PromiseFactory>
void SpawnGuardedUntilCallCompletes(absl::string_view name,
PromiseFactory promise_factory) {
spine_->SpawnGuardedUntilCallCompletes(name, std::move(promise_factory));
}
template <typename PromiseFactory>
void SpawnInfallible(absl::string_view name, PromiseFactory promise_factory) {
spine_->SpawnInfallible(name, std::move(promise_factory));
@ -577,6 +600,12 @@ class UnstartedCallHandler {
spine_->SpawnGuarded(name, std::move(promise_factory), whence);
}
template <typename PromiseFactory>
void SpawnGuardedUntilCallCompletes(absl::string_view name,
PromiseFactory promise_factory) {
spine_->SpawnGuardedUntilCallCompletes(name, std::move(promise_factory));
}
template <typename PromiseFactory>
void SpawnInfallible(absl::string_view name, PromiseFactory promise_factory) {
spine_->SpawnInfallible(name, std::move(promise_factory));
@ -616,9 +645,8 @@ struct CallInitiatorAndHandler {
CallInitiatorAndHandler MakeCallPair(
ClientMetadataHandle client_initial_metadata,
grpc_event_engine::experimental::EventEngine* event_engine, Arena* arena,
RefCountedPtr<CallArenaAllocator> call_arena_allocator_if_arena_is_owned,
grpc_call_context_element* legacy_context);
grpc_event_engine::experimental::EventEngine* event_engine,
RefCountedPtr<Arena> arena, grpc_call_context_element* legacy_context);
template <typename CallHalf>
auto OutgoingMessages(CallHalf h) {

@ -40,7 +40,7 @@ CallInitiator HijackedCall::MakeCall() {
CallInitiator HijackedCall::MakeCallWithMetadata(
ClientMetadataHandle metadata) {
auto call = MakeCallPair(std::move(metadata), call_handler_.event_engine(),
call_handler_.arena(), nullptr,
call_handler_.arena()->Ref(),
call_handler_.legacy_context());
destination_->StartCall(std::move(call.handler));
return std::move(call.initiator);

@ -528,6 +528,14 @@ struct WaitForReady {
static std::string DisplayValue(ValueType x);
};
// Annotation added by retry code to indicate a transparent retry.
struct IsTransparentRetry {
static absl::string_view DebugKey() { return "IsTransparentRetry"; }
static constexpr bool kRepeatable = false;
using ValueType = bool;
static std::string DisplayValue(ValueType x) { return x ? "true" : "false"; }
};
// Annotation added by a transport to note that server trailing metadata
// is a Trailers-Only response.
struct GrpcTrailersOnly {
@ -1536,7 +1544,8 @@ using grpc_metadata_batch_base = grpc_core::MetadataMap<
grpc_core::GrpcStreamNetworkState, grpc_core::PeerString,
grpc_core::GrpcStatusContext, grpc_core::GrpcStatusFromWire,
grpc_core::GrpcCallWasCancelled, grpc_core::WaitForReady,
grpc_core::GrpcTrailersOnly, grpc_core::GrpcTarPit,
grpc_core::IsTransparentRetry, grpc_core::GrpcTrailersOnly,
grpc_core::GrpcTarPit,
grpc_core::GrpcRegisteredMethod GRPC_CUSTOM_CLIENT_METADATA
GRPC_CUSTOM_SERVER_METADATA>;

@ -484,6 +484,16 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
ChannelArgs channel_args_;
};
namespace promise_detail {
template <>
struct OldStyleContext<LoadBalancingPolicy::SubchannelCallTrackerInterface> {
static constexpr grpc_context_index kIndex =
GRPC_SUBCHANNEL_CALL_TRACKER_INTERFACE;
};
} // namespace promise_detail
} // namespace grpc_core
#endif // GRPC_SRC_CORE_LOAD_BALANCING_LB_POLICY_H

@ -33,6 +33,7 @@
#include "src/core/lib/channel/context.h"
#include "src/core/lib/gprpp/ref_counted_string.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/promise/context.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"
@ -221,6 +222,21 @@ void AddClientCallTracerToContext(grpc_call_context_element* call_context,
void AddServerCallTracerToContext(grpc_call_context_element* call_context,
ServerCallTracer* tracer);
template <>
struct ContextSubclass<ClientCallTracer::CallAttemptTracer> {
using Base = CallTracerInterface;
};
template <>
struct ContextSubclass<ServerCallTracer> {
using Base = CallTracerInterface;
};
template <>
struct ContextSubclass<ClientCallTracer> {
using Base = CallTracerAnnotationInterface;
};
} // namespace grpc_core
#endif // GRPC_SRC_CORE_TELEMETRY_CALL_TRACER_H

@ -16,7 +16,9 @@
//
//
#include "src/core/lib/http/format_request.h"
#include <grpc/support/port_platform.h>
#include "src/core/util/http_client/format_request.h"
#include <stdio.h>
#include <string.h>
@ -31,9 +33,8 @@
#include "absl/strings/string_view.h"
#include <grpc/slice.h>
#include <grpc/support/port_platform.h>
#include "src/core/lib/http/httpcli.h"
#include "src/core/util/http_client/httpcli.h"
static void fill_common_header(const grpc_http_request* request,
const char* host, const char* path,

@ -16,13 +16,14 @@
//
//
#ifndef GRPC_SRC_CORE_LIB_HTTP_FORMAT_REQUEST_H
#define GRPC_SRC_CORE_LIB_HTTP_FORMAT_REQUEST_H
#ifndef GRPC_SRC_CORE_UTIL_HTTP_CLIENT_FORMAT_REQUEST_H
#define GRPC_SRC_CORE_UTIL_HTTP_CLIENT_FORMAT_REQUEST_H
#include <grpc/slice.h>
#include <grpc/support/port_platform.h>
#include "src/core/lib/http/parser.h"
#include <grpc/slice.h>
#include "src/core/util/http_client/parser.h"
grpc_slice grpc_httpcli_format_get_request(const grpc_http_request* request,
const char* host, const char* path);
@ -34,4 +35,4 @@ grpc_slice grpc_httpcli_format_connect_request(const grpc_http_request* request,
const char* host,
const char* path);
#endif // GRPC_SRC_CORE_LIB_HTTP_FORMAT_REQUEST_H
#endif // GRPC_SRC_CORE_UTIL_HTTP_CLIENT_FORMAT_REQUEST_H

@ -16,7 +16,9 @@
//
//
#include "src/core/lib/http/httpcli.h"
#include <grpc/support/port_platform.h>
#include "src/core/util/http_client/httpcli.h"
#include <limits.h>
@ -32,7 +34,6 @@
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/handshaker/handshaker_registry.h"
#include "src/core/handshaker/tcp_connect/tcp_connect_handshaker.h"
@ -41,8 +42,6 @@
#include "src/core/lib/channel/channel_args_preconditioning.h"
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/http/format_request.h"
#include "src/core/lib/http/parser.h"
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/pollset_set.h"
@ -52,6 +51,8 @@
#include "src/core/lib/security/security_connector/security_connector.h"
#include "src/core/lib/slice/slice.h"
#include "src/core/lib/transport/error_utils.h"
#include "src/core/util/http_client/format_request.h"
#include "src/core/util/http_client/parser.h"
namespace grpc_core {

@ -16,8 +16,10 @@
//
//
#ifndef GRPC_SRC_CORE_LIB_HTTP_HTTPCLI_H
#define GRPC_SRC_CORE_LIB_HTTP_HTTPCLI_H
#ifndef GRPC_SRC_CORE_UTIL_HTTP_CLIENT_HTTPCLI_H
#define GRPC_SRC_CORE_UTIL_HTTP_CLIENT_HTTPCLI_H
#include <grpc/support/port_platform.h>
#include <stddef.h>
@ -32,7 +34,6 @@
#include <grpc/grpc.h>
#include <grpc/slice.h>
#include <grpc/support/port_platform.h>
#include "src/core/handshaker/handshaker.h"
#include "src/core/lib/gprpp/debug_location.h"
@ -40,7 +41,6 @@
#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/http/parser.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/error.h"
@ -52,6 +52,7 @@
#include "src/core/lib/iomgr/resolved_address.h"
#include "src/core/lib/resource_quota/resource_quota.h"
#include "src/core/lib/uri/uri_parser.h"
#include "src/core/util/http_client/parser.h"
// User agent this library reports
#define GRPC_HTTPCLI_USER_AGENT "grpc-httpcli/0.0"
@ -264,4 +265,4 @@ class HttpRequest : public InternallyRefCounted<HttpRequest> {
} // namespace grpc_core
#endif // GRPC_SRC_CORE_LIB_HTTP_HTTPCLI_H
#endif // GRPC_SRC_CORE_UTIL_HTTP_CLIENT_HTTPCLI_H

@ -16,6 +16,8 @@
//
//
#include <grpc/support/port_platform.h>
#include <string.h>
#include <string>
@ -32,7 +34,6 @@
#include <grpc/impl/channel_arg_names.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/string_util.h>
#include "src/core/handshaker/handshaker.h"

@ -14,12 +14,13 @@
// limitations under the License.
//
#ifndef GRPC_SRC_CORE_LIB_HTTP_HTTPCLI_SSL_CREDENTIALS_H
#define GRPC_SRC_CORE_LIB_HTTP_HTTPCLI_SSL_CREDENTIALS_H
#ifndef GRPC_SRC_CORE_UTIL_HTTP_CLIENT_HTTPCLI_SSL_CREDENTIALS_H
#define GRPC_SRC_CORE_UTIL_HTTP_CLIENT_HTTPCLI_SSL_CREDENTIALS_H
#include <grpc/grpc.h>
#include <grpc/support/port_platform.h>
#include <grpc/grpc.h>
#include "src/core/lib/gprpp/ref_counted_ptr.h"
namespace grpc_core {
@ -35,4 +36,4 @@ RefCountedPtr<grpc_channel_credentials> CreateHttpRequestSSLCredentials();
} // namespace grpc_core
#endif // GRPC_SRC_CORE_LIB_HTTP_HTTPCLI_SSL_CREDENTIALS_H
#endif // GRPC_SRC_CORE_UTIL_HTTP_CLIENT_HTTPCLI_SSL_CREDENTIALS_H

@ -16,7 +16,9 @@
//
//
#include "src/core/lib/http/parser.h"
#include <grpc/support/port_platform.h>
#include "src/core/util/http_client/parser.h"
#include <string.h>
@ -27,7 +29,6 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
grpc_core::TraceFlag grpc_http1_trace(false, "http1");

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

Loading…
Cancel
Save