Compare commits

...

7 Commits

Author SHA1 Message Date
Hannah Shi 3ae0975635 Sync c-core 1.65.4 2024-08-03 16:09:32 -07:00
Hannah Shi 320be969b3 Sync c-core 1.65.2 2024-07-26 09:52:04 -07:00
Hannah Shi 1c57040df5 Sync c-core 1.65.1 2024-07-18 08:04:50 -07:00
Hannah Shi 833773b562 Sync c-core 1.65.0 2024-07-01 18:04:40 -07:00
Hannah Shi 7a21c140a5 Sync c-core 1.65.0-pre2 2024-06-24 18:49:04 -07:00
Hannah Shi 5d79a3c917 revert to macos-12 for release so to skip pod lint 2024-06-14 20:07:32 -07:00
Hannah Shi 21f872aad5 Sync c-core 1.65.0-pre1 2024-06-14 19:44:15 -07:00
663 changed files with 40952 additions and 17110 deletions

View File

@ -10,7 +10,7 @@ env:
TAG: ${{ github.event.release.tag_name }}
jobs:
release-cocoapod-gRPC-Core:
runs-on: macos-14
runs-on: macos-12
steps:
- name: Repo checkout
uses: actions/checkout@v3
@ -28,7 +28,7 @@ jobs:
version=${TAG#v}
timeout 1h scripts/wait_for_pod_release.sh gRPC-Core $version
release-cocoapod-gRPC-Cpp:
runs-on: macos-14
runs-on: macos-12
needs: [release-cocoapod-gRPC-Core]
steps:
- name: Repo checkout
@ -47,7 +47,7 @@ jobs:
version=${TAG#v}
timeout 1h scripts/wait_for_pod_release.sh gRPC-C++ $version
release-cocoapod-gRPC-RxLibrary:
runs-on: macos-14
runs-on: macos-12
steps:
- name: Repo checkout
uses: actions/checkout@v3
@ -66,7 +66,7 @@ jobs:
timeout 1h scripts/wait_for_pod_release.sh gRPC-RxLibrary $version
release-cocoapod-gRPC:
runs-on: macos-14
runs-on: macos-12
needs: [release-cocoapod-gRPC-RxLibrary, release-cocoapod-gRPC-Core]
steps:
- name: Repo checkout
@ -86,7 +86,7 @@ jobs:
timeout 1h scripts/wait_for_pod_release.sh gRPC $version
release-cocoapod-gRPC-ProtoRPC:
runs-on: macos-14
runs-on: macos-12
needs: [release-cocoapod-gRPC-RxLibrary, release-cocoapod-gRPC]
steps:
- name: Repo checkout

View File

@ -22,7 +22,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC-C++'
# TODO (mxyan): use version that match gRPC version when pod is stabilized
version = '1.65.0-dev'
version = '1.65.4'
s.version = version
s.summary = 'gRPC C++ library'
s.homepage = 'https://grpc.io'
@ -176,6 +176,7 @@ Pod::Spec.new do |s|
'include/grpcpp/impl/service_type.h',
'include/grpcpp/impl/status.h',
'include/grpcpp/impl/sync.h',
'include/grpcpp/passive_listener.h',
'include/grpcpp/resource_quota.h',
'include/grpcpp/security/audit_logging.h',
'include/grpcpp/security/auth_context.h',
@ -243,6 +244,8 @@ Pod::Spec.new do |s|
ss.dependency 'abseil/functional/bind_front', abseil_version
ss.dependency 'abseil/functional/function_ref', abseil_version
ss.dependency 'abseil/hash/hash', abseil_version
ss.dependency 'abseil/log/absl_check', abseil_version
ss.dependency 'abseil/log/absl_log', abseil_version
ss.dependency 'abseil/log/check', abseil_version
ss.dependency 'abseil/log/globals', abseil_version
ss.dependency 'abseil/log/log', abseil_version
@ -267,6 +270,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',
@ -275,6 +279,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',
@ -299,7 +304,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',
@ -361,7 +365,6 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/hpack_parser.h',
'src/core/ext/transport/chttp2/transport/hpack_parser_table.h',
'src/core/ext/transport/chttp2/transport/http2_settings.h',
'src/core/ext/transport/chttp2/transport/http_trace.h',
'src/core/ext/transport/chttp2/transport/huffsyms.h',
'src/core/ext/transport/chttp2/transport/internal.h',
'src/core/ext/transport/chttp2/transport/legacy_frame.h',
@ -865,7 +868,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',
@ -873,30 +875,24 @@ Pod::Spec.new do |s|
'src/core/lib/backoff/backoff.h',
'src/core/lib/backoff/random_early_detection.h',
'src/core/lib/channel/call_finalization.h',
'src/core/lib/channel/call_tracer.h',
'src/core/lib/channel/channel_args.h',
'src/core/lib/channel/channel_args_preconditioning.h',
'src/core/lib/channel/channel_fwd.h',
'src/core/lib/channel/channel_stack.h',
'src/core/lib/channel/channel_stack_builder.h',
'src/core/lib/channel/channel_stack_builder_impl.h',
'src/core/lib/channel/channel_stack_trace.h',
'src/core/lib/channel/connected_channel.h',
'src/core/lib/channel/context.h',
'src/core/lib/channel/metrics.h',
'src/core/lib/channel/promise_based_filter.h',
'src/core/lib/channel/status_util.h',
'src/core/lib/channel/tcp_tracer.h',
'src/core/lib/compression/compression_internal.h',
'src/core/lib/compression/message_compress.h',
'src/core/lib/config/config_vars.h',
'src/core/lib/config/core_configuration.h',
'src/core/lib/config/load_config.h',
'src/core/lib/debug/event_log.h',
'src/core/lib/debug/histogram_view.h',
'src/core/lib/debug/stats.h',
'src/core/lib/debug/stats_data.h',
'src/core/lib/debug/trace.h',
'src/core/lib/debug/trace_flags.h',
'src/core/lib/debug/trace_impl.h',
'src/core/lib/event_engine/ares_resolver.h',
'src/core/lib/event_engine/cf_engine/cf_engine.h',
'src/core/lib/event_engine/cf_engine/cfstream_endpoint.h',
@ -910,6 +906,7 @@ Pod::Spec.new do |s|
'src/core/lib/event_engine/extensions/can_track_errors.h',
'src/core/lib/event_engine/extensions/chaotic_good_extension.h',
'src/core/lib/event_engine/extensions/supports_fd.h',
'src/core/lib/event_engine/extensions/tcp_trace.h',
'src/core/lib/event_engine/forkable.h',
'src/core/lib/event_engine/grpc_polled_fd.h',
'src/core/lib/event_engine/handle_containers.h',
@ -963,12 +960,6 @@ Pod::Spec.new do |s|
'src/core/lib/event_engine/work_queue/work_queue.h',
'src/core/lib/experiments/config.h',
'src/core/lib/experiments/experiments.h',
'src/core/lib/gpr/alloc.h',
'src/core/lib/gpr/spinlock.h',
'src/core/lib/gpr/string.h',
'src/core/lib/gpr/time_precise.h',
'src/core/lib/gpr/tmpfile.h',
'src/core/lib/gpr/useful.h',
'src/core/lib/gprpp/atomic_utils.h',
'src/core/lib/gprpp/bitset.h',
'src/core/lib/gprpp/chunked_vector.h',
@ -979,9 +970,11 @@ 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',
'src/core/lib/gprpp/glob.h',
'src/core/lib/gprpp/host_port.h',
'src/core/lib/gprpp/if_list.h',
'src/core/lib/gprpp/load_file.h',
@ -1016,10 +1009,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',
@ -1085,13 +1074,6 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/vsock.h',
'src/core/lib/iomgr/wakeup_fd_pipe.h',
'src/core/lib/iomgr/wakeup_fd_posix.h',
'src/core/lib/json/json.h',
'src/core/lib/json/json_args.h',
'src/core/lib/json/json_channel_args.h',
'src/core/lib/json/json_object_loader.h',
'src/core/lib/json/json_reader.h',
'src/core/lib/json/json_util.h',
'src/core/lib/json/json_writer.h',
'src/core/lib/matchers/matchers.h',
'src/core/lib/promise/activity.h',
'src/core/lib/promise/all_ok.h',
@ -1111,6 +1093,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',
@ -1120,7 +1103,6 @@ Pod::Spec.new do |s|
'src/core/lib/promise/seq.h',
'src/core/lib/promise/sleep.h',
'src/core/lib/promise/status_flag.h',
'src/core/lib/promise/trace.h',
'src/core/lib/promise/try_join.h',
'src/core/lib/promise/try_seq.h',
'src/core/lib/resource_quota/api.h',
@ -1130,7 +1112,6 @@ Pod::Spec.new do |s|
'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/security/authorization/audit_logging.h',
'src/core/lib/security/authorization/authorization_engine.h',
'src/core/lib/security/authorization/authorization_policy_provider.h',
@ -1195,23 +1176,25 @@ Pod::Spec.new do |s|
'src/core/lib/surface/api_trace.h',
'src/core/lib/surface/call.h',
'src/core/lib/surface/call_test_only.h',
'src/core/lib/surface/call_trace.h',
'src/core/lib/surface/call_utils.h',
'src/core/lib/surface/channel.h',
'src/core/lib/surface/channel_create.h',
'src/core/lib/surface/channel_init.h',
'src/core/lib/surface/channel_stack_type.h',
'src/core/lib/surface/client_call.h',
'src/core/lib/surface/completion_queue.h',
'src/core/lib/surface/completion_queue_factory.h',
'src/core/lib/surface/event_string.h',
'src/core/lib/surface/filter_stack_call.h',
'src/core/lib/surface/init.h',
'src/core/lib/surface/init_internally.h',
'src/core/lib/surface/lame_client.h',
'src/core/lib/surface/legacy_channel.h',
'src/core/lib/surface/server_call.h',
'src/core/lib/surface/validate_metadata.h',
'src/core/lib/surface/wait_for_cq_end_op.h',
'src/core/lib/transport/batch_builder.h',
'src/core/lib/transport/bdp_estimator.h',
'src/core/lib/transport/call_arena_allocator.h',
'src/core/lib/transport/call_destination.h',
'src/core/lib/transport/call_filters.h',
'src/core/lib/transport/call_final_info.h',
'src/core/lib/transport/call_spine.h',
@ -1219,6 +1202,7 @@ Pod::Spec.new do |s|
'src/core/lib/transport/custom_metadata.h',
'src/core/lib/transport/error_utils.h',
'src/core/lib/transport/http2_errors.h',
'src/core/lib/transport/interception_chain.h',
'src/core/lib/transport/message.h',
'src/core/lib/transport/metadata.h',
'src/core/lib/transport/metadata_batch.h',
@ -1274,7 +1258,6 @@ Pod::Spec.new do |s|
'src/core/resolver/server_address.h',
'src/core/resolver/xds/xds_dependency_manager.h',
'src/core/resolver/xds/xds_resolver_attributes.h',
'src/core/resolver/xds/xds_resolver_trace.h',
'src/core/server/server.h',
'src/core/server/server_call_tracer_filter.h',
'src/core/server/server_config_selector.h',
@ -1285,6 +1268,12 @@ Pod::Spec.new do |s|
'src/core/service_config/service_config_call_data.h',
'src/core/service_config/service_config_impl.h',
'src/core/service_config/service_config_parser.h',
'src/core/telemetry/call_tracer.h',
'src/core/telemetry/histogram_view.h',
'src/core/telemetry/metrics.h',
'src/core/telemetry/stats.h',
'src/core/telemetry/stats_data.h',
'src/core/telemetry/tcp_tracer.h',
'src/core/tsi/alts/crypt/gsec.h',
'src/core/tsi/alts/frame_protector/alts_counter.h',
'src/core/tsi/alts/frame_protector/alts_crypter.h',
@ -1314,6 +1303,24 @@ Pod::Spec.new do |s|
'src/core/tsi/transport_security.h',
'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',
'src/core/util/json/json_object_loader.h',
'src/core/util/json/json_reader.h',
'src/core/util/json/json_util.h',
'src/core/util/json/json_writer.h',
'src/core/util/spinlock.h',
'src/core/util/string.h',
'src/core/util/time_precise.h',
'src/core/util/tmpfile.h',
'src/core/util/useful.h',
'src/core/xds/grpc/certificate_provider_store.h',
'src/core/xds/grpc/file_watcher_certificate_provider_factory.h',
'src/core/xds/grpc/upb_utils.h',
@ -1554,6 +1561,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',
@ -1562,6 +1570,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',
@ -1586,7 +1595,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',
@ -1630,7 +1638,6 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/hpack_parser.h',
'src/core/ext/transport/chttp2/transport/hpack_parser_table.h',
'src/core/ext/transport/chttp2/transport/http2_settings.h',
'src/core/ext/transport/chttp2/transport/http_trace.h',
'src/core/ext/transport/chttp2/transport/huffsyms.h',
'src/core/ext/transport/chttp2/transport/internal.h',
'src/core/ext/transport/chttp2/transport/legacy_frame.h',
@ -2134,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',
@ -2142,30 +2148,24 @@ Pod::Spec.new do |s|
'src/core/lib/backoff/backoff.h',
'src/core/lib/backoff/random_early_detection.h',
'src/core/lib/channel/call_finalization.h',
'src/core/lib/channel/call_tracer.h',
'src/core/lib/channel/channel_args.h',
'src/core/lib/channel/channel_args_preconditioning.h',
'src/core/lib/channel/channel_fwd.h',
'src/core/lib/channel/channel_stack.h',
'src/core/lib/channel/channel_stack_builder.h',
'src/core/lib/channel/channel_stack_builder_impl.h',
'src/core/lib/channel/channel_stack_trace.h',
'src/core/lib/channel/connected_channel.h',
'src/core/lib/channel/context.h',
'src/core/lib/channel/metrics.h',
'src/core/lib/channel/promise_based_filter.h',
'src/core/lib/channel/status_util.h',
'src/core/lib/channel/tcp_tracer.h',
'src/core/lib/compression/compression_internal.h',
'src/core/lib/compression/message_compress.h',
'src/core/lib/config/config_vars.h',
'src/core/lib/config/core_configuration.h',
'src/core/lib/config/load_config.h',
'src/core/lib/debug/event_log.h',
'src/core/lib/debug/histogram_view.h',
'src/core/lib/debug/stats.h',
'src/core/lib/debug/stats_data.h',
'src/core/lib/debug/trace.h',
'src/core/lib/debug/trace_flags.h',
'src/core/lib/debug/trace_impl.h',
'src/core/lib/event_engine/ares_resolver.h',
'src/core/lib/event_engine/cf_engine/cf_engine.h',
'src/core/lib/event_engine/cf_engine/cfstream_endpoint.h',
@ -2179,6 +2179,7 @@ Pod::Spec.new do |s|
'src/core/lib/event_engine/extensions/can_track_errors.h',
'src/core/lib/event_engine/extensions/chaotic_good_extension.h',
'src/core/lib/event_engine/extensions/supports_fd.h',
'src/core/lib/event_engine/extensions/tcp_trace.h',
'src/core/lib/event_engine/forkable.h',
'src/core/lib/event_engine/grpc_polled_fd.h',
'src/core/lib/event_engine/handle_containers.h',
@ -2232,12 +2233,6 @@ Pod::Spec.new do |s|
'src/core/lib/event_engine/work_queue/work_queue.h',
'src/core/lib/experiments/config.h',
'src/core/lib/experiments/experiments.h',
'src/core/lib/gpr/alloc.h',
'src/core/lib/gpr/spinlock.h',
'src/core/lib/gpr/string.h',
'src/core/lib/gpr/time_precise.h',
'src/core/lib/gpr/tmpfile.h',
'src/core/lib/gpr/useful.h',
'src/core/lib/gprpp/atomic_utils.h',
'src/core/lib/gprpp/bitset.h',
'src/core/lib/gprpp/chunked_vector.h',
@ -2248,9 +2243,11 @@ 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',
'src/core/lib/gprpp/glob.h',
'src/core/lib/gprpp/host_port.h',
'src/core/lib/gprpp/if_list.h',
'src/core/lib/gprpp/load_file.h',
@ -2285,10 +2282,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',
@ -2354,13 +2347,6 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/vsock.h',
'src/core/lib/iomgr/wakeup_fd_pipe.h',
'src/core/lib/iomgr/wakeup_fd_posix.h',
'src/core/lib/json/json.h',
'src/core/lib/json/json_args.h',
'src/core/lib/json/json_channel_args.h',
'src/core/lib/json/json_object_loader.h',
'src/core/lib/json/json_reader.h',
'src/core/lib/json/json_util.h',
'src/core/lib/json/json_writer.h',
'src/core/lib/matchers/matchers.h',
'src/core/lib/promise/activity.h',
'src/core/lib/promise/all_ok.h',
@ -2380,6 +2366,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',
@ -2389,7 +2376,6 @@ Pod::Spec.new do |s|
'src/core/lib/promise/seq.h',
'src/core/lib/promise/sleep.h',
'src/core/lib/promise/status_flag.h',
'src/core/lib/promise/trace.h',
'src/core/lib/promise/try_join.h',
'src/core/lib/promise/try_seq.h',
'src/core/lib/resource_quota/api.h',
@ -2399,7 +2385,6 @@ Pod::Spec.new do |s|
'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/security/authorization/audit_logging.h',
'src/core/lib/security/authorization/authorization_engine.h',
'src/core/lib/security/authorization/authorization_policy_provider.h',
@ -2464,23 +2449,25 @@ Pod::Spec.new do |s|
'src/core/lib/surface/api_trace.h',
'src/core/lib/surface/call.h',
'src/core/lib/surface/call_test_only.h',
'src/core/lib/surface/call_trace.h',
'src/core/lib/surface/call_utils.h',
'src/core/lib/surface/channel.h',
'src/core/lib/surface/channel_create.h',
'src/core/lib/surface/channel_init.h',
'src/core/lib/surface/channel_stack_type.h',
'src/core/lib/surface/client_call.h',
'src/core/lib/surface/completion_queue.h',
'src/core/lib/surface/completion_queue_factory.h',
'src/core/lib/surface/event_string.h',
'src/core/lib/surface/filter_stack_call.h',
'src/core/lib/surface/init.h',
'src/core/lib/surface/init_internally.h',
'src/core/lib/surface/lame_client.h',
'src/core/lib/surface/legacy_channel.h',
'src/core/lib/surface/server_call.h',
'src/core/lib/surface/validate_metadata.h',
'src/core/lib/surface/wait_for_cq_end_op.h',
'src/core/lib/transport/batch_builder.h',
'src/core/lib/transport/bdp_estimator.h',
'src/core/lib/transport/call_arena_allocator.h',
'src/core/lib/transport/call_destination.h',
'src/core/lib/transport/call_filters.h',
'src/core/lib/transport/call_final_info.h',
'src/core/lib/transport/call_spine.h',
@ -2488,6 +2475,7 @@ Pod::Spec.new do |s|
'src/core/lib/transport/custom_metadata.h',
'src/core/lib/transport/error_utils.h',
'src/core/lib/transport/http2_errors.h',
'src/core/lib/transport/interception_chain.h',
'src/core/lib/transport/message.h',
'src/core/lib/transport/metadata.h',
'src/core/lib/transport/metadata_batch.h',
@ -2543,7 +2531,6 @@ Pod::Spec.new do |s|
'src/core/resolver/server_address.h',
'src/core/resolver/xds/xds_dependency_manager.h',
'src/core/resolver/xds/xds_resolver_attributes.h',
'src/core/resolver/xds/xds_resolver_trace.h',
'src/core/server/server.h',
'src/core/server/server_call_tracer_filter.h',
'src/core/server/server_config_selector.h',
@ -2554,6 +2541,12 @@ Pod::Spec.new do |s|
'src/core/service_config/service_config_call_data.h',
'src/core/service_config/service_config_impl.h',
'src/core/service_config/service_config_parser.h',
'src/core/telemetry/call_tracer.h',
'src/core/telemetry/histogram_view.h',
'src/core/telemetry/metrics.h',
'src/core/telemetry/stats.h',
'src/core/telemetry/stats_data.h',
'src/core/telemetry/tcp_tracer.h',
'src/core/tsi/alts/crypt/gsec.h',
'src/core/tsi/alts/frame_protector/alts_counter.h',
'src/core/tsi/alts/frame_protector/alts_crypter.h',
@ -2583,6 +2576,24 @@ Pod::Spec.new do |s|
'src/core/tsi/transport_security.h',
'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',
'src/core/util/json/json_object_loader.h',
'src/core/util/json/json_reader.h',
'src/core/util/json/json_util.h',
'src/core/util/json/json_writer.h',
'src/core/util/spinlock.h',
'src/core/util/string.h',
'src/core/util/time_precise.h',
'src/core/util/tmpfile.h',
'src/core/util/useful.h',
'src/core/xds/grpc/certificate_provider_store.h',
'src/core/xds/grpc/file_watcher_certificate_provider_factory.h',
'src/core/xds/grpc/upb_utils.h',

View File

@ -21,7 +21,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC-Core'
version = '1.65.0-dev'
version = '1.65.4'
s.version = version
s.summary = 'Core cross-platform gRPC library, written in C'
s.homepage = 'https://grpc.io'
@ -82,7 +82,7 @@ Pod::Spec.new do |s|
' "$(PODS_TARGET_SRCROOT)/third_party/utf8_range"'\
' "$(PODS_TARGET_SRCROOT)/third_party/xxhash"',
# If we don't set these two settings, `include/grpc/support/time.h` and
# `src/core/lib/gpr/string.h` shadow the system `<time.h>` and `<string.h>`, breaking the
# `src/core/util/string.h` shadow the system `<time.h>` and `<string.h>`, breaking the
# build.
'USE_HEADERMAP' => 'NO',
'ALWAYS_SEARCH_USER_PATHS' => 'NO',
@ -168,6 +168,7 @@ Pod::Spec.new do |s|
'include/grpc/impl/propagation_bits.h',
'include/grpc/impl/slice_type.h',
'include/grpc/load_reporting.h',
'include/grpc/passive_listener.h',
'include/grpc/slice.h',
'include/grpc/slice_buffer.h',
'include/grpc/status.h',
@ -198,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.36'
ss.dependency 'abseil/algorithm/container', abseil_version
ss.dependency 'abseil/base/base', abseil_version
ss.dependency 'abseil/base/config', abseil_version
@ -244,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',
@ -259,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',
@ -307,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',
@ -353,8 +356,6 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/hpack_parser_table.h',
'src/core/ext/transport/chttp2/transport/http2_settings.cc',
'src/core/ext/transport/chttp2/transport/http2_settings.h',
'src/core/ext/transport/chttp2/transport/http_trace.cc',
'src/core/ext/transport/chttp2/transport/http_trace.h',
'src/core/ext/transport/chttp2/transport/huffsyms.cc',
'src/core/ext/transport/chttp2/transport/huffsyms.h',
'src/core/ext/transport/chttp2/transport/internal.h',
@ -374,7 +375,6 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/write_size_policy.cc',
'src/core/ext/transport/chttp2/transport/write_size_policy.h',
'src/core/ext/transport/chttp2/transport/writing.cc',
'src/core/ext/transport/inproc/inproc_plugin.cc',
'src/core/ext/transport/inproc/inproc_transport.cc',
'src/core/ext/transport/inproc/inproc_transport.h',
'src/core/ext/transport/inproc/legacy_inproc_transport.cc',
@ -1196,8 +1196,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',
@ -1210,8 +1208,6 @@ Pod::Spec.new do |s|
'src/core/lib/backoff/random_early_detection.cc',
'src/core/lib/backoff/random_early_detection.h',
'src/core/lib/channel/call_finalization.h',
'src/core/lib/channel/call_tracer.cc',
'src/core/lib/channel/call_tracer.h',
'src/core/lib/channel/channel_args.cc',
'src/core/lib/channel/channel_args.h',
'src/core/lib/channel/channel_args_preconditioning.cc',
@ -1223,18 +1219,12 @@ Pod::Spec.new do |s|
'src/core/lib/channel/channel_stack_builder.h',
'src/core/lib/channel/channel_stack_builder_impl.cc',
'src/core/lib/channel/channel_stack_builder_impl.h',
'src/core/lib/channel/channel_stack_trace.cc',
'src/core/lib/channel/channel_stack_trace.h',
'src/core/lib/channel/connected_channel.cc',
'src/core/lib/channel/connected_channel.h',
'src/core/lib/channel/context.h',
'src/core/lib/channel/metrics.cc',
'src/core/lib/channel/metrics.h',
'src/core/lib/channel/promise_based_filter.cc',
'src/core/lib/channel/promise_based_filter.h',
'src/core/lib/channel/status_util.cc',
'src/core/lib/channel/status_util.h',
'src/core/lib/channel/tcp_tracer.h',
'src/core/lib/compression/compression.cc',
'src/core/lib/compression/compression_internal.cc',
'src/core/lib/compression/compression_internal.h',
@ -1249,14 +1239,11 @@ Pod::Spec.new do |s|
'src/core/lib/config/load_config.h',
'src/core/lib/debug/event_log.cc',
'src/core/lib/debug/event_log.h',
'src/core/lib/debug/histogram_view.cc',
'src/core/lib/debug/histogram_view.h',
'src/core/lib/debug/stats.cc',
'src/core/lib/debug/stats.h',
'src/core/lib/debug/stats_data.cc',
'src/core/lib/debug/stats_data.h',
'src/core/lib/debug/trace.cc',
'src/core/lib/debug/trace.h',
'src/core/lib/debug/trace_flags.cc',
'src/core/lib/debug/trace_flags.h',
'src/core/lib/debug/trace_impl.h',
'src/core/lib/event_engine/ares_resolver.cc',
'src/core/lib/event_engine/ares_resolver.h',
'src/core/lib/event_engine/cf_engine/cf_engine.cc',
@ -1278,6 +1265,7 @@ Pod::Spec.new do |s|
'src/core/lib/event_engine/extensions/can_track_errors.h',
'src/core/lib/event_engine/extensions/chaotic_good_extension.h',
'src/core/lib/event_engine/extensions/supports_fd.h',
'src/core/lib/event_engine/extensions/tcp_trace.h',
'src/core/lib/event_engine/forkable.cc',
'src/core/lib/event_engine/forkable.h',
'src/core/lib/event_engine/grpc_polled_fd.h',
@ -1348,7 +1336,6 @@ Pod::Spec.new do |s|
'src/core/lib/event_engine/thready_event_engine/thready_event_engine.h',
'src/core/lib/event_engine/time_util.cc',
'src/core/lib/event_engine/time_util.h',
'src/core/lib/event_engine/trace.cc',
'src/core/lib/event_engine/trace.h',
'src/core/lib/event_engine/utils.cc',
'src/core/lib/event_engine/utils.h',
@ -1373,38 +1360,6 @@ Pod::Spec.new do |s|
'src/core/lib/experiments/config.h',
'src/core/lib/experiments/experiments.cc',
'src/core/lib/experiments/experiments.h',
'src/core/lib/gpr/alloc.cc',
'src/core/lib/gpr/alloc.h',
'src/core/lib/gpr/android/log.cc',
'src/core/lib/gpr/atm.cc',
'src/core/lib/gpr/iphone/cpu.cc',
'src/core/lib/gpr/linux/cpu.cc',
'src/core/lib/gpr/linux/log.cc',
'src/core/lib/gpr/log.cc',
'src/core/lib/gpr/msys/tmpfile.cc',
'src/core/lib/gpr/posix/cpu.cc',
'src/core/lib/gpr/posix/log.cc',
'src/core/lib/gpr/posix/string.cc',
'src/core/lib/gpr/posix/sync.cc',
'src/core/lib/gpr/posix/time.cc',
'src/core/lib/gpr/posix/tmpfile.cc',
'src/core/lib/gpr/spinlock.h',
'src/core/lib/gpr/string.cc',
'src/core/lib/gpr/string.h',
'src/core/lib/gpr/sync.cc',
'src/core/lib/gpr/sync_abseil.cc',
'src/core/lib/gpr/time.cc',
'src/core/lib/gpr/time_precise.cc',
'src/core/lib/gpr/time_precise.h',
'src/core/lib/gpr/tmpfile.h',
'src/core/lib/gpr/useful.h',
'src/core/lib/gpr/windows/cpu.cc',
'src/core/lib/gpr/windows/log.cc',
'src/core/lib/gpr/windows/string.cc',
'src/core/lib/gpr/windows/string_util.cc',
'src/core/lib/gpr/windows/sync.cc',
'src/core/lib/gpr/windows/time.cc',
'src/core/lib/gpr/windows/tmpfile.cc',
'src/core/lib/gprpp/atomic_utils.h',
'src/core/lib/gprpp/bitset.h',
'src/core/lib/gprpp/chunked_vector.h',
@ -1416,11 +1371,15 @@ 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',
'src/core/lib/gprpp/fork.cc',
'src/core/lib/gprpp/fork.h',
'src/core/lib/gprpp/glob.cc',
'src/core/lib/gprpp/glob.h',
'src/core/lib/gprpp/host_port.cc',
'src/core/lib/gprpp/host_port.h',
'src/core/lib/gprpp/if_list.h',
@ -1478,14 +1437,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',
@ -1518,7 +1469,6 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/ev_poll_posix.h',
'src/core/lib/iomgr/ev_posix.cc',
'src/core/lib/iomgr/ev_posix.h',
'src/core/lib/iomgr/ev_windows.cc',
'src/core/lib/iomgr/event_engine_shims/closure.cc',
'src/core/lib/iomgr/event_engine_shims/closure.h',
'src/core/lib/iomgr/event_engine_shims/endpoint.cc',
@ -1628,17 +1578,6 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/wakeup_fd_pipe.h',
'src/core/lib/iomgr/wakeup_fd_posix.cc',
'src/core/lib/iomgr/wakeup_fd_posix.h',
'src/core/lib/json/json.h',
'src/core/lib/json/json_args.h',
'src/core/lib/json/json_channel_args.h',
'src/core/lib/json/json_object_loader.cc',
'src/core/lib/json/json_object_loader.h',
'src/core/lib/json/json_reader.cc',
'src/core/lib/json/json_reader.h',
'src/core/lib/json/json_util.cc',
'src/core/lib/json/json_util.h',
'src/core/lib/json/json_writer.cc',
'src/core/lib/json/json_writer.h',
'src/core/lib/matchers/matchers.cc',
'src/core/lib/matchers/matchers.h',
'src/core/lib/promise/activity.cc',
@ -1660,6 +1599,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',
@ -1671,8 +1611,6 @@ Pod::Spec.new do |s|
'src/core/lib/promise/sleep.cc',
'src/core/lib/promise/sleep.h',
'src/core/lib/promise/status_flag.h',
'src/core/lib/promise/trace.cc',
'src/core/lib/promise/trace.h',
'src/core/lib/promise/try_join.h',
'src/core/lib/promise/try_seq.h',
'src/core/lib/resource_quota/api.cc',
@ -1689,8 +1627,6 @@ Pod::Spec.new do |s|
'src/core/lib/resource_quota/resource_quota.h',
'src/core/lib/resource_quota/thread_quota.cc',
'src/core/lib/resource_quota/thread_quota.h',
'src/core/lib/resource_quota/trace.cc',
'src/core/lib/resource_quota/trace.h',
'src/core/lib/security/authorization/audit_logging.cc',
'src/core/lib/security/authorization/audit_logging.h',
'src/core/lib/security/authorization/authorization_engine.h',
@ -1815,11 +1751,9 @@ Pod::Spec.new do |s|
'src/core/lib/slice/slice_buffer.cc',
'src/core/lib/slice/slice_buffer.h',
'src/core/lib/slice/slice_internal.h',
'src/core/lib/slice/slice_refcount.cc',
'src/core/lib/slice/slice_refcount.h',
'src/core/lib/slice/slice_string_helpers.cc',
'src/core/lib/slice/slice_string_helpers.h',
'src/core/lib/surface/api_trace.cc',
'src/core/lib/surface/api_trace.h',
'src/core/lib/surface/byte_buffer.cc',
'src/core/lib/surface/byte_buffer_reader.cc',
@ -1828,7 +1762,8 @@ Pod::Spec.new do |s|
'src/core/lib/surface/call_details.cc',
'src/core/lib/surface/call_log_batch.cc',
'src/core/lib/surface/call_test_only.h',
'src/core/lib/surface/call_trace.h',
'src/core/lib/surface/call_utils.cc',
'src/core/lib/surface/call_utils.h',
'src/core/lib/surface/channel.cc',
'src/core/lib/surface/channel.h',
'src/core/lib/surface/channel_create.cc',
@ -1837,12 +1772,16 @@ Pod::Spec.new do |s|
'src/core/lib/surface/channel_init.h',
'src/core/lib/surface/channel_stack_type.cc',
'src/core/lib/surface/channel_stack_type.h',
'src/core/lib/surface/client_call.cc',
'src/core/lib/surface/client_call.h',
'src/core/lib/surface/completion_queue.cc',
'src/core/lib/surface/completion_queue.h',
'src/core/lib/surface/completion_queue_factory.cc',
'src/core/lib/surface/completion_queue_factory.h',
'src/core/lib/surface/event_string.cc',
'src/core/lib/surface/event_string.h',
'src/core/lib/surface/filter_stack_call.cc',
'src/core/lib/surface/filter_stack_call.h',
'src/core/lib/surface/init.cc',
'src/core/lib/surface/init.h',
'src/core/lib/surface/init_internally.cc',
@ -1852,17 +1791,16 @@ Pod::Spec.new do |s|
'src/core/lib/surface/legacy_channel.cc',
'src/core/lib/surface/legacy_channel.h',
'src/core/lib/surface/metadata_array.cc',
'src/core/lib/surface/server_call.cc',
'src/core/lib/surface/server_call.h',
'src/core/lib/surface/validate_metadata.cc',
'src/core/lib/surface/validate_metadata.h',
'src/core/lib/surface/version.cc',
'src/core/lib/surface/wait_for_cq_end_op.cc',
'src/core/lib/surface/wait_for_cq_end_op.h',
'src/core/lib/transport/batch_builder.cc',
'src/core/lib/transport/batch_builder.h',
'src/core/lib/transport/bdp_estimator.cc',
'src/core/lib/transport/bdp_estimator.h',
'src/core/lib/transport/call_arena_allocator.cc',
'src/core/lib/transport/call_arena_allocator.h',
'src/core/lib/transport/call_destination.h',
'src/core/lib/transport/call_filters.cc',
'src/core/lib/transport/call_filters.h',
'src/core/lib/transport/call_final_info.cc',
@ -1875,6 +1813,8 @@ Pod::Spec.new do |s|
'src/core/lib/transport/error_utils.cc',
'src/core/lib/transport/error_utils.h',
'src/core/lib/transport/http2_errors.h',
'src/core/lib/transport/interception_chain.cc',
'src/core/lib/transport/interception_chain.h',
'src/core/lib/transport/message.cc',
'src/core/lib/transport/message.h',
'src/core/lib/transport/metadata.cc',
@ -1989,8 +1929,6 @@ Pod::Spec.new do |s|
'src/core/resolver/xds/xds_dependency_manager.h',
'src/core/resolver/xds/xds_resolver.cc',
'src/core/resolver/xds/xds_resolver_attributes.h',
'src/core/resolver/xds/xds_resolver_trace.cc',
'src/core/resolver/xds/xds_resolver_trace.h',
'src/core/server/server.cc',
'src/core/server/server.h',
'src/core/server/server_call_tracer_filter.cc',
@ -2009,6 +1947,17 @@ Pod::Spec.new do |s|
'src/core/service_config/service_config_impl.h',
'src/core/service_config/service_config_parser.cc',
'src/core/service_config/service_config_parser.h',
'src/core/telemetry/call_tracer.cc',
'src/core/telemetry/call_tracer.h',
'src/core/telemetry/histogram_view.cc',
'src/core/telemetry/histogram_view.h',
'src/core/telemetry/metrics.cc',
'src/core/telemetry/metrics.h',
'src/core/telemetry/stats.cc',
'src/core/telemetry/stats.h',
'src/core/telemetry/stats_data.cc',
'src/core/telemetry/stats_data.h',
'src/core/telemetry/tcp_tracer.h',
'src/core/tsi/alts/crypt/aes_gcm.cc',
'src/core/tsi/alts/crypt/gsec.cc',
'src/core/tsi/alts/crypt/gsec.h',
@ -2067,6 +2016,59 @@ Pod::Spec.new do |s|
'src/core/tsi/transport_security_grpc.cc',
'src/core/tsi/transport_security_grpc.h',
'src/core/tsi/transport_security_interface.h',
'src/core/util/alloc.cc',
'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',
'src/core/util/json/json_channel_args.h',
'src/core/util/json/json_object_loader.cc',
'src/core/util/json/json_object_loader.h',
'src/core/util/json/json_reader.cc',
'src/core/util/json/json_reader.h',
'src/core/util/json/json_util.cc',
'src/core/util/json/json_util.h',
'src/core/util/json/json_writer.cc',
'src/core/util/json/json_writer.h',
'src/core/util/linux/cpu.cc',
'src/core/util/linux/log.cc',
'src/core/util/log.cc',
'src/core/util/msys/tmpfile.cc',
'src/core/util/posix/cpu.cc',
'src/core/util/posix/log.cc',
'src/core/util/posix/string.cc',
'src/core/util/posix/sync.cc',
'src/core/util/posix/time.cc',
'src/core/util/posix/tmpfile.cc',
'src/core/util/spinlock.h',
'src/core/util/string.cc',
'src/core/util/string.h',
'src/core/util/sync.cc',
'src/core/util/sync_abseil.cc',
'src/core/util/time.cc',
'src/core/util/time_precise.cc',
'src/core/util/time_precise.h',
'src/core/util/tmpfile.h',
'src/core/util/useful.h',
'src/core/util/windows/cpu.cc',
'src/core/util/windows/log.cc',
'src/core/util/windows/string.cc',
'src/core/util/windows/string_util.cc',
'src/core/util/windows/sync.cc',
'src/core/util/windows/time.cc',
'src/core/util/windows/tmpfile.cc',
'src/core/xds/grpc/certificate_provider_store.cc',
'src/core/xds/grpc/certificate_provider_store.h',
'src/core/xds/grpc/file_watcher_certificate_provider_factory.cc',
@ -2353,6 +2355,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',
@ -2361,6 +2364,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',
@ -2385,7 +2389,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',
@ -2409,7 +2412,6 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/hpack_parser.h',
'src/core/ext/transport/chttp2/transport/hpack_parser_table.h',
'src/core/ext/transport/chttp2/transport/http2_settings.h',
'src/core/ext/transport/chttp2/transport/http_trace.h',
'src/core/ext/transport/chttp2/transport/huffsyms.h',
'src/core/ext/transport/chttp2/transport/internal.h',
'src/core/ext/transport/chttp2/transport/legacy_frame.h',
@ -2913,7 +2915,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',
@ -2921,30 +2922,24 @@ Pod::Spec.new do |s|
'src/core/lib/backoff/backoff.h',
'src/core/lib/backoff/random_early_detection.h',
'src/core/lib/channel/call_finalization.h',
'src/core/lib/channel/call_tracer.h',
'src/core/lib/channel/channel_args.h',
'src/core/lib/channel/channel_args_preconditioning.h',
'src/core/lib/channel/channel_fwd.h',
'src/core/lib/channel/channel_stack.h',
'src/core/lib/channel/channel_stack_builder.h',
'src/core/lib/channel/channel_stack_builder_impl.h',
'src/core/lib/channel/channel_stack_trace.h',
'src/core/lib/channel/connected_channel.h',
'src/core/lib/channel/context.h',
'src/core/lib/channel/metrics.h',
'src/core/lib/channel/promise_based_filter.h',
'src/core/lib/channel/status_util.h',
'src/core/lib/channel/tcp_tracer.h',
'src/core/lib/compression/compression_internal.h',
'src/core/lib/compression/message_compress.h',
'src/core/lib/config/config_vars.h',
'src/core/lib/config/core_configuration.h',
'src/core/lib/config/load_config.h',
'src/core/lib/debug/event_log.h',
'src/core/lib/debug/histogram_view.h',
'src/core/lib/debug/stats.h',
'src/core/lib/debug/stats_data.h',
'src/core/lib/debug/trace.h',
'src/core/lib/debug/trace_flags.h',
'src/core/lib/debug/trace_impl.h',
'src/core/lib/event_engine/ares_resolver.h',
'src/core/lib/event_engine/cf_engine/cf_engine.h',
'src/core/lib/event_engine/cf_engine/cfstream_endpoint.h',
@ -2958,6 +2953,7 @@ Pod::Spec.new do |s|
'src/core/lib/event_engine/extensions/can_track_errors.h',
'src/core/lib/event_engine/extensions/chaotic_good_extension.h',
'src/core/lib/event_engine/extensions/supports_fd.h',
'src/core/lib/event_engine/extensions/tcp_trace.h',
'src/core/lib/event_engine/forkable.h',
'src/core/lib/event_engine/grpc_polled_fd.h',
'src/core/lib/event_engine/handle_containers.h',
@ -3011,12 +3007,6 @@ Pod::Spec.new do |s|
'src/core/lib/event_engine/work_queue/work_queue.h',
'src/core/lib/experiments/config.h',
'src/core/lib/experiments/experiments.h',
'src/core/lib/gpr/alloc.h',
'src/core/lib/gpr/spinlock.h',
'src/core/lib/gpr/string.h',
'src/core/lib/gpr/time_precise.h',
'src/core/lib/gpr/tmpfile.h',
'src/core/lib/gpr/useful.h',
'src/core/lib/gprpp/atomic_utils.h',
'src/core/lib/gprpp/bitset.h',
'src/core/lib/gprpp/chunked_vector.h',
@ -3027,9 +3017,11 @@ 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',
'src/core/lib/gprpp/glob.h',
'src/core/lib/gprpp/host_port.h',
'src/core/lib/gprpp/if_list.h',
'src/core/lib/gprpp/load_file.h',
@ -3064,10 +3056,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',
@ -3133,13 +3121,6 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/vsock.h',
'src/core/lib/iomgr/wakeup_fd_pipe.h',
'src/core/lib/iomgr/wakeup_fd_posix.h',
'src/core/lib/json/json.h',
'src/core/lib/json/json_args.h',
'src/core/lib/json/json_channel_args.h',
'src/core/lib/json/json_object_loader.h',
'src/core/lib/json/json_reader.h',
'src/core/lib/json/json_util.h',
'src/core/lib/json/json_writer.h',
'src/core/lib/matchers/matchers.h',
'src/core/lib/promise/activity.h',
'src/core/lib/promise/all_ok.h',
@ -3159,6 +3140,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',
@ -3168,7 +3150,6 @@ Pod::Spec.new do |s|
'src/core/lib/promise/seq.h',
'src/core/lib/promise/sleep.h',
'src/core/lib/promise/status_flag.h',
'src/core/lib/promise/trace.h',
'src/core/lib/promise/try_join.h',
'src/core/lib/promise/try_seq.h',
'src/core/lib/resource_quota/api.h',
@ -3178,7 +3159,6 @@ Pod::Spec.new do |s|
'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/security/authorization/audit_logging.h',
'src/core/lib/security/authorization/authorization_engine.h',
'src/core/lib/security/authorization/authorization_policy_provider.h',
@ -3243,23 +3223,25 @@ Pod::Spec.new do |s|
'src/core/lib/surface/api_trace.h',
'src/core/lib/surface/call.h',
'src/core/lib/surface/call_test_only.h',
'src/core/lib/surface/call_trace.h',
'src/core/lib/surface/call_utils.h',
'src/core/lib/surface/channel.h',
'src/core/lib/surface/channel_create.h',
'src/core/lib/surface/channel_init.h',
'src/core/lib/surface/channel_stack_type.h',
'src/core/lib/surface/client_call.h',
'src/core/lib/surface/completion_queue.h',
'src/core/lib/surface/completion_queue_factory.h',
'src/core/lib/surface/event_string.h',
'src/core/lib/surface/filter_stack_call.h',
'src/core/lib/surface/init.h',
'src/core/lib/surface/init_internally.h',
'src/core/lib/surface/lame_client.h',
'src/core/lib/surface/legacy_channel.h',
'src/core/lib/surface/server_call.h',
'src/core/lib/surface/validate_metadata.h',
'src/core/lib/surface/wait_for_cq_end_op.h',
'src/core/lib/transport/batch_builder.h',
'src/core/lib/transport/bdp_estimator.h',
'src/core/lib/transport/call_arena_allocator.h',
'src/core/lib/transport/call_destination.h',
'src/core/lib/transport/call_filters.h',
'src/core/lib/transport/call_final_info.h',
'src/core/lib/transport/call_spine.h',
@ -3267,6 +3249,7 @@ Pod::Spec.new do |s|
'src/core/lib/transport/custom_metadata.h',
'src/core/lib/transport/error_utils.h',
'src/core/lib/transport/http2_errors.h',
'src/core/lib/transport/interception_chain.h',
'src/core/lib/transport/message.h',
'src/core/lib/transport/metadata.h',
'src/core/lib/transport/metadata_batch.h',
@ -3322,7 +3305,6 @@ Pod::Spec.new do |s|
'src/core/resolver/server_address.h',
'src/core/resolver/xds/xds_dependency_manager.h',
'src/core/resolver/xds/xds_resolver_attributes.h',
'src/core/resolver/xds/xds_resolver_trace.h',
'src/core/server/server.h',
'src/core/server/server_call_tracer_filter.h',
'src/core/server/server_config_selector.h',
@ -3333,6 +3315,12 @@ Pod::Spec.new do |s|
'src/core/service_config/service_config_call_data.h',
'src/core/service_config/service_config_impl.h',
'src/core/service_config/service_config_parser.h',
'src/core/telemetry/call_tracer.h',
'src/core/telemetry/histogram_view.h',
'src/core/telemetry/metrics.h',
'src/core/telemetry/stats.h',
'src/core/telemetry/stats_data.h',
'src/core/telemetry/tcp_tracer.h',
'src/core/tsi/alts/crypt/gsec.h',
'src/core/tsi/alts/frame_protector/alts_counter.h',
'src/core/tsi/alts/frame_protector/alts_crypter.h',
@ -3362,6 +3350,24 @@ Pod::Spec.new do |s|
'src/core/tsi/transport_security.h',
'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',
'src/core/util/json/json_object_loader.h',
'src/core/util/json/json_reader.h',
'src/core/util/json/json_util.h',
'src/core/util/json/json_writer.h',
'src/core/util/spinlock.h',
'src/core/util/string.h',
'src/core/util/time_precise.h',
'src/core/util/tmpfile.h',
'src/core/util/useful.h',
'src/core/xds/grpc/certificate_provider_store.h',
'src/core/xds/grpc/file_watcher_certificate_provider_factory.h',
'src/core/xds/grpc/upb_utils.h',

View File

@ -21,7 +21,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC-ProtoRPC'
version = '1.65.0-dev'
version = '1.65.4'
s.version = version
s.summary = 'RPC library for Protocol Buffers, based on gRPC'
s.homepage = 'https://grpc.io'

View File

@ -21,7 +21,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC-RxLibrary'
version = '1.65.0-dev'
version = '1.65.4'
s.version = version
s.summary = 'Reactive Extensions library for iOS/OSX.'
s.homepage = 'https://grpc.io'

View File

@ -20,7 +20,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC'
version = '1.65.0-dev'
version = '1.65.4'
s.version = version
s.summary = 'gRPC client library for iOS/OSX'
s.homepage = 'https://grpc.io'

View File

@ -132,8 +132,6 @@ class EventEngine : public std::enable_shared_from_this<EventEngine>,
struct TaskHandle {
intptr_t keys[2];
static const GRPC_DLL TaskHandle kInvalid;
friend bool operator==(const TaskHandle& lhs, const TaskHandle& rhs);
friend bool operator!=(const TaskHandle& lhs, const TaskHandle& rhs);
};
/// A handle to a cancellable connection attempt.
///
@ -141,10 +139,6 @@ class EventEngine : public std::enable_shared_from_this<EventEngine>,
struct ConnectionHandle {
intptr_t keys[2];
static const GRPC_DLL ConnectionHandle kInvalid;
friend bool operator==(const ConnectionHandle& lhs,
const ConnectionHandle& rhs);
friend bool operator!=(const ConnectionHandle& lhs,
const ConnectionHandle& rhs);
};
/// Thin wrapper around a platform-specific sockaddr type. A sockaddr struct
/// exists on all platforms that gRPC supports.
@ -496,6 +490,19 @@ void EventEngineFactoryReset();
/// Create an EventEngine using the default factory.
std::unique_ptr<EventEngine> CreateEventEngine();
bool operator==(const EventEngine::TaskHandle& lhs,
const EventEngine::TaskHandle& rhs);
bool operator!=(const EventEngine::TaskHandle& lhs,
const EventEngine::TaskHandle& rhs);
std::ostream& operator<<(std::ostream& out,
const EventEngine::TaskHandle& handle);
bool operator==(const EventEngine::ConnectionHandle& lhs,
const EventEngine::ConnectionHandle& rhs);
bool operator!=(const EventEngine::ConnectionHandle& lhs,
const EventEngine::ConnectionHandle& rhs);
std::ostream& operator<<(std::ostream& out,
const EventEngine::ConnectionHandle& handle);
} // namespace experimental
} // namespace grpc_event_engine

