Merge branch 'master' into src_core_lib_misc_gpr_log

pull/36713/head
tanvi-jagtap 8 months ago
commit 371b8b6342
  1. 61
      BUILD
  2. 1
      BoringSSL-Package.swift
  3. 238
      CMakeLists.txt
  4. 1
      MAINTAINERS.md
  5. 15
      Makefile
  6. 29
      Package.swift
  7. 13
      bazel/experiments.bzl
  8. 2
      bazel/generate_cc.bzl
  9. 2
      bazel/generate_objc.bzl
  10. 14
      bazel/grpc_deps.bzl
  11. 2
      bazel/grpc_extra_deps.bzl
  12. 6
      bazel/python_rules.bzl
  13. 243
      build_autogenerated.yaml
  14. 19
      config.m4
  15. 19
      config.w32
  16. 2
      doc/grpc_xds_features.md
  17. 30
      gRPC-C++.podspec
  18. 46
      gRPC-Core.podspec
  19. 33
      grpc.gemspec
  20. 2669
      grpc.gyp
  21. 8
      include/grpc/impl/channel_arg_names.h
  22. 33
      package.xml
  23. 7
      requirements.bazel.txt
  24. 20
      src/boringssl/boringssl_prefix_symbols.h
  25. 31
      src/core/BUILD
  26. 1387
      src/core/client_channel/client_channel.cc
  27. 243
      src/core/client_channel/client_channel.h
  28. 92
      src/core/client_channel/client_channel_filter.cc
  29. 25
      src/core/client_channel/client_channel_filter.h
  30. 18
      src/core/client_channel/client_channel_internal.h
  31. 333
      src/core/client_channel/load_balanced_call_destination.cc
  32. 49
      src/core/client_channel/load_balanced_call_destination.h
  33. 7
      src/core/client_channel/retry_filter.cc
  34. 3
      src/core/client_channel/retry_filter.h
  35. 15
      src/core/client_channel/retry_filter_legacy_call_data.cc
  36. 227
      src/core/client_channel/subchannel.cc
  37. 47
      src/core/client_channel/subchannel.h
  38. 9
      src/core/client_channel/subchannel_stream_client.cc
  39. 4
      src/core/client_channel/subchannel_stream_client.h
  40. 6
      src/core/ext/filters/backend_metrics/backend_metric_filter.cc
  41. 7
      src/core/ext/filters/backend_metrics/backend_metric_provider.h
  42. 6
      src/core/ext/filters/census/grpc_context.cc
  43. 4
      src/core/ext/filters/channel_idle/legacy_channel_idle_filter.cc
  44. 2
      src/core/ext/filters/channel_idle/legacy_channel_idle_filter.h
  45. 5
      src/core/ext/filters/fault_injection/fault_injection_filter.cc
  46. 11
      src/core/ext/filters/http/message_compress/compression_filter.cc
  47. 10
      src/core/ext/filters/message_size/message_size_filter.cc
  48. 3
      src/core/ext/filters/message_size/message_size_filter.h
  49. 5
      src/core/ext/filters/rbac/rbac_filter.cc
  50. 5
      src/core/ext/filters/stateful_session/stateful_session_filter.cc
  51. 2
      src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc
  52. 5
      src/core/ext/transport/chaotic_good/client/chaotic_good_connector.h
  53. 7
      src/core/ext/transport/chaotic_good/client_transport.cc
  54. 6
      src/core/ext/transport/chaotic_good/server/chaotic_good_server.cc
  55. 11
      src/core/ext/transport/chaotic_good/server/chaotic_good_server.h
  56. 7
      src/core/ext/transport/chaotic_good/server_transport.cc
  57. 21
      src/core/ext/transport/chttp2/server/chttp2_server.cc
  58. 70
      src/core/ext/transport/chttp2/transport/chttp2_transport.cc
  59. 2
      src/core/ext/transport/chttp2/transport/chttp2_transport.h
  60. 7
      src/core/ext/transport/chttp2/transport/internal.h
  61. 9
      src/core/ext/transport/chttp2/transport/parsing.cc
  62. 42
      src/core/ext/transport/chttp2/transport/ping_rate_policy.cc
  63. 9
      src/core/ext/transport/chttp2/transport/ping_rate_policy.h
  64. 8
      src/core/ext/transport/chttp2/transport/writing.cc
  65. 6
      src/core/ext/transport/inproc/inproc_transport.cc
  66. 4
      src/core/handshaker/http_connect/http_connect_handshaker.cc
  67. 9
      src/core/handshaker/security/secure_endpoint.cc
  68. 39
      src/core/handshaker/security/security_handshaker.cc
  69. 31
      src/core/handshaker/security/tsi_error.cc
  70. 30
      src/core/handshaker/security/tsi_error.h
  71. 15
      src/core/lib/channel/channel_args.h
  72. 6
      src/core/lib/channel/channel_stack.h
  73. 60
      src/core/lib/channel/context.h
  74. 7
      src/core/lib/config/config_vars.cc
  75. 4
      src/core/lib/config/config_vars.h
  76. 5
      src/core/lib/config/config_vars.yaml
  77. 18
      src/core/lib/event_engine/posix_engine/posix_endpoint.cc
  78. 2
      src/core/lib/event_engine/posix_engine/posix_endpoint.h
  79. 8
      src/core/lib/event_engine/windows/windows_listener.cc
  80. 62
      src/core/lib/experiments/experiments.cc
  81. 27
      src/core/lib/experiments/experiments.h
  82. 10
      src/core/lib/experiments/experiments.yaml
  83. 4
      src/core/lib/experiments/rollouts.yaml
  84. 18
      src/core/lib/gprpp/dual_ref_counted.h
  85. 41
      src/core/lib/gprpp/status_helper.cc
  86. 34
      src/core/lib/gprpp/status_helper.h
  87. 16
      src/core/lib/iomgr/endpoint_cfstream.cc
  88. 28
      src/core/lib/iomgr/error.cc
  89. 17
      src/core/lib/iomgr/resolve_address_posix.cc
  90. 15
      src/core/lib/iomgr/socket_utils_common_posix.cc
  91. 11
      src/core/lib/iomgr/tcp_client_posix.cc
  92. 6
      src/core/lib/iomgr/tcp_client_windows.cc
  93. 18
      src/core/lib/iomgr/tcp_posix.cc
  94. 9
      src/core/lib/iomgr/tcp_server_windows.cc
  95. 31
      src/core/lib/promise/activity.h
  96. 10
      src/core/lib/promise/cancel_callback.h
  97. 5
      src/core/lib/promise/context.h
  98. 17
      src/core/lib/promise/map.h
  99. 1
      src/core/lib/promise/observable.h
  100. 6
      src/core/lib/promise/party.cc
  101. Some files were not shown because too many files have changed in this diff Show More

61
BUILD