View File

@ -0,0 +1,37 @@
/*
*
* Copyright 2016 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_GRPC_CRONET_H
#define GRPC_GRPC_CRONET_H
#include <grpc/grpc.h>
#include <grpc/support/port_platform.h>
#ifdef __cplusplus
extern "C" {
#endif
GRPCAPI grpc_channel* grpc_cronet_secure_channel_create(
void* engine, const char* target, const grpc_channel_args* args,
void* reserved);
#ifdef __cplusplus
}
#endif
#endif /* GRPC_GRPC_CRONET_H */

View File

@ -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
@ -396,6 +398,8 @@
* If unspecified, it is unlimited */
#define GRPC_ARG_MAX_ALLOWED_INCOMING_CONNECTIONS \
"grpc.max_allowed_incoming_connections"
/** Configure per-channel or per-server stats plugins. */
#define GRPC_ARG_EXPERIMENTAL_STATS_PLUGINS "grpc.experimental.stats_plugins"
/** \} */
#endif /* GRPC_IMPL_CHANNEL_ARG_NAMES_H */

View File

@ -38,6 +38,7 @@ header "byte_buffer.h"
header "impl/propagation_bits.h"
header "impl/slice_type.h"
header "load_reporting.h"
header "passive_listener.h"
header "slice.h"
header "slice_buffer.h"
header "status.h"

View File

@ -0,0 +1,62 @@
// Copyright 2024 The gRPC Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef GRPC_PASSIVE_LISTENER_H
#define GRPC_PASSIVE_LISTENER_H
#include <memory>
#include <grpc/event_engine/event_engine.h>
#include <grpc/grpc.h>
// #include <grpc/support/port_platform.h>
namespace grpc_core {
class Server;
namespace experimental {
class PassiveListenerImpl;
/// -- EXPERIMENTAL API --
/// Interface for used for Server Endpoint injection.
class PassiveListener {
public:
virtual ~PassiveListener() = default;
/// -- EXPERIMENTAL API --
///
/// Takes an Endpoint for an established connection, and treats it as if the
/// connection had been accepted by the server.
///
/// The server must be started before endpoints can be accepted.
virtual absl::Status AcceptConnectedEndpoint(
std::unique_ptr<grpc_event_engine::experimental::EventEngine::Endpoint>
endpoint) = 0;
/// -- EXPERIMENTAL API --
///
/// Takes a connected file descriptor, and treats it as if the server had
/// accepted the connection itself.
///
/// Returns a failure status if the server's active EventEngine does not
/// support Endpoint creation from fds.
virtual absl::Status AcceptConnectedFd(int fd) = 0;
};
} // namespace experimental
} // namespace grpc_core
absl::Status grpc_server_add_passive_listener(
grpc_core::Server* server, grpc_server_credentials* credentials,
std::shared_ptr<grpc_core::experimental::PassiveListenerImpl>
passive_listener);
#endif /* GRPC_PASSIVE_LISTENER_H */

View File

@ -28,15 +28,10 @@
extern "C" {
#endif
/** GPR log API.
Usage (within grpc):
int argument1 = 3;
char* argument2 = "hello";
gpr_log(GPR_DEBUG, "format string %d", argument1);
gpr_log(GPR_INFO, "hello world");
gpr_log(GPR_ERROR, "%d %s!!", argument1, argument2); */
/**
* Logging functions in this file are deprecated.
* Please use absl ABSL_LOG instead.
*/
/** The severity of a log message - use the #defines below when calling into
gpr_log to additionally supply file and line data */
@ -65,7 +60,7 @@ GPRAPI void gpr_log_message(const char* file, int line,
gpr_log_severity severity, const char* message);
/** Set global log verbosity */
GPRAPI void gpr_set_log_verbosity(gpr_log_severity min_severity_to_print);
GPRAPI void gpr_set_log_verbosity(gpr_log_severity deprecated_setting);
GPRAPI void gpr_log_verbosity_init(void);
@ -82,7 +77,8 @@ struct gpr_log_func_args {
typedef struct gpr_log_func_args gpr_log_func_args;
typedef void (*gpr_log_func)(gpr_log_func_args* args);
GPRAPI void gpr_set_log_function(gpr_log_func func);
GPRAPI void gpr_set_log_function(gpr_log_func deprecated_setting);
GPRAPI void gpr_assertion_failed(const char* filename, int line,
const char* message) GPR_ATTRIBUTE_NORETURN;
@ -99,12 +95,6 @@ GPRAPI void gpr_assertion_failed(const char* filename, int line,
} \
} while (0)
#ifndef NDEBUG
#define GPR_DEBUG_ASSERT(x) GPR_ASSERT(x)
#else
#define GPR_DEBUG_ASSERT(x) GPR_ASSERT(true || (x))
#endif
#ifdef __cplusplus
}
#endif

View File

@ -272,6 +272,9 @@
#define GPR_PLATFORM_STRING "ios"
#define GPR_CPU_IPHONE 1
#define GRPC_CFSTREAM 1
#ifndef GRPC_IOS_EVENT_ENGINE_CLIENT
#define GRPC_IOS_EVENT_ENGINE_CLIENT 1
#endif /* GRPC_IOS_EVENT_ENGINE_CLIENT */
/* the c-ares resolver isn't safe to enable on iOS */
#define GRPC_ARES 0
#else /* TARGET_OS_IPHONE */

View File