@ -1341,7 +1341,7 @@ grpc_cc_library(
"grpc_base",
"grpc_public_hdrs",
"grpc_trace",
"legacy_context",
"//src/core:arena",
],
)
@ -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",
@ -2292,7 +2295,6 @@ grpc_cc_library(
srcs = [
"//src/core:handshaker/security/secure_endpoint.cc",
"//src/core:handshaker/security/security_handshaker.cc",
"//src/core:handshaker/security/tsi_error.cc",
"//src/core:lib/security/context/security_context.cc",
"//src/core:lib/security/credentials/call_creds_util.cc",
"//src/core:lib/security/credentials/composite/composite_credentials.cc",
@ -2305,7 +2307,6 @@ grpc_cc_library(
hdrs = [
"//src/core:handshaker/security/secure_endpoint.h",
"//src/core:handshaker/security/security_handshaker.h",
"//src/core:handshaker/security/tsi_error.h",
"//src/core:lib/security/context/security_context.h",
"//src/core:lib/security/credentials/call_creds_util.h",
"//src/core:lib/security/credentials/composite/composite_credentials.h",
@ -3698,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",
@ -3710,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",
@ -3735,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",
@ -3760,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",
@ -3793,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",
@ -3827,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",
@ -3840,7 +3840,6 @@ grpc_cc_library(
"//src/core:try_seq",
"//src/core:unique_type_name",
"//src/core:useful",
"//src/core:validation_errors",
],
)
@ -3915,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",

238
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)
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
@ -1861,7 +1872,6 @@ add_library(grpc
src/core/ext/filters/rbac/rbac_service_config_parser.cc
src/core/ext/filters/stateful_session/stateful_session_filter.cc
src/core/ext/filters/stateful_session/stateful_session_service_config_parser.cc
src/core/ext/gcp/metadata_query.cc
src/core/ext/transport/chttp2/alpn/alpn.cc
src/core/ext/transport/chttp2/client/chttp2_connector.cc
src/core/ext/transport/chttp2/server/chttp2_server.cc
@ -2222,7 +2232,6 @@ add_library(grpc
src/core/handshaker/proxy_mapper_registry.cc
src/core/handshaker/security/secure_endpoint.cc
src/core/handshaker/security/security_handshaker.cc
src/core/handshaker/security/tsi_error.cc
src/core/handshaker/tcp_connect/tcp_connect_handshaker.cc
src/core/lib/address_utils/parse_address.cc
src/core/lib/address_utils/sockaddr_utils.cc
@ -2292,6 +2301,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
@ -2303,10 +2313,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
@ -2596,6 +2602,11 @@ 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/gcp_metadata_query.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
@ -2927,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
@ -2934,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
@ -3015,7 +3028,6 @@ add_library(grpc_unsecure
src/core/handshaker/proxy_mapper_registry.cc
src/core/handshaker/security/secure_endpoint.cc
src/core/handshaker/security/security_handshaker.cc
src/core/handshaker/security/tsi_error.cc
src/core/handshaker/tcp_connect/tcp_connect_handshaker.cc
src/core/lib/address_utils/parse_address.cc
src/core/lib/address_utils/sockaddr_utils.cc
@ -3085,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
@ -3094,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
@ -3314,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
@ -5135,7 +5148,6 @@ add_library(grpc_authorization_provider
src/core/handshaker/proxy_mapper_registry.cc
src/core/handshaker/security/secure_endpoint.cc
src/core/handshaker/security/security_handshaker.cc
src/core/handshaker/security/tsi_error.cc
src/core/lib/address_utils/parse_address.cc
src/core/lib/address_utils/sockaddr_utils.cc
src/core/lib/backoff/backoff.cc
@ -5203,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
@ -8506,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
@ -8518,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
@ -9108,7 +9125,43 @@ endif()
if(gRPC_BUILD_TESTS)
add_executable(cancel_callback_test
src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c
src/core/ext/upb-gen/google/rpc/status.upb_minitable.c
src/core/lib/debug/trace.cc
src/core/lib/experiments/config.cc
src/core/lib/experiments/experiments.cc
src/core/lib/gprpp/status_helper.cc
src/core/lib/gprpp/time.cc
src/core/lib/iomgr/closure.cc
src/core/lib/iomgr/combiner.cc
src/core/lib/iomgr/error.cc
src/core/lib/iomgr/exec_ctx.cc
src/core/lib/iomgr/executor.cc
src/core/lib/iomgr/iomgr_internal.cc
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
src/core/lib/slice/slice_refcount.cc
src/core/lib/slice/slice_string_helpers.cc
test/core/promise/cancel_callback_test.cc
third_party/upb/upb/mini_descriptor/build_enum.c
third_party/upb/upb/mini_descriptor/decode.c
third_party/upb/upb/mini_descriptor/internal/base92.c
third_party/upb/upb/mini_descriptor/internal/encode.c
third_party/upb/upb/mini_descriptor/link.c
third_party/upb/upb/wire/decode.c
third_party/upb/upb/wire/encode.c
third_party/upb/upb/wire/eps_copy_input_stream.c
third_party/upb/upb/wire/internal/decode_fast.c
third_party/upb/upb/wire/reader.c
)
if(WIN32 AND MSVC)
if(BUILD_SHARED_LIBS)
@ -9141,7 +9194,13 @@ target_include_directories(cancel_callback_test
target_link_libraries(cancel_callback_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
utf8_range_lib
upb_message_lib
absl::config
absl::function_ref
absl::hash
absl::type_traits
absl::statusor
gpr
)
@ -10526,9 +10585,17 @@ 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
${_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)
@ -10562,10 +10629,12 @@ target_include_directories(client_channel_test
target_link_libraries(client_channel_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
${_gRPC_PROTOBUF_LIBRARIES}
grpc_test_util
)
endif()
endif()
if(gRPC_BUILD_TESTS)
@ -11340,6 +11409,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)
@ -17832,6 +17953,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
@ -18985,6 +19107,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)
@ -29324,6 +29498,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

15
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 \
@ -701,7 +703,6 @@ LIBGRPC_SRC = \
src/core/ext/filters/rbac/rbac_service_config_parser.cc \
src/core/ext/filters/stateful_session/stateful_session_filter.cc \
src/core/ext/filters/stateful_session/stateful_session_service_config_parser.cc \
src/core/ext/gcp/metadata_query.cc \
src/core/ext/transport/chttp2/alpn/alpn.cc \
src/core/ext/transport/chttp2/client/chttp2_connector.cc \
src/core/ext/transport/chttp2/server/chttp2_server.cc \
@ -1062,7 +1063,6 @@ LIBGRPC_SRC = \
src/core/handshaker/proxy_mapper_registry.cc \
src/core/handshaker/security/secure_endpoint.cc \
src/core/handshaker/security/security_handshaker.cc \
src/core/handshaker/security/tsi_error.cc \
src/core/handshaker/tcp_connect/tcp_connect_handshaker.cc \
src/core/lib/address_utils/parse_address.cc \
src/core/lib/address_utils/sockaddr_utils.cc \
@ -1137,6 +1137,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 \
@ -1162,10 +1163,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 \
@ -1458,6 +1455,11 @@ LIBGRPC_SRC = \
src/core/util/alloc.cc \
src/core/util/android/log.cc \
src/core/util/atm.cc \
src/core/util/gcp_metadata_query.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 \
@ -1935,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 \

29
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",
@ -189,8 +193,6 @@ let package = Package(
"src/core/ext/filters/stateful_session/stateful_session_filter.h",
"src/core/ext/filters/stateful_session/stateful_session_service_config_parser.cc",
"src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h",
"src/core/ext/gcp/metadata_query.cc",
"src/core/ext/gcp/metadata_query.h",
"src/core/ext/transport/chttp2/alpn/alpn.cc",
"src/core/ext/transport/chttp2/alpn/alpn.h",
"src/core/ext/transport/chttp2/client/chttp2_connector.cc",
@ -1078,8 +1080,6 @@ let package = Package(
"src/core/handshaker/security/secure_endpoint.h",
"src/core/handshaker/security/security_handshaker.cc",
"src/core/handshaker/security/security_handshaker.h",
"src/core/handshaker/security/tsi_error.cc",
"src/core/handshaker/security/tsi_error.h",
"src/core/handshaker/tcp_connect/tcp_connect_handshaker.cc",
"src/core/handshaker/tcp_connect/tcp_connect_handshaker.h",
"src/core/lib/address_utils/parse_address.cc",
@ -1255,6 +1255,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",
@ -1317,14 +1319,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",
@ -1488,6 +1482,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",
@ -1917,6 +1912,16 @@ let package = Package(
"src/core/util/alloc.h",
"src/core/util/android/log.cc",
"src/core/util/atm.cc",
"src/core/util/gcp_metadata_query.cc",
"src/core/util/gcp_metadata_query.h",
"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",
],

@ -187,7 +187,7 @@ _generate_cc = rule(
mandatory = False,
),
"_protoc": attr.label(
default = Label("//external:protocol_compiler"),
default = Label("@com_google_protobuf//:protoc"),
executable = True,
cfg = "exec",
),

@ -180,7 +180,7 @@ generate_objc = rule(
default = "@com_google_protobuf//:well_known_type_protos",
),
"_protoc": attr.label(
default = Label("//external:protocol_compiler"),
default = Label("@com_google_protobuf//:protoc"),
executable = True,
cfg = "exec",
),

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

@ -110,7 +110,7 @@ _gen_py_aspect = aspect(
fragments = ["py"],
attrs = {
"_protoc": attr.label(
default = Label("//external:protocol_compiler"),
default = Label("@com_google_protobuf//:protoc"),
providers = ["files_to_run"],
executable = True,
cfg = "exec",
@ -166,7 +166,7 @@ py_proto_library = rule(
aspects = [_gen_py_aspect],
),
"_protoc": attr.label(
default = Label("//external:protocol_compiler"),
default = Label("@com_google_protobuf//:protoc"),
providers = ["files_to_run"],
executable = True,
cfg = "exec",
@ -259,7 +259,7 @@ _generate_pb2_grpc_src = rule(
executable = True,
providers = ["files_to_run"],
cfg = "exec",
default = Label("//external:protocol_compiler"),
default = Label("@com_google_protobuf//:protoc"),
),
"grpc_library": attr.label(
default = Label("//src/python/grpcio/grpc:grpcio"),

@ -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
@ -259,7 +261,6 @@ libs:
- src/core/ext/filters/rbac/rbac_service_config_parser.h
- src/core/ext/filters/stateful_session/stateful_session_filter.h
- src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h
- src/core/ext/gcp/metadata_query.h
- src/core/ext/transport/chttp2/alpn/alpn.h
- src/core/ext/transport/chttp2/client/chttp2_connector.h
- src/core/ext/transport/chttp2/server/chttp2_server.h
@ -787,7 +788,6 @@ libs:
- src/core/handshaker/proxy_mapper_registry.h
- src/core/handshaker/security/secure_endpoint.h
- src/core/handshaker/security/security_handshaker.h
- src/core/handshaker/security/tsi_error.h
- src/core/handshaker/tcp_connect/tcp_connect_handshaker.h
- src/core/lib/address_utils/parse_address.h
- src/core/lib/address_utils/sockaddr_utils.h
@ -883,6 +883,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
@ -907,10 +908,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
@ -995,6 +992,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
@ -1206,6 +1204,11 @@ libs:
- src/core/tsi/transport_security.h
- src/core/tsi/transport_security_grpc.h
- src/core/tsi/transport_security_interface.h
- src/core/util/gcp_metadata_query.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
@ -1251,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
@ -1258,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
@ -1282,7 +1287,6 @@ libs:
- src/core/ext/filters/rbac/rbac_service_config_parser.cc
- src/core/ext/filters/stateful_session/stateful_session_filter.cc
- src/core/ext/filters/stateful_session/stateful_session_service_config_parser.cc
- src/core/ext/gcp/metadata_query.cc
- src/core/ext/transport/chttp2/alpn/alpn.cc
- src/core/ext/transport/chttp2/client/chttp2_connector.cc
- src/core/ext/transport/chttp2/server/chttp2_server.cc
@ -1643,7 +1647,6 @@ libs:
- src/core/handshaker/proxy_mapper_registry.cc
- src/core/handshaker/security/secure_endpoint.cc
- src/core/handshaker/security/security_handshaker.cc
- src/core/handshaker/security/tsi_error.cc
- src/core/handshaker/tcp_connect/tcp_connect_handshaker.cc
- src/core/lib/address_utils/parse_address.cc
- src/core/lib/address_utils/sockaddr_utils.cc
@ -1713,6 +1716,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
@ -1724,10 +1728,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
@ -2017,6 +2017,11 @@ 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/gcp_metadata_query.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
@ -2215,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
@ -2223,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
@ -2325,7 +2332,6 @@ libs:
- src/core/handshaker/proxy_mapper_registry.h
- src/core/handshaker/security/secure_endpoint.h
- src/core/handshaker/security/security_handshaker.h
- src/core/handshaker/security/tsi_error.h
- src/core/handshaker/tcp_connect/tcp_connect_handshaker.h
- src/core/lib/address_utils/parse_address.h
- src/core/lib/address_utils/sockaddr_utils.h
@ -2420,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
@ -2443,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
@ -2529,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
@ -2677,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
@ -2708,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
@ -2715,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
@ -2796,7 +2806,6 @@ libs:
- src/core/handshaker/proxy_mapper_registry.cc
- src/core/handshaker/security/secure_endpoint.cc
- src/core/handshaker/security/security_handshaker.cc
- src/core/handshaker/security/tsi_error.cc
- src/core/handshaker/tcp_connect/tcp_connect_handshaker.cc
- src/core/lib/address_utils/parse_address.cc
- src/core/lib/address_utils/sockaddr_utils.cc
@ -2866,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
@ -2875,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
@ -3095,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
@ -4417,7 +4427,6 @@ libs:
- src/core/handshaker/proxy_mapper_registry.h
- src/core/handshaker/security/secure_endpoint.h
- src/core/handshaker/security/security_handshaker.h
- src/core/handshaker/security/tsi_error.h
- src/core/lib/address_utils/parse_address.h
- src/core/lib/address_utils/sockaddr_utils.h
- src/core/lib/avl/avl.h
@ -4510,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
@ -4618,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
@ -4765,7 +4776,6 @@ libs:
- src/core/handshaker/proxy_mapper_registry.cc
- src/core/handshaker/security/secure_endpoint.cc
- src/core/handshaker/security/security_handshaker.cc
- src/core/handshaker/security/tsi_error.cc
- src/core/lib/address_utils/parse_address.cc
- src/core/lib/address_utils/sockaddr_utils.cc
- src/core/lib/backoff/backoff.cc
@ -4833,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
@ -6376,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
@ -6414,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
@ -6468,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
@ -6480,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
@ -6948,14 +6968,124 @@ targets:
build: test
language: c++
headers:
- src/core/ext/upb-gen/google/protobuf/any.upb.h
- src/core/ext/upb-gen/google/protobuf/any.upb_minitable.h
- src/core/ext/upb-gen/google/rpc/status.upb.h
- src/core/ext/upb-gen/google/rpc/status.upb_minitable.h
- src/core/lib/debug/trace.h
- src/core/lib/event_engine/event_engine_context.h
- src/core/lib/experiments/config.h
- src/core/lib/experiments/experiments.h
- src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/cpp_impl_of.h
- src/core/lib/gprpp/down_cast.h
- src/core/lib/gprpp/manual_constructor.h
- src/core/lib/gprpp/orphanable.h
- src/core/lib/gprpp/ref_counted.h
- src/core/lib/gprpp/ref_counted_ptr.h
- src/core/lib/gprpp/status_helper.h
- src/core/lib/gprpp/time.h
- src/core/lib/iomgr/closure.h
- src/core/lib/iomgr/combiner.h
- src/core/lib/iomgr/error.h
- src/core/lib/iomgr/exec_ctx.h
- src/core/lib/iomgr/executor.h
- src/core/lib/iomgr/iomgr_internal.h
- src/core/lib/promise/activity.h
- src/core/lib/promise/cancel_callback.h
- src/core/lib/promise/context.h
- src/core/lib/promise/detail/basic_seq.h
- src/core/lib/promise/detail/promise_factory.h
- src/core/lib/promise/detail/promise_like.h
- src/core/lib/promise/detail/seq_state.h
- src/core/lib/promise/detail/status.h
- src/core/lib/promise/exec_ctx_wakeup_scheduler.h
- src/core/lib/promise/loop.h
- src/core/lib/promise/map.h
- src/core/lib/promise/poll.h
- src/core/lib/promise/race.h
- src/core/lib/promise/seq.h
- src/core/lib/promise/trace.h
- src/core/lib/resource_quota/arena.h
- src/core/lib/resource_quota/connection_quota.h
- src/core/lib/resource_quota/memory_quota.h
- src/core/lib/resource_quota/periodic_update.h
- src/core/lib/resource_quota/resource_quota.h
- 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
- src/core/lib/slice/slice_internal.h
- src/core/lib/slice/slice_refcount.h
- src/core/lib/slice/slice_string_helpers.h
- src/core/util/spinlock.h
- third_party/upb/upb/generated_code_support.h
- third_party/upb/upb/mini_descriptor/build_enum.h
- third_party/upb/upb/mini_descriptor/decode.h
- third_party/upb/upb/mini_descriptor/internal/base92.h
- third_party/upb/upb/mini_descriptor/internal/decoder.h
- third_party/upb/upb/mini_descriptor/internal/encode.h
- third_party/upb/upb/mini_descriptor/internal/encode.hpp
- third_party/upb/upb/mini_descriptor/internal/modifiers.h
- third_party/upb/upb/mini_descriptor/internal/wire_constants.h
- third_party/upb/upb/mini_descriptor/link.h
- third_party/upb/upb/wire/decode.h
- third_party/upb/upb/wire/encode.h
- third_party/upb/upb/wire/eps_copy_input_stream.h
- third_party/upb/upb/wire/internal/constants.h
- third_party/upb/upb/wire/internal/decode_fast.h
- third_party/upb/upb/wire/internal/decoder.h
- third_party/upb/upb/wire/internal/reader.h
- third_party/upb/upb/wire/reader.h
- third_party/upb/upb/wire/types.h
src:
- src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c
- src/core/ext/upb-gen/google/rpc/status.upb_minitable.c
- src/core/lib/debug/trace.cc
- src/core/lib/experiments/config.cc
- src/core/lib/experiments/experiments.cc
- src/core/lib/gprpp/status_helper.cc
- src/core/lib/gprpp/time.cc
- src/core/lib/iomgr/closure.cc
- src/core/lib/iomgr/combiner.cc
- src/core/lib/iomgr/error.cc
- src/core/lib/iomgr/exec_ctx.cc
- src/core/lib/iomgr/executor.cc
- src/core/lib/iomgr/iomgr_internal.cc
- 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
- src/core/lib/slice/slice_refcount.cc
- src/core/lib/slice/slice_string_helpers.cc
- test/core/promise/cancel_callback_test.cc
- third_party/upb/upb/mini_descriptor/build_enum.c
- third_party/upb/upb/mini_descriptor/decode.c
- third_party/upb/upb/mini_descriptor/internal/base92.c
- third_party/upb/upb/mini_descriptor/internal/encode.c
- third_party/upb/upb/mini_descriptor/link.c
- third_party/upb/upb/wire/decode.c
- third_party/upb/upb/wire/encode.c
- third_party/upb/upb/wire/eps_copy_input_stream.c
- third_party/upb/upb/wire/internal/decode_fast.c
- third_party/upb/upb/wire/reader.c
deps:
- gtest
- utf8_range_lib
- upb_message_lib
- absl/base:config
- absl/functional:function_ref
- absl/hash:hash
- absl/meta:type_traits
- absl/status:statusor
- gpr
uses_polling: false
- name: cancel_in_a_vacuum_test
@ -7869,12 +7999,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
@ -8225,6 +8365,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
@ -11669,6 +11830,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
@ -11776,6 +11938,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
@ -11961,6 +12124,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
@ -12733,6 +12897,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
@ -14639,6 +14824,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:
@ -18993,6 +19179,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

19
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 \
@ -76,7 +78,6 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/filters/rbac/rbac_service_config_parser.cc \
src/core/ext/filters/stateful_session/stateful_session_filter.cc \
src/core/ext/filters/stateful_session/stateful_session_service_config_parser.cc \
src/core/ext/gcp/metadata_query.cc \
src/core/ext/transport/chttp2/alpn/alpn.cc \
src/core/ext/transport/chttp2/client/chttp2_connector.cc \
src/core/ext/transport/chttp2/server/chttp2_server.cc \
@ -437,7 +438,6 @@ if test "$PHP_GRPC" != "no"; then
src/core/handshaker/proxy_mapper_registry.cc \
src/core/handshaker/security/secure_endpoint.cc \
src/core/handshaker/security/security_handshaker.cc \
src/core/handshaker/security/tsi_error.cc \
src/core/handshaker/tcp_connect/tcp_connect_handshaker.cc \
src/core/lib/address_utils/parse_address.cc \
src/core/lib/address_utils/sockaddr_utils.cc \
@ -512,6 +512,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 \
@ -537,10 +538,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 \
@ -833,6 +830,11 @@ 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/gcp_metadata_query.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 \
@ -1112,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 \
@ -1399,7 +1402,6 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/message_size)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/rbac)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/stateful_session)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/gcp)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/alpn)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/client)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/server)
@ -1530,7 +1532,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)
@ -1601,6 +1602,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)
@ -1652,6 +1654,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)

19
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 " +
@ -41,7 +43,6 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\filters\\rbac\\rbac_service_config_parser.cc " +
"src\\core\\ext\\filters\\stateful_session\\stateful_session_filter.cc " +
"src\\core\\ext\\filters\\stateful_session\\stateful_session_service_config_parser.cc " +
"src\\core\\ext\\gcp\\metadata_query.cc " +
"src\\core\\ext\\transport\\chttp2\\alpn\\alpn.cc " +
"src\\core\\ext\\transport\\chttp2\\client\\chttp2_connector.cc " +
"src\\core\\ext\\transport\\chttp2\\server\\chttp2_server.cc " +
@ -402,7 +403,6 @@ if (PHP_GRPC != "no") {
"src\\core\\handshaker\\proxy_mapper_registry.cc " +
"src\\core\\handshaker\\security\\secure_endpoint.cc " +
"src\\core\\handshaker\\security\\security_handshaker.cc " +
"src\\core\\handshaker\\security\\tsi_error.cc " +
"src\\core\\handshaker\\tcp_connect\\tcp_connect_handshaker.cc " +
"src\\core\\lib\\address_utils\\parse_address.cc " +
"src\\core\\lib\\address_utils\\sockaddr_utils.cc " +
@ -477,6 +477,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 " +
@ -502,10 +503,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 " +
@ -798,6 +795,11 @@ if (PHP_GRPC != "no") {
"src\\core\\util\\alloc.cc " +
"src\\core\\util\\android\\log.cc " +
"src\\core\\util\\atm.cc " +
"src\\core\\util\\gcp_metadata_query.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 " +
@ -1077,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 " +
@ -1393,7 +1396,6 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\message_size");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\rbac");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\filters\\stateful_session");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\gcp");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\transport\\chttp2\\alpn");
@ -1667,7 +1669,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");
@ -1741,6 +1742,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");
@ -1805,6 +1807,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 | | | |

30
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',
@ -300,7 +302,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/rbac/rbac_service_config_parser.h',
'src/core/ext/filters/stateful_session/stateful_session_filter.h',
'src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h',
'src/core/ext/gcp/metadata_query.h',
'src/core/ext/transport/binder/client/binder_connector.cc',
'src/core/ext/transport/binder/client/binder_connector.h',
'src/core/ext/transport/binder/client/channel_create.cc',
@ -866,7 +867,6 @@ Pod::Spec.new do |s|
'src/core/handshaker/proxy_mapper_registry.h',
'src/core/handshaker/security/secure_endpoint.h',
'src/core/handshaker/security/security_handshaker.h',
'src/core/handshaker/security/tsi_error.h',
'src/core/handshaker/tcp_connect/tcp_connect_handshaker.h',
'src/core/lib/address_utils/parse_address.h',
'src/core/lib/address_utils/sockaddr_utils.h',
@ -968,6 +968,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',
@ -1005,10 +1006,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',
@ -1093,6 +1090,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',
@ -1305,6 +1303,11 @@ 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/gcp_metadata_query.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',
@ -1557,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',
@ -1565,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',
@ -1589,7 +1594,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/rbac/rbac_service_config_parser.h',
'src/core/ext/filters/stateful_session/stateful_session_filter.h',
'src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h',
'src/core/ext/gcp/metadata_query.h',
'src/core/ext/transport/binder/client/binder_connector.h',
'src/core/ext/transport/binder/client/channel_create_impl.h',
'src/core/ext/transport/binder/client/connection_id_generator.h',
@ -2137,7 +2141,6 @@ Pod::Spec.new do |s|
'src/core/handshaker/proxy_mapper_registry.h',
'src/core/handshaker/security/secure_endpoint.h',
'src/core/handshaker/security/security_handshaker.h',
'src/core/handshaker/security/tsi_error.h',
'src/core/handshaker/tcp_connect/tcp_connect_handshaker.h',
'src/core/lib/address_utils/parse_address.h',
'src/core/lib/address_utils/sockaddr_utils.h',
@ -2239,6 +2242,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',
@ -2276,10 +2280,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',
@ -2364,6 +2364,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',
@ -2576,6 +2577,11 @@ 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/gcp_metadata_query.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',

46
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',
@ -308,8 +312,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/stateful_session/stateful_session_filter.h',
'src/core/ext/filters/stateful_session/stateful_session_service_config_parser.cc',
'src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h',
'src/core/ext/gcp/metadata_query.cc',
'src/core/ext/gcp/metadata_query.h',
'src/core/ext/transport/chttp2/alpn/alpn.cc',
'src/core/ext/transport/chttp2/alpn/alpn.h',
'src/core/ext/transport/chttp2/client/chttp2_connector.cc',
@ -1197,8 +1199,6 @@ Pod::Spec.new do |s|
'src/core/handshaker/security/secure_endpoint.h',
'src/core/handshaker/security/security_handshaker.cc',
'src/core/handshaker/security/security_handshaker.h',
'src/core/handshaker/security/tsi_error.cc',
'src/core/handshaker/security/tsi_error.h',
'src/core/handshaker/tcp_connect/tcp_connect_handshaker.cc',
'src/core/handshaker/tcp_connect/tcp_connect_handshaker.h',
'src/core/lib/address_utils/parse_address.cc',
@ -1374,6 +1374,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',
@ -1436,14 +1438,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',
@ -1607,6 +1601,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',
@ -2032,6 +2027,16 @@ Pod::Spec.new do |s|
'src/core/util/alloc.h',
'src/core/util/android/log.cc',
'src/core/util/atm.cc',
'src/core/util/gcp_metadata_query.cc',
'src/core/util/gcp_metadata_query.h',
'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',
@ -2357,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',
@ -2365,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',
@ -2389,7 +2396,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/rbac/rbac_service_config_parser.h',
'src/core/ext/filters/stateful_session/stateful_session_filter.h',
'src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h',
'src/core/ext/gcp/metadata_query.h',
'src/core/ext/transport/chttp2/alpn/alpn.h',
'src/core/ext/transport/chttp2/client/chttp2_connector.h',
'src/core/ext/transport/chttp2/server/chttp2_server.h',
@ -2917,7 +2923,6 @@ Pod::Spec.new do |s|
'src/core/handshaker/proxy_mapper_registry.h',
'src/core/handshaker/security/secure_endpoint.h',
'src/core/handshaker/security/security_handshaker.h',
'src/core/handshaker/security/tsi_error.h',
'src/core/handshaker/tcp_connect/tcp_connect_handshaker.h',
'src/core/lib/address_utils/parse_address.h',
'src/core/lib/address_utils/sockaddr_utils.h',
@ -3019,6 +3024,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',
@ -3056,10 +3062,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',
@ -3144,6 +3146,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',
@ -3356,6 +3359,11 @@ 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/gcp_metadata_query.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',

33
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 )
@ -195,8 +199,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/stateful_session/stateful_session_filter.h )
s.files += %w( src/core/ext/filters/stateful_session/stateful_session_service_config_parser.cc )
s.files += %w( src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h )
s.files += %w( src/core/ext/gcp/metadata_query.cc )
s.files += %w( src/core/ext/gcp/metadata_query.h )
s.files += %w( src/core/ext/transport/chttp2/alpn/alpn.cc )
s.files += %w( src/core/ext/transport/chttp2/alpn/alpn.h )
s.files += %w( src/core/ext/transport/chttp2/client/chttp2_connector.cc )
@ -1084,8 +1086,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/handshaker/security/secure_endpoint.h )
s.files += %w( src/core/handshaker/security/security_handshaker.cc )
s.files += %w( src/core/handshaker/security/security_handshaker.h )
s.files += %w( src/core/handshaker/security/tsi_error.cc )
s.files += %w( src/core/handshaker/security/tsi_error.h )
s.files += %w( src/core/handshaker/tcp_connect/tcp_connect_handshaker.cc )
s.files += %w( src/core/handshaker/tcp_connect/tcp_connect_handshaker.h )
s.files += %w( src/core/lib/address_utils/parse_address.cc )
@ -1261,6 +1261,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 )
@ -1323,14 +1325,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 )
@ -1494,6 +1488,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 )
@ -1919,6 +1914,16 @@ 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/gcp_metadata_query.cc )
s.files += %w( src/core/util/gcp_metadata_query.h )
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 )
@ -2517,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 )
@ -2540,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 )
@ -2860,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

33
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" />
@ -177,8 +181,6 @@
<file baseinstalldir="/" name="src/core/ext/filters/stateful_session/stateful_session_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/stateful_session/stateful_session_service_config_parser.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/gcp/metadata_query.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/gcp/metadata_query.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/alpn/alpn.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/alpn/alpn.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/chttp2_connector.cc" role="src" />
@ -1066,8 +1068,6 @@
<file baseinstalldir="/" name="src/core/handshaker/security/secure_endpoint.h" role="src" />
<file baseinstalldir="/" name="src/core/handshaker/security/security_handshaker.cc" role="src" />
<file baseinstalldir="/" name="src/core/handshaker/security/security_handshaker.h" role="src" />
<file baseinstalldir="/" name="src/core/handshaker/security/tsi_error.cc" role="src" />
<file baseinstalldir="/" name="src/core/handshaker/security/tsi_error.h" role="src" />
<file baseinstalldir="/" name="src/core/handshaker/tcp_connect/tcp_connect_handshaker.cc" role="src" />
<file baseinstalldir="/" name="src/core/handshaker/tcp_connect/tcp_connect_handshaker.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/address_utils/parse_address.cc" role="src" />
@ -1243,6 +1243,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" />
@ -1305,14 +1307,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" />
@ -1476,6 +1470,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" />
@ -1901,6 +1896,16 @@
<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/gcp_metadata_query.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/gcp_metadata_query.h" 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" />
@ -2521,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" />
@ -2544,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" />
@ -2864,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" />

@ -26,9 +26,12 @@ pyasn1==0.5.0
rsa==4.9
greenlet==1.1.3.post0
zope.interface==6.1
opentelemetry-sdk==1.21.0
opentelemetry-api==1.21.0
opentelemetry-sdk==1.24.0
opentelemetry-api==1.24.0
importlib-metadata==6.11.0
opentelemetry-resourcedetector-gcp==1.6.0a0
opentelemetry-exporter-prometheus==0.45b0
prometheus_client==0.20.0
Deprecated==1.2.14
opentelemetry-semantic-conventions==0.42b0
typing-extensions==4.9.0

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