@ -38,7 +38,7 @@
#include <memory>
#include <string>
#include "absl/log/check.h"
#include "absl/log/absl_check.h"
#include <grpc/impl/compression_types.h>
#include <grpc/impl/propagation_bits.h>
@ -248,7 +248,7 @@ class ClientContext {
/// \return A multimap of initial metadata key-value pairs from the server.
const std::multimap<grpc::string_ref, grpc::string_ref>&
GetServerInitialMetadata() const {
CHECK(initial_metadata_received_);
ABSL_CHECK(initial_metadata_received_);
return *recv_initial_metadata_.map();
}

View File

@ -34,7 +34,7 @@
#include <list>
#include "absl/log/check.h"
#include "absl/log/absl_check.h"
#include <grpc/grpc.h>
#include <grpc/support/atm.h>
@ -325,7 +325,7 @@ class CompletionQueue : private grpc::internal::GrpcLibrary {
bool ok = ev.success != 0;
void* ignored = tag;
if (tag->FinalizeResult(&ignored, &ok)) {
CHECK(ignored == tag);
ABSL_CHECK(ignored == tag);
return ok;
}
}
@ -346,7 +346,7 @@ class CompletionQueue : private grpc::internal::GrpcLibrary {
bool ok = ev.success != 0;
void* ignored = tag;
// the tag must be swallowed if using TryPluck
CHECK(!tag->FinalizeResult(&ignored, &ok));
ABSL_CHECK(!tag->FinalizeResult(&ignored, &ok));
}
/// Performs a single polling pluck on \a tag. Calls tag->FinalizeResult if
@ -363,7 +363,7 @@ class CompletionQueue : private grpc::internal::GrpcLibrary {
bool ok = ev.success != 0;
void* ignored = tag;
CHECK(!tag->FinalizeResult(&ignored, &ok));
ABSL_CHECK(!tag->FinalizeResult(&ignored, &ok));
}
/// Manage state of avalanching operations : completion queue tags that

View File

@ -23,14 +23,14 @@
#include <map>
#include <memory>
#include "absl/log/check.h"
#include "absl/log/absl_check.h"
#include "absl/log/absl_log.h"
#include <grpc/grpc.h>
#include <grpc/impl/compression_types.h>
#include <grpc/impl/grpc_types.h>
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpcpp/client_context.h>
#include <grpcpp/completion_queue.h>
#include <grpcpp/impl/call.h>
@ -318,7 +318,7 @@ class CallOpSendMessage {
return;
}
if (msg_ != nullptr) {
CHECK(serializer_(msg_).ok());
ABSL_CHECK(serializer_(msg_).ok());
}
serializer_ = nullptr;
grpc_op* op = &ops[(*nops)++];
@ -771,7 +771,9 @@ class CallOpRecvInitialMetadata {
class CallOpClientRecvStatus {
public:
CallOpClientRecvStatus()
: recv_status_(nullptr), debug_error_string_(nullptr) {}
: metadata_map_(nullptr),
recv_status_(nullptr),
debug_error_string_(nullptr) {}
void ClientRecvStatus(grpc::ClientContext* context, Status* status) {
client_context_ = context;
@ -797,7 +799,7 @@ class CallOpClientRecvStatus {
if (recv_status_ == nullptr || hijacked_) return;
if (static_cast<StatusCode>(status_code_) == StatusCode::OK) {
*recv_status_ = Status();
DCHECK_EQ(debug_error_string_, nullptr);
ABSL_DCHECK_EQ(debug_error_string_, nullptr);
} else {
*recv_status_ =
Status(static_cast<StatusCode>(status_code_),
@ -974,9 +976,9 @@ class CallOpSet : public CallOpSetInterface,
// A failure here indicates an API misuse; for example, doing a Write
// while another Write is already pending on the same RPC or invoking
// WritesDone multiple times
gpr_log(GPR_ERROR, "API misuse of type %s observed",
grpc_call_error_to_string(err));
CHECK(false);
ABSL_LOG(ERROR) << "API misuse of type " << grpc_call_error_to_string(err)
<< " observed";
ABSL_CHECK(false);
}
}
@ -986,8 +988,8 @@ class CallOpSet : public CallOpSetInterface,
done_intercepting_ = true;
// The following call_start_batch is internally-generated so no need for an
// explanatory log on failure.
CHECK(grpc_call_start_batch(call_.call(), nullptr, 0, core_cq_tag(),
nullptr) == GRPC_CALL_OK);
ABSL_CHECK(grpc_call_start_batch(call_.call(), nullptr, 0, core_cq_tag(),
nullptr) == GRPC_CALL_OK);
}
private:

View File

@ -22,7 +22,7 @@
#include <array>
#include <functional>
#include "absl/log/check.h"
#include "absl/log/absl_check.h"
#include <grpc/impl/grpc_types.h>
#include <grpc/support/log.h>
@ -58,15 +58,16 @@ class InterceptorBatchMethodsImpl
if (call_->client_rpc_info() != nullptr) {
return ProceedClient();
}
CHECK_NE(call_->server_rpc_info(), nullptr);
ABSL_CHECK_NE(call_->server_rpc_info(), nullptr);
ProceedServer();
}
void Hijack() override {
// Only the client can hijack when sending down initial metadata
CHECK(!reverse_ && ops_ != nullptr && call_->client_rpc_info() != nullptr);
ABSL_CHECK(!reverse_ && ops_ != nullptr &&
call_->client_rpc_info() != nullptr);
// It is illegal to call Hijack twice
CHECK(!ran_hijacking_interceptor_);
ABSL_CHECK(!ran_hijacking_interceptor_);
auto* rpc_info = call_->client_rpc_info();
rpc_info->hijacked_ = true;
rpc_info->hijacked_interceptor_ = current_interceptor_index_;
@ -81,21 +82,21 @@ class InterceptorBatchMethodsImpl
}
ByteBuffer* GetSerializedSendMessage() override {
CHECK_NE(orig_send_message_, nullptr);
ABSL_CHECK_NE(orig_send_message_, nullptr);
if (*orig_send_message_ != nullptr) {
CHECK(serializer_(*orig_send_message_).ok());
ABSL_CHECK(serializer_(*orig_send_message_).ok());
*orig_send_message_ = nullptr;
}
return send_message_;
}
const void* GetSendMessage() override {
CHECK_NE(orig_send_message_, nullptr);
ABSL_CHECK_NE(orig_send_message_, nullptr);
return *orig_send_message_;
}
void ModifySendMessage(const void* message) override {
CHECK_NE(orig_send_message_, nullptr);
ABSL_CHECK_NE(orig_send_message_, nullptr);
*orig_send_message_ = message;
}
@ -130,7 +131,7 @@ class InterceptorBatchMethodsImpl
Status* GetRecvStatus() override { return recv_status_; }
void FailHijackedSendMessage() override {
CHECK(hooks_[static_cast<size_t>(
ABSL_CHECK(hooks_[static_cast<size_t>(
experimental::InterceptionHookPoints::PRE_SEND_MESSAGE)]);
*fail_send_message_ = true;
}
@ -193,7 +194,7 @@ class InterceptorBatchMethodsImpl
}
void FailHijackedRecvMessage() override {
CHECK(hooks_[static_cast<size_t>(
ABSL_CHECK(hooks_[static_cast<size_t>(
experimental::InterceptionHookPoints::PRE_RECV_MESSAGE)]);
*hijacked_recv_message_failed_ = true;
}
@ -237,7 +238,7 @@ class InterceptorBatchMethodsImpl
// ContinueFinalizeOpsAfterInterception will be called. Note that neither of
// them is invoked if there were no interceptors registered.
bool RunInterceptors() {
CHECK(ops_);
ABSL_CHECK(ops_);
auto* client_rpc_info = call_->client_rpc_info();
if (client_rpc_info != nullptr) {
if (client_rpc_info->interceptors_.empty()) {
@ -262,8 +263,8 @@ class InterceptorBatchMethodsImpl
// SyncRequest.
bool RunInterceptors(std::function<void(void)> f) {
// This is used only by the server for initial call request
CHECK_EQ(reverse_, true);
CHECK_EQ(call_->client_rpc_info(), nullptr);
ABSL_CHECK_EQ(reverse_, true);
ABSL_CHECK_EQ(call_->client_rpc_info(), nullptr);
auto* server_rpc_info = call_->server_rpc_info();
if (server_rpc_info == nullptr || server_rpc_info->interceptors_.empty()) {
return true;
@ -357,7 +358,7 @@ class InterceptorBatchMethodsImpl
return ops_->ContinueFinalizeResultAfterInterception();
}
}
CHECK(callback_);
ABSL_CHECK(callback_);
callback_();
}
@ -423,98 +424,103 @@ class CancelInterceptorBatchMethods
void Hijack() override {
// Only the client can hijack when sending down initial metadata
CHECK(false) << "It is illegal to call Hijack on a method which has a "
"Cancel notification";
ABSL_CHECK(false) << "It is illegal to call Hijack on a method which has a "
"Cancel notification";
}
ByteBuffer* GetSerializedSendMessage() override {
CHECK(false) << "It is illegal to call GetSendMessage on a method which "
"has a Cancel notification";
ABSL_CHECK(false)
<< "It is illegal to call GetSendMessage on a method which "
"has a Cancel notification";
return nullptr;
}
bool GetSendMessageStatus() override {
CHECK(false)
ABSL_CHECK(false)
<< "It is illegal to call GetSendMessageStatus on a method which "
"has a Cancel notification";
return false;
}
const void* GetSendMessage() override {
CHECK(false)
ABSL_CHECK(false)
<< "It is illegal to call GetOriginalSendMessage on a method which "
"has a Cancel notification";
return nullptr;
}
void ModifySendMessage(const void* /*message*/) override {
CHECK(false) << "It is illegal to call ModifySendMessage on a method which "
"has a Cancel notification";
ABSL_CHECK(false)
<< "It is illegal to call ModifySendMessage on a method which "
"has a Cancel notification";
}
std::multimap<std::string, std::string>* GetSendInitialMetadata() override {
CHECK(false) << "It is illegal to call GetSendInitialMetadata on a "
"method which has a Cancel notification";
ABSL_CHECK(false) << "It is illegal to call GetSendInitialMetadata on a "
"method which has a Cancel notification";
return nullptr;
}
Status GetSendStatus() override {
CHECK(false) << "It is illegal to call GetSendStatus on a method which "
"has a Cancel notification";
ABSL_CHECK(false)
<< "It is illegal to call GetSendStatus on a method which "
"has a Cancel notification";
return Status();
}
void ModifySendStatus(const Status& /*status*/) override {
CHECK(false) << "It is illegal to call ModifySendStatus on a method "
"which has a Cancel notification";
ABSL_CHECK(false) << "It is illegal to call ModifySendStatus on a method "
"which has a Cancel notification";
}
std::multimap<std::string, std::string>* GetSendTrailingMetadata() override {
CHECK(false) << "It is illegal to call GetSendTrailingMetadata on a "
"method which has a Cancel notification";
ABSL_CHECK(false) << "It is illegal to call GetSendTrailingMetadata on a "
"method which has a Cancel notification";
return nullptr;
}
void* GetRecvMessage() override {
CHECK(false) << "It is illegal to call GetRecvMessage on a method which "
"has a Cancel notification";
ABSL_CHECK(false)
<< "It is illegal to call GetRecvMessage on a method which "
"has a Cancel notification";
return nullptr;
}
std::multimap<grpc::string_ref, grpc::string_ref>* GetRecvInitialMetadata()
override {
CHECK(false) << "It is illegal to call GetRecvInitialMetadata on a "
"method which has a Cancel notification";
ABSL_CHECK(false) << "It is illegal to call GetRecvInitialMetadata on a "
"method which has a Cancel notification";
return nullptr;
}
Status* GetRecvStatus() override {
CHECK(false) << "It is illegal to call GetRecvStatus on a method which "
"has a Cancel notification";
ABSL_CHECK(false)
<< "It is illegal to call GetRecvStatus on a method which "
"has a Cancel notification";
return nullptr;
}
std::multimap<grpc::string_ref, grpc::string_ref>* GetRecvTrailingMetadata()
override {
CHECK(false) << "It is illegal to call GetRecvTrailingMetadata on a "
"method which has a Cancel notification";
ABSL_CHECK(false) << "It is illegal to call GetRecvTrailingMetadata on a "
"method which has a Cancel notification";
return nullptr;
}
std::unique_ptr<ChannelInterface> GetInterceptedChannel() override {
CHECK(false) << "It is illegal to call GetInterceptedChannel on a "
"method which has a Cancel notification";
ABSL_CHECK(false) << "It is illegal to call GetInterceptedChannel on a "
"method which has a Cancel notification";
return std::unique_ptr<ChannelInterface>(nullptr);
}
void FailHijackedRecvMessage() override {
CHECK(false) << "It is illegal to call FailHijackedRecvMessage on a "
"method which has a Cancel notification";
ABSL_CHECK(false) << "It is illegal to call FailHijackedRecvMessage on a "
"method which has a Cancel notification";
}
void FailHijackedSendMessage() override {
CHECK(false) << "It is illegal to call FailHijackedSendMessage on a "
"method which has a Cancel notification";
ABSL_CHECK(false) << "It is illegal to call FailHijackedSendMessage on a "
"method which has a Cancel notification";
}
};
} // namespace internal

View File

@ -21,7 +21,7 @@
#include <type_traits>
#include "absl/log/check.h"
#include "absl/log/absl_check.h"
#include <grpc/byte_buffer_reader.h>
#include <grpc/impl/grpc_types.h>
@ -53,8 +53,8 @@ Status GenericSerialize(const grpc::protobuf::MessageLite& msg, ByteBuffer* bb,
if (static_cast<size_t>(byte_size) <= GRPC_SLICE_INLINED_SIZE) {
Slice slice(byte_size);
// We serialize directly into the allocated slices memory
CHECK(slice.end() == msg.SerializeWithCachedSizesToArray(
const_cast<uint8_t*>(slice.begin())));
ABSL_CHECK(slice.end() == msg.SerializeWithCachedSizesToArray(
const_cast<uint8_t*>(slice.begin())));
ByteBuffer tmp(&slice, 1);
bb->Swap(&tmp);

View File

@ -25,9 +25,9 @@
#include <memory>
#include <vector>
#include "absl/log/check.h"
#include "absl/log/absl_check.h"
#include "absl/log/absl_log.h"
#include <grpc/support/log.h>
#include <grpcpp/impl/rpc_method.h>
#include <grpcpp/support/byte_buffer.h>
#include <grpcpp/support/config.h>
@ -77,7 +77,7 @@ class MethodHandler {
// retained by the handler. Returns nullptr if deserialization failed.
virtual void* Deserialize(grpc_call* /*call*/, grpc_byte_buffer* req,
Status* /*status*/, void** /*handler_data*/) {
CHECK_EQ(req, nullptr);
ABSL_CHECK_EQ(req, nullptr);
return nullptr;
}
};
@ -116,12 +116,12 @@ class RpcServiceMethod : public RpcMethod {
// this is not an error condition, as it allows users to declare a server
// like WithRawMethod_foo<AsyncService>. However since it
// overwrites behavior, it should be logged.
gpr_log(
GPR_INFO,
"You are marking method %s as '%s', even though it was "
"previously marked '%s'. This behavior will overwrite the original "
"behavior. If you expected this then ignore this message.",
name(), TypeToString(api_type_), TypeToString(type));
ABSL_LOG(INFO)
<< "You are marking method " << name() << " as '"
<< TypeToString(api_type_)
<< "', even though it was previously marked '" << TypeToString(type)
<< "'. This behavior will overwrite the original behavior. If "
"you expected this then ignore this message.";
}
api_type_ = type;
}

View File

@ -18,7 +18,7 @@
#ifndef GRPCPP_IMPL_SERVER_CALLBACK_HANDLERS_H
#define GRPCPP_IMPL_SERVER_CALLBACK_HANDLERS_H
#include "absl/log/check.h"
#include "absl/log/absl_check.h"
#include <grpc/grpc.h>
#include <grpc/impl/call.h>
@ -149,7 +149,7 @@ class CallbackUnaryHandler : public grpc::internal::MethodHandler {
}
void SendInitialMetadata() override {
CHECK(!ctx_->sent_initial_metadata_);
ABSL_CHECK(!ctx_->sent_initial_metadata_);
this->Ref();
// The callback for this function should not be marked inline because it
// is directly invoking a user-controlled reaction
@ -337,7 +337,7 @@ class CallbackClientStreamingHandler : public grpc::internal::MethodHandler {
}
void SendInitialMetadata() override {
CHECK(!ctx_->sent_initial_metadata_);
ABSL_CHECK(!ctx_->sent_initial_metadata_);
this->Ref();
// The callback for this function should not be inlined because it invokes
// a user-controlled reaction, but any resulting OnDone can be inlined in
@ -541,7 +541,7 @@ class CallbackServerStreamingHandler : public grpc::internal::MethodHandler {
}
void SendInitialMetadata() override {
CHECK(!ctx_->sent_initial_metadata_);
ABSL_CHECK(!ctx_->sent_initial_metadata_);
this->Ref();
// The callback for this function should not be inlined because it invokes
// a user-controlled reaction, but any resulting OnDone can be inlined in
@ -579,7 +579,7 @@ class CallbackServerStreamingHandler : public grpc::internal::MethodHandler {
ctx_->sent_initial_metadata_ = true;
}
// TODO(vjpai): don't assert
CHECK(write_ops_.SendMessagePtr(resp, options).ok());
ABSL_CHECK(write_ops_.SendMessagePtr(resp, options).ok());
call_.PerformOps(&write_ops_);
}
@ -587,7 +587,7 @@ class CallbackServerStreamingHandler : public grpc::internal::MethodHandler {
grpc::Status s) override {
// This combines the write into the finish callback
// TODO(vjpai): don't assert
CHECK(finish_ops_.SendMessagePtr(resp, options).ok());
ABSL_CHECK(finish_ops_.SendMessagePtr(resp, options).ok());
Finish(std::move(s));
}
@ -753,7 +753,7 @@ class CallbackBidiHandler : public grpc::internal::MethodHandler {
}
void SendInitialMetadata() override {
CHECK(!ctx_->sent_initial_metadata_);
ABSL_CHECK(!ctx_->sent_initial_metadata_);
this->Ref();
// The callback for this function should not be inlined because it invokes
// a user-controlled reaction, but any resulting OnDone can be inlined in
@ -791,14 +791,14 @@ class CallbackBidiHandler : public grpc::internal::MethodHandler {
ctx_->sent_initial_metadata_ = true;
}
// TODO(vjpai): don't assert
CHECK(write_ops_.SendMessagePtr(resp, options).ok());
ABSL_CHECK(write_ops_.SendMessagePtr(resp, options).ok());
call_.PerformOps(&write_ops_);
}
void WriteAndFinish(const ResponseType* resp, grpc::WriteOptions options,
grpc::Status s) override {
// TODO(vjpai): don't assert
CHECK(finish_ops_.SendMessagePtr(resp, options).ok());
ABSL_CHECK(finish_ops_.SendMessagePtr(resp, options).ok());
Finish(std::move(s));
}

View File

@ -19,7 +19,7 @@
#ifndef GRPCPP_IMPL_SERVICE_TYPE_H
#define GRPCPP_IMPL_SERVICE_TYPE_H
#include "absl/log/check.h"
#include "absl/log/absl_check.h"
#include <grpc/support/log.h>
#include <grpcpp/impl/rpc_service_method.h>
@ -152,7 +152,7 @@ class Service {
// This does not have to be a hard error, however no one has approached us
// with a use case yet. Please file an issue if you believe you have one.
size_t idx = static_cast<size_t>(index);
CHECK_NE(methods_[idx].get(), nullptr)
ABSL_CHECK_NE(methods_[idx].get(), nullptr)
<< "Cannot mark the method as 'async' because it has already been "
"marked as 'generic'.";
methods_[idx]->SetServerApiType(internal::RpcServiceMethod::ApiType::ASYNC);
@ -162,7 +162,7 @@ class Service {
// This does not have to be a hard error, however no one has approached us
// with a use case yet. Please file an issue if you believe you have one.
size_t idx = static_cast<size_t>(index);
CHECK_NE(methods_[idx].get(), nullptr)
ABSL_CHECK_NE(methods_[idx].get(), nullptr)
<< "Cannot mark the method as 'raw' because it has already "
"been marked as 'generic'.";
methods_[idx]->SetServerApiType(internal::RpcServiceMethod::ApiType::RAW);
@ -172,7 +172,7 @@ class Service {
// This does not have to be a hard error, however no one has approached us
// with a use case yet. Please file an issue if you believe you have one.
size_t idx = static_cast<size_t>(index);
CHECK_NE(methods_[idx]->handler(), nullptr)
ABSL_CHECK_NE(methods_[idx]->handler(), nullptr)
<< "Cannot mark the method as 'generic' because it has already been "
"marked as 'async' or 'raw'.";
methods_[idx].reset();
@ -182,7 +182,7 @@ class Service {
// This does not have to be a hard error, however no one has approached us
// with a use case yet. Please file an issue if you believe you have one.
size_t idx = static_cast<size_t>(index);
CHECK(methods_[idx] && methods_[idx]->handler())
ABSL_CHECK(methods_[idx] && methods_[idx]->handler())
<< "Cannot mark an async or generic method Streamed";
methods_[idx]->SetHandler(streamed_method);
@ -197,7 +197,7 @@ class Service {
// This does not have to be a hard error, however no one has approached us
// with a use case yet. Please file an issue if you believe you have one.
size_t idx = static_cast<size_t>(index);
CHECK_NE(methods_[idx].get(), nullptr)
ABSL_CHECK_NE(methods_[idx].get(), nullptr)
<< "Cannot mark the method as 'callback' because it has already been "
"marked as 'generic'.";
methods_[idx]->SetHandler(handler);
@ -209,7 +209,7 @@ class Service {
// This does not have to be a hard error, however no one has approached us
// with a use case yet. Please file an issue if you believe you have one.
size_t idx = static_cast<size_t>(index);
CHECK_NE(methods_[idx].get(), nullptr)
ABSL_CHECK_NE(methods_[idx].get(), nullptr)
<< "Cannot mark the method as 'raw callback' because it has already "
"been marked as 'generic'.";
methods_[idx]->SetHandler(handler);

View File

@ -27,7 +27,7 @@
#include <mutex>
#include "absl/log/check.h"
#include "absl/log/absl_check.h"
#include "absl/synchronization/mutex.h"
#include <grpc/support/log.h>
@ -106,7 +106,7 @@ class ABSL_SCOPED_LOCKABLE ReleasableMutexLock {
ReleasableMutexLock& operator=(const ReleasableMutexLock&) = delete;
void Release() ABSL_UNLOCK_FUNCTION() {
DCHECK(!released_);
ABSL_DCHECK(!released_);
released_ = true;
mu_->Unlock();
}

View File

@ -1,4 +1,4 @@
// Copyright 2022 gRPC authors.
// Copyright 2024 The gRPC Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -11,14 +11,17 @@
// 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 GRPCPP_PASSIVE_LISTENER_H
#define GRPCPP_PASSIVE_LISTENER_H
#ifndef GRPC_SRC_CORE_LIB_PROMISE_TRACE_H
#define GRPC_SRC_CORE_LIB_PROMISE_TRACE_H
#include <grpc/passive_listener.h>
#include <grpc/support/port_platform.h>
namespace grpc {
namespace experimental {
#include "src/core/lib/debug/trace.h"
using grpc_core::experimental::PassiveListener;
extern grpc_core::DebugOnlyTraceFlag grpc_trace_promise_primitives;
} // namespace experimental
} // namespace grpc
#endif // GRPC_SRC_CORE_LIB_PROMISE_TRACE_H
#endif // GRPCPP_PASSIVE_LISTENER_H

View File

@ -1,4 +1,5 @@
//
//
// Copyright 2019 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -13,18 +14,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
//
#ifndef GRPC_SRC_CORE_RESOLVER_XDS_XDS_RESOLVER_TRACE_H
#define GRPC_SRC_CORE_RESOLVER_XDS_XDS_RESOLVER_TRACE_H
#ifndef GRPCPP_SECURITY_CRONET_CREDENTIALS_H
#define GRPCPP_SECURITY_CRONET_CREDENTIALS_H
#include <grpc/support/port_platform.h>
#include <memory>
#include "src/core/lib/debug/trace.h"
namespace grpc {
namespace grpc_core {
class ChannelCredentials;
extern TraceFlag grpc_xds_resolver_trace;
/// Credentials for a channel using Cronet.
std::shared_ptr<ChannelCredentials> CronetChannelCredentials(void* engine);
} // namespace grpc_core
} // namespace grpc
#endif // GRPC_SRC_CORE_RESOLVER_XDS_XDS_RESOLVER_TRACE_H
#endif // GRPCPP_SECURITY_CRONET_CREDENTIALS_H

View File

@ -84,6 +84,7 @@ class ServerCredentials : private grpc::internal::GrpcLibrary {
// Needed for access to AddPortToServer.
friend class Server;
// Needed for access to c_creds_.
friend class ServerBuilder;
friend std::shared_ptr<ServerCredentials> grpc::XdsServerCredentials(
const std::shared_ptr<ServerCredentials>& fallback_credentials);

View File

@ -103,6 +103,8 @@ class TlsCredentialsOptions {
// call is covered by the cert that the peer presented.
// We will perform such checks by default. This should be disabled if
// verifiers other than the host name verifier is used.
// Deprecated: This function will be removed in the 1.66 release. This will be
// replaced by and handled within the custom verifier settings.
void set_check_call_host(bool check_call_host);
// Deprecated in favor of set_crl_provider. The
@ -111,6 +113,8 @@ class TlsCredentialsOptions {
// If set, gRPC will read all hashed x.509 CRL files in the directory and
// enforce the CRL files on all TLS handshakes. Only supported for OpenSSL
// version > 1.1.
// Deprecated: This function will be removed in the 1.66 release. Use the
// set_crl_provider function instead.
void set_crl_directory(const std::string& path);
void set_crl_provider(std::shared_ptr<CrlProvider> crl_provider);
@ -184,6 +188,7 @@ class TlsServerCredentialsOptions final : public TlsCredentialsOptions {
// WARNING: This API is extremely dangerous and should not be used. If the
// server's trust bundle is too large, then the TLS server will be unable to
// form a ServerHello, and hence will be unusable.
// Deprecated: This function will be removed in the 1.66 release.
void set_send_client_ca_list(bool send_client_ca_list);
private:

View File

@ -25,13 +25,17 @@
#include <vector>
#include <grpc/compression.h>
#include <grpc/event_engine/event_engine.h>
#include <grpc/passive_listener.h>
#include <grpc/support/cpu.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/workaround_list.h>
#include <grpcpp/impl/channel_argument_option.h>
#include <grpcpp/impl/server_builder_option.h>
#include <grpcpp/impl/server_builder_plugin.h>
#include <grpcpp/passive_listener.h>
#include <grpcpp/security/authorization_policy_provider.h>
#include <grpcpp/security/server_credentials.h>
#include <grpcpp/server.h>
#include <grpcpp/support/config.h>
#include <grpcpp/support/server_interceptor.h>
@ -291,6 +295,18 @@ class ServerBuilder {
void EnableCallMetricRecording(
experimental::ServerMetricRecorder* server_metric_recorder = nullptr);
// Creates a passive listener for Server Endpoint injection.
///
/// \a PasiveListener lets applications provide pre-established connections
/// to gRPC Servers. The server will behave as if it accepted the connection
/// itself on its own listening addresses.
///
/// This can be called multiple times to create passive listeners with
/// different server credentials.
ServerBuilder& AddPassiveListener(
std::shared_ptr<grpc::ServerCredentials> creds,
std::unique_ptr<grpc::experimental::PassiveListener>& passive_listener);
private:
ServerBuilder* builder_;
};
@ -364,6 +380,17 @@ class ServerBuilder {
private:
friend class grpc::testing::ServerBuilderPluginTest;
struct UnstartedPassiveListener {
std::weak_ptr<grpc_core::experimental::PassiveListenerImpl>
passive_listener;
std::shared_ptr<grpc::ServerCredentials> credentials;
UnstartedPassiveListener(
std::weak_ptr<grpc_core::experimental::PassiveListenerImpl> listener,
std::shared_ptr<grpc::ServerCredentials> creds)
: passive_listener(std::move(listener)),
credentials(std::move(creds)) {}
};
struct SyncServerSettings {
SyncServerSettings()
: num_cqs(1), min_pollers(1), max_pollers(2), cq_timeout_msec(10000) {}
@ -388,6 +415,7 @@ class ServerBuilder {
std::vector<std::unique_ptr<grpc::ServerBuilderOption>> options_;
std::vector<std::unique_ptr<NamedService>> services_;
std::vector<Port> ports_;
std::vector<UnstartedPassiveListener> unstarted_passive_listeners_;
SyncServerSettings sync_server_settings_;

View File

@ -19,7 +19,7 @@
#ifndef GRPCPP_SERVER_INTERFACE_H
#define GRPCPP_SERVER_INTERFACE_H
#include "absl/log/check.h"
#include "absl/log/absl_check.h"
#include <grpc/grpc.h>
#include <grpc/impl/grpc_types.h>
@ -320,7 +320,7 @@ class ServerInterface : public internal::CallHook {
grpc::CompletionQueue* call_cq,
grpc::ServerCompletionQueue* notification_cq, void* tag,
Message* message) {
CHECK(method);
ABSL_CHECK(method);
new PayloadAsyncRequest<Message>(method, this, context, stream, call_cq,
notification_cq, tag, message);
}
@ -331,7 +331,7 @@ class ServerInterface : public internal::CallHook {
grpc::CompletionQueue* call_cq,
grpc::ServerCompletionQueue* notification_cq,
void* tag) {
CHECK(method);
ABSL_CHECK(method);
new NoPayloadAsyncRequest(method, this, context, stream, call_cq,
notification_cq, tag);
}

View File

@ -19,7 +19,7 @@
#ifndef GRPCPP_SUPPORT_ASYNC_STREAM_H
#define GRPCPP_SUPPORT_ASYNC_STREAM_H
#include "absl/log/check.h"
#include "absl/log/absl_check.h"
#include <grpc/grpc.h>
#include <grpc/support/log.h>
@ -202,7 +202,7 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> {
public:
// always allocated against a call arena, no memory free required
static void operator delete(void* /*ptr*/, std::size_t size) {
CHECK_EQ(size, sizeof(ClientAsyncReader));
ABSL_CHECK_EQ(size, sizeof(ClientAsyncReader));
}
// This operator should never be called as the memory should be freed as part
@ -210,10 +210,10 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> {
// delete to the operator new so that some compilers will not complain (see
// https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
// there are no tests catching the compiler warning.
static void operator delete(void*, void*) { CHECK(false); }
static void operator delete(void*, void*) { ABSL_CHECK(false); }
void StartCall(void* tag) override {
CHECK(!started_);
ABSL_CHECK(!started_);
started_ = true;
StartCallInternal(tag);
}
@ -227,8 +227,8 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> {
/// calling code can access the received metadata through the
/// \a ClientContext.
void ReadInitialMetadata(void* tag) override {
CHECK(started_);
CHECK(!context_->initial_metadata_received_);
ABSL_CHECK(started_);
ABSL_CHECK(!context_->initial_metadata_received_);
meta_ops_.set_output_tag(tag);
meta_ops_.RecvInitialMetadata(context_);
@ -236,7 +236,7 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> {
}
void Read(R* msg, void* tag) override {
CHECK(started_);
ABSL_CHECK(started_);
read_ops_.set_output_tag(tag);
if (!context_->initial_metadata_received_) {
read_ops_.RecvInitialMetadata(context_);
@ -251,7 +251,7 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> {
/// - the \a ClientContext associated with this call is updated with
/// possible initial and trailing metadata received from the server.
void Finish(grpc::Status* status, void* tag) override {
CHECK(started_);
ABSL_CHECK(started_);
finish_ops_.set_output_tag(tag);
if (!context_->initial_metadata_received_) {
finish_ops_.RecvInitialMetadata(context_);
@ -267,12 +267,12 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> {
const W& request, bool start, void* tag)
: context_(context), call_(call), started_(start) {
// TODO(ctiller): don't assert
CHECK(init_ops_.SendMessage(request).ok());
ABSL_CHECK(init_ops_.SendMessage(request).ok());
init_ops_.ClientSendClose();
if (start) {
StartCallInternal(tag);
} else {
CHECK(tag == nullptr);
ABSL_CHECK(tag == nullptr);
}
}
@ -350,7 +350,7 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> {
public:
// always allocated against a call arena, no memory free required
static void operator delete(void* /*ptr*/, std::size_t size) {
CHECK_EQ(size, sizeof(ClientAsyncWriter));
ABSL_CHECK_EQ(size, sizeof(ClientAsyncWriter));
}
// This operator should never be called as the memory should be freed as part
@ -358,10 +358,10 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> {
// delete to the operator new so that some compilers will not complain (see
// https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
// there are no tests catching the compiler warning.
static void operator delete(void*, void*) { CHECK(false); }
static void operator delete(void*, void*) { ABSL_CHECK(false); }
void StartCall(void* tag) override {
CHECK(!started_);
ABSL_CHECK(!started_);
started_ = true;
StartCallInternal(tag);
}
@ -374,8 +374,8 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> {
/// associated with this call is updated, and the calling code can access
/// the received metadata through the \a ClientContext.
void ReadInitialMetadata(void* tag) override {
CHECK(started_);
CHECK(!context_->initial_metadata_received_);
ABSL_CHECK(started_);
ABSL_CHECK(!context_->initial_metadata_received_);
meta_ops_.set_output_tag(tag);
meta_ops_.RecvInitialMetadata(context_);
@ -383,27 +383,27 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> {
}
void Write(const W& msg, void* tag) override {
CHECK(started_);
ABSL_CHECK(started_);
write_ops_.set_output_tag(tag);
// TODO(ctiller): don't assert
CHECK(write_ops_.SendMessage(msg).ok());
ABSL_CHECK(write_ops_.SendMessage(msg).ok());
call_.PerformOps(&write_ops_);
}
void Write(const W& msg, grpc::WriteOptions options, void* tag) override {
CHECK(started_);
ABSL_CHECK(started_);
write_ops_.set_output_tag(tag);
if (options.is_last_message()) {
options.set_buffer_hint();
write_ops_.ClientSendClose();
}
// TODO(ctiller): don't assert
CHECK(write_ops_.SendMessage(msg, options).ok());
ABSL_CHECK(write_ops_.SendMessage(msg, options).ok());
call_.PerformOps(&write_ops_);
}
void WritesDone(void* tag) override {
CHECK(started_);
ABSL_CHECK(started_);
write_ops_.set_output_tag(tag);
write_ops_.ClientSendClose();
call_.PerformOps(&write_ops_);
@ -417,7 +417,7 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> {
/// - attempts to fill in the \a response parameter passed to this class's
/// constructor with the server's response message.
void Finish(grpc::Status* status, void* tag) override {
CHECK(started_);
ABSL_CHECK(started_);
finish_ops_.set_output_tag(tag);
if (!context_->initial_metadata_received_) {
finish_ops_.RecvInitialMetadata(context_);
@ -437,7 +437,7 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> {
if (start) {
StartCallInternal(tag);
} else {
CHECK(tag == nullptr);
ABSL_CHECK(tag == nullptr);
}
}
@ -517,7 +517,7 @@ class ClientAsyncReaderWriter final
public:
// always allocated against a call arena, no memory free required
static void operator delete(void* /*ptr*/, std::size_t size) {
CHECK_EQ(size, sizeof(ClientAsyncReaderWriter));
ABSL_CHECK_EQ(size, sizeof(ClientAsyncReaderWriter));
}
// This operator should never be called as the memory should be freed as part
@ -525,10 +525,10 @@ class ClientAsyncReaderWriter final
// delete to the operator new so that some compilers will not complain (see
// https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
// there are no tests catching the compiler warning.
static void operator delete(void*, void*) { CHECK(false); }
static void operator delete(void*, void*) { ABSL_CHECK(false); }
void StartCall(void* tag) override {
CHECK(!started_);
ABSL_CHECK(!started_);
started_ = true;
StartCallInternal(tag);
}
@ -541,8 +541,8 @@ class ClientAsyncReaderWriter final
/// is updated with it, and then the receiving initial metadata can
/// be accessed through this \a ClientContext.
void ReadInitialMetadata(void* tag) override {
CHECK(started_);
CHECK(!context_->initial_metadata_received_);
ABSL_CHECK(started_);
ABSL_CHECK(!context_->initial_metadata_received_);
meta_ops_.set_output_tag(tag);
meta_ops_.RecvInitialMetadata(context_);
@ -550,7 +550,7 @@ class ClientAsyncReaderWriter final
}
void Read(R* msg, void* tag) override {
CHECK(started_);
ABSL_CHECK(started_);
read_ops_.set_output_tag(tag);
if (!context_->initial_metadata_received_) {
read_ops_.RecvInitialMetadata(context_);
@ -560,27 +560,27 @@ class ClientAsyncReaderWriter final
}
void Write(const W& msg, void* tag) override {
CHECK(started_);
ABSL_CHECK(started_);
write_ops_.set_output_tag(tag);
// TODO(ctiller): don't assert
CHECK(write_ops_.SendMessage(msg).ok());
ABSL_CHECK(write_ops_.SendMessage(msg).ok());
call_.PerformOps(&write_ops_);
}
void Write(const W& msg, grpc::WriteOptions options, void* tag) override {
CHECK(started_);
ABSL_CHECK(started_);
write_ops_.set_output_tag(tag);
if (options.is_last_message()) {
options.set_buffer_hint();
write_ops_.ClientSendClose();
}
// TODO(ctiller): don't assert
CHECK(write_ops_.SendMessage(msg, options).ok());
ABSL_CHECK(write_ops_.SendMessage(msg, options).ok());
call_.PerformOps(&write_ops_);
}
void WritesDone(void* tag) override {
CHECK(started_);
ABSL_CHECK(started_);
write_ops_.set_output_tag(tag);
write_ops_.ClientSendClose();
call_.PerformOps(&write_ops_);
@ -591,7 +591,7 @@ class ClientAsyncReaderWriter final
/// - the \a ClientContext associated with this call is updated with
/// possible initial and trailing metadata sent from the server.
void Finish(grpc::Status* status, void* tag) override {
CHECK(started_);
ABSL_CHECK(started_);
finish_ops_.set_output_tag(tag);
if (!context_->initial_metadata_received_) {
finish_ops_.RecvInitialMetadata(context_);
@ -608,7 +608,7 @@ class ClientAsyncReaderWriter final
if (start) {
StartCallInternal(tag);
} else {
CHECK(tag == nullptr);
ABSL_CHECK(tag == nullptr);
}
}
@ -708,7 +708,7 @@ class ServerAsyncReader final : public ServerAsyncReaderInterface<W, R> {
/// - The initial metadata that will be sent to the client from this op will
/// be taken from the \a ServerContext associated with the call.
void SendInitialMetadata(void* tag) override {
CHECK(!ctx_->sent_initial_metadata_);
ABSL_CHECK(!ctx_->sent_initial_metadata_);
meta_ops_.set_output_tag(tag);
meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_,
@ -767,7 +767,7 @@ class ServerAsyncReader final : public ServerAsyncReaderInterface<W, R> {
/// gRPC doesn't take ownership or a reference to \a status, so it is safe to
/// to deallocate once FinishWithError returns.
void FinishWithError(const grpc::Status& status, void* tag) override {
CHECK(!status.ok());
ABSL_CHECK(!status.ok());
finish_ops_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) {
finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_,
@ -857,7 +857,7 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> {
///
/// \param[in] tag Tag identifying this request.
void SendInitialMetadata(void* tag) override {
CHECK(!ctx_->sent_initial_metadata_);
ABSL_CHECK(!ctx_->sent_initial_metadata_);
meta_ops_.set_output_tag(tag);
meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_,
@ -873,7 +873,7 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> {
write_ops_.set_output_tag(tag);
EnsureInitialMetadataSent(&write_ops_);
// TODO(ctiller): don't assert
CHECK(write_ops_.SendMessage(msg).ok());
ABSL_CHECK(write_ops_.SendMessage(msg).ok());
call_.PerformOps(&write_ops_);
}
@ -885,7 +885,7 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> {
EnsureInitialMetadataSent(&write_ops_);
// TODO(ctiller): don't assert
CHECK(write_ops_.SendMessage(msg, options).ok());
ABSL_CHECK(write_ops_.SendMessage(msg, options).ok());
call_.PerformOps(&write_ops_);
}
@ -904,7 +904,7 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> {
write_ops_.set_output_tag(tag);
EnsureInitialMetadataSent(&write_ops_);
options.set_buffer_hint();
CHECK(write_ops_.SendMessage(msg, options).ok());
ABSL_CHECK(write_ops_.SendMessage(msg, options).ok());
write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status);
call_.PerformOps(&write_ops_);
}
@ -1023,7 +1023,7 @@ class ServerAsyncReaderWriter final
///
/// \param[in] tag Tag identifying this request.
void SendInitialMetadata(void* tag) override {
CHECK(!ctx_->sent_initial_metadata_);
ABSL_CHECK(!ctx_->sent_initial_metadata_);
meta_ops_.set_output_tag(tag);
meta_ops_.SendInitialMetadata(&ctx_->initial_metadata_,
@ -1045,7 +1045,7 @@ class ServerAsyncReaderWriter final
write_ops_.set_output_tag(tag);
EnsureInitialMetadataSent(&write_ops_);
// TODO(ctiller): don't assert
CHECK(write_ops_.SendMessage(msg).ok());
ABSL_CHECK(write_ops_.SendMessage(msg).ok());
call_.PerformOps(&write_ops_);
}
@ -1055,7 +1055,7 @@ class ServerAsyncReaderWriter final
options.set_buffer_hint();
}
EnsureInitialMetadataSent(&write_ops_);
CHECK(write_ops_.SendMessage(msg, options).ok());
ABSL_CHECK(write_ops_.SendMessage(msg, options).ok());
call_.PerformOps(&write_ops_);
}
@ -1075,7 +1075,7 @@ class ServerAsyncReaderWriter final
write_ops_.set_output_tag(tag);
EnsureInitialMetadataSent(&write_ops_);
options.set_buffer_hint();
CHECK(write_ops_.SendMessage(msg, options).ok());
ABSL_CHECK(write_ops_.SendMessage(msg, options).ok());
write_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status);
call_.PerformOps(&write_ops_);
}

View File

@ -19,7 +19,7 @@
#ifndef GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H
#define GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H
#include "absl/log/check.h"
#include "absl/log/absl_check.h"
#include <grpc/grpc.h>
#include <grpc/support/log.h>
@ -132,7 +132,7 @@ class ClientAsyncResponseReaderHelper {
new (grpc_call_arena_alloc(call, sizeof(SingleBufType))) SingleBufType;
*single_buf_ptr = single_buf;
// TODO(ctiller): don't assert
CHECK(single_buf->SendMessage(request).ok());
ABSL_CHECK(single_buf->SendMessage(request).ok());
single_buf->ClientSendClose();
// The purpose of the following functions is to type-erase the actual
@ -222,7 +222,7 @@ class ClientAsyncResponseReader final
public:
// always allocated against a call arena, no memory free required
static void operator delete(void* /*ptr*/, std::size_t size) {
CHECK_EQ(size, sizeof(ClientAsyncResponseReader));
ABSL_CHECK_EQ(size, sizeof(ClientAsyncResponseReader));
}
// This operator should never be called as the memory should be freed as part
@ -230,10 +230,10 @@ class ClientAsyncResponseReader final
// delete to the operator new so that some compilers will not complain (see
// https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
// there are no tests catching the compiler warning.
static void operator delete(void*, void*) { CHECK(false); }
static void operator delete(void*, void*) { ABSL_CHECK(false); }
void StartCall() override {
DCHECK(!started_);
ABSL_DCHECK(!started_);
started_ = true;
internal::ClientAsyncResponseReaderHelper::StartCall(context_, single_buf_);
}
@ -245,8 +245,8 @@ class ClientAsyncResponseReader final
/// - the \a ClientContext associated with this call is updated with
/// possible initial and trailing metadata sent from the server.
void ReadInitialMetadata(void* tag) override {
DCHECK(started_);
DCHECK(!context_->initial_metadata_received_);
ABSL_DCHECK(started_);
ABSL_DCHECK(!context_->initial_metadata_received_);
read_initial_metadata_(context_, &call_, single_buf_, tag);
initial_metadata_read_ = true;
}
@ -257,7 +257,7 @@ class ClientAsyncResponseReader final
/// - the \a ClientContext associated with this call is updated with
/// possible initial and trailing metadata sent from the server.
void Finish(R* msg, grpc::Status* status, void* tag) override {
DCHECK(started_);
ABSL_DCHECK(started_);
finish_(context_, &call_, initial_metadata_read_, single_buf_, &finish_buf_,
static_cast<void*>(msg), status, tag);
}
@ -306,7 +306,7 @@ class ServerAsyncResponseWriter final
///
/// \param[in] tag Tag identifying this request.
void SendInitialMetadata(void* tag) override {
CHECK(!ctx_->sent_initial_metadata_);
ABSL_CHECK(!ctx_->sent_initial_metadata_);
meta_buf_.set_output_tag(tag);
meta_buf_.SendInitialMetadata(&ctx_->initial_metadata_,
@ -375,7 +375,7 @@ class ServerAsyncResponseWriter final
/// deallocate them once the Finish operation is complete (i.e. a result
/// arrives in the completion queue).
void FinishWithError(const grpc::Status& status, void* tag) {
CHECK(!status.ok());
ABSL_CHECK(!status.ok());
finish_buf_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) {
finish_buf_.SendInitialMetadata(&ctx_->initial_metadata_,

View File

@ -21,7 +21,7 @@
#include <functional>
#include "absl/log/check.h"
#include "absl/log/absl_check.h"
#include <grpc/grpc.h>
#include <grpc/impl/grpc_types.h>
@ -73,7 +73,7 @@ class CallbackWithStatusTag : public grpc_completion_queue_functor {
public:
// always allocated against a call arena, no memory free required
static void operator delete(void* /*ptr*/, std::size_t size) {
CHECK_EQ(size, sizeof(CallbackWithStatusTag));
ABSL_CHECK_EQ(size, sizeof(CallbackWithStatusTag));
}
// This operator should never be called as the memory should be freed as part
@ -81,7 +81,7 @@ class CallbackWithStatusTag : public grpc_completion_queue_functor {
// delete to the operator new so that some compilers will not complain (see
// https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
// there are no tests catching the compiler warning.
static void operator delete(void*, void*) { CHECK(false); }
static void operator delete(void*, void*) { ABSL_CHECK(false); }
CallbackWithStatusTag(grpc_call* call, std::function<void(Status)> f,
CompletionQueueTag* ops)
@ -120,7 +120,7 @@ class CallbackWithStatusTag : public grpc_completion_queue_functor {
// The tag was swallowed
return;
}
CHECK(ignored == ops_);
ABSL_CHECK(ignored == ops_);
// Last use of func_ or status_, so ok to move them out
auto func = std::move(func_);
@ -139,7 +139,7 @@ class CallbackWithSuccessTag : public grpc_completion_queue_functor {
public:
// always allocated against a call arena, no memory free required
static void operator delete(void* /*ptr*/, std::size_t size) {
CHECK_EQ(size, sizeof(CallbackWithSuccessTag));
ABSL_CHECK_EQ(size, sizeof(CallbackWithSuccessTag));
}
// This operator should never be called as the memory should be freed as part
@ -147,7 +147,7 @@ class CallbackWithSuccessTag : public grpc_completion_queue_functor {
// delete to the operator new so that some compilers will not complain (see
// https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
// there are no tests catching the compiler warning.
static void operator delete(void*, void*) { CHECK(false); }
static void operator delete(void*, void*) { ABSL_CHECK(false); }
CallbackWithSuccessTag() : call_(nullptr) {}
@ -164,7 +164,7 @@ class CallbackWithSuccessTag : public grpc_completion_queue_functor {
// callbacks.
void Set(grpc_call* call, std::function<void(bool)> f,
CompletionQueueTag* ops, bool can_inline) {
CHECK_EQ(call_, nullptr);
ABSL_CHECK_EQ(call_, nullptr);
grpc_call_ref(call);
call_ = call;
func_ = std::move(f);
@ -210,7 +210,7 @@ class CallbackWithSuccessTag : public grpc_completion_queue_functor {
#endif
bool do_callback = ops_->FinalizeResult(&ignored, &ok);
#ifndef NDEBUG
DCHECK(ignored == ops);
ABSL_DCHECK(ignored == ops);
#endif
if (do_callback) {

View File

@ -22,7 +22,7 @@
#include <atomic>
#include <functional>
#include "absl/log/check.h"
#include "absl/log/absl_check.h"
#include <grpc/grpc.h>
#include <grpc/impl/call.h>
@ -72,7 +72,7 @@ class CallbackUnaryCallImpl {
const InputMessage* request, OutputMessage* result,
std::function<void(grpc::Status)> on_completion) {
grpc::CompletionQueue* cq = channel->CallbackCQ();
CHECK_NE(cq, nullptr);
ABSL_CHECK_NE(cq, nullptr);
grpc::internal::Call call(channel->CreateCall(method, context, cq));
using FullCallOpSet = grpc::internal::CallOpSet<
@ -306,7 +306,7 @@ class ClientBidiReactor : public internal::ClientReactor {
/// The argument to AddMultipleHolds must be positive.
void AddHold() { AddMultipleHolds(1); }
void AddMultipleHolds(int holds) {
DCHECK_GT(holds, 0);
ABSL_DCHECK_GT(holds, 0);
stream_->AddHold(holds);
}
void RemoveHold() { stream_->RemoveHold(); }
@ -370,7 +370,7 @@ class ClientReadReactor : public internal::ClientReactor {
void AddHold() { AddMultipleHolds(1); }
void AddMultipleHolds(int holds) {
DCHECK_GT(holds, 0);
ABSL_DCHECK_GT(holds, 0);
reader_->AddHold(holds);
}
void RemoveHold() { reader_->RemoveHold(); }
@ -402,7 +402,7 @@ class ClientWriteReactor : public internal::ClientReactor {
void AddHold() { AddMultipleHolds(1); }
void AddMultipleHolds(int holds) {
DCHECK_GT(holds, 0);
ABSL_DCHECK_GT(holds, 0);
writer_->AddHold(holds);
}
void RemoveHold() { writer_->RemoveHold(); }
@ -463,7 +463,7 @@ class ClientCallbackReaderWriterImpl
public:
// always allocated against a call arena, no memory free required
static void operator delete(void* /*ptr*/, std::size_t size) {
CHECK_EQ(size, sizeof(ClientCallbackReaderWriterImpl));
ABSL_CHECK_EQ(size, sizeof(ClientCallbackReaderWriterImpl));
}
// This operator should never be called as the memory should be freed as part
@ -471,7 +471,7 @@ class ClientCallbackReaderWriterImpl
// delete to the operator new so that some compilers will not complain (see
// https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
// there are no tests catching the compiler warning.
static void operator delete(void*, void*) { CHECK(false); }
static void operator delete(void*, void*) { ABSL_CHECK(false); }
void StartCall() ABSL_LOCKS_EXCLUDED(start_mu_) override {
// This call initiates two batches, plus any backlog, each with a callback
@ -529,7 +529,7 @@ class ClientCallbackReaderWriterImpl
write_ops_.ClientSendClose();
}
// TODO(vjpai): don't assert
CHECK(write_ops_.SendMessagePtr(msg, options).ok());
ABSL_CHECK(write_ops_.SendMessagePtr(msg, options).ok());
callbacks_outstanding_.fetch_add(1, std::memory_order_relaxed);
if (GPR_UNLIKELY(corked_write_needed_)) {
write_ops_.SendInitialMetadata(&context_->send_initial_metadata_,
@ -721,7 +721,7 @@ class ClientCallbackReaderImpl : public ClientCallbackReader<Response> {
public:
// always allocated against a call arena, no memory free required
static void operator delete(void* /*ptr*/, std::size_t size) {
CHECK_EQ(size, sizeof(ClientCallbackReaderImpl));
ABSL_CHECK_EQ(size, sizeof(ClientCallbackReaderImpl));
}
// This operator should never be called as the memory should be freed as part
@ -729,7 +729,7 @@ class ClientCallbackReaderImpl : public ClientCallbackReader<Response> {
// delete to the operator new so that some compilers will not complain (see
// https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
// there are no tests catching the compiler warning.
static void operator delete(void*, void*) { CHECK(false); }
static void operator delete(void*, void*) { ABSL_CHECK(false); }
void StartCall() override {
// This call initiates two batches, plus any backlog, each with a callback
@ -806,7 +806,7 @@ class ClientCallbackReaderImpl : public ClientCallbackReader<Response> {
: context_(context), call_(call), reactor_(reactor) {
this->BindReactor(reactor);
// TODO(vjpai): don't assert
CHECK(start_ops_.SendMessagePtr(request).ok());
ABSL_CHECK(start_ops_.SendMessagePtr(request).ok());
start_ops_.ClientSendClose();
}
@ -882,7 +882,7 @@ class ClientCallbackWriterImpl : public ClientCallbackWriter<Request> {
public:
// always allocated against a call arena, no memory free required
static void operator delete(void* /*ptr*/, std::size_t size) {
CHECK_EQ(size, sizeof(ClientCallbackWriterImpl));
ABSL_CHECK_EQ(size, sizeof(ClientCallbackWriterImpl));
}
// This operator should never be called as the memory should be freed as part
@ -890,7 +890,7 @@ class ClientCallbackWriterImpl : public ClientCallbackWriter<Request> {
// delete to the operator new so that some compilers will not complain (see
// https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
// there are no tests catching the compiler warning.
static void operator delete(void*, void*) { CHECK(false); }
static void operator delete(void*, void*) { ABSL_CHECK(false); }
void StartCall() ABSL_LOCKS_EXCLUDED(start_mu_) override {
// This call initiates two batches, plus any backlog, each with a callback
@ -931,7 +931,7 @@ class ClientCallbackWriterImpl : public ClientCallbackWriter<Request> {
write_ops_.ClientSendClose();
}
// TODO(vjpai): don't assert
CHECK(write_ops_.SendMessagePtr(msg, options).ok());
ABSL_CHECK(write_ops_.SendMessagePtr(msg, options).ok());
callbacks_outstanding_.fetch_add(1, std::memory_order_relaxed);
if (GPR_UNLIKELY(corked_write_needed_)) {
@ -1112,7 +1112,7 @@ class ClientCallbackUnaryImpl final : public ClientCallbackUnary {
public:
// always allocated against a call arena, no memory free required
static void operator delete(void* /*ptr*/, std::size_t size) {
CHECK_EQ(size, sizeof(ClientCallbackUnaryImpl));
ABSL_CHECK_EQ(size, sizeof(ClientCallbackUnaryImpl));
}
// This operator should never be called as the memory should be freed as part
@ -1120,7 +1120,7 @@ class ClientCallbackUnaryImpl final : public ClientCallbackUnary {
// delete to the operator new so that some compilers will not complain (see
// https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
// there are no tests catching the compiler warning.
static void operator delete(void*, void*) { CHECK(false); }
static void operator delete(void*, void*) { ABSL_CHECK(false); }
void StartCall() override {
// This call initiates two batches, each with a callback
@ -1159,7 +1159,7 @@ class ClientCallbackUnaryImpl final : public ClientCallbackUnary {
: context_(context), call_(call), reactor_(reactor) {
this->BindReactor(reactor);
// TODO(vjpai): don't assert
CHECK(start_ops_.SendMessagePtr(request).ok());
ABSL_CHECK(start_ops_.SendMessagePtr(request).ok());
start_ops_.ClientSendClose();
finish_ops_.RecvMessage(response);
finish_ops_.AllowNoMessage();

View File

@ -22,7 +22,7 @@
#include <memory>
#include <vector>
#include "absl/log/check.h"
#include "absl/log/absl_check.h"
#include <grpc/support/log.h>
#include <grpcpp/impl/rpc_method.h>
@ -141,7 +141,7 @@ class ClientRpcInfo {
// Runs interceptor at pos \a pos.
void RunInterceptor(
experimental::InterceptorBatchMethods* interceptor_methods, size_t pos) {
CHECK_LT(pos, interceptors_.size());
ABSL_CHECK_LT(pos, interceptors_.size());
interceptors_[pos]->Intercept(interceptor_methods);
}

View File

@ -19,7 +19,7 @@
#ifndef GRPCPP_SUPPORT_METHOD_HANDLER_H
#define GRPCPP_SUPPORT_METHOD_HANDLER_H
#include "absl/log/check.h"
#include "absl/log/absl_check.h"
#include <grpc/byte_buffer.h>
#include <grpc/support/log.h>
@ -59,7 +59,7 @@ template <class Callable>
template <class ResponseType>
void UnaryRunHandlerHelper(const MethodHandler::HandlerParameter& param,
ResponseType* rsp, grpc::Status& status) {
CHECK(!param.server_context->sent_initial_metadata_);
ABSL_CHECK(!param.server_context->sent_initial_metadata_);
grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata,
grpc::internal::CallOpSendMessage,
grpc::internal::CallOpServerSendStatus>

View File

@ -21,7 +21,7 @@
#include <type_traits>
#include "absl/log/check.h"
#include "absl/log/absl_check.h"
#include "absl/strings/cord.h"
#include <grpc/byte_buffer.h>
@ -76,7 +76,7 @@ class ProtoBufferReader : public grpc::protobuf::io::ZeroCopyInputStream {
if (backup_count_ > 0) {
*data = GRPC_SLICE_START_PTR(*slice_) + GRPC_SLICE_LENGTH(*slice_) -
backup_count_;
CHECK_LE(backup_count_, INT_MAX);
ABSL_CHECK_LE(backup_count_, INT_MAX);
*size = static_cast<int>(backup_count_);
backup_count_ = 0;
return true;
@ -87,7 +87,7 @@ class ProtoBufferReader : public grpc::protobuf::io::ZeroCopyInputStream {
}
*data = GRPC_SLICE_START_PTR(*slice_);
// On win x64, int is only 32bit
CHECK_LE(GRPC_SLICE_LENGTH(*slice_), static_cast<size_t>(INT_MAX));
ABSL_CHECK_LE(GRPC_SLICE_LENGTH(*slice_), static_cast<size_t>(INT_MAX));
byte_count_ += * size = static_cast<int>(GRPC_SLICE_LENGTH(*slice_));
return true;
}
@ -99,7 +99,7 @@ class ProtoBufferReader : public grpc::protobuf::io::ZeroCopyInputStream {
/// bytes that have already been returned by the last call of Next.
/// So do the backup and have that ready for a later Next.
void BackUp(int count) override {
CHECK_LE(count, static_cast<int>(GRPC_SLICE_LENGTH(*slice_)));
ABSL_CHECK_LE(count, static_cast<int>(GRPC_SLICE_LENGTH(*slice_)));
backup_count_ = count;
}
@ -175,7 +175,7 @@ class ProtoBufferReader : public grpc::protobuf::io::ZeroCopyInputStream {
return true;
}
}
CHECK_EQ(count, 0);
ABSL_CHECK_EQ(count, 0);
return true;
}
#endif // GRPC_PROTOBUF_CORD_SUPPORT_ENABLED

View File

@ -21,7 +21,7 @@
#include <type_traits>
#include "absl/log/check.h"
#include "absl/log/absl_check.h"
#include "absl/strings/cord.h"
#include <grpc/byte_buffer.h>
@ -65,7 +65,7 @@ class ProtoBufferWriter : public grpc::protobuf::io::ZeroCopyOutputStream {
total_size_(total_size),
byte_count_(0),
have_backup_(false) {
CHECK(!byte_buffer->Valid());
ABSL_CHECK(!byte_buffer->Valid());
/// Create an empty raw byte buffer and look at its underlying slice buffer
grpc_byte_buffer* bp = grpc_raw_byte_buffer_create(nullptr, 0);
byte_buffer->set_buffer(bp);
@ -82,7 +82,7 @@ class ProtoBufferWriter : public grpc::protobuf::io::ZeroCopyOutputStream {
/// safe for the caller to write from data[0, size - 1].
bool Next(void** data, int* size) override {
// Protobuf should not ask for more memory than total_size_.
CHECK_LT(byte_count_, total_size_);
ABSL_CHECK_LT(byte_count_, total_size_);
// 1. Use the remaining backup slice if we have one
// 2. Otherwise allocate a slice, up to the remaining length needed
// or our maximum allocation size
@ -107,7 +107,7 @@ class ProtoBufferWriter : public grpc::protobuf::io::ZeroCopyOutputStream {
}
*data = GRPC_SLICE_START_PTR(slice_);
// On win x64, int is only 32bit
CHECK(GRPC_SLICE_LENGTH(slice_) <= static_cast<size_t>(INT_MAX));
ABSL_CHECK(GRPC_SLICE_LENGTH(slice_) <= static_cast<size_t>(INT_MAX));
byte_count_ += * size = static_cast<int>(GRPC_SLICE_LENGTH(slice_));
// Using grpc_slice_buffer_add could modify slice_ and merge it with the
// previous slice. Therefore, use grpc_slice_buffer_add_indexed method to
@ -132,7 +132,7 @@ class ProtoBufferWriter : public grpc::protobuf::io::ZeroCopyOutputStream {
/// 2. Split it into the needed (if any) and unneeded part
/// 3. Add the needed part back to the slice buffer
/// 4. Mark that we still have the remaining part (for later use/unref)
CHECK_LE(count, static_cast<int>(GRPC_SLICE_LENGTH(slice_)));
ABSL_CHECK_LE(count, static_cast<int>(GRPC_SLICE_LENGTH(slice_)));
grpc_slice_buffer_pop(slice_buffer_);
if (static_cast<size_t>(count) == GRPC_SLICE_LENGTH(slice_)) {
backup_slice_ = slice_;

View File

@ -22,7 +22,7 @@
#include <atomic>
#include <vector>
#include "absl/log/check.h"
#include "absl/log/absl_check.h"
#include <grpc/support/log.h>
#include <grpcpp/impl/rpc_method.h>
@ -102,7 +102,7 @@ class ServerRpcInfo {
// Runs interceptor at pos \a pos.
void RunInterceptor(
experimental::InterceptorBatchMethods* interceptor_methods, size_t pos) {
CHECK_LT(pos, interceptors_.size());
ABSL_CHECK_LT(pos, interceptors_.size());
interceptors_[pos]->Intercept(interceptor_methods);
}

View File

@ -19,7 +19,7 @@
#ifndef GRPCPP_SUPPORT_SYNC_STREAM_H
#define GRPCPP_SUPPORT_SYNC_STREAM_H
#include "absl/log/check.h"
#include "absl/log/absl_check.h"
#include <grpc/support/log.h>
#include <grpcpp/client_context.h>
@ -186,7 +186,7 @@ class ClientReader final : public ClientReaderInterface<R> {
/// the server will be accessible through the \a ClientContext used to
/// construct this object.
void WaitForInitialMetadata() override {
CHECK(!context_->initial_metadata_received_);
ABSL_CHECK(!context_->initial_metadata_received_);
grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata> ops;
ops.RecvInitialMetadata(context_);
@ -232,7 +232,7 @@ class ClientReader final : public ClientReaderInterface<R> {
grpc::Status status;
ops.ClientRecvStatus(context_, &status);
call_.PerformOps(&ops);
CHECK(cq_.Pluck(&ops));
ABSL_CHECK(cq_.Pluck(&ops));
return status;
}
@ -261,7 +261,7 @@ class ClientReader final : public ClientReaderInterface<R> {
ops.SendInitialMetadata(&context->send_initial_metadata_,
context->initial_metadata_flags());
// TODO(ctiller): don't assert
CHECK(ops.SendMessagePtr(&request).ok());
ABSL_CHECK(ops.SendMessagePtr(&request).ok());
ops.ClientSendClose();
call_.PerformOps(&ops);
cq_.Pluck(&ops);
@ -308,7 +308,7 @@ class ClientWriter : public ClientWriterInterface<W> {
/// Once complete, the initial metadata read from the server will be
/// accessible through the \a ClientContext used to construct this object.
void WaitForInitialMetadata() {
CHECK(!context_->initial_metadata_received_);
ABSL_CHECK(!context_->initial_metadata_received_);
grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata> ops;
ops.RecvInitialMetadata(context_);
@ -366,7 +366,7 @@ class ClientWriter : public ClientWriterInterface<W> {
}
finish_ops_.ClientRecvStatus(context_, &status);
call_.PerformOps(&finish_ops_);
CHECK(cq_.Pluck(&finish_ops_));
ABSL_CHECK(cq_.Pluck(&finish_ops_));
return status;
}
@ -457,7 +457,7 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> {
/// Once complete, the initial metadata read from the server will be
/// accessible through the \a ClientContext used to construct this object.
void WaitForInitialMetadata() override {
CHECK(!context_->initial_metadata_received_);
ABSL_CHECK(!context_->initial_metadata_received_);
grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata> ops;
ops.RecvInitialMetadata(context_);
@ -538,7 +538,7 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> {
grpc::Status status;
ops.ClientRecvStatus(context_, &status);
call_.PerformOps(&ops);
CHECK(cq_.Pluck(&ops));
ABSL_CHECK(cq_.Pluck(&ops));
return status;
}
@ -585,7 +585,7 @@ class ServerReader final : public ServerReaderInterface<R> {
/// for semantics. Note that initial metadata will be affected by the
/// \a ServerContext associated with this call.
void SendInitialMetadata() override {
CHECK(!ctx_->sent_initial_metadata_);
ABSL_CHECK(!ctx_->sent_initial_metadata_);
grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata> ops;
ops.SendInitialMetadata(&ctx_->initial_metadata_,
@ -642,7 +642,7 @@ class ServerWriter final : public ServerWriterInterface<W> {
/// Note that initial metadata will be affected by the
/// \a ServerContext associated with this call.
void SendInitialMetadata() override {
CHECK(!ctx_->sent_initial_metadata_);
ABSL_CHECK(!ctx_->sent_initial_metadata_);
grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata> ops;
ops.SendInitialMetadata(&ctx_->initial_metadata_,
@ -715,7 +715,7 @@ class ServerReaderWriterBody final {
: call_(call), ctx_(ctx) {}
void SendInitialMetadata() {
CHECK(!ctx_->sent_initial_metadata_);
ABSL_CHECK(!ctx_->sent_initial_metadata_);
grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata> ops;
ops.SendInitialMetadata(&ctx_->initial_metadata_,

View File

@ -20,8 +20,8 @@
#define GRPC_CPP_VERSION_MAJOR 1
#define GRPC_CPP_VERSION_MINOR 65
#define GRPC_CPP_VERSION_PATCH 0
#define GRPC_CPP_VERSION_TAG "dev"
#define GRPC_CPP_VERSION_STRING "1.65.0-dev"
#define GRPC_CPP_VERSION_PATCH 4
#define GRPC_CPP_VERSION_TAG ""
#define GRPC_CPP_VERSION_STRING "1.65.4"
#endif // GRPCPP_VERSION_INFO_H

View File

@ -10,3 +10,4 @@ set -ex
brew install coreutils
brew install pyyaml
pip3 install pyyaml || true

View File

@ -28,10 +28,10 @@
#include <grpc/support/port_platform.h>
#include "src/core/channelz/channelz.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/slice/slice.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/util/string.h"
namespace grpc_core {
namespace channelz {

View File

@ -30,7 +30,7 @@
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/json/json.h"
#include "src/core/util/json/json.h"
namespace grpc_core {
namespace channelz {

View File

@ -37,12 +37,12 @@
#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/resolved_address.h"
#include "src/core/lib/json/json_writer.h"
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/uri/uri_parser.h"
#include "src/core/util/json/json_writer.h"
#include "src/core/util/string.h"
#include "src/core/util/useful.h"
namespace grpc_core {
namespace channelz {

View File

@ -38,13 +38,13 @@
#include <grpc/support/port_platform.h>
#include "src/core/channelz/channel_trace.h"
#include "src/core/lib/gpr/time_precise.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/per_cpu.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/json/json.h"
#include "src/core/util/json/json.h"
#include "src/core/util/time_precise.h"
#include "src/core/util/useful.h"
// Channel arg key for channelz node.
#define GRPC_ARG_CHANNELZ_CHANNEL_NODE "grpc.internal.channelz_channel_node"
@ -72,7 +72,7 @@ class ListenSocketNode;
namespace testing {
class CallCountingHelperPeer;
class ChannelNodePeer;
class SubchannelNodePeer;
} // namespace testing
// base class for all channelz entities
@ -228,9 +228,6 @@ class ChannelNode final : public BaseNode {
void RemoveChildSubchannel(intptr_t child_uuid);
private:
// Allows the channel trace test to access trace_.
friend class testing::ChannelNodePeer;
void PopulateChildRefs(Json::Object* json);
std::string target_;
@ -277,6 +274,9 @@ class SubchannelNode final : public BaseNode {
void RecordCallSucceeded() { call_counter_.RecordCallSucceeded(); }
private:
// Allows the channel trace test to access trace_.
friend class testing::SubchannelNodePeer;
std::atomic<grpc_connectivity_state> connectivity_state_{GRPC_CHANNEL_IDLE};
Mutex socket_mu_;
RefCountedPtr<SocketNode> child_socket_ ABSL_GUARDED_BY(socket_mu_);

View File

@ -25,6 +25,7 @@
#include <vector>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include <grpc/grpc.h>
#include <grpc/support/json.h>
@ -35,8 +36,8 @@
#include "src/core/channelz/channelz.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/json/json.h"
#include "src/core/lib/json/json_writer.h"
#include "src/core/util/json/json.h"
#include "src/core/util/json/json_writer.h"
namespace grpc_core {
namespace channelz {
@ -171,7 +172,7 @@ void ChannelzRegistry::InternalLogAllEntities() {
}
for (size_t i = 0; i < nodes.size(); ++i) {
std::string json = nodes[i]->RenderJsonString();
gpr_log(GPR_INFO, "%s", json.c_str());
LOG(INFO) << json;
}
}

View File

@ -22,10 +22,10 @@
#include <inttypes.h>
#include "absl/log/log.h"
#include "absl/status/status.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include "src/core/lib/config/config_vars.h"
@ -66,10 +66,9 @@ void grpc_client_channel_global_init_backup_polling() {
int32_t poll_interval_ms =
grpc_core::ConfigVars::Get().ClientChannelBackupPollIntervalMs();
if (poll_interval_ms < 0) {
gpr_log(GPR_ERROR,
"Invalid GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS: %d, "
"default value %" PRId64 " will be used.",
poll_interval_ms, g_poll_interval.millis());
LOG(ERROR) << "Invalid GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS: "
<< poll_interval_ms << ", default value "
<< g_poll_interval.millis() << " will be used.";
} else {
g_poll_interval = grpc_core::Duration::Milliseconds(poll_interval_ms);
}

File diff suppressed because it is too large Load Diff

View File

@ -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<RefCountedPtr<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 Orphaned() 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;
void StartCall(UnstartedCallHandler unstarted_handler) override;
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

File diff suppressed because it is too large Load Diff

View File

@ -43,12 +43,9 @@
#include "src/core/client_channel/dynamic_filters.h"
#include "src/core/client_channel/subchannel.h"
#include "src/core/client_channel/subchannel_pool_interface.h"
#include "src/core/lib/channel/call_tracer.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_fwd.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/context.h"
#include "src/core/lib/gpr/time_precise.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"
@ -60,8 +57,6 @@
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/iomgr_fwd.h"
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/promise/activity.h"
#include "src/core/lib/promise/arena_promise.h"
#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/slice/slice.h"
#include "src/core/lib/transport/connectivity_state.h"
@ -71,6 +66,8 @@
#include "src/core/load_balancing/lb_policy.h"
#include "src/core/resolver/resolver.h"
#include "src/core/service_config/service_config.h"
#include "src/core/telemetry/call_tracer.h"
#include "src/core/util/time_precise.h"
//
// Client channel filter
@ -86,9 +83,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
@ -103,20 +97,16 @@ namespace grpc_core {
class ClientChannelFilter final {
public:
static const grpc_channel_filter kFilterVtableWithPromises;
static const grpc_channel_filter kFilterVtableWithoutPromises;
static const grpc_channel_filter kFilter;
class LoadBalancedCall;
class FilterBasedLoadBalancedCall;
class PromiseBasedLoadBalancedCall;
// 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 ArenaPromise<ServerMetadataHandle> MakeCallPromise(
grpc_channel_element* elem, CallArgs call_args,
NextPromiseFactory next_promise_factory);
static absl::string_view ChannelArgName() {
return "grpc.internal.client_channel_filter";
}
grpc_connectivity_state CheckConnectivityState(bool try_to_connect);
@ -162,20 +152,9 @@ class ClientChannelFilter final {
grpc_closure* on_call_destruction_complete,
absl::AnyInvocable<void()> on_commit, bool is_transparent_retry);
ArenaPromise<ServerMetadataHandle> CreateLoadBalancedCallPromise(
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;
class PromiseBasedCallData;
class ResolverResultHandler;
class SubchannelWrapper;
class ClientChannelControlHelper;
@ -378,8 +357,7 @@ class ClientChannelFilter final {
class ClientChannelFilter::LoadBalancedCall
: public InternallyRefCounted<LoadBalancedCall, UnrefCallDtor> {
public:
LoadBalancedCall(ClientChannelFilter* chand,
grpc_call_context_element* call_context,
LoadBalancedCall(ClientChannelFilter* chand, Arena* arena,
absl::AnyInvocable<void()> on_commit,
bool is_transparent_retry);
~LoadBalancedCall() override;
@ -398,8 +376,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 +386,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_);
@ -433,14 +412,11 @@ class ClientChannelFilter::LoadBalancedCall
void RecordLatency();
grpc_call_context_element* call_context() const { return call_context_; }
private:
class LbCallState;
class Metadata;
class BackendMetricAccessor;
virtual Arena* arena() const = 0;
virtual grpc_polling_entity* pollent() = 0;
virtual grpc_metadata_batch* send_initial_metadata() const = 0;
@ -466,7 +442,7 @@ class ClientChannelFilter::LoadBalancedCall
const BackendMetricData* backend_metric_data_ = nullptr;
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 +478,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 +532,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_;
@ -594,33 +568,6 @@ class ClientChannelFilter::FilterBasedLoadBalancedCall final
grpc_transport_stream_op_batch* pending_batches_[MAX_PENDING_BATCHES] = {};
};
class ClientChannelFilter::PromiseBasedLoadBalancedCall final
: public ClientChannelFilter::LoadBalancedCall {
public:
PromiseBasedLoadBalancedCall(ClientChannelFilter* chand,
absl::AnyInvocable<void()> on_commit,
bool is_transparent_retry);
ArenaPromise<ServerMetadataHandle> MakeCallPromise(
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;
void RetryPickLocked() override;
void OnAddToQueueLocked() override
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannelFilter::lb_mu_);
grpc_polling_entity pollent_;
ClientMetadataHandle client_initial_metadata_;
Waker waker_;
bool was_queued_ = false;
Slice peer_string_;
};
} // namespace grpc_core
#endif // GRPC_SRC_CORE_CLIENT_CHANNEL_CLIENT_CHANNEL_FILTER_H

View File

@ -26,12 +26,12 @@
#include <grpc/support/log.h>
#include "src/core/lib/channel/call_tracer.h"
#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"
//
// This file contains internal interfaces used to allow various plugins
@ -57,9 +57,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 +74,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

View File

@ -31,24 +31,11 @@
namespace grpc_core {
namespace {
bool IsEverythingBelowClientChannelPromiseSafe(const ChannelArgs& args) {
return !args.GetBool(GRPC_ARG_ENABLE_RETRIES).value_or(true);
}
} // namespace
void BuildClientChannelConfiguration(CoreConfiguration::Builder* builder) {
internal::ClientChannelServiceConfigParser::Register(builder);
internal::RetryServiceConfigParser::Register(builder);
builder->channel_init()
->RegisterFilter(GRPC_CLIENT_CHANNEL,
&ClientChannelFilter::kFilterVtableWithPromises)
.If(IsEverythingBelowClientChannelPromiseSafe)
.Terminal();
builder->channel_init()
->RegisterFilter(GRPC_CLIENT_CHANNEL,
&ClientChannelFilter::kFilterVtableWithoutPromises)
.IfNot(IsEverythingBelowClientChannelPromiseSafe)
->RegisterV2Filter<ClientChannelFilter>(GRPC_CLIENT_CHANNEL)
.Terminal();
}

View File

@ -32,11 +32,11 @@
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/gprpp/validation_errors.h"
#include "src/core/lib/json/json.h"
#include "src/core/lib/json/json_args.h"
#include "src/core/lib/json/json_object_loader.h"
#include "src/core/load_balancing/lb_policy.h"
#include "src/core/service_config/service_config_parser.h"
#include "src/core/util/json/json.h"
#include "src/core/util/json/json_args.h"
#include "src/core/util/json/json_object_loader.h"
namespace grpc_core {
namespace internal {

View File

@ -19,7 +19,7 @@
#include "src/core/client_channel/config_selector.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/util/useful.h"
namespace grpc_core {

View File

@ -33,13 +33,13 @@
#include "src/core/client_channel/client_channel_internal.h"
#include "src/core/lib/channel/channel_fwd.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/slice/slice.h"
#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/service_config/service_config.h"
#include "src/core/util/useful.h"
// Channel arg key for ConfigSelector.
#define GRPC_ARG_CONFIG_SELECTOR "grpc.internal.config_selector"

View File

@ -24,6 +24,7 @@
#include <utility>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/status/statusor.h"
#include <grpc/support/log.h>
@ -32,10 +33,10 @@
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/channel_stack_builder_impl.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/alloc.h"
#include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/surface/channel_stack_type.h"
#include "src/core/lib/surface/lame_client.h"
#include "src/core/util/alloc.h"
// Conversion between call and call stack.
#define CALL_TO_CALL_STACK(call) \
@ -58,7 +59,6 @@ DynamicFilters::Call::Call(Args args, grpc_error_handle* error)
const grpc_call_element_args call_args = {
call_stack, // call_stack
nullptr, // server_transport_data
args.context, // context
args.path, // path
args.start_time, // start_time
args.deadline, // deadline
@ -68,7 +68,7 @@ DynamicFilters::Call::Call(Args args, grpc_error_handle* error)
*error = grpc_call_stack_init(channel_stack_->channel_stack_.get(), 1,
Destroy, this, &call_args);
if (GPR_UNLIKELY(!error->ok())) {
gpr_log(GPR_ERROR, "error: %s", StatusToString(*error).c_str());
LOG(ERROR) << "error: " << StatusToString(*error);
return;
}
grpc_call_stack_set_pollset_or_pollset_set(call_stack, args.pollent);

View File

@ -27,8 +27,6 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_fwd.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/context.h"
#include "src/core/lib/gpr/time_precise.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
@ -39,6 +37,7 @@
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/transport/transport.h"
#include "src/core/util/time_precise.h"
namespace grpc_core {
@ -54,7 +53,6 @@ class DynamicFilters final : public RefCounted<DynamicFilters> {
gpr_cycle_counter start_time;
Timestamp deadline;
Arena* arena;
grpc_call_context_element* context;
CallCombiner* call_combiner;
};

View File

@ -0,0 +1,336 @@
// 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/config/core_configuration.h"
#include "src/core/lib/promise/loop.h"
#include "src/core/telemetry/call_tracer.h"
namespace grpc_core {
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>>> {
GRPC_TRACE_LOG(client_channel_lb_call, INFO)
<< "client_channel: " << GetContext<Activity>()->DebugTag()
<< " pick succeeded: subchannel="
<< 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) {
GRPC_TRACE_LOG(client_channel_lb_call, INFO)
<< "client_channel: " << GetContext<Activity>()->DebugTag()
<< " returned by LB picker has no connected subchannel; queueing "
"pick";
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*/) {
GRPC_TRACE_LOG(client_channel_lb_call, INFO)
<< "client_channel: " << GetContext<Activity>()->DebugTag()
<< " pick queued";
return Continue{};
},
// FailPick
[&](LoadBalancingPolicy::PickResult::Fail* fail_pick)
-> LoopCtl<absl::StatusOr<RefCountedPtr<UnstartedCallDestination>>> {
GRPC_TRACE_LOG(client_channel_lb_call, INFO)
<< "client_channel: " << GetContext<Activity>()->DebugTag()
<< " pick failed: " << fail_pick->status;
// 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>>> {
GRPC_TRACE_LOG(client_channel_lb_call, INFO)
<< "client_channel: " << GetContext<Activity>()->DebugTag()
<< " pick dropped: " << drop_pick->status;
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 {
CHECK_NE(picker.get(), nullptr);
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();
});
});
}
void RegisterLoadBalancedCallDestination(CoreConfiguration::Builder* builder) {
class LoadBalancedCallDestinationFactory final
: public ClientChannel::CallDestinationFactory {
public:
RefCountedPtr<UnstartedCallDestination> CreateCallDestination(
ClientChannel::PickerObservable picker) override {
return MakeRefCounted<LoadBalancedCallDestination>(std::move(picker));
}
};
builder->channel_args_preconditioning()->RegisterStage([](ChannelArgs args) {
return args.SetObject(
NoDestructSingleton<LoadBalancedCallDestinationFactory>::Get());
});
}
} // namespace grpc_core

View File

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

View File

@ -89,8 +89,6 @@ using grpc_core::internal::RetryMethodConfig;
using grpc_core::internal::RetryServiceConfigParser;
using grpc_event_engine::experimental::EventEngine;
grpc_core::TraceFlag grpc_retry_trace(false, "retry");
namespace grpc_core {
//
@ -130,11 +128,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_));
@ -142,8 +137,6 @@ const RetryMethodConfig* RetryFilter::GetRetryPolicy(
const grpc_channel_filter RetryFilter::kVtable = {
RetryFilter::LegacyCallData::StartTransportStreamOpBatch,
nullptr,
/* init_call: */ nullptr,
RetryFilter::StartTransportOp,
sizeof(RetryFilter::LegacyCallData),
RetryFilter::LegacyCallData::Init,

View File

@ -38,14 +38,10 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_fwd.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/context.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/transport/transport.h"
extern grpc_core::TraceFlag grpc_retry_trace;
#include "src/core/util/useful.h"
namespace grpc_core {
@ -66,8 +62,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_;

View File

@ -32,10 +32,8 @@
#include "src/core/client_channel/retry_throttle.h"
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/context.h"
#include "src/core/lib/channel/status_util.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/construct_destruct.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/orphanable.h"
@ -54,6 +52,7 @@
#include "src/core/lib/transport/error_utils.h"
#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/transport/transport.h"
#include "src/core/util/useful.h"
namespace grpc_core {
@ -117,10 +116,8 @@ class RetryFilter::LegacyCallData::CallStackDestructionBarrier final
RetryFilter::LegacyCallData::CallAttempt::CallAttempt(
RetryFilter::LegacyCallData* calld, bool is_transparent_retry)
: RefCounted(GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace) ? "CallAttempt"
: nullptr),
: RefCounted(GRPC_TRACE_FLAG_ENABLED(retry) ? "CallAttempt" : nullptr),
calld_(calld),
batch_payload_(calld->call_context_),
started_send_initial_metadata_(false),
completed_send_initial_metadata_(false),
started_send_trailing_metadata_(false),
@ -137,14 +134,13 @@ 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();
}
},
is_transparent_retry);
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p attempt=%p: created attempt, lb_call=%p",
calld->chand_, calld, this, lb_call_.get());
@ -154,7 +150,7 @@ RetryFilter::LegacyCallData::CallAttempt::CallAttempt(
calld->retry_policy_->per_attempt_recv_timeout().has_value()) {
const Duration per_attempt_recv_timeout =
*calld->retry_policy_->per_attempt_recv_timeout();
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p attempt=%p: per-attempt timeout in %" PRId64
" ms",
@ -173,7 +169,7 @@ RetryFilter::LegacyCallData::CallAttempt::CallAttempt(
}
RetryFilter::LegacyCallData::CallAttempt::~CallAttempt() {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: destroying call attempt",
calld_->chand_, calld_, this);
}
@ -240,7 +236,7 @@ void RetryFilter::LegacyCallData::CallAttempt::MaybeSwitchToFastPath() {
// yet seen that op from the surface, we can't switch yet.
if (recv_trailing_metadata_internal_batch_ != nullptr) return;
// Switch to fast path.
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p attempt=%p: retry state no longer needed; "
"moving LB call to parent and unreffing the call attempt",
@ -259,7 +255,7 @@ RetryFilter::LegacyCallData::CallAttempt::MaybeCreateBatchForReplay() {
// send_initial_metadata.
if (calld_->seen_send_initial_metadata_ && !started_send_initial_metadata_ &&
!calld_->pending_send_initial_metadata_) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p attempt=%p: replaying previously completed "
"send_initial_metadata op",
@ -273,7 +269,7 @@ RetryFilter::LegacyCallData::CallAttempt::MaybeCreateBatchForReplay() {
if (started_send_message_count_ < calld_->send_messages_.size() &&
started_send_message_count_ == completed_send_message_count_ &&
!calld_->pending_send_message_) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p attempt=%p: replaying previously completed "
"send_message op",
@ -292,7 +288,7 @@ RetryFilter::LegacyCallData::CallAttempt::MaybeCreateBatchForReplay() {
started_send_message_count_ == calld_->send_messages_.size() &&
!started_send_trailing_metadata_ &&
!calld_->pending_send_trailing_metadata_) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p attempt=%p: replaying previously completed "
"send_trailing_metadata op",
@ -323,7 +319,7 @@ void StartBatchInCallCombiner(void* arg, grpc_error_handle /*ignored*/) {
void RetryFilter::LegacyCallData::CallAttempt::AddClosureForBatch(
grpc_transport_stream_op_batch* batch, const char* reason,
CallCombinerClosureList* closures) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: adding batch (%s): %s",
calld_->chand_, calld_, this, reason,
grpc_transport_stream_op_batch_string(batch, false).c_str());
@ -336,7 +332,7 @@ void RetryFilter::LegacyCallData::CallAttempt::AddClosureForBatch(
void RetryFilter::LegacyCallData::CallAttempt::
AddBatchForInternalRecvTrailingMetadata(CallCombinerClosureList* closures) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p attempt=%p: call failed but "
"recv_trailing_metadata not started; starting it internally",
@ -526,7 +522,7 @@ void RetryFilter::LegacyCallData::CallAttempt::AddRetriableBatches(
}
void RetryFilter::LegacyCallData::CallAttempt::StartRetriableBatches() {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p attempt=%p: constructing retriable batches",
calld_->chand_, calld_, this);
@ -536,7 +532,7 @@ void RetryFilter::LegacyCallData::CallAttempt::StartRetriableBatches() {
AddRetriableBatches(&closures);
// Note: This will yield the call combiner.
// Start batches on LB call.
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p attempt=%p: starting %" PRIuPTR
" retriable batches on lb_call=%p",
@ -564,7 +560,7 @@ bool RetryFilter::LegacyCallData::CallAttempt::ShouldRetry(
if (calld_->retry_throttle_data_ != nullptr) {
calld_->retry_throttle_data_->RecordSuccess();
}
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: call succeeded",
calld_->chand_, calld_, this);
}
@ -572,7 +568,7 @@ bool RetryFilter::LegacyCallData::CallAttempt::ShouldRetry(
}
// Status is not OK. Check whether the status is retryable.
if (!calld_->retry_policy_->retryable_status_codes().Contains(*status)) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p attempt=%p: status %s not configured as "
"retryable",
@ -591,7 +587,7 @@ bool RetryFilter::LegacyCallData::CallAttempt::ShouldRetry(
// checks, so that we don't fail to record failures due to other factors.
if (calld_->retry_throttle_data_ != nullptr &&
!calld_->retry_throttle_data_->RecordFailure()) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: retries throttled",
calld_->chand_, calld_, this);
}
@ -599,7 +595,7 @@ bool RetryFilter::LegacyCallData::CallAttempt::ShouldRetry(
}
// Check whether the call is committed.
if (calld_->retry_committed_) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p attempt=%p: retries already committed",
calld_->chand_, calld_, this);
@ -610,7 +606,7 @@ bool RetryFilter::LegacyCallData::CallAttempt::ShouldRetry(
++calld_->num_attempts_completed_;
if (calld_->num_attempts_completed_ >=
calld_->retry_policy_->max_attempts()) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(
GPR_INFO, "chand=%p calld=%p attempt=%p: exceeded %d retry attempts",
calld_->chand_, calld_, this, calld_->retry_policy_->max_attempts());
@ -620,7 +616,7 @@ bool RetryFilter::LegacyCallData::CallAttempt::ShouldRetry(
// Check server push-back.
if (server_pushback.has_value()) {
if (*server_pushback < Duration::Zero()) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p attempt=%p: not retrying due to server "
"push-back",
@ -628,7 +624,7 @@ bool RetryFilter::LegacyCallData::CallAttempt::ShouldRetry(
}
return false;
} else {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(
GPR_INFO,
"chand=%p calld=%p attempt=%p: server push-back: retry in %" PRIu64
@ -678,7 +674,7 @@ void RetryFilter::LegacyCallData::CallAttempt::OnPerAttemptRecvTimerLocked(
void* arg, grpc_error_handle error) {
auto* call_attempt = static_cast<CallAttempt*>(arg);
auto* calld = call_attempt->calld_;
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p attempt=%p: perAttemptRecvTimeout timer fired: "
"error=%s, per_attempt_recv_timer_handle_.has_value()=%d",
@ -717,7 +713,7 @@ void RetryFilter::LegacyCallData::CallAttempt::OnPerAttemptRecvTimerLocked(
void RetryFilter::LegacyCallData::CallAttempt::
MaybeCancelPerAttemptRecvTimer() {
if (per_attempt_recv_timer_handle_.has_value()) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p attempt=%p: cancelling "
"perAttemptRecvTimeout timer",
@ -738,11 +734,10 @@ void RetryFilter::LegacyCallData::CallAttempt::
RetryFilter::LegacyCallData::CallAttempt::BatchData::BatchData(
RefCountedPtr<CallAttempt> attempt, int refcount, bool set_on_complete)
: RefCounted(
GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace) ? "BatchData" : nullptr,
refcount),
: RefCounted(GRPC_TRACE_FLAG_ENABLED(retry) ? "BatchData" : nullptr,
refcount),
call_attempt_(attempt.release()) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: creating batch %p",
call_attempt_->calld_->chand_, call_attempt_->calld_, call_attempt_,
this);
@ -763,7 +758,7 @@ RetryFilter::LegacyCallData::CallAttempt::BatchData::BatchData(
}
RetryFilter::LegacyCallData::CallAttempt::BatchData::~BatchData() {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: destroying batch %p",
call_attempt_->calld_->chand_, call_attempt_->calld_, call_attempt_,
this);
@ -836,7 +831,7 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::
RefCountedPtr<BatchData> batch_data(static_cast<BatchData*>(arg));
CallAttempt* call_attempt = batch_data->call_attempt_;
RetryFilter::LegacyCallData* calld = call_attempt->calld_;
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p attempt=%p batch_data=%p: "
"got recv_initial_metadata_ready, error=%s",
@ -863,7 +858,7 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::
if (GPR_UNLIKELY(
(call_attempt->trailing_metadata_available_ || !error.ok()) &&
!call_attempt->completed_recv_trailing_metadata_)) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p attempt=%p: deferring "
"recv_initial_metadata_ready (Trailers-Only)",
@ -935,7 +930,7 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::RecvMessageReady(
RefCountedPtr<BatchData> batch_data(static_cast<BatchData*>(arg));
CallAttempt* call_attempt = batch_data->call_attempt_;
RetryFilter::LegacyCallData* calld = call_attempt->calld_;
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p attempt=%p batch_data=%p: "
"got recv_message_ready, error=%s",
@ -965,7 +960,7 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::RecvMessageReady(
if (GPR_UNLIKELY(
(!call_attempt->recv_message_.has_value() || !error.ok()) &&
!call_attempt->completed_recv_trailing_metadata_)) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p attempt=%p: deferring recv_message_ready "
"(nullptr message and recv_trailing_metadata pending)",
@ -1129,7 +1124,7 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::
RefCountedPtr<BatchData> batch_data(static_cast<BatchData*>(arg));
CallAttempt* call_attempt = batch_data->call_attempt_;
RetryFilter::LegacyCallData* calld = call_attempt->calld_;
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p attempt=%p batch_data=%p: "
"got recv_trailing_metadata_ready, error=%s",
@ -1156,7 +1151,7 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::
batch_data->batch_.payload->recv_trailing_metadata.recv_trailing_metadata;
GetCallStatus(calld->deadline_, md_batch, error, &status, &server_pushback,
&is_lb_drop, &stream_network_state);
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p attempt=%p: call finished, status=%s "
"server_pushback=%s is_lb_drop=%d stream_network_state=%s",
@ -1277,7 +1272,7 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::
}
}
if (have_pending_send_ops) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p attempt=%p: starting next batch for pending "
"send op(s)",
@ -1292,7 +1287,7 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::OnComplete(
RefCountedPtr<BatchData> batch_data(static_cast<BatchData*>(arg));
CallAttempt* call_attempt = batch_data->call_attempt_;
RetryFilter::LegacyCallData* calld = call_attempt->calld_;
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p attempt=%p batch_data=%p: "
"got on_complete, error=%s, batch=%s",
@ -1314,7 +1309,7 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::OnComplete(
// recv_trailing_metadata comes back.
if (GPR_UNLIKELY(!calld->retry_committed_ && !error.ok() &&
!call_attempt->completed_recv_trailing_metadata_)) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: deferring on_complete",
calld->chand_, calld, call_attempt);
}
@ -1368,7 +1363,7 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::OnCompleteForCancelOp(
RefCountedPtr<BatchData> batch_data(static_cast<BatchData*>(arg));
CallAttempt* call_attempt = batch_data->call_attempt_;
RetryFilter::LegacyCallData* calld = call_attempt->calld_;
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p attempt=%p batch_data=%p: "
"got on_complete for cancel_stream batch, error=%s, batch=%s",
@ -1412,7 +1407,7 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::
void RetryFilter::LegacyCallData::CallAttempt::BatchData::
AddRetriableSendMessageOp() {
auto* calld = call_attempt_->calld_;
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(
GPR_INFO,
"chand=%p calld=%p attempt=%p: starting calld->send_messages[%" PRIuPTR
@ -1501,7 +1496,7 @@ grpc_error_handle RetryFilter::LegacyCallData::Init(
grpc_call_element* elem, const grpc_call_element_args* args) {
auto* chand = static_cast<RetryFilter*>(elem->channel_data);
new (elem->call_data) RetryFilter::LegacyCallData(chand, *args);
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: created call", chand,
elem->call_data);
}
@ -1545,7 +1540,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
@ -1563,7 +1558,6 @@ RetryFilter::LegacyCallData::LegacyCallData(RetryFilter* chand,
arena_(args.arena),
owning_call_(args.call_stack),
call_combiner_(args.call_combiner),
call_context_(args.context),
call_stack_destruction_barrier_(
arena_->New<CallStackDestructionBarrier>()),
pending_send_initial_metadata_(false),
@ -1584,8 +1578,7 @@ RetryFilter::LegacyCallData::~LegacyCallData() {
void RetryFilter::LegacyCallData::StartTransportStreamOpBatch(
grpc_transport_stream_op_batch* batch) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace) &&
!GRPC_TRACE_FLAG_ENABLED(grpc_trace_channel)) {
if (GRPC_TRACE_FLAG_ENABLED(retry) && !GRPC_TRACE_FLAG_ENABLED(channel)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: batch started from surface: %s",
chand_, this,
grpc_transport_stream_op_batch_string(batch, false).c_str());
@ -1608,7 +1601,7 @@ void RetryFilter::LegacyCallData::StartTransportStreamOpBatch(
if (GPR_UNLIKELY(batch->cancel_stream)) {
// Save cancel_error in case subsequent batches are started.
cancelled_from_surface_ = batch->payload->cancel_stream.cancel_error;
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: cancelled from surface: %s", chand_,
this, StatusToString(cancelled_from_surface_).c_str());
}
@ -1631,7 +1624,7 @@ void RetryFilter::LegacyCallData::StartTransportStreamOpBatch(
}
// Cancel retry timer if needed.
if (retry_timer_handle_.has_value()) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: cancelling retry timer", chand_,
this);
}
@ -1677,7 +1670,7 @@ void RetryFilter::LegacyCallData::StartTransportStreamOpBatch(
if (!retry_codepath_started_ && retry_committed_ &&
(retry_policy_ == nullptr ||
!retry_policy_->per_attempt_recv_timeout().has_value())) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p: retry committed before first attempt; "
"creating LB call",
@ -1685,8 +1678,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);
@ -1696,7 +1689,7 @@ void RetryFilter::LegacyCallData::StartTransportStreamOpBatch(
// Otherwise, create a call attempt.
// The attempt will automatically start any necessary replays or
// pending batches.
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: creating call attempt", chand_,
this);
}
@ -1705,7 +1698,7 @@ void RetryFilter::LegacyCallData::StartTransportStreamOpBatch(
return;
}
// Send batches to call attempt.
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: starting batch on attempt=%p", chand_,
this, call_attempt_.get());
}
@ -1715,9 +1708,9 @@ void RetryFilter::LegacyCallData::StartTransportStreamOpBatch(
OrphanablePtr<ClientChannelFilter::FilterBasedLoadBalancedCall>
RetryFilter::LegacyCallData::CreateLoadBalancedCall(
absl::AnyInvocable<void()> on_commit, bool is_transparent_retry) {
grpc_call_element_args args = {owning_call_, nullptr, call_context_,
path_, /*start_time=*/0, deadline_,
arena_, call_combiner_};
grpc_call_element_args args = {owning_call_, nullptr, path_,
/*start_time=*/0, deadline_, arena_,
call_combiner_};
return chand_->client_channel()->CreateLoadBalancedCall(
args, pollent_,
// This callback holds a ref to the CallStackDestructionBarrier
@ -1763,7 +1756,7 @@ void RetryFilter::LegacyCallData::MaybeCacheSendOpsForBatch(
}
void RetryFilter::LegacyCallData::FreeCachedSendInitialMetadata() {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: destroying send_initial_metadata",
chand_, this);
}
@ -1772,7 +1765,7 @@ void RetryFilter::LegacyCallData::FreeCachedSendInitialMetadata() {
void RetryFilter::LegacyCallData::FreeCachedSendMessage(size_t idx) {
if (send_messages_[idx].slices != nullptr) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p: destroying send_messages[%" PRIuPTR "]",
chand_, this, idx);
@ -1782,7 +1775,7 @@ void RetryFilter::LegacyCallData::FreeCachedSendMessage(size_t idx) {
}
void RetryFilter::LegacyCallData::FreeCachedSendTrailingMetadata() {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: destroying send_trailing_metadata",
chand_, this);
}
@ -1821,7 +1814,7 @@ RetryFilter::LegacyCallData::PendingBatch*
RetryFilter::LegacyCallData::PendingBatchesAdd(
grpc_transport_stream_op_batch* batch) {
const size_t idx = GetBatchIndex(batch);
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p: adding pending batch at index %" PRIuPTR,
chand_, this, idx);
@ -1852,7 +1845,7 @@ RetryFilter::LegacyCallData::PendingBatchesAdd(
// ops have already been sent, and we commit to that attempt.
if (GPR_UNLIKELY(bytes_buffered_for_retry_ >
chand_->per_rpc_retry_buffer_size())) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p: exceeded retry buffer size, committing",
chand_, this);
@ -1889,7 +1882,7 @@ void RetryFilter::LegacyCallData::MaybeClearPendingBatch(
(!batch->recv_trailing_metadata ||
batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready ==
nullptr)) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: clearing pending batch", chand_,
this);
}
@ -1912,7 +1905,7 @@ void RetryFilter::LegacyCallData::FailPendingBatchInCallCombiner(
// This is called via the call combiner, so access to calld is synchronized.
void RetryFilter::LegacyCallData::PendingBatchesFail(grpc_error_handle error) {
CHECK(!error.ok());
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
size_t num_batches = 0;
for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
if (pending_batches_[i].batch != nullptr) ++num_batches;
@ -1946,7 +1939,7 @@ RetryFilter::LegacyCallData::PendingBatchFind(const char* log_message,
PendingBatch* pending = &pending_batches_[i];
grpc_transport_stream_op_batch* batch = pending->batch;
if (batch != nullptr && predicate(batch)) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p: %s pending batch at index %" PRIuPTR,
chand_, this, log_message, i);
@ -1964,7 +1957,7 @@ RetryFilter::LegacyCallData::PendingBatchFind(const char* log_message,
void RetryFilter::LegacyCallData::RetryCommit(CallAttempt* call_attempt) {
if (retry_committed_) return;
retry_committed_ = true;
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: committing retries", chand_, this);
}
if (call_attempt != nullptr) {
@ -1976,8 +1969,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.
@ -1998,7 +1991,7 @@ void RetryFilter::LegacyCallData::StartRetryTimer(
} else {
next_attempt_timeout = retry_backoff_.NextAttemptTime() - Timestamp::Now();
}
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p: retrying failed call in %" PRId64 " ms", chand_,
this, next_attempt_timeout.millis());
@ -2031,7 +2024,7 @@ void RetryFilter::LegacyCallData::OnRetryTimerLocked(
void RetryFilter::LegacyCallData::AddClosureToStartTransparentRetry(
CallCombinerClosureList* closures) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(retry)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: scheduling transparent retry", chand_,
this);
}

View File

@ -37,7 +37,6 @@
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/channel/channel_fwd.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/context.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted.h"
@ -380,7 +379,6 @@ class RetryFilter::LegacyCallData final {
Arena* arena_;
grpc_call_stack* owning_call_;
CallCombiner* call_combiner_;
grpc_call_context_element* call_context_;
grpc_error_handle cancelled_from_surface_;

View File

@ -23,6 +23,7 @@
#include <utility>
#include <vector>
#include "absl/log/log.h"
#include "absl/strings/numbers.h"
#include "absl/strings/str_cat.h"
#include "absl/types/optional.h"
@ -30,12 +31,11 @@
#include <grpc/impl/channel_arg_names.h>
#include <grpc/status.h>
#include <grpc/support/json.h>
#include <grpc/support/log.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/status_util.h"
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/json/json_channel_args.h"
#include "src/core/util/json/json_channel_args.h"
// As per the retry design, we do not allow more than 5 retry attempts.
#define MAX_MAX_RETRY_ATTEMPTS 5
@ -142,9 +142,8 @@ void RetryMethodConfig::JsonPostLoad(const Json& json, const JsonArgs& args,
if (max_attempts_ <= 1) {
errors->AddError("must be at least 2");
} else if (max_attempts_ > MAX_MAX_RETRY_ATTEMPTS) {
gpr_log(GPR_ERROR,
"service config: clamped retryPolicy.maxAttempts at %d",
MAX_MAX_RETRY_ATTEMPTS);
LOG(ERROR) << "service config: clamped retryPolicy.maxAttempts at "
<< MAX_MAX_RETRY_ATTEMPTS;
max_attempts_ = MAX_MAX_RETRY_ATTEMPTS;
}
}

View File

@ -32,10 +32,10 @@
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/gprpp/validation_errors.h"
#include "src/core/lib/json/json.h"
#include "src/core/lib/json/json_args.h"
#include "src/core/lib/json/json_object_loader.h"
#include "src/core/service_config/service_config_parser.h"
#include "src/core/util/json/json.h"
#include "src/core/util/json/json_args.h"
#include "src/core/util/json/json_object_loader.h"
namespace grpc_core {
namespace internal {

View File

@ -27,6 +27,7 @@
#include <utility>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/status/statusor.h"
#include "absl/strings/cord.h"
#include "absl/strings/str_cat.h"
@ -40,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"
@ -48,12 +50,11 @@
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/channel_stack_builder_impl.h"
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/debug/stats_data.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/alloc.h"
#include "src/core/lib/gpr/useful.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"
@ -67,7 +68,12 @@
#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"
#include "src/core/util/alloc.h"
#include "src/core/util/useful.h"
// Backoff parameters.
#define GRPC_SUBCHANNEL_INITIAL_CONNECT_BACKOFF_SECONDS 1
@ -88,83 +94,138 @@ namespace grpc_core {
using ::grpc_event_engine::experimental::EventEngine;
TraceFlag grpc_trace_subchannel(false, "subchannel");
DebugOnlyTraceFlag grpc_trace_subchannel_refcount(false, "subchannel_refcount");
//
// ConnectedSubchannel
//
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),
GRPC_TRACE_FLAG_ENABLED(subchannel_refcount) ? "ConnectedSubchannel"
: nullptr),
args_(args),
channelz_subchannel_(std::move(channelz_subchannel)) {}
ConnectedSubchannel::~ConnectedSubchannel() {
GRPC_CHANNEL_STACK_UNREF(channel_stack_, "connected_subchannel_dtor");
}
//
// LegacyConnectedSubchannel
//
void ConnectedSubchannel::StartWatch(
grpc_pollset_set* interested_parties,
OrphanablePtr<ConnectivityStateWatcherInterface> watcher) {
grpc_transport_op* op = grpc_make_transport_op(nullptr);
op->start_connectivity_watch = std::move(watcher);
op->start_connectivity_watch_state = GRPC_CHANNEL_READY;
op->bind_pollset_set = interested_parties;
grpc_channel_element* elem = grpc_channel_stack_element(channel_stack_, 0);
elem->filter->start_transport_op(elem, op);
}
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)) {}
void ConnectedSubchannel::Ping(grpc_closure* on_initiate,
grpc_closure* on_ack) {
grpc_transport_op* op = grpc_make_transport_op(nullptr);
grpc_channel_element* elem;
op->send_ping.on_initiate = on_initiate;
op->send_ping.on_ack = on_ack;
elem = grpc_channel_stack_element(channel_stack_, 0);
elem->filter->start_transport_op(elem, op);
}
size_t ConnectedSubchannel::GetInitialCallSizeEstimate() const {
return GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(SubchannelCall)) +
channel_stack_->call_stack_size;
}
ArenaPromise<ServerMetadataHandle> ConnectedSubchannel::MakeCallPromise(
CallArgs call_args) {
// If not using channelz, we just need to call the channel stack.
if (channelz_subchannel() == nullptr) {
return channel_stack_->MakeClientCallPromise(std::move(call_args));
~LegacyConnectedSubchannel() override {
channel_stack_.reset(DEBUG_LOCATION, "ConnectedSubchannel");
}
// Otherwise, we need to wrap the channel stack promise with code that
// handles the channelz updates.
return OnCancel(
Seq(channel_stack_->MakeClientCallPromise(std::move(call_args)),
[self = Ref()](ServerMetadataHandle metadata) {
channelz::SubchannelNode* channelz_subchannel =
self->channelz_subchannel();
CHECK_NE(channelz_subchannel, nullptr);
if (metadata->get(GrpcStatusMetadata())
.value_or(GRPC_STATUS_UNKNOWN) != GRPC_STATUS_OK) {
channelz_subchannel->RecordCallFailed();
} else {
channelz_subchannel->RecordCallSucceeded();
}
return metadata;
}),
[self = Ref()]() {
channelz::SubchannelNode* channelz_subchannel =
self->channelz_subchannel();
CHECK_NE(channelz_subchannel, nullptr);
channelz_subchannel->RecordCallFailed();
});
}
void StartWatch(
grpc_pollset_set* interested_parties,
OrphanablePtr<ConnectivityStateWatcherInterface> watcher) override {
grpc_transport_op* op = grpc_make_transport_op(nullptr);
op->start_connectivity_watch = std::move(watcher);
op->start_connectivity_watch_state = GRPC_CHANNEL_READY;
op->bind_pollset_set = interested_parties;
grpc_channel_element* elem =
grpc_channel_stack_element(channel_stack_.get(), 0);
elem->filter->start_transport_op(elem, op);
}
void Ping(absl::AnyInvocable<void(absl::Status)>) override {
Crash("call v3 ping method called in legacy impl");
}
RefCountedPtr<UnstartedCallDestination> unstarted_call_destination()
const override {
Crash("call v3 unstarted_call_destination method called in legacy impl");
}
grpc_channel_stack* channel_stack() const override {
return channel_stack_.get();
}
size_t GetInitialCallSizeEstimate() const override {
return GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(SubchannelCall)) +
channel_stack_->call_stack_size;
}
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; }
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
@ -186,7 +247,6 @@ SubchannelCall::SubchannelCall(Args args, grpc_error_handle* error)
const grpc_call_element_args call_args = {
callstk, // call_stack
nullptr, // server_transport_data
args.context, // context
args.path.c_slice(), // path
args.start_time, // start_time
args.deadline, // deadline
@ -196,7 +256,7 @@ SubchannelCall::SubchannelCall(Args args, grpc_error_handle* error)
*error = grpc_call_stack_init(connected_subchannel_->channel_stack(), 1,
SubchannelCall::Destroy, this, &call_args);
if (GPR_UNLIKELY(!error->ok())) {
gpr_log(GPR_ERROR, "error: %s", StatusToString(*error).c_str());
LOG(ERROR) << "error: " << StatusToString(*error);
return;
}
grpc_call_stack_set_pollset_or_pollset_set(callstk, args.pollent);
@ -254,8 +314,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
@ -357,7 +417,7 @@ class Subchannel::ConnectedSubchannelStateWatcher final
if (c->connected_subchannel_ == nullptr) return;
if (new_state == GRPC_CHANNEL_TRANSIENT_FAILURE ||
new_state == GRPC_CHANNEL_SHUTDOWN) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_subchannel)) {
if (GRPC_TRACE_FLAG_ENABLED(subchannel)) {
gpr_log(GPR_INFO,
"subchannel %p %s: Connected subchannel %p reports %s: %s", c,
c->key_.ToString().c_str(), c->connected_subchannel_.get(),
@ -456,9 +516,9 @@ BackOff::Options ParseArgsForBackoffValues(const ChannelArgs& args,
Subchannel::Subchannel(SubchannelKey key,
OrphanablePtr<SubchannelConnector> connector,
const ChannelArgs& args)
: DualRefCounted<Subchannel>(
GRPC_TRACE_FLAG_ENABLED(grpc_trace_subchannel_refcount) ? "Subchannel"
: nullptr),
: DualRefCounted<Subchannel>(GRPC_TRACE_FLAG_ENABLED(subchannel_refcount)
? "Subchannel"
: nullptr),
key_(std::move(key)),
args_(args),
pollset_set_(grpc_pollset_set_create()),
@ -473,8 +533,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,
@ -542,7 +602,7 @@ void Subchannel::ThrottleKeepaliveTime(int new_keepalive_time) {
// Only update the value if the new keepalive time is larger.
if (new_keepalive_time > keepalive_time_) {
keepalive_time_ = new_keepalive_time;
if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_subchannel)) {
if (GRPC_TRACE_FLAG_ENABLED(subchannel)) {
gpr_log(GPR_INFO, "subchannel %p %s: throttling keepalive time to %d",
this, key_.ToString().c_str(), new_keepalive_time);
}
@ -586,7 +646,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();
}
@ -697,8 +758,10 @@ void Subchannel::OnRetryTimer() {
void Subchannel::OnRetryTimerLocked() {
if (shutdown_) return;
gpr_log(GPR_INFO, "subchannel %p %s: backoff delay elapsed, reporting IDLE",
this, key_.ToString().c_str());
if (GRPC_TRACE_FLAG_ENABLED(subchannel)) {
LOG(INFO) << "subchannel " << this << " " << key_.ToString()
<< ": backoff delay elapsed, reporting IDLE";
}
SetConnectivityStateLocked(GRPC_CHANNEL_IDLE, absl::OkStatus());
}
@ -742,11 +805,12 @@ void Subchannel::OnConnectingFinishedLocked(grpc_error_handle error) {
if (connecting_result_.transport == nullptr || !PublishTransportLocked()) {
const Duration time_until_next_attempt =
next_attempt_time_ - Timestamp::Now();
gpr_log(GPR_INFO,
"subchannel %p %s: connect failed (%s), backing off for %" PRId64
" ms",
this, key_.ToString().c_str(), StatusToString(error).c_str(),
time_until_next_attempt.millis());
if (GRPC_TRACE_FLAG_ENABLED(subchannel)) {
LOG(INFO) << "subchannel " << this << " " << key_.ToString()
<< ": connect failed (" << StatusToString(error)
<< "), backing off for " << time_until_next_attempt.millis()
<< " ms";
}
SetConnectivityStateLocked(GRPC_CHANNEL_TRANSIENT_FAILURE,
grpc_error_to_absl_status(error));
retry_timer_handle_ = event_engine_->RunAfter(
@ -757,11 +821,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();
}
});
@ -769,37 +833,59 @@ void Subchannel::OnConnectingFinishedLocked(grpc_error_handle error) {
}
bool Subchannel::PublishTransportLocked() {
// Construct channel stack.
// Builder takes ownership of transport.
ChannelStackBuilderImpl builder(
"subchannel", GRPC_CLIENT_SUBCHANNEL,
connecting_result_.channel_args.SetObject(
std::exchange(connecting_result_.transport, nullptr)));
if (!CoreConfiguration::Get().channel_init().CreateStack(&builder)) {
return false;
auto socket_node = std::move(connecting_result_.socket_node);
if (connecting_result_.transport->filter_stack_transport() != nullptr) {
// Construct channel stack.
// Builder takes ownership of transport.
ChannelStackBuilderImpl builder(
"subchannel", GRPC_CLIENT_SUBCHANNEL,
connecting_result_.channel_args.SetObject(
std::exchange(connecting_result_.transport, nullptr)));
if (!CoreConfiguration::Get().channel_init().CreateStack(&builder)) {
return false;
}
absl::StatusOr<RefCountedPtr<grpc_channel_stack>> stack = builder.Build();
if (!stack.ok()) {
connecting_result_.Reset();
gpr_log(GPR_ERROR,
"subchannel %p %s: error initializing subchannel stack: %s", this,
key_.ToString().c_str(), stack.status().ToString().c_str());
return false;
}
connected_subchannel_ = MakeRefCounted<LegacyConnectedSubchannel>(
std::move(*stack), args_, channelz_node_);
} else {
OrphanablePtr<ClientTransport> transport(
std::exchange(connecting_result_.transport, nullptr)
->client_transport());
InterceptionChainBuilder builder(
connecting_result_.channel_args.SetObject(transport.get()));
CoreConfiguration::Get().channel_init().AddToInterceptionChainBuilder(
GRPC_CLIENT_SUBCHANNEL, builder);
auto transport_destination =
MakeRefCounted<NewConnectedSubchannel::TransportCallDestination>(
std::move(transport));
auto call_destination = builder.Build(transport_destination);
if (!call_destination.ok()) {
connecting_result_.Reset();
gpr_log(GPR_ERROR,
"subchannel %p %s: error initializing subchannel stack: %s", this,
key_.ToString().c_str(),
call_destination.status().ToString().c_str());
return false;
}
connected_subchannel_ = MakeRefCounted<NewConnectedSubchannel>(
std::move(*call_destination), std::move(transport_destination), args_,
channelz_node_);
}
absl::StatusOr<RefCountedPtr<grpc_channel_stack>> stk = builder.Build();
if (!stk.ok()) {
auto error = absl_status_to_grpc_error(stk.status());
connecting_result_.Reset();
gpr_log(GPR_ERROR,
"subchannel %p %s: error initializing subchannel stack: %s", this,
key_.ToString().c_str(), StatusToString(error).c_str());
return false;
}
RefCountedPtr<channelz::SocketNode> socket =
std::move(connecting_result_.socket_node);
connecting_result_.Reset();
if (shutdown_) return false;
// Publish.
connected_subchannel_.reset(
new ConnectedSubchannel(stk->release(), args_, channelz_node_));
if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_subchannel)) {
if (GRPC_TRACE_FLAG_ENABLED(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(
@ -810,4 +896,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

View File

@ -36,8 +36,6 @@
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_fwd.h"
#include "src/core/lib/channel/context.h"
#include "src/core/lib/gpr/time_precise.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/dual_ref_counted.h"
#include "src/core/lib/gprpp/orphanable.h"
@ -59,35 +57,39 @@
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/transport/transport.h"
#include "src/core/util/time_precise.h"
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;
ArenaPromise<ServerMetadataHandle> MakeCallPromise(CallArgs call_args);
// Methods for v3 stack.
virtual void Ping(absl::AnyInvocable<void(absl::Status)> on_ack) = 0;
virtual RefCountedPtr<UnstartedCallDestination> unstarted_call_destination()
const = 0;
// Methods for legacy stack.
virtual grpc_channel_stack* channel_stack() const = 0;
virtual size_t GetInitialCallSizeEstimate() const = 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.
@ -104,7 +106,6 @@ class SubchannelCall final {
gpr_cycle_counter start_time;
Timestamp deadline;
Arena* arena;
grpc_call_context_element* context;
CallCombiner* call_combiner;
};
static RefCountedPtr<SubchannelCall> Create(Args args,
@ -243,6 +244,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 +279,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_);

View File

@ -36,8 +36,6 @@
namespace grpc_core {
TraceFlag grpc_subchannel_pool_trace(false, "subchannel_pool");
SubchannelKey::SubchannelKey(const grpc_resolved_address& address,
const ChannelArgs& args)
: address_(address), args_(args) {}

View File

@ -27,17 +27,15 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/resolved_address.h"
#include "src/core/util/useful.h"
namespace grpc_core {
class Subchannel;
extern TraceFlag grpc_subchannel_pool_trace;
// A key that can uniquely identify a subchannel.
class SubchannelKey final {
public:
@ -68,7 +66,7 @@ class SubchannelKey final {
class SubchannelPoolInterface : public RefCounted<SubchannelPoolInterface> {
public:
SubchannelPoolInterface()
: RefCounted(GRPC_TRACE_FLAG_ENABLED(grpc_subchannel_pool_trace)
: RefCounted(GRPC_TRACE_FLAG_ENABLED(subchannel_pool)
? "SubchannelPoolInterface"
: nullptr) {}
~SubchannelPoolInterface() override {}

View File

@ -24,12 +24,11 @@
#include <utility>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include <grpc/status.h>
#include <grpc/support/log.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/time_precise.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/gprpp/sync.h"
@ -37,6 +36,7 @@
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/resource_quota/resource_quota.h"
#include "src/core/lib/transport/error_utils.h"
#include "src/core/util/time_precise.h"
#define SUBCHANNEL_STREAM_INITIAL_CONNECT_BACKOFF_SECONDS 1
#define SUBCHANNEL_STREAM_RECONNECT_BACKOFF_MULTIPLIER 1.6
@ -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()
@ -76,22 +77,22 @@ SubchannelStreamClient::SubchannelStreamClient(
SUBCHANNEL_STREAM_RECONNECT_MAX_BACKOFF_SECONDS))),
event_engine_(connected_subchannel_->args().GetObject<EventEngine>()) {
if (GPR_UNLIKELY(tracer_ != nullptr)) {
gpr_log(GPR_INFO, "%s %p: created SubchannelStreamClient", tracer_, this);
LOG(INFO) << tracer_ << " " << this << ": created SubchannelStreamClient";
}
StartCall();
}
SubchannelStreamClient::~SubchannelStreamClient() {
if (GPR_UNLIKELY(tracer_ != nullptr)) {
gpr_log(GPR_INFO, "%s %p: destroying SubchannelStreamClient", tracer_,
this);
LOG(INFO) << tracer_ << " " << this
<< ": destroying SubchannelStreamClient";
}
}
void SubchannelStreamClient::Orphan() {
if (GPR_UNLIKELY(tracer_ != nullptr)) {
gpr_log(GPR_INFO, "%s %p: SubchannelStreamClient shutting down", tracer_,
this);
LOG(INFO) << tracer_ << " " << this
<< ": SubchannelStreamClient shutting down";
}
{
MutexLock lock(&mu_);
@ -118,8 +119,9 @@ void SubchannelStreamClient::StartCallLocked() {
}
call_state_ = MakeOrphanable<CallState>(Ref(), interested_parties_);
if (GPR_UNLIKELY(tracer_ != nullptr)) {
gpr_log(GPR_INFO, "%s %p: SubchannelStreamClient created CallState %p",
tracer_, this, call_state_.get());
LOG(INFO) << tracer_ << " " << this
<< ": SubchannelStreamClient created CallState "
<< call_state_.get();
}
call_state_->StartCallLocked();
}
@ -130,13 +132,13 @@ void SubchannelStreamClient::StartRetryTimerLocked() {
}
const Duration timeout = retry_backoff_.NextAttemptTime() - Timestamp::Now();
if (GPR_UNLIKELY(tracer_ != nullptr)) {
gpr_log(GPR_INFO, "%s %p: SubchannelStreamClient health check call lost...",
tracer_, this);
LOG(INFO) << tracer_ << " " << this
<< ": SubchannelStreamClient health check call lost...";
if (timeout > Duration::Zero()) {
gpr_log(GPR_INFO, "%s %p: ... will retry in %" PRId64 "ms.", tracer_,
this, timeout.millis());
LOG(INFO) << tracer_ << " " << this << ": ... will retry in "
<< timeout.millis() << "ms.";
} else {
gpr_log(GPR_INFO, "%s %p: ... retrying immediately.", tracer_, this);
LOG(INFO) << tracer_ << " " << this << ": ... retrying immediately.";
}
}
retry_timer_handle_ = event_engine_->RunAfter(
@ -153,9 +155,8 @@ void SubchannelStreamClient::OnRetryTimer() {
if (event_handler_ != nullptr && retry_timer_handle_.has_value() &&
call_state_ == nullptr) {
if (GPR_UNLIKELY(tracer_ != nullptr)) {
gpr_log(GPR_INFO,
"%s %p: SubchannelStreamClient restarting health check call",
tracer_, this);
LOG(INFO) << tracer_ << " " << this
<< ": SubchannelStreamClient restarting health check call";
}
StartCallLocked();
}
@ -171,21 +172,13 @@ 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_)),
payload_(context_) {}
arena_(subchannel_stream_client_->call_allocator_->MakeArena()) {}
SubchannelStreamClient::CallState::~CallState() {
if (GPR_UNLIKELY(subchannel_stream_client_->tracer_ != nullptr)) {
gpr_log(GPR_INFO, "%s %p: SubchannelStreamClient destroying CallState %p",
subchannel_stream_client_->tracer_, subchannel_stream_client_.get(),
this);
}
for (size_t i = 0; i < GRPC_CONTEXT_COUNT; ++i) {
if (context_[i].destroy != nullptr) {
context_[i].destroy(context_[i].value);
}
LOG(INFO) << subchannel_stream_client_->tracer_ << " "
<< subchannel_stream_client_.get()
<< ": SubchannelStreamClient destroying CallState " << this;
}
// Unset the call combiner cancellation closure. This has the
// effect of scheduling the previously set cancellation closure, if
@ -207,7 +200,6 @@ void SubchannelStreamClient::CallState::StartCallLocked() {
gpr_get_cycle_counter(), // start_time
Timestamp::InfFuture(), // deadline
arena_.get(),
context_,
&call_combiner_,
};
grpc_error_handle error;
@ -218,16 +210,14 @@ void SubchannelStreamClient::CallState::StartCallLocked() {
call_->SetAfterCallStackDestroy(&after_call_stack_destruction_);
// Check if creation failed.
if (!error.ok() || subchannel_stream_client_->event_handler_ == nullptr) {
gpr_log(GPR_ERROR,
"SubchannelStreamClient %p CallState %p: error creating "
"stream on subchannel (%s); will retry",
subchannel_stream_client_.get(), this,
StatusToString(error).c_str());
LOG(ERROR) << "SubchannelStreamClient " << subchannel_stream_client_.get()
<< " CallState " << this << ": error creating "
<< "stream on subchannel (" << StatusToString(error)
<< "); will retry";
CallEndedLocked(/*retry=*/true);
return;
}
// Initialize payload and batch.
payload_.context = context_;
batch_.payload = &payload_;
// on_complete callback takes ref, handled manually.
call_->Ref(DEBUG_LOCATION, "on_complete").release();
@ -371,12 +361,10 @@ void SubchannelStreamClient::CallState::RecvMessageReady() {
subchannel_stream_client_.get(), recv_message_->JoinIntoString());
if (!status.ok()) {
if (GPR_UNLIKELY(subchannel_stream_client_->tracer_ != nullptr)) {
gpr_log(GPR_INFO,
"%s %p: SubchannelStreamClient CallState %p: failed to "
"parse response message: %s",
subchannel_stream_client_->tracer_,
subchannel_stream_client_.get(), this,
status.ToString().c_str());
LOG(INFO) << subchannel_stream_client_->tracer_ << " "
<< subchannel_stream_client_.get()
<< ": SubchannelStreamClient CallState " << this
<< ": failed to parse response message: " << status;
}
Cancel();
}
@ -419,11 +407,10 @@ void SubchannelStreamClient::CallState::RecvTrailingMetadataReady(
nullptr /* error_string */);
}
if (GPR_UNLIKELY(self->subchannel_stream_client_->tracer_ != nullptr)) {
gpr_log(GPR_INFO,
"%s %p: SubchannelStreamClient CallState %p: health watch failed "
"with status %d",
self->subchannel_stream_client_->tracer_,
self->subchannel_stream_client_.get(), self, status);
LOG(INFO) << self->subchannel_stream_client_->tracer_ << " "
<< self->subchannel_stream_client_.get()
<< ": SubchannelStreamClient CallState " << self
<< ": health watch failed with status " << status;
}
// Clean up.
self->recv_trailing_metadata_.Clear();

View File

@ -34,7 +34,6 @@
#include "src/core/client_channel/subchannel.h"
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/channel/context.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/sync.h"
@ -146,9 +145,8 @@ 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] = {};
// The streaming call to the backend. Always non-null.
// Refs are tracked manually; when the last ref is released, the
@ -201,7 +199,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_);

View File

@ -33,7 +33,6 @@
#include <grpc/support/log.h>
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/context.h"
#include "src/core/lib/channel/promise_based_filter.h"
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/debug/trace.h"
@ -47,11 +46,10 @@
namespace grpc_core {
TraceFlag grpc_backend_metric_filter_trace(false, "backend_metric_filter");
const NoInterceptor BackendMetricFilter::Call::OnClientInitialMetadata;
const NoInterceptor BackendMetricFilter::Call::OnServerInitialMetadata;
const NoInterceptor BackendMetricFilter::Call::OnClientToServerMessage;
const NoInterceptor BackendMetricFilter::Call::OnClientToServerHalfClose;
const NoInterceptor BackendMetricFilter::Call::OnServerToClientMessage;
const NoInterceptor BackendMetricFilter::Call::OnFinalize;
@ -128,24 +126,23 @@ BackendMetricFilter::Create(const ChannelArgs&, ChannelFilter::Args) {
}
void BackendMetricFilter::Call::OnServerTrailingMetadata(ServerMetadata& md) {
auto* ctx = &GetContext<
grpc_call_context_element>()[GRPC_CONTEXT_BACKEND_METRIC_PROVIDER];
if (md.get(GrpcCallWasCancelled()).value_or(false)) return;
auto* ctx = MaybeGetContext<BackendMetricProvider>();
if (ctx == nullptr) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_filter_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(backend_metric_filter)) {
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)) {
if (GRPC_TRACE_FLAG_ENABLED(backend_metric_filter)) {
gpr_log(GPR_INFO, "[%p] Backend metrics serialized. size: %" PRIuPTR,
this, serialized->size());
}
md.Set(EndpointLoadMetricsBinMetadata(),
Slice::FromCopiedString(std::move(*serialized)));
} else if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_filter_trace)) {
} else if (GRPC_TRACE_FLAG_ENABLED(backend_metric_filter)) {
gpr_log(GPR_INFO, "[%p] No backend metrics.", this);
}
}

View File

@ -44,6 +44,7 @@ class BackendMetricFilter : public ImplementChannelFilter<BackendMetricFilter> {
static const NoInterceptor OnServerInitialMetadata;
void OnServerTrailingMetadata(ServerMetadata& md);
static const NoInterceptor OnClientToServerMessage;
static const NoInterceptor OnClientToServerHalfClose;
static const NoInterceptor OnServerToClientMessage;
static const NoInterceptor OnFinalize;
};

View File

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

View File

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

View File

@ -68,25 +68,20 @@ const auto kDefaultMaxConnectionAgeGrace = Duration::Infinity();
const auto kDefaultMaxConnectionIdle = Duration::Infinity();
const auto kMaxConnectionAgeJitter = 0.1;
TraceFlag grpc_trace_client_idle_filter(false, "client_idle_filter");
} // namespace
#define GRPC_IDLE_FILTER_LOG(format, ...) \
do { \
if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_client_idle_filter)) { \
if (GRPC_TRACE_FLAG_ENABLED(client_idle_filter)) { \
gpr_log(GPR_INFO, "(client idle filter) " format, ##__VA_ARGS__); \
} \
} 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;
@ -307,15 +302,13 @@ void RegisterLegacyChannelIdleFilters(CoreConfiguration::Builder* builder) {
.If([](const ChannelArgs& channel_args) {
return GetClientIdleTimeout(channel_args) != Duration::Infinity();
});
if (!IsChaoticGoodEnabled()) {
builder->channel_init()
->RegisterV2Filter<LegacyMaxAgeFilter>(GRPC_SERVER_CHANNEL)
.ExcludeFromMinimalStack()
.If([](const ChannelArgs& channel_args) {
return LegacyMaxAgeFilter::Config::FromChannelArgs(channel_args)
.enable();
});
}
builder->channel_init()
->RegisterV2Filter<LegacyMaxAgeFilter>(GRPC_SERVER_CHANNEL)
.ExcludeFromMinimalStack()
.If([](const ChannelArgs& channel_args) {
return LegacyMaxAgeFilter::Config::FromChannelArgs(channel_args)
.enable();
});
}
LegacyMaxAgeFilter::LegacyMaxAgeFilter(grpc_channel_stack* channel_stack,

View File

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

View File

@ -40,7 +40,6 @@
#include "src/core/ext/filters/fault_injection/fault_injection_service_config_parser.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/context.h"
#include "src/core/lib/channel/status_util.h"
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/debug/trace.h"
@ -54,10 +53,10 @@
namespace grpc_core {
TraceFlag grpc_fault_injection_filter_trace(false, "fault_injection_filter");
const NoInterceptor FaultInjectionFilter::Call::OnServerInitialMetadata;
const NoInterceptor FaultInjectionFilter::Call::OnServerTrailingMetadata;
const NoInterceptor FaultInjectionFilter::Call::OnClientToServerMessage;
const NoInterceptor FaultInjectionFilter::Call::OnClientToServerHalfClose;
const NoInterceptor FaultInjectionFilter::Call::OnServerToClientMessage;
const NoInterceptor FaultInjectionFilter::Call::OnFinalize;
@ -151,7 +150,7 @@ FaultInjectionFilter::FaultInjectionFilter(ChannelFilter::Args filter_args)
ArenaPromise<absl::Status> FaultInjectionFilter::Call::OnClientInitialMetadata(
ClientMetadata& md, FaultInjectionFilter* filter) {
auto decision = filter->MakeInjectionDecision(md);
if (GRPC_TRACE_FLAG_ENABLED(grpc_fault_injection_filter_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(fault_injection_filter)) {
gpr_log(GPR_INFO, "chand=%p: Fault injection triggered %s", this,
decision.ToString().c_str());
}
@ -166,10 +165,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_));

View File

@ -58,6 +58,7 @@ class FaultInjectionFilter
static const NoInterceptor OnServerInitialMetadata;
static const NoInterceptor OnServerTrailingMetadata;
static const NoInterceptor OnClientToServerMessage;
static const NoInterceptor OnClientToServerHalfClose;
static const NoInterceptor OnServerToClientMessage;
static const NoInterceptor OnFinalize;
};

View File

@ -35,10 +35,10 @@
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/gprpp/validation_errors.h"
#include "src/core/lib/json/json.h"
#include "src/core/lib/json/json_args.h"
#include "src/core/lib/json/json_object_loader.h"
#include "src/core/service_config/service_config_parser.h"
#include "src/core/util/json/json.h"
#include "src/core/util/json/json_args.h"
#include "src/core/util/json/json_object_loader.h"
// Channel arg key for enabling parsing fault injection via method config.
#define GRPC_ARG_PARSE_FAULT_INJECTION_METHOD_CONFIG \

View File

@ -54,6 +54,7 @@ namespace grpc_core {
const NoInterceptor HttpClientFilter::Call::OnServerToClientMessage;
const NoInterceptor HttpClientFilter::Call::OnClientToServerMessage;
const NoInterceptor HttpClientFilter::Call::OnClientToServerHalfClose;
const NoInterceptor HttpClientFilter::Call::OnFinalize;
const grpc_channel_filter HttpClientFilter::kFilter =

View File

@ -47,6 +47,7 @@ class HttpClientFilter : public ImplementChannelFilter<HttpClientFilter> {
absl::Status OnServerInitialMetadata(ServerMetadata& md);
absl::Status OnServerTrailingMetadata(ServerMetadata& md);
static const NoInterceptor OnClientToServerMessage;
static const NoInterceptor OnClientToServerHalfClose;
static const NoInterceptor OnServerToClientMessage;
static const NoInterceptor OnFinalize;
};

View File

@ -40,6 +40,7 @@ namespace grpc_core {
const NoInterceptor ClientAuthorityFilter::Call::OnServerInitialMetadata;
const NoInterceptor ClientAuthorityFilter::Call::OnServerTrailingMetadata;
const NoInterceptor ClientAuthorityFilter::Call::OnClientToServerMessage;
const NoInterceptor ClientAuthorityFilter::Call::OnClientToServerHalfClose;
const NoInterceptor ClientAuthorityFilter::Call::OnServerToClientMessage;
const NoInterceptor ClientAuthorityFilter::Call::OnFinalize;

View File

@ -52,6 +52,7 @@ class ClientAuthorityFilter final
static const NoInterceptor OnServerInitialMetadata;
static const NoInterceptor OnServerTrailingMetadata;
static const NoInterceptor OnClientToServerMessage;
static const NoInterceptor OnClientToServerHalfClose;
static const NoInterceptor OnServerToClientMessage;
static const NoInterceptor OnFinalize;
};

View File

@ -35,10 +35,8 @@
#include <grpc/support/log.h>
#include "src/core/ext/filters/message_size/message_size_filter.h"
#include "src/core/lib/channel/call_tracer.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/context.h"
#include "src/core/lib/channel/promise_based_filter.h"
#include "src/core/lib/compression/compression_internal.h"
#include "src/core/lib/compression/message_compress.h"
@ -51,14 +49,16 @@
#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/slice/slice_buffer.h"
#include "src/core/lib/surface/call.h"
#include "src/core/lib/surface/call_trace.h"
#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/transport/transport.h"
#include "src/core/telemetry/call_tracer.h"
namespace grpc_core {
const NoInterceptor ServerCompressionFilter::Call::OnClientToServerHalfClose;
const NoInterceptor ServerCompressionFilter::Call::OnServerTrailingMetadata;
const NoInterceptor ServerCompressionFilter::Call::OnFinalize;
const NoInterceptor ClientCompressionFilter::Call::OnClientToServerHalfClose;
const NoInterceptor ClientCompressionFilter::Call::OnServerTrailingMetadata;
const NoInterceptor ClientCompressionFilter::Call::OnFinalize;
@ -113,13 +113,11 @@ ChannelCompression::ChannelCompression(const ChannelArgs& args)
MessageHandle ChannelCompression::CompressMessage(
MessageHandle message, grpc_compression_algorithm algorithm) const {
if (GRPC_TRACE_FLAG_ENABLED(grpc_compression_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(compression)) {
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());
}
@ -139,7 +137,7 @@ MessageHandle ChannelCompression::CompressMessage(
// If we achieved compression send it as compressed, otherwise send it as (to
// avoid spending cycles on the receiver decompressing).
if (did_compress) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_compression_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(compression)) {
const char* algo_name;
const size_t before_size = payload->Length();
const size_t after_size = tmp.Length();
@ -157,7 +155,7 @@ MessageHandle ChannelCompression::CompressMessage(
call_tracer->RecordSendCompressedMessage(*message->payload());
}
} else {
if (GRPC_TRACE_FLAG_ENABLED(grpc_compression_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(compression)) {
const char* algo_name;
CHECK(grpc_compression_algorithm_name(algorithm, &algo_name));
gpr_log(GPR_INFO,
@ -171,14 +169,12 @@ MessageHandle ChannelCompression::CompressMessage(
absl::StatusOr<MessageHandle> ChannelCompression::DecompressMessage(
bool is_client, MessageHandle message, DecompressArgs args) const {
if (GRPC_TRACE_FLAG_ENABLED(grpc_compression_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(compression)) {
gpr_log(GPR_INFO, "DecompressMessage: len=%" PRIdPTR " max=%d alg=%d",
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());
}
@ -234,8 +230,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)) {

View File

@ -129,6 +129,7 @@ class ClientCompressionFilter final
absl::StatusOr<MessageHandle> OnServerToClientMessage(
MessageHandle message, ClientCompressionFilter* filter);
static const NoInterceptor OnClientToServerHalfClose;
static const NoInterceptor OnServerTrailingMetadata;
static const NoInterceptor OnFinalize;
@ -165,6 +166,7 @@ class ServerCompressionFilter final
MessageHandle OnServerToClientMessage(MessageHandle message,
ServerCompressionFilter* filter);
static const NoInterceptor OnClientToServerHalfClose;
static const NoInterceptor OnServerTrailingMetadata;
static const NoInterceptor OnFinalize;

View File

@ -44,12 +44,12 @@
#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/slice/percent_encoding.h"
#include "src/core/lib/slice/slice.h"
#include "src/core/lib/surface/call_trace.h"
#include "src/core/lib/transport/metadata_batch.h"
namespace grpc_core {
const NoInterceptor HttpServerFilter::Call::OnClientToServerMessage;
const NoInterceptor HttpServerFilter::Call::OnClientToServerHalfClose;
const NoInterceptor HttpServerFilter::Call::OnServerToClientMessage;
const NoInterceptor HttpServerFilter::Call::OnFinalize;
@ -139,7 +139,7 @@ ServerMetadataHandle HttpServerFilter::Call::OnClientInitialMetadata(
}
void HttpServerFilter::Call::OnServerInitialMetadata(ServerMetadata& md) {
if (grpc_call_trace.enabled()) {
if (GRPC_TRACE_FLAG_ENABLED(call)) {
gpr_log(GPR_INFO, "%s[http-server] Write metadata",
GetContext<Activity>()->DebugTag().c_str());
}

View File

@ -50,6 +50,7 @@ class HttpServerFilter : public ImplementChannelFilter<HttpServerFilter> {
void OnServerInitialMetadata(ServerMetadata& md);
void OnServerTrailingMetadata(ServerMetadata& md);
static const NoInterceptor OnClientToServerMessage;
static const NoInterceptor OnClientToServerHalfClose;
static const NoInterceptor OnServerToClientMessage;
static const NoInterceptor OnFinalize;
};

View File

@ -40,7 +40,6 @@
#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/slice/slice.h"
#include "src/core/lib/slice/slice_buffer.h"
#include "src/core/lib/surface/call_trace.h"
#include "src/core/lib/surface/channel_stack_type.h"
#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/transport/transport.h"
@ -51,10 +50,12 @@ namespace grpc_core {
const NoInterceptor ClientMessageSizeFilter::Call::OnClientInitialMetadata;
const NoInterceptor ClientMessageSizeFilter::Call::OnServerInitialMetadata;
const NoInterceptor ClientMessageSizeFilter::Call::OnServerTrailingMetadata;
const NoInterceptor ClientMessageSizeFilter::Call::OnClientToServerHalfClose;
const NoInterceptor ClientMessageSizeFilter::Call::OnFinalize;
const NoInterceptor ServerMessageSizeFilter::Call::OnClientInitialMetadata;
const NoInterceptor ServerMessageSizeFilter::Call::OnServerInitialMetadata;
const NoInterceptor ServerMessageSizeFilter::Call::OnServerTrailingMetadata;
const NoInterceptor ServerMessageSizeFilter::Call::OnClientToServerHalfClose;
const NoInterceptor ServerMessageSizeFilter::Call::OnFinalize;
//
@ -62,11 +63,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));
@ -161,7 +159,7 @@ ServerMetadataHandle CheckPayload(const Message& msg,
absl::optional<uint32_t> max_length,
bool is_client, bool is_send) {
if (!max_length.has_value()) return nullptr;
if (GRPC_TRACE_FLAG_ENABLED(grpc_call_trace)) {
if (GRPC_TRACE_FLAG_ENABLED(call)) {
gpr_log(GPR_INFO, "%s[message_size] %s len:%" PRIdPTR " max:%d",
GetContext<Activity>()->DebugTag().c_str(),
is_send ? "send" : "recv", msg.payload()->Length(), *max_length);
@ -186,8 +184,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();

View File

@ -30,16 +30,15 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_fwd.h"
#include "src/core/lib/channel/context.h"
#include "src/core/lib/channel/promise_based_filter.h"
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gprpp/validation_errors.h"
#include "src/core/lib/json/json.h"
#include "src/core/lib/json/json_args.h"
#include "src/core/lib/json/json_object_loader.h"
#include "src/core/lib/promise/arena_promise.h"
#include "src/core/lib/transport/transport.h"
#include "src/core/service_config/service_config_parser.h"
#include "src/core/util/json/json.h"
#include "src/core/util/json/json_args.h"
#include "src/core/util/json/json_object_loader.h"
namespace grpc_core {
@ -55,8 +54,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);
@ -105,6 +103,7 @@ class ServerMessageSizeFilter final
static const NoInterceptor OnFinalize;
ServerMetadataHandle OnClientToServerMessage(
const Message& message, ServerMessageSizeFilter* filter);
static const NoInterceptor OnClientToServerHalfClose;
ServerMetadataHandle OnServerToClientMessage(
const Message& message, ServerMessageSizeFilter* filter);
};
@ -133,6 +132,7 @@ class ClientMessageSizeFilter final
static const NoInterceptor OnServerTrailingMetadata;
static const NoInterceptor OnFinalize;
ServerMetadataHandle OnClientToServerMessage(const Message& message);
static const NoInterceptor OnClientToServerHalfClose;
ServerMetadataHandle OnServerToClientMessage(const Message& message);
private:

View File

@ -29,7 +29,6 @@
#include "src/core/ext/filters/rbac/rbac_service_config_parser.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/context.h"
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/promise/context.h"
@ -46,16 +45,14 @@ namespace grpc_core {
const NoInterceptor RbacFilter::Call::OnServerInitialMetadata;
const NoInterceptor RbacFilter::Call::OnServerTrailingMetadata;
const NoInterceptor RbacFilter::Call::OnClientToServerMessage;
const NoInterceptor RbacFilter::Call::OnClientToServerHalfClose;
const NoInterceptor RbacFilter::Call::OnServerToClientMessage;
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_));

View File

@ -55,6 +55,7 @@ class RbacFilter : public ImplementChannelFilter<RbacFilter> {
static const NoInterceptor OnServerInitialMetadata;
static const NoInterceptor OnServerTrailingMetadata;
static const NoInterceptor OnClientToServerMessage;
static const NoInterceptor OnClientToServerHalfClose;
static const NoInterceptor OnServerToClientMessage;
static const NoInterceptor OnFinalize;
};

View File

@ -31,10 +31,10 @@
#include <grpc/grpc_audit_logging.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/json/json_args.h"
#include "src/core/lib/json/json_object_loader.h"
#include "src/core/lib/matchers/matchers.h"
#include "src/core/lib/security/authorization/audit_logging.h"
#include "src/core/util/json/json_args.h"
#include "src/core/util/json/json_object_loader.h"
namespace grpc_core {

View File

@ -31,10 +31,10 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gprpp/validation_errors.h"
#include "src/core/lib/json/json.h"
#include "src/core/lib/security/authorization/grpc_authorization_engine.h"
#include "src/core/lib/security/authorization/rbac_policy.h"
#include "src/core/service_config/service_config_parser.h"
#include "src/core/util/json/json.h"
namespace grpc_core {

View File

@ -41,7 +41,6 @@
#include "src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/context.h"
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/crash.h"
@ -58,8 +57,8 @@
namespace grpc_core {
TraceFlag grpc_stateful_session_filter_trace(false, "stateful_session_filter");
const NoInterceptor StatefulSessionFilter::Call::OnClientToServerMessage;
const NoInterceptor StatefulSessionFilter::Call::OnClientToServerHalfClose;
const NoInterceptor StatefulSessionFilter::Call::OnServerToClientMessage;
const NoInterceptor StatefulSessionFilter::Call::OnFinalize;
@ -224,10 +223,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(

View File

@ -86,6 +86,7 @@ class StatefulSessionFilter
void OnServerInitialMetadata(ServerMetadata& md);
void OnServerTrailingMetadata(ServerMetadata& md);
static const NoInterceptor OnClientToServerMessage;
static const NoInterceptor OnClientToServerHalfClose;
static const NoInterceptor OnServerToClientMessage;
static const NoInterceptor OnFinalize;

View File

@ -32,10 +32,10 @@
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/gprpp/validation_errors.h"
#include "src/core/lib/json/json.h"
#include "src/core/lib/json/json_args.h"
#include "src/core/lib/json/json_object_loader.h"
#include "src/core/service_config/service_config_parser.h"
#include "src/core/util/json/json.h"
#include "src/core/util/json/json_args.h"
#include "src/core/util/json/json_object_loader.h"
// Channel arg key for enabling parsing fault injection via method config.
#define GRPC_ARG_PARSE_STATEFUL_SESSION_METHOD_CONFIG \

View File

@ -23,7 +23,7 @@
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/lib/gpr/useful.h"
#include "src/core/util/useful.h"
// in order of preference
static const char* const supported_versions[] = {"h2"};

View File

@ -25,6 +25,7 @@
#include <utility>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_format.h"
@ -95,12 +96,6 @@ void NullThenSchedClosure(const DebugLocation& location, grpc_closure** closure,
}
} // namespace
Chttp2Connector::~Chttp2Connector() {
if (endpoint_ != nullptr) {
grpc_endpoint_destroy(endpoint_);
}
}
void Chttp2Connector::Connect(const Args& args, Result* result,
grpc_closure* notify) {
{
@ -109,7 +104,6 @@ void Chttp2Connector::Connect(const Args& args, Result* result,
args_ = args;
result_ = result;
notify_ = notify;
CHECK_EQ(endpoint_, nullptr);
event_engine_ = args_.channel_args.GetObject<EventEngine>();
}
absl::StatusOr<std::string> address = grpc_sockaddr_to_uri(args.address);
@ -152,11 +146,6 @@ void Chttp2Connector::OnHandshakeDone(void* arg, grpc_error_handle error) {
// We were shut down after handshaking completed successfully, so
// destroy the endpoint here.
if (args->endpoint != nullptr) {
// TODO(ctiller): It is currently necessary to shutdown endpoints
// before destroying them, even if we know that there are no
// pending read/write callbacks. This should be fixed, at which
// point this can be removed.
grpc_endpoint_shutdown(args->endpoint, error);
grpc_endpoint_destroy(args->endpoint);
grpc_slice_buffer_destroy(args->read_buffer);
gpr_free(args->read_buffer);
@ -171,19 +160,20 @@ void Chttp2Connector::OnHandshakeDone(void* arg, grpc_error_handle error) {
self->result_->socket_node =
grpc_chttp2_transport_get_socket_node(self->result_->transport);
self->result_->channel_args = args->args;
self->endpoint_ = args->endpoint;
self->Ref().release(); // Ref held by OnReceiveSettings()
GRPC_CLOSURE_INIT(&self->on_receive_settings_, OnReceiveSettings, self,
grpc_schedule_on_exec_ctx);
grpc_chttp2_transport_start_reading(self->result_->transport,
args->read_buffer,
&self->on_receive_settings_, nullptr);
grpc_chttp2_transport_start_reading(
self->result_->transport, args->read_buffer,
&self->on_receive_settings_, self->args_.interested_parties, nullptr);
self->timer_handle_ = self->event_engine_->RunAfter(
self->args_.deadline - Timestamp::Now(),
[self = self->RefAsSubclass<Chttp2Connector>()] {
[self = self->RefAsSubclass<Chttp2Connector>()]() mutable {
ApplicationCallbackExecCtx callback_exec_ctx;
ExecCtx exec_ctx;
self->OnTimeout();
// Ensure the Chttp2Connector is deleted under an ExecCtx.
self.reset();
});
} else {
// If the handshaking succeeded but there is no endpoint, then the
@ -202,8 +192,6 @@ void Chttp2Connector::OnReceiveSettings(void* arg, grpc_error_handle error) {
{
MutexLock lock(&self->mu_);
if (!self->notify_error_.has_value()) {
grpc_endpoint_delete_from_pollset_set(self->endpoint_,
self->args_.interested_parties);
if (!error.ok()) {
// Transport got an error while waiting on SETTINGS frame.
self->result_->Reset();
@ -232,7 +220,6 @@ void Chttp2Connector::OnTimeout() {
if (!notify_error_.has_value()) {
// The transport did not receive the settings frame in time. Destroy the
// transport.
grpc_endpoint_delete_from_pollset_set(endpoint_, args_.interested_parties);
result_->Reset();
MaybeNotify(GRPC_ERROR_CREATE(
"connection attempt timed out before receiving SETTINGS frame"));
@ -247,9 +234,6 @@ void Chttp2Connector::MaybeNotify(grpc_error_handle error) {
if (notify_error_.has_value()) {
NullThenSchedClosure(DEBUG_LOCATION, &notify_, notify_error_.value());
// Clear state for a new Connect().
// Clear out the endpoint_, since it is the responsibility of
// the transport to shut it down.
endpoint_ = nullptr;
notify_error_.reset();
} else {
notify_error_ = error;
@ -308,10 +292,10 @@ class Chttp2SecureClientChannelFactory : public ClientChannelFactory {
}
};
absl::StatusOr<OrphanablePtr<Channel>> CreateChannel(const char* target,
absl::StatusOr<RefCountedPtr<Channel>> CreateChannel(const char* target,
const ChannelArgs& args) {
if (target == nullptr) {
gpr_log(GPR_ERROR, "cannot create channel with NULL target name");
LOG(ERROR) << "cannot create channel with NULL target name";
return absl::InvalidArgumentError("channel target is NULL");
}
return ChannelCreate(target, args, GRPC_CLIENT_CHANNEL, nullptr);
@ -408,7 +392,8 @@ grpc_channel* grpc_channel_create_from_fd(const char* target, int fd,
auto channel = grpc_core::ChannelCreate(
target, final_args, GRPC_CLIENT_DIRECT_CHANNEL, transport);
if (channel.ok()) {
grpc_chttp2_transport_start_reading(transport, nullptr, nullptr, nullptr);
grpc_chttp2_transport_start_reading(transport, nullptr, nullptr, nullptr,
nullptr);
grpc_core::ExecCtx::Get()->Flush();
return channel->release()->c_ptr();
} else {

View File

@ -37,8 +37,6 @@ namespace grpc_core {
class Chttp2Connector : public SubchannelConnector {
public:
~Chttp2Connector() override;
void Connect(const Args& args, Result* result, grpc_closure* notify) override;
void Shutdown(grpc_error_handle error) override;
@ -63,9 +61,6 @@ class Chttp2Connector : public SubchannelConnector {
Result* result_ = nullptr;
grpc_closure* notify_ = nullptr;
bool shutdown_ = false;
// Holds the endpoint when first created before being handed off to
// the handshake manager, and then again after handshake is done.
grpc_endpoint* endpoint_ = nullptr;
grpc_closure on_receive_settings_;
absl::optional<grpc_event_engine::experimental::EventEngine::TaskHandle>
timer_handle_ ABSL_GUARDED_BY(mu_);

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