@ -685,6 +685,8 @@ grpc_cc_library(
"lib/promise/cancel_callback.h",
],
deps = [
"arena",
"context",
"promise_like",
"//:gpr_platform",
],
@ -1236,6 +1238,7 @@ grpc_cc_library(
public_hdrs = ["lib/gprpp/dual_ref_counted.h"],
deps = [
"down_cast",
"ref_counted",
"//:debug_location",
"//:gpr",
"//:orphanable",
@ -1488,6 +1491,7 @@ grpc_cc_library(
"context",
"event_engine_memory_allocator",
"memory_quota",
"resource_quota",
"//:gpr",
],
)
@ -1651,6 +1655,7 @@ grpc_cc_library(
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/strings",
"absl/strings:str_format",
],
visibility = ["@grpc:alt_grpc_base_legacy"],
@ -3284,12 +3289,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",
],
)
@ -4423,10 +4428,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",
@ -5030,6 +5035,7 @@ grpc_cc_library(
"ext/filters/backend_metrics/backend_metric_provider.h",
],
language = "c++",
deps = ["arena"],
)
grpc_cc_library(
@ -7196,10 +7202,10 @@ grpc_cc_library(
grpc_cc_library(
name = "gcp_metadata_query",
srcs = [
"ext/gcp/metadata_query.cc",
"util/gcp_metadata_query.cc",
],
hdrs = [
"ext/gcp/metadata_query.h",
"util/gcp_metadata_query.h",
],
external_deps = [
"absl/functional:any_invocable",
@ -7512,12 +7518,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",
@ -7623,20 +7627,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

@ -269,8 +269,7 @@ class ClientChannelFilter::FilterBasedCallData final
void ResetDeadline(Duration timeout) override {
const Timestamp per_method_deadline =
Timestamp::FromCycleCounterRoundUp(call_start_time_) + timeout;
static_cast<Call*>(call_context_[GRPC_CONTEXT_CALL].value)
->UpdateDeadline(per_method_deadline);
arena_->GetContext<Call>()->UpdateDeadline(per_method_deadline);
}
void CreateDynamicCall();
@ -445,10 +444,9 @@ const grpc_channel_filter ClientChannelFilter::kFilterVtableWithoutPromises = {
namespace {
ClientChannelServiceConfigCallData* GetServiceConfigCallData(
grpc_call_context_element* context) {
return static_cast<ClientChannelServiceConfigCallData*>(
context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
ClientChannelServiceConfigCallData* GetServiceConfigCallData(Arena* arena) {
return DownCast<ClientChannelServiceConfigCallData*>(
arena->GetContext<ServiceConfigCallData>());
}
class DynamicTerminationFilter final {
@ -483,7 +481,7 @@ class DynamicTerminationFilter final {
std::move(call_args),
[]() {
auto* service_config_call_data =
GetServiceConfigCallData(GetContext<grpc_call_context_element>());
GetServiceConfigCallData(GetContext<Arena>());
service_config_call_data->Commit();
},
/*is_transparent_retry=*/false);
@ -536,8 +534,7 @@ class DynamicTerminationFilter::CallData final {
calld->call_context_, calld->path_,
/*start_time=*/0, calld->deadline_,
calld->arena_, calld->call_combiner_};
auto* service_config_call_data =
GetServiceConfigCallData(calld->call_context_);
auto* service_config_call_data = GetServiceConfigCallData(calld->arena_);
calld->lb_call_ = client_channel->CreateLoadBalancedCall(
args, pollent, nullptr,
[service_config_call_data]() { service_config_call_data->Commit(); },
@ -1109,7 +1106,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 +1356,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();
@ -2092,7 +2064,7 @@ grpc_error_handle ClientChannelFilter::CallData::ApplyServiceConfigToCallLocked(
// itself in the call context, so that it can be accessed by filters
// below us in the stack, and it will be cleaned up when the call ends.
auto* service_config_call_data =
arena()->New<ClientChannelServiceConfigCallData>(arena(), call_context());
arena()->New<ClientChannelServiceConfigCallData>(arena());
// Use the ConfigSelector to determine the config for the call.
absl::Status call_config_status =
(*config_selector)
@ -2158,8 +2130,7 @@ absl::optional<absl::Status> ClientChannelFilter::CallData::CheckResolution(
}
// If the call was queued, add trace annotation.
if (was_queued) {
auto* call_tracer = static_cast<CallTracerAnnotationInterface*>(
call_context()[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE].value);
auto* call_tracer = arena()->GetContext<CallTracerAnnotationInterface>();
if (call_tracer != nullptr) {
call_tracer->RecordAnnotation("Delayed name resolution complete.");
}
@ -2573,8 +2544,7 @@ void ClientChannelFilter::FilterBasedCallData::
void* arg, grpc_error_handle error) {
auto* calld = static_cast<FilterBasedCallData*>(arg);
auto* chand = calld->chand();
auto* service_config_call_data =
GetServiceConfigCallData(calld->call_context());
auto* service_config_call_data = GetServiceConfigCallData(calld->arena());
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p: got recv_trailing_metadata_ready: error=%s "
@ -2599,7 +2569,7 @@ class ClientChannelFilter::LoadBalancedCall::LbCallState final
public:
explicit LbCallState(LoadBalancedCall* lb_call) : lb_call_(lb_call) {}
void* Alloc(size_t size) override { return lb_call_->arena()->Alloc(size); }
void* Alloc(size_t size) override { return lb_call_->arena_->Alloc(size); }
// Internal API to allow first-party LB policies to access per-call
// attributes set by the ConfigSelector.
@ -2694,8 +2664,7 @@ class ClientChannelFilter::LoadBalancedCall::Metadata final
ServiceConfigCallData::CallAttributeInterface*
ClientChannelFilter::LoadBalancedCall::LbCallState::GetCallAttribute(
UniqueTypeName type) const {
auto* service_config_call_data =
GetServiceConfigCallData(lb_call_->call_context_);
auto* service_config_call_data = GetServiceConfigCallData(lb_call_->arena_);
return service_config_call_data->GetCallAttribute(type);
}
@ -2721,7 +2690,7 @@ class ClientChannelFilter::LoadBalancedCall::BackendMetricAccessor final
recv_trailing_metadata_ != nullptr) {
if (const auto* md = recv_trailing_metadata_->get_pointer(
EndpointLoadMetricsBinMetadata())) {
BackendMetricAllocator allocator(lb_call_->arena());
BackendMetricAllocator allocator(lb_call_->arena_);
lb_call_->backend_metric_data_ =
ParseBackendMetricData(md->as_string_view(), &allocator);
}
@ -2756,28 +2725,29 @@ class ClientChannelFilter::LoadBalancedCall::BackendMetricAccessor final
namespace {
void CreateCallAttemptTracer(grpc_call_context_element* context,
bool is_transparent_retry) {
auto* call_tracer = static_cast<ClientCallTracer*>(
context[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE].value);
void CreateCallAttemptTracer(Arena* arena, bool is_transparent_retry) {
auto* call_tracer = DownCast<ClientCallTracer*>(
arena->GetContext<CallTracerAnnotationInterface>());
if (call_tracer == nullptr) return;
auto* tracer = call_tracer->StartNewAttempt(is_transparent_retry);
context[GRPC_CONTEXT_CALL_TRACER].value = tracer;
arena->SetContext<CallTracerInterface>(tracer);
}
} // namespace
ClientChannelFilter::LoadBalancedCall::LoadBalancedCall(
ClientChannelFilter* chand, grpc_call_context_element* call_context,
absl::AnyInvocable<void()> on_commit, bool is_transparent_retry)
Arena* arena, absl::AnyInvocable<void()> on_commit,
bool is_transparent_retry)
: InternallyRefCounted(
GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)
? "LoadBalancedCall"
: nullptr),
chand_(chand),
on_commit_(std::move(on_commit)),
call_context_(call_context) {
CreateCallAttemptTracer(call_context, is_transparent_retry);
call_context_(call_context),
arena_(arena) {
CreateCallAttemptTracer(arena, is_transparent_retry);
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
gpr_log(GPR_INFO, "chand=%p lb_call=%p: created", chand_, this);
}
@ -3044,9 +3014,8 @@ ClientChannelFilter::FilterBasedLoadBalancedCall::FilterBasedLoadBalancedCall(
ClientChannelFilter* chand, const grpc_call_element_args& args,
grpc_polling_entity* pollent, grpc_closure* on_call_destruction_complete,
absl::AnyInvocable<void()> on_commit, bool is_transparent_retry)
: LoadBalancedCall(chand, args.context, std::move(on_commit),
: LoadBalancedCall(chand, args.context, args.arena, std::move(on_commit),
is_transparent_retry),
arena_(args.arena),
owning_call_(args.call_stack),
call_combiner_(args.call_combiner),
pollent_(pollent),
@ -3346,10 +3315,7 @@ void ClientChannelFilter::FilterBasedLoadBalancedCall::
grpc_status_code code;
std::string message;
grpc_error_get_status(
error,
static_cast<Call*>(self->call_context()[GRPC_CONTEXT_CALL].value)
->deadline(),
&code, &message,
error, self->arena()->GetContext<Call>()->deadline(), &code, &message,
/*http_error=*/nullptr, /*error_string=*/nullptr);
status = absl::Status(static_cast<absl::StatusCode>(code), message);
} else {
@ -3488,8 +3454,7 @@ void ClientChannelFilter::FilterBasedLoadBalancedCall::CreateSubchannelCall() {
CHECK_NE(path, nullptr);
SubchannelCall::Args call_args = {
connected_subchannel()->Ref(), pollent_, path->Ref(), /*start_time=*/0,
static_cast<Call*>(call_context()[GRPC_CONTEXT_CALL].value)->deadline(),
arena_,
arena()->GetContext<Call>()->deadline(), arena(),
// TODO(roth): When we implement hedging support, we will probably
// need to use a separate call context for each subchannel call.
call_context(), call_combiner_};
@ -3519,7 +3484,8 @@ ClientChannelFilter::PromiseBasedLoadBalancedCall::PromiseBasedLoadBalancedCall(
ClientChannelFilter* chand, absl::AnyInvocable<void()> on_commit,
bool is_transparent_retry)
: LoadBalancedCall(chand, GetContext<grpc_call_context_element>(),
std::move(on_commit), is_transparent_retry) {}
GetContext<Arena>(), std::move(on_commit),
is_transparent_retry) {}
ArenaPromise<ServerMetadataHandle>
ClientChannelFilter::PromiseBasedLoadBalancedCall::MakeCallPromise(
@ -3635,10 +3601,6 @@ ClientChannelFilter::PromiseBasedLoadBalancedCall::MakeCallPromise(
});
}
Arena* ClientChannelFilter::PromiseBasedLoadBalancedCall::arena() const {
return GetContext<Arena>();
}
grpc_metadata_batch*
ClientChannelFilter::PromiseBasedLoadBalancedCall::send_initial_metadata()
const {

@ -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;
@ -379,7 +372,7 @@ class ClientChannelFilter::LoadBalancedCall
: public InternallyRefCounted<LoadBalancedCall, UnrefCallDtor> {
public:
LoadBalancedCall(ClientChannelFilter* chand,
grpc_call_context_element* call_context,
grpc_call_context_element* call_context, Arena* arena,
absl::AnyInvocable<void()> on_commit,
bool is_transparent_retry);
~LoadBalancedCall() override;
@ -398,8 +391,8 @@ class ClientChannelFilter::LoadBalancedCall
protected:
ClientChannelFilter* chand() const { return chand_; }
ClientCallTracer::CallAttemptTracer* call_attempt_tracer() const {
return static_cast<ClientCallTracer::CallAttemptTracer*>(
call_context_[GRPC_CONTEXT_CALL_TRACER].value);
return DownCast<ClientCallTracer::CallAttemptTracer*>(
arena_->GetContext<CallTracerInterface>());
}
ConnectedSubchannel* connected_subchannel() const {
return connected_subchannel_.get();
@ -408,6 +401,7 @@ class ClientChannelFilter::LoadBalancedCall
lb_subchannel_call_tracker() const {
return lb_subchannel_call_tracker_.get();
}
Arena* arena() const { return arena_; }
void Commit() {
auto on_commit = std::move(on_commit_);
@ -440,7 +434,6 @@ class ClientChannelFilter::LoadBalancedCall
class Metadata;
class BackendMetricAccessor;
virtual Arena* arena() const = 0;
virtual grpc_polling_entity* pollent() = 0;
virtual grpc_metadata_batch* send_initial_metadata() const = 0;
@ -467,6 +460,7 @@ class ClientChannelFilter::LoadBalancedCall
std::unique_ptr<LoadBalancingPolicy::SubchannelCallTrackerInterface>
lb_subchannel_call_tracker_;
grpc_call_context_element* const call_context_;
Arena* const arena_;
};
class ClientChannelFilter::FilterBasedLoadBalancedCall final
@ -502,7 +496,6 @@ class ClientChannelFilter::FilterBasedLoadBalancedCall final
using LoadBalancedCall::chand;
using LoadBalancedCall::Commit;
Arena* arena() const override { return arena_; }
grpc_polling_entity* pollent() override { return pollent_; }
grpc_metadata_batch* send_initial_metadata() const override {
return pending_batches_[0]
@ -557,7 +550,6 @@ class ClientChannelFilter::FilterBasedLoadBalancedCall final
// TODO(roth): Instead of duplicating these fields in every filter
// that uses any one of them, we should store them in the call
// context. This will save per-call memory overhead.
Arena* arena_;
grpc_call_stack* owning_call_;
CallCombiner* call_combiner_;
grpc_polling_entity* pollent_;
@ -605,7 +597,6 @@ class ClientChannelFilter::PromiseBasedLoadBalancedCall final
CallArgs call_args, OrphanablePtr<PromiseBasedLoadBalancedCall> lb_call);
private:
Arena* arena() const override;
grpc_polling_entity* pollent() override { return &pollent_; }
grpc_metadata_batch* send_initial_metadata() const override;

@ -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"
@ -57,9 +58,8 @@ class ClientChannelLbCallState : public LoadBalancingPolicy::CallState {
// Internal type for ServiceConfigCallData. Handles call commits.
class ClientChannelServiceConfigCallData final : public ServiceConfigCallData {
public:
ClientChannelServiceConfigCallData(Arena* arena,
grpc_call_context_element* call_context)
: ServiceConfigCallData(arena, call_context) {}
explicit ClientChannelServiceConfigCallData(Arena* arena)
: ServiceConfigCallData(arena) {}
void SetOnCommit(absl::AnyInvocable<void()> on_commit) {
CHECK(on_commit_ == nullptr);
@ -75,6 +75,18 @@ class ClientChannelServiceConfigCallData final : public ServiceConfigCallData {
absl::AnyInvocable<void()> on_commit_;
};
template <>
struct ContextSubclass<ClientChannelServiceConfigCallData> {
using Base = ServiceConfigCallData;
};
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,333 @@
// 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 {
return GetContext<ClientCallTracer::CallAttemptTracer>();
}
};
// 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

@ -130,11 +130,8 @@ RetryFilter::RetryFilter(const ChannelArgs& args, grpc_error_handle* error)
server_name, config->max_milli_tokens(), config->milli_token_ratio());
}
const RetryMethodConfig* RetryFilter::GetRetryPolicy(
const grpc_call_context_element* context) {
if (context == nullptr) return nullptr;
auto* svc_cfg_call_data = static_cast<ServiceConfigCallData*>(
context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
const RetryMethodConfig* RetryFilter::GetRetryPolicy(Arena* arena) {
auto* svc_cfg_call_data = arena->GetContext<ServiceConfigCallData>();
if (svc_cfg_call_data == nullptr) return nullptr;
return static_cast<const RetryMethodConfig*>(
svc_cfg_call_data->GetMethodParsedConfig(service_config_parser_index_));

@ -66,8 +66,7 @@ class RetryFilter final {
// any even moderately compelling reason to do so.
static double BackoffJitter() { return 0.2; }
const internal::RetryMethodConfig* GetRetryPolicy(
const grpc_call_context_element* context);
const internal::RetryMethodConfig* GetRetryPolicy(Arena* arena);
RefCountedPtr<internal::ServerRetryThrottleData> retry_throttle_data() const {
return retry_throttle_data_;

@ -137,9 +137,8 @@ RetryFilter::LegacyCallData::CallAttempt::CallAttempt(
lb_call_committed_ = true;
if (calld_->retry_committed_) {
auto* service_config_call_data =
static_cast<ClientChannelServiceConfigCallData*>(
calld_->call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA]
.value);
DownCast<ClientChannelServiceConfigCallData*>(
calld_->arena_->GetContext<ServiceConfigCallData>());
service_config_call_data->Commit();
}
},
@ -1545,7 +1544,7 @@ RetryFilter::LegacyCallData::LegacyCallData(RetryFilter* chand,
const grpc_call_element_args& args)
: chand_(chand),
retry_throttle_data_(chand->retry_throttle_data()),
retry_policy_(chand->GetRetryPolicy(args.context)),
retry_policy_(chand->GetRetryPolicy(args.arena)),
retry_backoff_(
BackOff::Options()
.set_initial_backoff(retry_policy_ == nullptr
@ -1685,8 +1684,8 @@ void RetryFilter::LegacyCallData::StartTransportStreamOpBatch(
}
PendingBatchClear(pending);
auto* service_config_call_data =
static_cast<ClientChannelServiceConfigCallData*>(
call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
DownCast<ClientChannelServiceConfigCallData*>(
arena_->GetContext<ServiceConfigCallData>());
committed_call_ = CreateLoadBalancedCall(
[service_config_call_data]() { service_config_call_data->Commit(); },
/*is_transparent_retry=*/false);
@ -1976,8 +1975,8 @@ void RetryFilter::LegacyCallData::RetryCommit(CallAttempt* call_attempt) {
// problem anymore.
if (call_attempt->lb_call_committed()) {
auto* service_config_call_data =
static_cast<ClientChannelServiceConfigCallData*>(
call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
DownCast<ClientChannelServiceConfigCallData*>(
arena_->GetContext<ServiceConfigCallData>());
service_config_call_data->Commit();
}
// Free cached send ops.

@ -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,48 +102,63 @@ 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");
//
// 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 ConnectedSubchannel::StartWatch(
void StartWatch(
grpc_pollset_set* interested_parties,
OrphanablePtr<ConnectivityStateWatcherInterface> watcher) {
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_, 0);
grpc_channel_element* elem =
grpc_channel_stack_element(channel_stack_.get(), 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);
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");
}
size_t ConnectedSubchannel::GetInitialCallSizeEstimate() const {
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> ConnectedSubchannel::MakeCallPromise(
CallArgs call_args) {
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));
@ -150,7 +170,7 @@ ArenaPromise<ServerMetadataHandle> ConnectedSubchannel::MakeCallPromise(
[self = Ref()](ServerMetadataHandle metadata) {
channelz::SubchannelNode* channelz_subchannel =
self->channelz_subchannel();
CHECK_NE(channelz_subchannel, nullptr);
CHECK(channelz_subchannel != nullptr);
if (metadata->get(GrpcStatusMetadata())
.value_or(GRPC_STATUS_UNKNOWN) != GRPC_STATUS_OK) {
channelz_subchannel->RecordCallFailed();
@ -162,11 +182,89 @@ ArenaPromise<ServerMetadataHandle> ConnectedSubchannel::MakeCallPromise(
[self = Ref()]() {
channelz::SubchannelNode* channelz_subchannel =
self->channelz_subchannel();
CHECK_NE(channelz_subchannel, nullptr);
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,6 +869,9 @@ void Subchannel::OnConnectingFinishedLocked(grpc_error_handle error) {
}
bool Subchannel::PublishTransportLocked() {
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(
@ -779,28 +881,48 @@ bool Subchannel::PublishTransportLocked() {
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());
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(), StatusToString(error).c_str());
key_.ToString().c_str(),
call_destination.status().ToString().c_str());
return false;
}
RefCountedPtr<channelz::SocketNode> socket =
std::move(connecting_result_.socket_node);
connected_subchannel_ = MakeRefCounted<NewConnectedSubchannel>(
std::move(*call_destination), std::move(transport_destination), args_,
channelz_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_);

@ -130,16 +130,14 @@ BackendMetricFilter::Create(const ChannelArgs&, ChannelFilter::Args) {
void BackendMetricFilter::Call::OnServerTrailingMetadata(ServerMetadata& md) {
if (md.get(GrpcCallWasCancelled()).value_or(false)) return;
auto* ctx = &GetContext<
grpc_call_context_element>()[GRPC_CONTEXT_BACKEND_METRIC_PROVIDER];
auto* ctx = MaybeGetContext<BackendMetricProvider>();
if (ctx == nullptr) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_filter_trace)) {
gpr_log(GPR_INFO, "[%p] No BackendMetricProvider.", this);
}
return;
}
absl::optional<std::string> serialized = MaybeSerializeBackendMetrics(
reinterpret_cast<BackendMetricProvider*>(ctx->value));
absl::optional<std::string> serialized = MaybeSerializeBackendMetrics(ctx);
if (serialized.has_value() && !serialized->empty()) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_filter_trace)) {
gpr_log(GPR_INFO, "[%p] Backend metrics serialized. size: %" PRIuPTR,

@ -15,6 +15,8 @@
#ifndef GRPC_SRC_CORE_EXT_FILTERS_BACKEND_METRICS_BACKEND_METRIC_PROVIDER_H
#define GRPC_SRC_CORE_EXT_FILTERS_BACKEND_METRICS_BACKEND_METRIC_PROVIDER_H
#include "src/core/lib/resource_quota/arena.h"
namespace grpc_core {
struct BackendMetricData;
@ -24,6 +26,11 @@ class BackendMetricProvider {
virtual BackendMetricData GetBackendMetricData() = 0;
};
template <>
struct ArenaContextType<BackendMetricProvider> {
static void Destroy(BackendMetricProvider*) {}
};
} // namespace grpc_core
#endif // GRPC_SRC_CORE_EXT_FILTERS_BACKEND_METRICS_BACKEND_METRIC_PROVIDER_H

@ -21,7 +21,6 @@
#include <grpc/census.h>
#include <grpc/grpc.h>
#include "src/core/lib/channel/context.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/call.h"
@ -30,12 +29,11 @@ void grpc_census_call_set_context(grpc_call* call, census_context* context) {
GRPC_API_TRACE("grpc_census_call_set_context(call=%p, census_context=%p)", 2,
(call, context));
if (context != nullptr) {
grpc_call_context_set(call, GRPC_CONTEXT_TRACING, context, nullptr);
grpc_call_get_arena(call)->SetContext<census_context>(context);
}
}
census_context* grpc_census_call_get_context(grpc_call* call) {
GRPC_API_TRACE("grpc_census_call_get_context(call=%p)", 1, (call));
return static_cast<census_context*>(
grpc_call_context_get(call, GRPC_CONTEXT_TRACING));
return grpc_call_get_arena(call)->GetContext<census_context>();
}

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

@ -167,10 +167,7 @@ FaultInjectionFilter::MakeInjectionDecision(
const ClientMetadata& initial_metadata) {
// Fetch the fault injection policy from the service config, based on the
// relative index for which policy should this CallData use.
auto* service_config_call_data = static_cast<ServiceConfigCallData*>(
GetContext<
grpc_call_context_element>()[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA]
.value);
auto* service_config_call_data = GetContext<ServiceConfigCallData>();
auto* method_params = static_cast<FaultInjectionMethodParsedConfig*>(
service_config_call_data->GetMethodParsedConfig(
service_config_parser_index_));

@ -119,9 +119,7 @@ MessageHandle ChannelCompression::CompressMessage(
gpr_log(GPR_INFO, "CompressMessage: len=%" PRIdPTR " alg=%d flags=%d",
message->payload()->Length(), algorithm, message->flags());
}
auto* call_context = GetContext<grpc_call_context_element>();
auto* call_tracer = static_cast<CallTracerInterface*>(
call_context[GRPC_CONTEXT_CALL_TRACER].value);
auto* call_tracer = MaybeGetContext<CallTracerInterface>();
if (call_tracer != nullptr) {
call_tracer->RecordSendMessage(*message->payload());
}
@ -178,9 +176,7 @@ absl::StatusOr<MessageHandle> ChannelCompression::DecompressMessage(
message->payload()->Length(),
args.max_recv_message_length.value_or(-1), args.algorithm);
}
auto* call_context = GetContext<grpc_call_context_element>();
auto* call_tracer = static_cast<CallTracerInterface*>(
call_context[GRPC_CONTEXT_CALL_TRACER].value);
auto* call_tracer = MaybeGetContext<CallTracerInterface>();
if (call_tracer != nullptr) {
call_tracer->RecordReceivedMessage(*message->payload());
}
@ -236,8 +232,7 @@ ChannelCompression::DecompressArgs ChannelCompression::HandleIncomingMetadata(
auto max_recv_message_length = max_recv_size_;
const MessageSizeParsedConfig* limits =
MessageSizeParsedConfig::GetFromCallContext(
GetContext<grpc_call_context_element>(),
message_size_service_config_parser_index_);
GetContext<Arena>(), message_size_service_config_parser_index_);
if (limits != nullptr && limits->max_recv_size().has_value() &&
(!max_recv_message_length.has_value() ||
*limits->max_recv_size() < *max_recv_message_length)) {

@ -64,11 +64,8 @@ const NoInterceptor ServerMessageSizeFilter::Call::OnFinalize;
//
const MessageSizeParsedConfig* MessageSizeParsedConfig::GetFromCallContext(
const grpc_call_context_element* context,
size_t service_config_parser_index) {
if (context == nullptr) return nullptr;
auto* svc_cfg_call_data = static_cast<ServiceConfigCallData*>(
context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
Arena* arena, size_t service_config_parser_index) {
auto* svc_cfg_call_data = arena->GetContext<ServiceConfigCallData>();
if (svc_cfg_call_data == nullptr) return nullptr;
return static_cast<const MessageSizeParsedConfig*>(
svc_cfg_call_data->GetMethodParsedConfig(service_config_parser_index));
@ -188,8 +185,7 @@ ClientMessageSizeFilter::Call::Call(ClientMessageSizeFilter* filter)
// size to the receive limit.
const MessageSizeParsedConfig* config_from_call_context =
MessageSizeParsedConfig::GetFromCallContext(
GetContext<grpc_call_context_element>(),
filter->service_config_parser_index_);
GetContext<Arena>(), filter->service_config_parser_index_);
if (config_from_call_context != nullptr) {
absl::optional<uint32_t> max_send_size = limits_.max_send_size();
absl::optional<uint32_t> max_recv_size = limits_.max_recv_size();

@ -55,8 +55,7 @@ class MessageSizeParsedConfig : public ServiceConfigParser::ParsedConfig {
: max_send_size_(max_send_size), max_recv_size_(max_recv_size) {}
static const MessageSizeParsedConfig* GetFromCallContext(
const grpc_call_context_element* context,
size_t service_config_parser_index);
Arena* arena, size_t service_config_parser_index);
static MessageSizeParsedConfig GetFromChannelArgs(const ChannelArgs& args);

@ -53,10 +53,7 @@ const NoInterceptor RbacFilter::Call::OnFinalize;
absl::Status RbacFilter::Call::OnClientInitialMetadata(ClientMetadata& md,
RbacFilter* filter) {
// Fetch and apply the rbac policy from the service config.
auto* service_config_call_data = static_cast<ServiceConfigCallData*>(
GetContext<
grpc_call_context_element>()[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA]
.value);
auto* service_config_call_data = GetContext<ServiceConfigCallData>();
auto* method_params = static_cast<RbacMethodParsedConfig*>(
service_config_call_data->GetMethodParsedConfig(
filter->service_config_parser_index_));

@ -225,10 +225,7 @@ bool IsConfiguredPath(absl::string_view configured_path,
void StatefulSessionFilter::Call::OnClientInitialMetadata(
ClientMetadata& md, StatefulSessionFilter* filter) {
// Get config.
auto* service_config_call_data = static_cast<ServiceConfigCallData*>(
GetContext<
grpc_call_context_element>()[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA]
.value);
auto* service_config_call_data = GetContext<ServiceConfigCallData>();
CHECK_NE(service_config_call_data, nullptr);
auto* method_params = static_cast<StatefulSessionMethodParsedConfig*>(
service_config_call_data->GetMethodParsedConfig(

@ -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,8 +515,8 @@ 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_,
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(),

@ -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"
@ -227,14 +227,13 @@ namespace {
using TaskHandle = ::grpc_event_engine::experimental::EventEngine::TaskHandle;
grpc_core::CallTracerInterface* CallTracerIfSampled(grpc_chttp2_stream* s) {
if (s->context == nullptr || !grpc_core::IsTraceRecordCallopsEnabled()) {
grpc_core::CallTracerAnnotationInterface* CallTracerIfSampled(
grpc_chttp2_stream* s) {
if (!grpc_core::IsTraceRecordCallopsEnabled()) {
return nullptr;
}
auto* call_tracer = static_cast<grpc_core::CallTracerInterface*>(
static_cast<grpc_call_context_element*>(
s->context)[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE]
.value);
auto* call_tracer =
s->arena->GetContext<grpc_core::CallTracerAnnotationInterface>();
if (call_tracer == nullptr || !call_tracer->IsSampled()) {
return nullptr;
}
@ -243,13 +242,11 @@ grpc_core::CallTracerInterface* CallTracerIfSampled(grpc_chttp2_stream* s) {
std::shared_ptr<grpc_core::TcpTracerInterface> TcpTracerIfSampled(
grpc_chttp2_stream* s) {
if (s->context == nullptr || !grpc_core::IsTraceRecordCallopsEnabled()) {
if (!grpc_core::IsTraceRecordCallopsEnabled()) {
return nullptr;
}
auto* call_attempt_tracer = static_cast<grpc_core::CallTracerInterface*>(
static_cast<grpc_call_context_element*>(
s->context)[GRPC_CONTEXT_CALL_TRACER]
.value);
auto* call_attempt_tracer =
s->arena->GetContext<grpc_core::CallTracerInterface>();
if (call_attempt_tracer == nullptr || !call_attempt_tracer->IsSampled()) {
return nullptr;
}
@ -391,10 +388,10 @@ grpc_chttp2_transport::~grpc_chttp2_transport() {
grpc_error_handle error = GRPC_ERROR_CREATE("Transport destroyed");
// ContextList::Execute follows semantics of a callback function and does not
// take a ref on error
if (cl != nullptr) {
grpc_core::ForEachContextListEntryExecute(cl, nullptr, error);
if (context_list != nullptr) {
grpc_core::ForEachContextListEntryExecute(context_list, nullptr, error);
}
cl = nullptr;
context_list = nullptr;
grpc_slice_buffer_destroy(&read_buffer);
grpc_chttp2_goaway_parser_destroy(&goaway_parser);
@ -617,7 +614,7 @@ grpc_chttp2_transport::grpc_chttp2_transport(
&memory_owner),
deframe_state(is_client ? GRPC_DTS_FH_0 : GRPC_DTS_CLIENT_PREFIX_0),
is_client(is_client) {
cl = new grpc_core::ContextList();
context_list = new grpc_core::ContextList();
CHECK(strlen(GRPC_CHTTP2_CLIENT_CONNECT_STRING) ==
GRPC_CHTTP2_CLIENT_CONNECT_STRLEN);
@ -784,7 +781,8 @@ void grpc_chttp2_stream_unref(grpc_chttp2_stream* s) {
grpc_chttp2_stream::grpc_chttp2_stream(grpc_chttp2_transport* t,
grpc_stream_refcount* refcount,
const void* server_data)
const void* server_data,
grpc_core::Arena* arena)
: t(t->Ref()),
refcount([refcount]() {
// We reserve one 'active stream' that's dropped when the stream is
@ -798,6 +796,7 @@ grpc_chttp2_stream::grpc_chttp2_stream(grpc_chttp2_transport* t,
#endif
return refcount;
}()),
arena(arena),
flow_control(&t->flow_control) {
t->streams_allocated.fetch_add(1, std::memory_order_relaxed);
if (server_data) {
@ -855,8 +854,8 @@ grpc_chttp2_stream::~grpc_chttp2_stream() {
void grpc_chttp2_transport::InitStream(grpc_stream* gs,
grpc_stream_refcount* refcount,
const void* server_data,
grpc_core::Arena*) {
new (gs) grpc_chttp2_stream(this, refcount, server_data);
grpc_core::Arena* arena) {
new (gs) grpc_chttp2_stream(this, refcount, server_data, arena);
}
static void destroy_stream_locked(void* sp, grpc_error_handle /*error*/) {
@ -1015,13 +1014,13 @@ static void write_action_begin_locked(
}
static void write_action(grpc_chttp2_transport* t) {
void* cl = t->cl;
if (!t->cl->empty()) {
void* cl = t->context_list;
if (!t->context_list->empty()) {
// Transfer the ownership of the context list to the endpoint and create and
// associate a new context list with the transport.
// The old context list is stored in the cl local variable which is passed
// to the endpoint. Its upto the endpoint to manage its lifetime.
t->cl = new grpc_core::ContextList();
t->context_list = new grpc_core::ContextList();
} else {
// t->cl is Empty. There is nothing to trace in this endpoint_write. set cl
// to nullptr.
@ -1123,19 +1122,16 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
uint32_t goaway_error,
uint32_t last_stream_id,
absl::string_view goaway_text) {
t->goaway_error = grpc_error_set_str(
grpc_error_set_int(
t->goaway_error = grpc_error_set_int(
grpc_error_set_int(
grpc_core::StatusCreate(
absl::StatusCode::kUnavailable,
absl::StrFormat(
"GOAWAY received; Error code: %u; Debug Text: %s",
absl::StrFormat("GOAWAY received; Error code: %u; Debug Text: %s",
goaway_error, goaway_text),
DEBUG_LOCATION, {}),
grpc_core::StatusIntProperty::kHttp2Error,
static_cast<intptr_t>(goaway_error)),
grpc_core::StatusIntProperty::kRpcStatus, GRPC_STATUS_UNAVAILABLE),
grpc_core::StatusStrProperty::kRawBytes, goaway_text);
grpc_core::StatusIntProperty::kRpcStatus, GRPC_STATUS_UNAVAILABLE);
GRPC_CHTTP2_IF_TRACING(
gpr_log(GPR_INFO, "transport %p got goaway with last stream id %d", t,
@ -1293,12 +1289,10 @@ void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t,
if (cl_err.ok()) {
cl_err = GRPC_ERROR_CREATE(absl::StrCat(
"Error in HTTP transport completing operation: ", desc,
" write_state=", write_state_name(t->write_state), " refs=",
closure->next_data.scratch / CLOSURE_BARRIER_FIRST_REF_BIT, " flags=",
closure->next_data.scratch % CLOSURE_BARRIER_FIRST_REF_BIT));
cl_err = grpc_error_set_str(cl_err,
grpc_core::StatusStrProperty::kTargetAddress,
std::string(t->peer_string.as_string_view()));
" write_state=", write_state_name(t->write_state),
" refs=", closure->next_data.scratch / CLOSURE_BARRIER_FIRST_REF_BIT,
" flags=", closure->next_data.scratch % CLOSURE_BARRIER_FIRST_REF_BIT,
" peer_address=", t->peer_string.as_string_view()));
}
cl_err = grpc_error_add_child(cl_err, error);
closure->error_data.error = grpc_core::internal::StatusAllocHeapPtr(cl_err);
@ -1376,7 +1370,7 @@ static void perform_stream_op_locked(void* stream_op,
}
if (op->send_initial_metadata) {
if (s->call_tracer) {
if (s->call_tracer != nullptr) {
s->call_tracer->RecordAnnotation(
grpc_core::HttpAnnotation(grpc_core::HttpAnnotation::Type::kStart,
gpr_now(GPR_CLOCK_REALTIME))
@ -2613,9 +2607,9 @@ static grpc_error_handle try_http_parsing(grpc_chttp2_transport* t) {
if (parse_error.ok() &&
(parse_error = grpc_http_parser_eof(&parser)) == absl::OkStatus()) {
error = grpc_error_set_int(
grpc_error_set_int(
GRPC_ERROR_CREATE("Trying to connect an http1.x server"),
grpc_core::StatusIntProperty::kHttpStatus, response.status),
GRPC_ERROR_CREATE(
absl::StrCat("Trying to connect an http1.x server (HTTP status ",
response.status, ")")),
grpc_core::StatusIntProperty::kRpcStatus,
grpc_http2_status_to_grpc_status(response.status));
}

@ -83,7 +83,7 @@ void TestOnlyGlobalHttp2TransportDisableTransientFailureStateNotification(
typedef void (*WriteTimestampsCallback)(void*, Timestamps*,
grpc_error_handle error);
typedef void* (*CopyContextFn)(void*);
typedef void* (*CopyContextFn)(Arena*);
void GrpcHttp2SetWriteTimestampsCallback(WriteTimestampsCallback fn);
void GrpcHttp2SetCopyContextFn(CopyContextFn fn);

@ -466,7 +466,7 @@ struct grpc_chttp2_transport final : public grpc_core::FilterStackTransport,
grpc_chttp2_keepalive_state keepalive_state;
// Soft limit on max header size.
uint32_t max_header_list_size_soft_limit = 0;
grpc_core::ContextList* cl = nullptr;
grpc_core::ContextList* context_list = nullptr;
grpc_core::RefCountedPtr<grpc_core::channelz::SocketNode> channelz_socket;
uint32_t num_messages_in_next_write = 0;
/// The number of pending induced frames (SETTINGS_ACK, PINGS_ACK and
@ -545,12 +545,13 @@ typedef enum {
struct grpc_chttp2_stream {
grpc_chttp2_stream(grpc_chttp2_transport* t, grpc_stream_refcount* refcount,
const void* server_data);
const void* server_data, grpc_core::Arena* arena);
~grpc_chttp2_stream();
void* context = nullptr;
const grpc_core::RefCountedPtr<grpc_chttp2_transport> t;
grpc_stream_refcount* refcount;
grpc_core::Arena* const arena;
grpc_closure destroy_stream;
grpc_closure* destroy_stream_arg;
@ -643,7 +644,7 @@ struct grpc_chttp2_stream {
int64_t write_counter = 0;
/// Only set when enabled.
grpc_core::CallTracerInterface* call_tracer = nullptr;
grpc_core::CallTracerAnnotationInterface* call_tracer = nullptr;
/// Only set when enabled.
std::shared_ptr<grpc_core::TcpTracerInterface> tcp_tracer;

@ -942,13 +942,8 @@ grpc_error_handle grpc_chttp2_header_parser_parse(void* hpack_parser,
grpc_core::CallTracerAnnotationInterface* call_tracer = nullptr;
if (s != nullptr) {
s->stats.incoming.header_bytes += GRPC_SLICE_LENGTH(slice);
if (s->context != nullptr) {
call_tracer = static_cast<grpc_core::CallTracerAnnotationInterface*>(
static_cast<grpc_call_context_element*>(
s->context)[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE]
.value);
}
call_tracer =
s->arena->GetContext<grpc_core::CallTracerAnnotationInterface>();
}
grpc_error_handle error = parser->Parse(
slice, is_last != 0, absl::BitGenRef(t->bitgen), call_tracer);

@ -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();
};

@ -682,10 +682,10 @@ grpc_chttp2_begin_write_result grpc_chttp2_begin_write(
grpc_core::GrpcHttp2GetCopyContextFn();
if (copy_context_fn != nullptr &&
grpc_core::GrpcHttp2GetWriteTimestampsCallback() != nullptr) {
t->cl->emplace_back(copy_context_fn(s->context),
outbuf_relative_start_pos, num_stream_bytes,
s->byte_counter, s->write_counter - 1,
s->tcp_tracer);
t->context_list->emplace_back(copy_context_fn(s->arena),
outbuf_relative_start_pos,
num_stream_bytes, s->byte_counter,
s->write_counter - 1, s->tcp_tracer);
}
}
outbuf_relative_start_pos += num_stream_bytes;

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

@ -40,7 +40,6 @@
#include <grpc/support/port_platform.h>
#include <grpc/support/sync.h>
#include "src/core/handshaker/security/tsi_error.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
@ -340,8 +339,9 @@ static void on_read(void* user_data, grpc_error_handle error) {
if (result != TSI_OK) {
grpc_slice_buffer_reset_and_unref(ep->read_buffer);
call_read_cb(ep, grpc_set_tsi_error_result(
GRPC_ERROR_CREATE("Unwrap failed"), result));
call_read_cb(
ep, GRPC_ERROR_CREATE(absl::StrCat("Unwrap failed (",
tsi_result_to_string(result), ")")));
return;
}
@ -484,7 +484,8 @@ static void endpoint_write(grpc_endpoint* secure_ep, grpc_slice_buffer* slices,
grpc_slice_buffer_reset_and_unref(&ep->output_buffer);
grpc_core::ExecCtx::Run(
DEBUG_LOCATION, cb,
grpc_set_tsi_error_result(GRPC_ERROR_CREATE("Wrap failed"), result));
GRPC_ERROR_CREATE(
absl::StrCat("Wrap failed (", tsi_result_to_string(result), ")")));
return;
}

@ -48,7 +48,6 @@
#include "src/core/handshaker/handshaker_factory.h"
#include "src/core/handshaker/handshaker_registry.h"
#include "src/core/handshaker/security/secure_endpoint.h"
#include "src/core/handshaker/security/tsi_error.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gprpp/debug_location.h"
@ -260,10 +259,9 @@ void SecurityHandshaker::OnPeerCheckedInner(grpc_error_handle error) {
tsi_result result = tsi_handshaker_result_get_unused_bytes(
handshaker_result_, &unused_bytes, &unused_bytes_size);
if (result != TSI_OK) {
HandshakeFailedLocked(grpc_set_tsi_error_result(
GRPC_ERROR_CREATE(
"TSI handshaker result does not provide unused bytes"),
result));
HandshakeFailedLocked(GRPC_ERROR_CREATE(
absl::StrCat("TSI handshaker result does not provide unused bytes (",
tsi_result_to_string(result), ")")));
return;
}
// Check whether we need to wrap the endpoint.
@ -271,10 +269,10 @@ void SecurityHandshaker::OnPeerCheckedInner(grpc_error_handle error) {
result = tsi_handshaker_result_get_frame_protector_type(
handshaker_result_, &frame_protector_type);
if (result != TSI_OK) {
HandshakeFailedLocked(grpc_set_tsi_error_result(
GRPC_ERROR_CREATE("TSI handshaker result does not implement "
"get_frame_protector_type"),
result));
HandshakeFailedLocked(GRPC_ERROR_CREATE(
absl::StrCat("TSI handshaker result does not implement "
"get_frame_protector_type (",
tsi_result_to_string(result), ")")));
return;
}
tsi_zero_copy_grpc_protector* zero_copy_protector = nullptr;
@ -288,9 +286,9 @@ void SecurityHandshaker::OnPeerCheckedInner(grpc_error_handle error) {
handshaker_result_, max_frame_size_ == 0 ? nullptr : &max_frame_size_,
&zero_copy_protector);
if (result != TSI_OK) {
HandshakeFailedLocked(grpc_set_tsi_error_result(
GRPC_ERROR_CREATE("Zero-copy frame protector creation failed"),
result));
HandshakeFailedLocked(GRPC_ERROR_CREATE(
absl::StrCat("Zero-copy frame protector creation failed (",
tsi_result_to_string(result), ")")));
return;
}
break;
@ -300,8 +298,9 @@ void SecurityHandshaker::OnPeerCheckedInner(grpc_error_handle error) {
handshaker_result_, max_frame_size_ == 0 ? nullptr : &max_frame_size_,
&protector);
if (result != TSI_OK) {
HandshakeFailedLocked(grpc_set_tsi_error_result(
GRPC_ERROR_CREATE("Frame protector creation failed"), result));
HandshakeFailedLocked(
GRPC_ERROR_CREATE(absl::StrCat("Frame protector creation failed (",
tsi_result_to_string(result), ")")));
return;
}
break;
@ -356,8 +355,8 @@ grpc_error_handle SecurityHandshaker::CheckPeerLocked() {
tsi_result result =
tsi_handshaker_result_extract_peer(handshaker_result_, &peer);
if (result != TSI_OK) {
return grpc_set_tsi_error_result(
GRPC_ERROR_CREATE("Peer extraction failed"), result);
return GRPC_ERROR_CREATE(absl::StrCat("Peer extraction failed (",
tsi_result_to_string(result), ")"));
}
connector_->check_peer(peer, args_->endpoint, args_->args, &auth_context_,
&on_peer_checked_);
@ -398,11 +397,9 @@ grpc_error_handle SecurityHandshaker::OnHandshakeNextDoneLocked(
if (security_connector != nullptr) {
connector_type = security_connector->type().name();
}
return grpc_set_tsi_error_result(
GRPC_ERROR_CREATE(absl::StrCat(
connector_type, " handshake failed",
(tsi_handshake_error_.empty() ? "" : ": "), tsi_handshake_error_)),
result);
return GRPC_ERROR_CREATE(absl::StrCat(
connector_type, " handshake failed (", tsi_result_to_string(result),
")", (tsi_handshake_error_.empty() ? "" : ": "), tsi_handshake_error_));
}
// Update handshaker result.
if (handshaker_result != nullptr) {

@ -1,31 +0,0 @@
//
//
// Copyright 2015 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//
#include "src/core/handshaker/security/tsi_error.h"
#include <grpc/support/port_platform.h>
#include "src/core/lib/gprpp/status_helper.h"
grpc_error_handle grpc_set_tsi_error_result(grpc_error_handle error,
tsi_result result) {
return grpc_error_set_int(
grpc_error_set_str(error, grpc_core::StatusStrProperty::kTsiError,
tsi_result_to_string(result)),
grpc_core::StatusIntProperty::kTsiCode, result);
}

@ -1,30 +0,0 @@
//
//
// Copyright 2015 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//
#ifndef GRPC_SRC_CORE_HANDSHAKER_SECURITY_TSI_ERROR_H
#define GRPC_SRC_CORE_HANDSHAKER_SECURITY_TSI_ERROR_H
#include <grpc/support/port_platform.h>
#include "src/core/lib/iomgr/error.h"
#include "src/core/tsi/transport_security_interface.h"
grpc_error_handle grpc_set_tsi_error_result(grpc_error_handle error,
tsi_result result);
#endif // GRPC_SRC_CORE_HANDSHAKER_SECURITY_TSI_ERROR_H

@ -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::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,
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");
}

@ -28,42 +28,7 @@
/// Call context is represented as an array of \a grpc_call_context_elements.
/// This enum represents the indexes into the array, where each index
/// contains a different type of value.
typedef enum {
/// grpc_call* associated with this context.
GRPC_CONTEXT_CALL = 0,
/// Value is either a \a grpc_client_security_context or a
/// \a grpc_server_security_context.
GRPC_CONTEXT_SECURITY,
/// Value is a \a census_context.
GRPC_CONTEXT_TRACING,
/// Value is a CallTracerAnnotationInterface. (ClientCallTracer object on the
/// client-side call, or ServerCallTracer on the server-side.)
GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE,
/// Value is a CallTracerInterface (ServerCallTracer on the server-side,
/// CallAttemptTracer on a subchannel call.)
/// TODO(yashykt): Maybe come up with a better name. This will go away in the
/// future anyway, so not super important.
GRPC_CONTEXT_CALL_TRACER,
/// Reserved for traffic_class_context.
GRPC_CONTEXT_TRAFFIC,
/// Holds a pointer to ServiceConfigCallData associated with this call.
GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA,
/// Holds a pointer to BackendMetricProvider associated with this call on
/// the server.
GRPC_CONTEXT_BACKEND_METRIC_PROVIDER,
/// Special Google context
GRPC_CONTEXT_GOOGLE,
GRPC_CONTEXT_COUNT
} grpc_context_index;
typedef enum { GRPC_CONTEXT_COUNT } grpc_context_index;
struct grpc_call_context_element {
void* value = nullptr;
@ -71,8 +36,7 @@ struct grpc_call_context_element {
};
namespace grpc_core {
class Call;
class CallTracerAnnotationInterface;
class ServiceConfigCallData;
// Bind the legacy context array into the new style structure
// TODO(ctiller): remove as we migrate these contexts to the new system.
@ -85,17 +49,6 @@ namespace promise_detail {
template <typename T>
struct OldStyleContext;
template <>
struct OldStyleContext<Call> {
static constexpr grpc_context_index kIndex = GRPC_CONTEXT_CALL;
};
template <>
struct OldStyleContext<CallTracerAnnotationInterface> {
static constexpr grpc_context_index kIndex =
GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE;
};
template <typename T>
class Context<T, absl::void_t<decltype(OldStyleContext<T>::kIndex)>> {
public:
@ -104,6 +57,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

@ -75,8 +75,6 @@ ABSL_FLAG(absl::optional<bool>, grpc_not_use_system_ssl_roots, {},
"Disable loading system root certificates.");
ABSL_FLAG(absl::optional<std::string>, grpc_ssl_cipher_suites, {},
"A colon separated list of cipher suites to use with OpenSSL");
ABSL_FLAG(absl::optional<bool>, grpc_absl_logging, {},
"Use absl logging from within gpr_log.");
namespace grpc_core {
@ -94,8 +92,6 @@ ConfigVars::ConfigVars(const Overrides& overrides)
not_use_system_ssl_roots_(LoadConfig(
FLAGS_grpc_not_use_system_ssl_roots, "GRPC_NOT_USE_SYSTEM_SSL_ROOTS",
overrides.not_use_system_ssl_roots, false)),
absl_logging_(LoadConfig(FLAGS_grpc_absl_logging, "GRPC_ABSL_LOGGING",
overrides.absl_logging, true)),
dns_resolver_(LoadConfig(FLAGS_grpc_dns_resolver, "GRPC_DNS_RESOLVER",
overrides.dns_resolver, "")),
verbosity_(LoadConfig(FLAGS_grpc_verbosity, "GRPC_VERBOSITY",
@ -147,8 +143,7 @@ std::string ConfigVars::ToString() const {
"\"", ", default_ssl_roots_file_path: ", "\"",
absl::CEscape(DefaultSslRootsFilePath()), "\"",
", not_use_system_ssl_roots: ", NotUseSystemSslRoots() ? "true" : "false",
", ssl_cipher_suites: ", "\"", absl::CEscape(SslCipherSuites()), "\"",
", absl_logging: ", AbslLogging() ? "true" : "false");
", ssl_cipher_suites: ", "\"", absl::CEscape(SslCipherSuites()), "\"");
}
} // namespace grpc_core

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

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

@ -211,14 +211,9 @@ bool CmsgIsZeroCopy(const cmsghdr& cmsg) {
}
#endif // GRPC_LINUX_ERRQUEUE
absl::Status PosixOSError(int error_no, const char* call_name) {
absl::Status s = absl::UnknownError(grpc_core::StrError(error_no));
grpc_core::StatusSetInt(&s, grpc_core::StatusIntProperty::kErrorNo, error_no);
grpc_core::StatusSetStr(&s, grpc_core::StatusStrProperty::kOsError,
grpc_core::StrError(error_no));
grpc_core::StatusSetStr(&s, grpc_core::StatusStrProperty::kSyscall,
call_name);
return s;
absl::Status PosixOSError(int error_no, absl::string_view call_name) {
return absl::UnknownError(absl::StrCat(
call_name, ": ", grpc_core::StrError(error_no), " (", error_no, ")"));
}
} // namespace
@ -281,12 +276,7 @@ void PosixEndpointImpl::FinishEstimate() {
bytes_read_this_round_ = 0;
}
absl::Status PosixEndpointImpl::TcpAnnotateError(absl::Status src_error) {
auto peer_string = ResolvedAddressToNormalizedString(peer_address_);
grpc_core::StatusSetStr(&src_error,
grpc_core::StatusStrProperty::kTargetAddress,
peer_string.ok() ? *peer_string : "");
absl::Status PosixEndpointImpl::TcpAnnotateError(absl::Status src_error) const {
grpc_core::StatusSetInt(&src_error, grpc_core::StatusIntProperty::kFd,
handle_->WrappedFd());
grpc_core::StatusSetInt(&src_error, grpc_core::StatusIntProperty::kRpcStatus,

@ -525,7 +525,7 @@ class PosixEndpointImpl : public grpc_core::RefCounted<PosixEndpointImpl> {
bool WriteWithTimestamps(struct msghdr* msg, size_t sending_length,
ssize_t* sent_length, int* saved_errno,
int additional_flags);
absl::Status TcpAnnotateError(absl::Status src_error);
absl::Status TcpAnnotateError(absl::Status src_error) const;
#ifdef GRPC_LINUX_ERRQUEUE
bool ProcessErrors();
// Reads a cmsg to process zerocopy control messages.

@ -261,13 +261,9 @@ WindowsEventEngineListener::SinglePortSocketListener::PrepareListenerSocket(
SOCKET sock, const EventEngine::ResolvedAddress& addr) {
auto fail = [&](absl::Status error) -> absl::Status {
CHECK(!error.ok());
auto addr_uri = ResolvedAddressToURI(addr);
error = grpc_error_set_int(
grpc_error_set_str(
GRPC_ERROR_CREATE_REFERENCING("Failed to prepare server socket",
&error, 1),
grpc_core::StatusStrProperty::kTargetAddress,
addr_uri.ok() ? *addr_uri : addr_uri.status().ToString()),
GRPC_ERROR_CREATE_REFERENCING("Failed to prepare server socket", &error,
1),
grpc_core::StatusIntProperty::kFd, static_cast<intptr_t>(sock));
if (sock != INVALID_SOCKET) closesocket(sock);
return error;

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

@ -60,30 +60,16 @@ const absl::string_view kChildrenPropertyUrl = TYPE_URL(TYPE_CHILDREN_TAG);
const char* GetStatusIntPropertyUrl(StatusIntProperty key) {
switch (key) {
case StatusIntProperty::kErrorNo:
return TYPE_URL(TYPE_INT_TAG "errno");
case StatusIntProperty::kFileLine:
return TYPE_URL(TYPE_INT_TAG "file_line");
case StatusIntProperty::kStreamId:
return TYPE_URL(TYPE_INT_TAG "stream_id");
case StatusIntProperty::kRpcStatus:
return TYPE_URL(TYPE_INT_TAG "grpc_status");
case StatusIntProperty::kOffset:
return TYPE_URL(TYPE_INT_TAG "offset");
case StatusIntProperty::kIndex:
return TYPE_URL(TYPE_INT_TAG "index");
case StatusIntProperty::kSize:
return TYPE_URL(TYPE_INT_TAG "size");
case StatusIntProperty::kHttp2Error:
return TYPE_URL(TYPE_INT_TAG "http2_error");
case StatusIntProperty::kTsiCode:
return TYPE_URL(TYPE_INT_TAG "tsi_code");
case StatusIntProperty::kWsaError:
return TYPE_URL(TYPE_INT_TAG "wsa_error");
case StatusIntProperty::kFd:
return TYPE_URL(TYPE_INT_TAG "fd");
case StatusIntProperty::kHttpStatus:
return TYPE_URL(TYPE_INT_TAG "http_status");
case StatusIntProperty::kOccurredDuringWrite:
return TYPE_URL(TYPE_INT_TAG "occurred_during_write");
case StatusIntProperty::ChannelConnectivityState:
@ -100,24 +86,8 @@ const char* GetStatusStrPropertyUrl(StatusStrProperty key) {
return TYPE_URL(TYPE_STR_TAG "description");
case StatusStrProperty::kFile:
return TYPE_URL(TYPE_STR_TAG "file");
case StatusStrProperty::kOsError:
return TYPE_URL(TYPE_STR_TAG "os_error");
case StatusStrProperty::kSyscall:
return TYPE_URL(TYPE_STR_TAG "syscall");
case StatusStrProperty::kTargetAddress:
return TYPE_URL(TYPE_STR_TAG "target_address");
case StatusStrProperty::kGrpcMessage:
return TYPE_URL(TYPE_STR_TAG "grpc_message");
case StatusStrProperty::kRawBytes:
return TYPE_URL(TYPE_STR_TAG "raw_bytes");
case StatusStrProperty::kTsiError:
return TYPE_URL(TYPE_STR_TAG "tsi_error");
case StatusStrProperty::kFilename:
return TYPE_URL(TYPE_STR_TAG "filename");
case StatusStrProperty::kKey:
return TYPE_URL(TYPE_STR_TAG "key");
case StatusStrProperty::kValue:
return TYPE_URL(TYPE_STR_TAG "value");
}
GPR_UNREACHABLE_CODE(return "unknown");
}
@ -348,6 +318,17 @@ std::string StatusToString(const absl::Status& status) {
: absl::StrCat(head, " {", absl::StrJoin(kvs, ", "), "}");
}
absl::Status AddMessagePrefix(absl::string_view prefix, absl::Status status) {
absl::Status new_status(status.code(),
absl::StrCat(prefix, ": ", status.message()));
// TODO(roth): Remove this once we elimiate all status attributes.
status.ForEachPayload(
[&](absl::string_view type_url, const absl::Cord& payload) {
new_status.SetPayload(type_url, payload);
});
return new_status;
}
namespace internal {
google_rpc_Status* StatusToProto(const absl::Status& status, upb_Arena* arena) {

@ -48,8 +48,6 @@ namespace grpc_core {
/// This enum should have the same value of grpc_error_ints
enum class StatusIntProperty {
/// 'errno' from the operating system
kErrorNo,
/// __LINE__ from the call site creating the error
kFileLine,
/// stream identifier: for errors that are associated with an individual
@ -58,23 +56,10 @@ enum class StatusIntProperty {
/// grpc status code representing this error
// TODO(veblush): Remove this after grpc_error is replaced with absl::Status
kRpcStatus,
/// offset into some binary blob (usually represented by
/// RAW_BYTES) where the error occurred
kOffset,
/// context sensitive index associated with the error
kIndex,
/// context sensitive size associated with the error
kSize,
/// http2 error code associated with the error (see the HTTP2 RFC)
kHttp2Error,
/// TSI status code associated with the error
kTsiCode,
/// WSAGetLastError() reported when this error occurred
kWsaError,
/// File descriptor associated with this error
kFd,
/// HTTP status (i.e. 404)
kHttpStatus,
/// chttp2: did the error occur while a write was in progress
kOccurredDuringWrite,
/// channel connectivity state associated with the error
@ -89,24 +74,8 @@ enum class StatusStrProperty {
kDescription,
/// source file in which this error occurred
kFile,
/// operating system description of this error
kOsError,
/// syscall that generated this error
kSyscall,
/// peer that we were trying to communicate when this error occurred
kTargetAddress,
/// grpc status message associated with this error
kGrpcMessage,
/// hex dump (or similar) with the data that generated this error
kRawBytes,
/// tsi error string associated with this error
kTsiError,
/// filename that we were trying to read/write when this error occurred
kFilename,
/// key associated with the error
kKey,
/// value associated with the error
kValue,
};
/// This enum should have the same value of grpc_error_times
@ -158,6 +127,9 @@ GRPC_MUST_USE_RESULT std::vector<absl::Status> StatusGetChildren(
/// CANCELLATION:SampleMessage {errno:'2021', line:'54', children:[ABORTED]}
GRPC_MUST_USE_RESULT std::string StatusToString(const absl::Status& status);
/// Adds prefix to the message of status.
absl::Status AddMessagePrefix(absl::string_view prefix, absl::Status status);
namespace internal {
/// Builds a upb message, google_rpc_Status from a status

@ -106,12 +106,9 @@ static void CFStreamUnref(CFStreamEndpoint* ep) {
static void CFStreamRef(CFStreamEndpoint* ep) { gpr_ref(&ep->refcount); }
#endif
static grpc_error_handle CFStreamAnnotateError(grpc_error_handle src_error,
CFStreamEndpoint* ep) {
return grpc_error_set_str(
grpc_error_set_int(src_error, grpc_core::StatusIntProperty::kRpcStatus,
GRPC_STATUS_UNAVAILABLE),
grpc_core::StatusStrProperty::kTargetAddress, ep->peer_string);
static grpc_error_handle CFStreamAnnotateError(grpc_error_handle src_error) {
return grpc_error_set_int(src_error, grpc_core::StatusIntProperty::kRpcStatus,
GRPC_STATUS_UNAVAILABLE);
}
static void CallReadCb(CFStreamEndpoint* ep, grpc_error_handle error) {
@ -170,7 +167,7 @@ static void ReadAction(void* arg, grpc_error_handle error) {
CFErrorRef stream_error = CFReadStreamCopyError(ep->read_stream);
if (stream_error != nullptr) {
error = CFStreamAnnotateError(
GRPC_ERROR_CREATE_FROM_CFERROR(stream_error, "Read error"), ep);
GRPC_ERROR_CREATE_FROM_CFERROR(stream_error, "Read error"));
CFRelease(stream_error);
} else {
error = GRPC_ERROR_CREATE("Read error");
@ -179,8 +176,7 @@ static void ReadAction(void* arg, grpc_error_handle error) {
EP_UNREF(ep, "read");
} else if (read_size == 0) {
grpc_slice_buffer_reset_and_unref(ep->read_slices);
CallReadCb(ep,
CFStreamAnnotateError(GRPC_ERROR_CREATE("Socket closed"), ep));
CallReadCb(ep, CFStreamAnnotateError(GRPC_ERROR_CREATE("Socket closed")));
EP_UNREF(ep, "read");
} else {
if (read_size < static_cast<CFIndex>(len)) {
@ -209,7 +205,7 @@ static void WriteAction(void* arg, grpc_error_handle error) {
CFErrorRef stream_error = CFWriteStreamCopyError(ep->write_stream);
if (stream_error != nullptr) {
error = CFStreamAnnotateError(
GRPC_ERROR_CREATE_FROM_CFERROR(stream_error, "write failed."), ep);
GRPC_ERROR_CREATE_FROM_CFERROR(stream_error, "Write failed"));
CFRelease(stream_error);
} else {
error = GRPC_ERROR_CREATE("write failed.");

@ -21,6 +21,7 @@
#include <string.h>
#include "absl/log/check.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include <grpc/status.h>
@ -58,15 +59,10 @@ absl::Status grpc_status_create(absl::StatusCode code, absl::string_view msg,
absl::Status grpc_os_error(const grpc_core::DebugLocation& location, int err,
const char* call_name) {
auto err_string = grpc_core::StrError(err);
absl::Status s =
StatusCreate(absl::StatusCode::kUnknown, err_string, location, {});
grpc_core::StatusSetInt(&s, grpc_core::StatusIntProperty::kErrorNo, err);
grpc_core::StatusSetStr(&s, grpc_core::StatusStrProperty::kOsError,
err_string);
grpc_core::StatusSetStr(&s, grpc_core::StatusStrProperty::kSyscall,
call_name);
return s;
return StatusCreate(
absl::StatusCode::kUnknown,
absl::StrCat(call_name, ": ", grpc_core::StrError(err), " (", err, ")"),
location, {});
}
#ifdef GPR_WINDOWS
@ -104,15 +100,15 @@ std::string WSAErrorToShortDescription(int err) {
absl::Status grpc_wsa_error(const grpc_core::DebugLocation& location, int err,
absl::string_view call_name) {
char* utf8_message = gpr_format_message(err);
absl::Status s = StatusCreate(absl::StatusCode::kUnavailable,
WSAErrorToShortDescription(err), location, {});
StatusSetInt(&s, grpc_core::StatusIntProperty::kWsaError, err);
StatusSetInt(&s, grpc_core::StatusIntProperty::kRpcStatus,
absl::Status status = StatusCreate(
absl::StatusCode::kUnavailable,
absl::StrCat(call_name, ": ", WSAErrorToShortDescription(err), " (",
utf8_message, " -- ", err, ")"),
location, {});
StatusSetInt(&status, grpc_core::StatusIntProperty::kRpcStatus,
GRPC_STATUS_UNAVAILABLE);
StatusSetStr(&s, grpc_core::StatusStrProperty::kOsError, utf8_message);
StatusSetStr(&s, grpc_core::StatusStrProperty::kSyscall, call_name);
gpr_free(utf8_message);
return s;
return status;
}
#endif

@ -106,14 +106,13 @@ NativeDNSResolver::LookupHostnameBlocking(absl::string_view name,
// parse name, splitting it into host and port parts
SplitHostPort(name, &host, &port);
if (host.empty()) {
err = grpc_error_set_str(GRPC_ERROR_CREATE("unparseable host:port"),
StatusStrProperty::kTargetAddress, name);
err =
GRPC_ERROR_CREATE(absl::StrCat("unparseable host:port \"", name, "\""));
goto done;
}
if (port.empty()) {
if (default_port.empty()) {
err = grpc_error_set_str(GRPC_ERROR_CREATE("no port in name"),
StatusStrProperty::kTargetAddress, name);
err = GRPC_ERROR_CREATE(absl::StrCat("no port in name \"", name, "\""));
goto done;
}
port = std::string(default_port);
@ -139,14 +138,8 @@ NativeDNSResolver::LookupHostnameBlocking(absl::string_view name,
}
}
if (s != 0) {
err = grpc_error_set_str(
grpc_error_set_str(
grpc_error_set_str(
grpc_error_set_int(GRPC_ERROR_CREATE(gai_strerror(s)),
StatusIntProperty::kErrorNo, s),
StatusStrProperty::kOsError, gai_strerror(s)),
StatusStrProperty::kSyscall, "getaddrinfo"),
StatusStrProperty::kTargetAddress, name);
err = absl::UnknownError(absl::StrCat(
"getaddrinfo(\"", name, "\"): ", gai_strerror(s), " (", s, ")"));
goto done;
}
// Success path: fill in addrs

@ -45,6 +45,7 @@
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/strings/str_cat.h"
#include <grpc/event_engine/endpoint_config.h>
#include <grpc/support/alloc.h>
@ -464,15 +465,9 @@ int grpc_ipv6_loopback_available(void) {
return g_ipv6_loopback_available;
}
static grpc_error_handle error_for_fd(int fd,
const grpc_resolved_address* addr) {
static grpc_error_handle error_for_fd(int fd) {
if (fd >= 0) return absl::OkStatus();
auto addr_str = grpc_sockaddr_to_string(addr, false);
grpc_error_handle err = grpc_error_set_str(
GRPC_OS_ERROR(errno, "socket"),
grpc_core::StatusStrProperty::kTargetAddress,
addr_str.ok() ? addr_str.value() : addr_str.status().ToString());
return err;
return GRPC_OS_ERROR(errno, "socket");
}
grpc_error_handle grpc_create_dualstack_socket(
@ -523,7 +518,7 @@ grpc_error_handle grpc_create_dualstack_socket_using_factory(
// If this isn't an IPv4 address, then return whatever we've got.
if (!grpc_sockaddr_is_v4mapped(resolved_addr, nullptr)) {
*dsmode = GRPC_DSMODE_IPV6;
return error_for_fd(*newfd, resolved_addr);
return error_for_fd(*newfd);
}
// Fall back to AF_INET.
if (*newfd >= 0) {
@ -533,7 +528,7 @@ grpc_error_handle grpc_create_dualstack_socket_using_factory(
}
*dsmode = family == AF_INET ? GRPC_DSMODE_IPV4 : GRPC_DSMODE_NONE;
*newfd = create_socket(factory, family, type, protocol);
return error_for_fd(*newfd, resolved_addr);
return error_for_fd(*newfd);
}
#endif

@ -199,8 +199,7 @@ static void on_writable(void* acp, grpc_error_handle error) {
gpr_mu_lock(&ac->mu);
if (!error.ok()) {
error = grpc_error_set_str(error, grpc_core::StatusStrProperty::kOsError,
"Timeout occurred");
error = grpc_core::AddMessagePrefix("Timeout occurred", error);
goto finish;
}
@ -281,8 +280,6 @@ finish:
absl::StrCat("Failed to connect to remote host: ", str);
error = grpc_error_set_str(
error, grpc_core::StatusStrProperty::kDescription, description);
error = grpc_error_set_str(
error, grpc_core::StatusStrProperty::kTargetAddress, addr_str);
}
if (done) {
// This is safe even outside the lock, because "done", the sentinel, is
@ -347,7 +344,7 @@ int64_t grpc_tcp_client_create_from_prepared_fd(
return 0;
}
std::string name = absl::StrCat("tcp-client:", addr_uri.value());
std::string name = absl::StrCat("tcp-client:", *addr_uri);
grpc_fd* fdobj = grpc_fd_create(fd, name.c_str(), true);
int64_t connection_id = 0;
if (connect_errno == EWOULDBLOCK || connect_errno == EINPROGRESS) {
@ -358,7 +355,7 @@ int64_t grpc_tcp_client_create_from_prepared_fd(
if (err >= 0) {
// Connection already succeded. Return 0 to discourage any cancellation
// attempts.
*ep = grpc_tcp_client_create_from_fd(fdobj, options, addr_uri.value());
*ep = grpc_tcp_client_create_from_fd(fdobj, options, *addr_uri);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, absl::OkStatus());
return 0;
}
@ -366,8 +363,6 @@ int64_t grpc_tcp_client_create_from_prepared_fd(
// Connection already failed. Return 0 to discourage any cancellation
// attempts.
grpc_error_handle error = GRPC_OS_ERROR(connect_errno, "connect");
error = grpc_error_set_str(
error, grpc_core::StatusStrProperty::kTargetAddress, addr_uri.value());
grpc_fd_orphan(fdobj, nullptr, nullptr, "tcp_client_connect_error");
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, error);
return 0;

@ -246,10 +246,8 @@ static int64_t tcp_connect(grpc_closure* on_done, grpc_endpoint** endpoint,
failure:
CHECK(!error.ok());
grpc_error_handle final_error = grpc_error_set_str(
GRPC_ERROR_CREATE_REFERENCING("Failed to connect", &error, 1),
grpc_core::StatusStrProperty::kTargetAddress,
addr_uri.ok() ? *addr_uri : addr_uri.status().ToString());
grpc_error_handle final_error =
GRPC_ERROR_CREATE_REFERENCING("Failed to connect", &error, 1);
if (socket != NULL) {
grpc_winsocket_destroy(socket);
} else if (sock != INVALID_SOCKET) {

@ -762,14 +762,11 @@ static void finish_estimate(grpc_tcp* tcp) {
static grpc_error_handle tcp_annotate_error(grpc_error_handle src_error,
grpc_tcp* tcp) {
return grpc_error_set_str(
grpc_error_set_int(
grpc_error_set_int(src_error, grpc_core::StatusIntProperty::kFd,
tcp->fd),
return grpc_error_set_int(
grpc_error_set_int(src_error, grpc_core::StatusIntProperty::kFd, tcp->fd),
// All tcp errors are marked with UNAVAILABLE so that application may
// choose to retry.
grpc_core::StatusIntProperty::kRpcStatus, GRPC_STATUS_UNAVAILABLE),
grpc_core::StatusStrProperty::kTargetAddress, tcp->peer_string);
grpc_core::StatusIntProperty::kRpcStatus, GRPC_STATUS_UNAVAILABLE);
}
static void tcp_handle_read(void* arg /* grpc_tcp */, grpc_error_handle error);
@ -1668,10 +1665,6 @@ static bool do_tcp_flush_zerocopy(grpc_tcp* tcp, TcpZerocopySendRecord* record,
if (saved_errno == EAGAIN || saved_errno == ENOBUFS) {
record->UnwindIfThrottled(unwind_slice_idx, unwind_byte_idx);
return false;
} else if (saved_errno == EPIPE) {
*error = tcp_annotate_error(GRPC_OS_ERROR(saved_errno, "sendmsg"), tcp);
tcp_shutdown_buffer_list(tcp);
return true;
} else {
*error = tcp_annotate_error(GRPC_OS_ERROR(saved_errno, "sendmsg"), tcp);
tcp_shutdown_buffer_list(tcp);
@ -1782,11 +1775,6 @@ static bool tcp_flush(grpc_tcp* tcp, grpc_error_handle* error) {
grpc_slice_buffer_remove_first(tcp->outgoing_buffer);
}
return false;
} else if (saved_errno == EPIPE) {
*error = tcp_annotate_error(GRPC_OS_ERROR(saved_errno, "sendmsg"), tcp);
grpc_slice_buffer_reset_and_unref(tcp->outgoing_buffer);
tcp_shutdown_buffer_list(tcp);
return true;
} else {
*error = tcp_annotate_error(GRPC_OS_ERROR(saved_errno, "sendmsg"), tcp);
grpc_slice_buffer_reset_and_unref(tcp->outgoing_buffer);

@ -294,13 +294,8 @@ static grpc_error_handle prepare_socket(SOCKET sock,
failure:
CHECK(!error.ok());
auto addr_uri = grpc_sockaddr_to_uri(addr);
error = grpc_error_set_int(
grpc_error_set_str(
GRPC_ERROR_CREATE_REFERENCING("Failed to prepare server socket",
&error, 1),
grpc_core::StatusStrProperty::kTargetAddress,
addr_uri.ok() ? *addr_uri : addr_uri.status().ToString()),
error = grpc_error_set_int(GRPC_ERROR_CREATE_REFERENCING(
"Failed to prepare server socket", &error, 1),
grpc_core::StatusIntProperty::kFd, (intptr_t)sock);
if (sock != INVALID_SOCKET) closesocket(sock);
return error;

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

@ -17,7 +17,9 @@
#include <grpc/support/port_platform.h>
#include "src/core/lib/promise/context.h"
#include "src/core/lib/promise/detail/promise_like.h"
#include "src/core/lib/resource_quota/arena.h"
namespace grpc_core {
@ -31,6 +33,7 @@ class Handler {
Handler& operator=(const Handler&) = delete;
~Handler() {
if (!done_) {
promise_detail::Context<Arena> ctx(arena_.get());
fn_();
}
}
@ -48,6 +51,13 @@ class Handler {
private:
Fn fn_;
// Since cancellation happens at destruction time we need to either capture
// context here (via the arena), or make sure that no promise is destructed
// without an Arena context on the stack. The latter is an eternal game of
// whackamole, so we're choosing the former for now.
// TODO(ctiller): re-evaluate at some point in the future.
RefCountedPtr<Arena> arena_ =
HasContext<Arena>() ? GetContext<Arena>()->Ref() : nullptr;
bool done_ = false;
};

@ -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);
}

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

Loading…
Cancel
Save