grpc 1.63.0 → 1.69.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Makefile +179 -146
- data/include/grpc/compression.h +1 -2
- data/include/grpc/credentials.h +1221 -0
- data/include/grpc/event_engine/README.md +1 -1
- data/include/grpc/event_engine/endpoint_config.h +2 -2
- data/include/grpc/event_engine/event_engine.h +39 -15
- data/include/grpc/event_engine/extensible.h +5 -2
- data/include/grpc/event_engine/internal/memory_allocator_impl.h +4 -4
- data/include/grpc/event_engine/internal/slice_cast.h +1 -1
- data/include/grpc/event_engine/memory_allocator.h +3 -4
- data/include/grpc/event_engine/memory_request.h +19 -2
- data/include/grpc/event_engine/slice.h +3 -5
- data/include/grpc/event_engine/slice_buffer.h +6 -8
- data/include/grpc/grpc.h +8 -2
- data/include/grpc/grpc_audit_logging.h +3 -3
- data/include/grpc/grpc_crl_provider.h +5 -4
- data/include/grpc/grpc_posix.h +1 -2
- data/include/grpc/grpc_security.h +1 -1173
- data/include/grpc/impl/call.h +2 -2
- data/include/grpc/impl/channel_arg_names.h +10 -7
- data/include/grpc/impl/grpc_types.h +1 -2
- data/include/grpc/impl/slice_type.h +1 -2
- data/include/grpc/module.modulemap +2 -0
- data/include/grpc/passive_listener.h +62 -0
- data/include/grpc/support/alloc.h +1 -2
- data/include/grpc/support/json.h +1 -2
- data/include/grpc/support/log.h +37 -64
- data/include/grpc/support/metrics.h +21 -6
- data/include/grpc/support/port_platform.h +31 -1
- data/include/grpc/support/sync_generic.h +2 -4
- data/include/grpc/support/sync_posix.h +1 -2
- data/include/grpc/support/time.h +1 -2
- data/src/core/{lib/channel → channelz}/channel_trace.cc +60 -67
- data/src/core/{lib/channel → channelz}/channel_trace.h +23 -23
- data/src/core/{lib/channel → channelz}/channelz.cc +74 -14
- data/src/core/{lib/channel → channelz}/channelz.h +58 -21
- data/src/core/{lib/channel → channelz}/channelz_registry.cc +14 -14
- data/src/core/{lib/channel → channelz}/channelz_registry.h +6 -7
- data/src/core/client_channel/backup_poller.cc +25 -16
- data/src/core/client_channel/client_channel.cc +1426 -0
- data/src/core/client_channel/client_channel.h +245 -0
- data/src/core/client_channel/client_channel_factory.cc +2 -2
- data/src/core/client_channel/client_channel_factory.h +1 -2
- data/src/core/client_channel/client_channel_filter.cc +397 -914
- data/src/core/client_channel/client_channel_filter.h +25 -80
- data/src/core/client_channel/client_channel_internal.h +26 -11
- data/src/core/client_channel/client_channel_plugin.cc +3 -18
- data/src/core/client_channel/client_channel_service_config.cc +2 -3
- data/src/core/client_channel/client_channel_service_config.h +8 -10
- data/src/core/client_channel/config_selector.h +25 -25
- data/src/core/client_channel/connector.h +4 -4
- data/src/core/client_channel/direct_channel.cc +83 -0
- data/src/core/client_channel/direct_channel.h +101 -0
- data/src/core/client_channel/dynamic_filters.cc +19 -16
- data/src/core/client_channel/dynamic_filters.h +9 -10
- data/src/core/client_channel/global_subchannel_pool.cc +2 -2
- data/src/core/client_channel/global_subchannel_pool.h +2 -3
- data/src/core/client_channel/lb_metadata.cc +120 -0
- data/src/core/client_channel/lb_metadata.h +55 -0
- data/src/core/client_channel/load_balanced_call_destination.cc +273 -0
- data/src/core/client_channel/load_balanced_call_destination.h +48 -0
- data/src/core/client_channel/local_subchannel_pool.cc +6 -7
- data/src/core/client_channel/local_subchannel_pool.h +1 -1
- data/src/core/client_channel/retry_filter.cc +8 -17
- data/src/core/client_channel/retry_filter.h +9 -17
- data/src/core/client_channel/retry_filter_legacy_call_data.cc +214 -323
- data/src/core/client_channel/retry_filter_legacy_call_data.h +11 -14
- data/src/core/client_channel/retry_service_config.cc +10 -13
- data/src/core/client_channel/retry_service_config.h +6 -8
- data/src/core/client_channel/retry_throttle.cc +3 -4
- data/src/core/client_channel/retry_throttle.h +4 -7
- data/src/core/client_channel/subchannel.cc +293 -174
- data/src/core/client_channel/subchannel.h +48 -41
- data/src/core/client_channel/subchannel_interface_internal.h +1 -1
- data/src/core/client_channel/subchannel_pool_interface.cc +1 -5
- data/src/core/client_channel/subchannel_pool_interface.h +4 -7
- data/src/core/client_channel/subchannel_stream_client.cc +47 -61
- data/src/core/client_channel/subchannel_stream_client.h +10 -14
- data/src/core/{lib/config → config}/config_vars.cc +16 -19
- data/src/core/{lib/config → config}/config_vars.h +12 -15
- data/src/core/{lib/config → config}/config_vars_non_generated.cc +1 -1
- data/src/core/{lib/config → config}/core_configuration.cc +10 -10
- data/src/core/{lib/config → config}/core_configuration.h +10 -12
- data/src/core/{lib/config → config}/load_config.cc +5 -7
- data/src/core/{lib/config → config}/load_config.h +3 -4
- data/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +27 -31
- data/src/core/ext/filters/backend_metrics/backend_metric_filter.h +5 -3
- data/src/core/ext/filters/backend_metrics/backend_metric_provider.h +7 -0
- data/src/core/ext/filters/census/grpc_context.cc +7 -10
- data/src/core/ext/filters/channel_idle/idle_filter_state.cc +1 -2
- data/src/core/ext/filters/channel_idle/idle_filter_state.h +0 -1
- data/src/core/ext/filters/channel_idle/legacy_channel_idle_filter.cc +44 -47
- data/src/core/ext/filters/channel_idle/legacy_channel_idle_filter.h +22 -19
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +25 -29
- data/src/core/ext/filters/fault_injection/fault_injection_filter.h +8 -7
- data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.cc +2 -3
- data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.h +7 -10
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.cc +205 -0
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.h +97 -0
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_service_config_parser.cc +80 -0
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_service_config_parser.h +86 -0
- data/src/core/ext/filters/http/client/http_client_filter.cc +19 -12
- data/src/core/ext/filters/http/client/http_client_filter.h +8 -6
- data/src/core/ext/filters/http/client_authority_filter.cc +13 -11
- data/src/core/ext/filters/http/client_authority_filter.h +8 -5
- data/src/core/ext/filters/http/http_filters_plugin.cc +1 -2
- data/src/core/ext/filters/http/message_compress/compression_filter.cc +59 -54
- data/src/core/ext/filters/http/message_compress/compression_filter.h +16 -12
- data/src/core/ext/filters/http/server/http_server_filter.cc +18 -15
- data/src/core/ext/filters/http/server/http_server_filter.h +8 -6
- data/src/core/ext/filters/message_size/message_size_filter.cc +42 -51
- data/src/core/ext/filters/message_size/message_size_filter.h +20 -16
- data/src/core/ext/filters/rbac/rbac_filter.cc +20 -18
- data/src/core/ext/filters/rbac/rbac_filter.h +8 -7
- data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +16 -10
- data/src/core/ext/filters/rbac/rbac_service_config_parser.h +3 -5
- data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +26 -28
- data/src/core/ext/filters/stateful_session/stateful_session_filter.h +8 -6
- data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.cc +2 -3
- data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h +6 -8
- data/src/core/ext/transport/chttp2/alpn/alpn.cc +4 -5
- data/src/core/ext/transport/chttp2/alpn/alpn.h +0 -1
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +85 -117
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +5 -12
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +436 -324
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +34 -1
- data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +26 -38
- data/src/core/ext/transport/chttp2/transport/bin_decoder.h +1 -3
- data/src/core/ext/transport/chttp2/transport/bin_encoder.cc +10 -12
- data/src/core/ext/transport/chttp2/transport/bin_encoder.h +1 -3
- data/src/core/ext/transport/chttp2/transport/call_tracer_wrapper.cc +53 -0
- data/src/core/ext/transport/chttp2/transport/call_tracer_wrapper.h +72 -0
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +688 -562
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +14 -16
- data/src/core/ext/transport/chttp2/transport/context_list_entry.h +1 -2
- data/src/core/ext/transport/chttp2/transport/decode_huff.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/decode_huff.h +2 -2
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +11 -16
- data/src/core/ext/transport/chttp2/transport/flow_control.h +4 -9
- data/src/core/ext/transport/chttp2/transport/frame.cc +25 -8
- data/src/core/ext/transport/chttp2/transport/frame.h +11 -2
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +21 -22
- data/src/core/ext/transport/chttp2/transport/frame_data.h +3 -5
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +7 -10
- data/src/core/ext/transport/chttp2/transport/frame_goaway.h +1 -3
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +16 -21
- data/src/core/ext/transport/chttp2/transport/frame_ping.h +1 -3
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +19 -20
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +6 -6
- data/src/core/ext/transport/chttp2/transport/frame_security.cc +82 -0
- data/src/core/ext/transport/chttp2/transport/frame_security.h +44 -0
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +36 -21
- data/src/core/ext/transport/chttp2/transport/frame_settings.h +2 -4
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +31 -10
- data/src/core/ext/transport/chttp2/transport/frame_window_update.h +4 -4
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +21 -22
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +18 -15
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc +10 -10
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h +3 -4
- data/src/core/ext/transport/chttp2/transport/hpack_parse_result.cc +4 -5
- data/src/core/ext/transport/chttp2/transport/hpack_parse_result.h +5 -8
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +79 -74
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +5 -6
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +45 -20
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +28 -9
- data/src/core/ext/transport/chttp2/transport/http2_settings.cc +12 -4
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +10 -4
- data/src/core/ext/transport/chttp2/transport/huffsyms.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/internal.h +71 -81
- data/src/core/ext/transport/chttp2/transport/legacy_frame.h +1 -0
- data/src/core/ext/transport/chttp2/transport/parsing.cc +135 -121
- data/src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc +3 -4
- data/src/core/ext/transport/chttp2/transport/ping_abuse_policy.h +1 -1
- data/src/core/ext/transport/chttp2/transport/ping_callbacks.cc +4 -7
- data/src/core/ext/transport/chttp2/transport/ping_callbacks.h +2 -7
- data/src/core/ext/transport/chttp2/transport/ping_rate_policy.cc +33 -19
- data/src/core/ext/transport/chttp2/transport/ping_rate_policy.h +6 -7
- data/src/core/ext/transport/chttp2/transport/stream_lists.cc +19 -21
- data/src/core/ext/transport/chttp2/transport/stream_lists.h +65 -0
- data/src/core/ext/transport/chttp2/transport/varint.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/varint.h +2 -3
- data/src/core/ext/transport/chttp2/transport/write_size_policy.cc +4 -4
- data/src/core/ext/transport/chttp2/transport/write_size_policy.h +2 -3
- data/src/core/ext/transport/chttp2/transport/writing.cc +178 -140
- data/src/core/ext/transport/inproc/inproc_transport.cc +155 -73
- data/src/core/ext/transport/inproc/inproc_transport.h +2 -5
- data/src/core/ext/transport/inproc/legacy_inproc_transport.cc +127 -129
- data/src/core/ext/transport/inproc/legacy_inproc_transport.h +1 -4
- data/src/core/ext/upb-gen/envoy/admin/v3/certs.upb.h +46 -15
- data/src/core/ext/upb-gen/envoy/admin/v3/certs.upb_minitable.c +40 -18
- data/src/core/ext/upb-gen/envoy/admin/v3/certs.upb_minitable.h +10 -4
- data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb.h +59 -27
- data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb_minitable.c +36 -18
- data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb_minitable.h +9 -4
- data/src/core/ext/upb-gen/envoy/admin/v3/config_dump.upb.h +50 -15
- data/src/core/ext/upb-gen/envoy/admin/v3/config_dump.upb_minitable.c +44 -22
- data/src/core/ext/upb-gen/envoy/admin/v3/config_dump.upb_minitable.h +10 -4
- data/src/core/ext/upb-gen/envoy/admin/v3/config_dump_shared.upb.h +187 -54
- data/src/core/ext/upb-gen/envoy/admin/v3/config_dump_shared.upb_minitable.c +162 -84
- data/src/core/ext/upb-gen/envoy/admin/v3/config_dump_shared.upb_minitable.h +24 -4
- data/src/core/ext/upb-gen/envoy/admin/v3/init_dump.upb.h +11 -5
- data/src/core/ext/upb-gen/envoy/admin/v3/init_dump.upb_minitable.c +14 -4
- data/src/core/ext/upb-gen/envoy/admin/v3/init_dump.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/envoy/admin/v3/listeners.upb.h +19 -6
- data/src/core/ext/upb-gen/envoy/admin/v3/listeners.upb_minitable.c +18 -8
- data/src/core/ext/upb-gen/envoy/admin/v3/listeners.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/envoy/admin/v3/memory.upb.h +11 -10
- data/src/core/ext/upb-gen/envoy/admin/v3/memory.upb_minitable.c +7 -1
- data/src/core/ext/upb-gen/envoy/admin/v3/memory.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/admin/v3/metrics.upb.h +8 -7
- data/src/core/ext/upb-gen/envoy/admin/v3/metrics.upb_minitable.c +7 -1
- data/src/core/ext/upb-gen/envoy/admin/v3/metrics.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/admin/v3/mutex_stats.upb.h +8 -7
- data/src/core/ext/upb-gen/envoy/admin/v3/mutex_stats.upb_minitable.c +7 -1
- data/src/core/ext/upb-gen/envoy/admin/v3/mutex_stats.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb.h +129 -82
- data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb_minitable.c +39 -27
- data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/envoy/admin/v3/tap.upb.h +9 -6
- data/src/core/ext/upb-gen/envoy/admin/v3/tap.upb_minitable.c +10 -4
- data/src/core/ext/upb-gen/envoy/admin/v3/tap.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/annotations/deprecation.upb.h +9 -8
- data/src/core/ext/upb-gen/envoy/annotations/deprecation.upb_minitable.c +7 -1
- data/src/core/ext/upb-gen/envoy/annotations/deprecation.upb_minitable.h +5 -4
- data/src/core/ext/upb-gen/envoy/annotations/resource.upb.h +18 -8
- data/src/core/ext/upb-gen/envoy/annotations/resource.upb_minitable.c +13 -6
- data/src/core/ext/upb-gen/envoy/annotations/resource.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb.h +91 -34
- data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb_minitable.c +114 -48
- data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb_minitable.h +21 -4
- data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb.h +544 -254
- data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb_minitable.c +265 -149
- data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb_minitable.h +29 -4
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb.h +41 -14
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb_minitable.c +31 -17
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb_minitable.h +8 -4
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb.h +499 -141
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.c +268 -143
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.h +31 -4
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/filter.upb.h +12 -7
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/filter.upb_minitable.c +11 -5
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/filter.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb.h +171 -27
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb_minitable.c +54 -27
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb.h +127 -35
- data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb_minitable.c +125 -63
- data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb_minitable.h +20 -4
- data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb.h +67 -27
- data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb_minitable.c +60 -26
- data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb_minitable.h +13 -4
- data/src/core/ext/upb-gen/envoy/config/core/v3/backoff.upb.h +11 -6
- data/src/core/ext/upb-gen/envoy/config/core/v3/backoff.upb_minitable.c +11 -5
- data/src/core/ext/upb-gen/envoy/config/core/v3/backoff.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb.h +755 -72
- data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb_minitable.c +320 -75
- data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb_minitable.h +39 -4
- data/src/core/ext/upb-gen/envoy/config/core/v3/config_source.upb.h +67 -25
- data/src/core/ext/upb-gen/envoy/config/core/v3/config_source.upb_minitable.c +57 -27
- data/src/core/ext/upb-gen/envoy/config/core/v3/config_source.upb_minitable.h +12 -4
- data/src/core/ext/upb-gen/envoy/config/core/v3/event_service_config.upb.h +8 -5
- data/src/core/ext/upb-gen/envoy/config/core/v3/event_service_config.upb_minitable.c +10 -4
- data/src/core/ext/upb-gen/envoy/config/core/v3/event_service_config.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/config/core/v3/extension.upb.h +9 -6
- data/src/core/ext/upb-gen/envoy/config/core/v3/extension.upb_minitable.c +10 -4
- data/src/core/ext/upb-gen/envoy/config/core/v3/extension.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_method_list.upb.h +11 -5
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_method_list.upb_minitable.c +14 -4
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_method_list.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb.h +201 -62
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb_minitable.c +120 -53
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb_minitable.h +19 -4
- data/src/core/ext/upb-gen/envoy/config/core/v3/health_check.upb.h +196 -62
- data/src/core/ext/upb-gen/envoy/config/core/v3/health_check.upb_minitable.c +95 -53
- data/src/core/ext/upb-gen/envoy/config/core/v3/health_check.upb_minitable.h +14 -4
- data/src/core/ext/upb-gen/envoy/config/core/v3/http_service.upb.h +13 -5
- data/src/core/ext/upb-gen/envoy/config/core/v3/http_service.upb_minitable.c +11 -5
- data/src/core/ext/upb-gen/envoy/config/core/v3/http_service.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/config/core/v3/http_uri.upb.h +10 -7
- data/src/core/ext/upb-gen/envoy/config/core/v3/http_uri.upb_minitable.c +10 -4
- data/src/core/ext/upb-gen/envoy/config/core/v3/http_uri.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb.h +231 -76
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.c +150 -78
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.h +21 -4
- data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb.h +10 -7
- data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb_minitable.c +14 -4
- data/src/core/ext/upb-gen/envoy/config/core/v3/proxy_protocol.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/envoy/config/core/v3/resolver.upb.h +15 -7
- data/src/core/ext/upb-gen/envoy/config/core/v3/resolver.upb_minitable.c +15 -5
- data/src/core/ext/upb-gen/envoy/config/core/v3/resolver.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb.h +16 -10
- data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb_minitable.c +14 -4
- data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/envoy/config/core/v3/substitution_format_string.upb.h +23 -11
- data/src/core/ext/upb-gen/envoy/config/core/v3/substitution_format_string.upb_minitable.c +17 -7
- data/src/core/ext/upb-gen/envoy/config/core/v3/substitution_format_string.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/envoy/config/core/v3/udp_socket_config.upb.h +11 -6
- data/src/core/ext/upb-gen/envoy/config/core/v3/udp_socket_config.upb_minitable.c +11 -5
- data/src/core/ext/upb-gen/envoy/config/core/v3/udp_socket_config.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint.upb.h +42 -11
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint.upb_minitable.c +35 -17
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint.upb_minitable.h +9 -4
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb.h +106 -34
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.c +69 -37
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.h +12 -4
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/load_report.upb.h +281 -37
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/load_report.upb_minitable.c +81 -27
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/load_report.upb_minitable.h +12 -4
- data/src/core/ext/upb-gen/envoy/config/listener/v3/api_listener.upb.h +8 -5
- data/src/core/ext/upb-gen/envoy/config/listener/v3/api_listener.upb_minitable.c +10 -4
- data/src/core/ext/upb-gen/envoy/config/listener/v3/api_listener.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb.h +142 -47
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.c +90 -47
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.h +15 -4
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener_components.upb.h +91 -29
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener_components.upb_minitable.c +68 -38
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener_components.upb_minitable.h +12 -4
- data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb.h +93 -13
- data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb_minitable.c +24 -14
- data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/config/listener/v3/udp_listener_config.upb.h +14 -7
- data/src/core/ext/upb-gen/envoy/config/listener/v3/udp_listener_config.upb_minitable.c +16 -6
- data/src/core/ext/upb-gen/envoy/config/listener/v3/udp_listener_config.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb.h +14 -9
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb_minitable.c +11 -5
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb.h +51 -22
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb_minitable.c +58 -24
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb_minitable.h +13 -4
- data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb.h +68 -21
- data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb_minitable.c +71 -29
- data/src/core/ext/upb-gen/envoy/config/overload/v3/overload.upb_minitable.h +15 -4
- data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb.h +159 -38
- data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb_minitable.c +105 -57
- data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb_minitable.h +16 -4
- data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb.h +61 -13
- data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb_minitable.c +33 -19
- data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb_minitable.h +8 -4
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb.h +708 -233
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.c +499 -262
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.h +63 -4
- data/src/core/ext/upb-gen/envoy/config/route/v3/scoped_route.upb.h +20 -10
- data/src/core/ext/upb-gen/envoy/config/route/v3/scoped_route.upb_minitable.c +22 -8
- data/src/core/ext/upb-gen/envoy/config/route/v3/scoped_route.upb_minitable.h +8 -4
- data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb.h +100 -35
- data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb_minitable.c +95 -45
- data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb_minitable.h +17 -4
- data/src/core/ext/upb-gen/envoy/config/trace/v3/datadog.upb.h +118 -16
- data/src/core/ext/upb-gen/envoy/config/trace/v3/datadog.upb_minitable.c +43 -12
- data/src/core/ext/upb-gen/envoy/config/trace/v3/datadog.upb_minitable.h +8 -4
- data/src/core/ext/upb-gen/envoy/config/trace/v3/dynamic_ot.upb.h +9 -6
- data/src/core/ext/upb-gen/envoy/config/trace/v3/dynamic_ot.upb_minitable.c +10 -4
- data/src/core/ext/upb-gen/envoy/config/trace/v3/dynamic_ot.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/config/trace/v3/http_tracer.upb.h +12 -7
- data/src/core/ext/upb-gen/envoy/config/trace/v3/http_tracer.upb_minitable.c +17 -7
- data/src/core/ext/upb-gen/envoy/config/trace/v3/http_tracer.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/envoy/config/trace/v3/lightstep.upb.h +10 -7
- data/src/core/ext/upb-gen/envoy/config/trace/v3/lightstep.upb_minitable.c +10 -4
- data/src/core/ext/upb-gen/envoy/config/trace/v3/lightstep.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opencensus.upb.h +22 -15
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opencensus.upb_minitable.c +12 -6
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opencensus.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb.h +20 -8
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb_minitable.c +13 -7
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/config/trace/v3/service.upb.h +8 -5
- data/src/core/ext/upb-gen/envoy/config/trace/v3/service.upb_minitable.c +10 -4
- data/src/core/ext/upb-gen/envoy/config/trace/v3/service.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/config/trace/v3/skywalking.upb.h +17 -10
- data/src/core/ext/upb-gen/envoy/config/trace/v3/skywalking.upb_minitable.c +18 -8
- data/src/core/ext/upb-gen/envoy/config/trace/v3/skywalking.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/envoy/config/trace/v3/trace.upb.h +5 -4
- data/src/core/ext/upb-gen/envoy/config/trace/v3/trace.upb_minitable.c +3 -1
- data/src/core/ext/upb-gen/envoy/config/trace/v3/trace.upb_minitable.h +5 -4
- data/src/core/ext/upb-gen/envoy/config/trace/v3/xray.upb.h +19 -10
- data/src/core/ext/upb-gen/envoy/config/trace/v3/xray.upb_minitable.c +19 -9
- data/src/core/ext/upb-gen/envoy/config/trace/v3/xray.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb.h +14 -11
- data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb_minitable.c +10 -4
- data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/data/accesslog/v3/accesslog.upb.h +216 -102
- data/src/core/ext/upb-gen/envoy/data/accesslog/v3/accesslog.upb_minitable.c +124 -57
- data/src/core/ext/upb-gen/envoy/data/accesslog/v3/accesslog.upb_minitable.h +21 -4
- data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +5 -4
- data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb_minitable.c +7 -1
- data/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3/fault.upb.h +24 -11
- data/src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3/fault.upb_minitable.c +33 -11
- data/src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3/fault.upb_minitable.h +10 -4
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb.h +42 -22
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.c +27 -13
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.h +8 -4
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h +444 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c +135 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.h +38 -0
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +56 -13
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c +29 -13
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb.h +29 -12
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb_minitable.c +20 -10
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h +13 -8
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.c +17 -7
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +327 -134
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.c +208 -121
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.h +26 -4
- data/src/core/ext/upb-gen/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.h +8 -5
- data/src/core/ext/upb-gen/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb_minitable.c +10 -4
- data/src/core/ext/upb-gen/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h +23 -10
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb_minitable.c +15 -9
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +31 -14
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.c +39 -17
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.h +10 -4
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb.h +6 -5
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb_minitable.c +7 -1
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/pick_first/v3/pick_first.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h +22 -11
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb_minitable.c +14 -8
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.h +8 -5
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb_minitable.c +10 -4
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upb.h +106 -0
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upb_minitable.c +52 -0
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upb_minitable.h +32 -0
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/cert.upb.h +5 -4
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/cert.upb_minitable.c +3 -1
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/cert.upb_minitable.h +5 -4
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb.h +170 -31
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb_minitable.c +83 -37
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb_minitable.h +14 -4
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +25 -12
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb_minitable.c +27 -13
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/secret.upb_minitable.h +8 -4
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +112 -39
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls.upb_minitable.c +73 -43
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls.upb_minitable.h +12 -4
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h +14 -6
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb_minitable.c +17 -7
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb.h +58 -20
- data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb_minitable.c +44 -26
- data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb_minitable.h +9 -4
- data/src/core/ext/upb-gen/envoy/service/discovery/v3/ads.upb.h +5 -4
- data/src/core/ext/upb-gen/envoy/service/discovery/v3/ads.upb_minitable.c +7 -1
- data/src/core/ext/upb-gen/envoy/service/discovery/v3/ads.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/service/discovery/v3/discovery.upb.h +122 -40
- data/src/core/ext/upb-gen/envoy/service/discovery/v3/discovery.upb_minitable.c +105 -47
- data/src/core/ext/upb-gen/envoy/service/discovery/v3/discovery.upb_minitable.h +19 -4
- data/src/core/ext/upb-gen/envoy/service/load_stats/v3/lrs.upb.h +18 -8
- data/src/core/ext/upb-gen/envoy/service/load_stats/v3/lrs.upb_minitable.c +18 -8
- data/src/core/ext/upb-gen/envoy/service/load_stats/v3/lrs.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/envoy/service/status/v3/csds.upb.h +65 -24
- data/src/core/ext/upb-gen/envoy/service/status/v3/csds.upb_minitable.c +47 -25
- data/src/core/ext/upb-gen/envoy/service/status/v3/csds.upb_minitable.h +10 -4
- data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb.h +10 -7
- data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb_minitable.c +10 -4
- data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/type/http/v3/path_transformation.upb.h +16 -6
- data/src/core/ext/upb-gen/envoy/type/http/v3/path_transformation.upb_minitable.c +26 -8
- data/src/core/ext/upb-gen/envoy/type/http/v3/path_transformation.upb_minitable.h +9 -4
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/filter_state.upb.h +9 -6
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/filter_state.upb_minitable.c +10 -4
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/filter_state.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/http_inputs.upb.h +10 -9
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/http_inputs.upb_minitable.c +23 -1
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/http_inputs.upb_minitable.h +10 -4
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/metadata.upb.h +16 -8
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/metadata.upb_minitable.c +15 -5
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/metadata.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/node.upb.h +13 -5
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/node.upb_minitable.c +11 -5
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/node.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/number.upb.h +9 -6
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/number.upb_minitable.c +10 -4
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/number.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/path.upb.h +8 -5
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/path.upb_minitable.c +10 -4
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/path.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/regex.upb.h +16 -9
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/regex.upb_minitable.c +24 -10
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/regex.upb_minitable.h +8 -4
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/status_code_input.upb.h +5 -4
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/status_code_input.upb_minitable.c +11 -1
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/status_code_input.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/string.upb.h +51 -10
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/string.upb_minitable.c +30 -9
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/string.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/struct.upb.h +14 -6
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/struct.upb_minitable.c +15 -5
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/struct.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/value.upb.h +30 -12
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/value.upb_minitable.c +32 -14
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/value.upb_minitable.h +9 -4
- data/src/core/ext/upb-gen/envoy/type/metadata/v3/metadata.upb.h +24 -10
- data/src/core/ext/upb-gen/envoy/type/metadata/v3/metadata.upb_minitable.c +40 -10
- data/src/core/ext/upb-gen/envoy/type/metadata/v3/metadata.upb_minitable.h +12 -4
- data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb.h +30 -17
- data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb_minitable.c +33 -11
- data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb_minitable.h +10 -4
- data/src/core/ext/upb-gen/envoy/type/v3/hash_policy.upb.h +12 -7
- data/src/core/ext/upb-gen/envoy/type/v3/hash_policy.upb_minitable.c +19 -5
- data/src/core/ext/upb-gen/envoy/type/v3/hash_policy.upb_minitable.h +8 -4
- data/src/core/ext/upb-gen/envoy/type/v3/http.upb.h +5 -4
- data/src/core/ext/upb-gen/envoy/type/v3/http.upb_minitable.c +3 -1
- data/src/core/ext/upb-gen/envoy/type/v3/http.upb_minitable.h +5 -4
- data/src/core/ext/upb-gen/envoy/type/v3/http_status.upb.h +6 -5
- data/src/core/ext/upb-gen/envoy/type/v3/http_status.upb_minitable.c +7 -1
- data/src/core/ext/upb-gen/envoy/type/v3/http_status.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/type/v3/percent.upb.h +8 -7
- data/src/core/ext/upb-gen/envoy/type/v3/percent.upb_minitable.c +11 -1
- data/src/core/ext/upb-gen/envoy/type/v3/percent.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/envoy/type/v3/range.upb.h +11 -10
- data/src/core/ext/upb-gen/envoy/type/v3/range.upb_minitable.c +15 -1
- data/src/core/ext/upb-gen/envoy/type/v3/range.upb_minitable.h +8 -4
- data/src/core/ext/upb-gen/envoy/type/v3/ratelimit_strategy.upb.h +14 -9
- data/src/core/ext/upb-gen/envoy/type/v3/ratelimit_strategy.upb_minitable.c +15 -5
- data/src/core/ext/upb-gen/envoy/type/v3/ratelimit_strategy.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/envoy/type/v3/ratelimit_unit.upb.h +5 -4
- data/src/core/ext/upb-gen/envoy/type/v3/ratelimit_unit.upb_minitable.c +3 -1
- data/src/core/ext/upb-gen/envoy/type/v3/ratelimit_unit.upb_minitable.h +5 -4
- data/src/core/ext/upb-gen/envoy/type/v3/semantic_version.upb.h +8 -7
- data/src/core/ext/upb-gen/envoy/type/v3/semantic_version.upb_minitable.c +7 -1
- data/src/core/ext/upb-gen/envoy/type/v3/semantic_version.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/envoy/type/v3/token_bucket.upb.h +12 -7
- data/src/core/ext/upb-gen/envoy/type/v3/token_bucket.upb_minitable.c +11 -5
- data/src/core/ext/upb-gen/envoy/type/v3/token_bucket.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/google/api/annotations.upb.h +17 -7
- data/src/core/ext/upb-gen/google/api/annotations.upb_minitable.c +5 -2
- data/src/core/ext/upb-gen/google/api/annotations.upb_minitable.h +5 -4
- data/src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.upb.h +135 -36
- data/src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.upb_minitable.c +121 -56
- data/src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.upb_minitable.h +18 -4
- data/src/core/ext/upb-gen/google/api/expr/v1alpha1/syntax.upb.h +525 -69
- data/src/core/ext/upb-gen/google/api/expr/v1alpha1/syntax.upb_minitable.c +202 -68
- data/src/core/ext/upb-gen/google/api/expr/v1alpha1/syntax.upb_minitable.h +23 -4
- data/src/core/ext/upb-gen/google/api/http.upb.h +30 -16
- data/src/core/ext/upb-gen/google/api/http.upb_minitable.c +22 -8
- data/src/core/ext/upb-gen/google/api/http.upb_minitable.h +8 -4
- data/src/core/ext/upb-gen/google/api/httpbody.upb.h +12 -6
- data/src/core/ext/upb-gen/google/api/httpbody.upb_minitable.c +10 -4
- data/src/core/ext/upb-gen/google/api/httpbody.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/google/protobuf/any.upb.h +8 -6
- data/src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c +7 -1
- data/src/core/ext/upb-gen/google/protobuf/any.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/google/protobuf/descriptor.upb.h +583 -181
- data/src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.c +376 -215
- data/src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.h +56 -21
- data/src/core/ext/upb-gen/google/protobuf/duration.upb.h +8 -6
- data/src/core/ext/upb-gen/google/protobuf/duration.upb_minitable.c +7 -1
- data/src/core/ext/upb-gen/google/protobuf/duration.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/google/protobuf/empty.upb.h +6 -4
- data/src/core/ext/upb-gen/google/protobuf/empty.upb_minitable.c +7 -1
- data/src/core/ext/upb-gen/google/protobuf/empty.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/google/protobuf/struct.upb.h +33 -10
- data/src/core/ext/upb-gen/google/protobuf/struct.upb_minitable.c +32 -14
- data/src/core/ext/upb-gen/google/protobuf/struct.upb_minitable.h +9 -4
- data/src/core/ext/upb-gen/google/protobuf/timestamp.upb.h +8 -6
- data/src/core/ext/upb-gen/google/protobuf/timestamp.upb_minitable.c +7 -1
- data/src/core/ext/upb-gen/google/protobuf/timestamp.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/google/protobuf/wrappers.upb.h +15 -13
- data/src/core/ext/upb-gen/google/protobuf/wrappers.upb_minitable.c +39 -1
- data/src/core/ext/upb-gen/google/protobuf/wrappers.upb_minitable.h +14 -4
- data/src/core/ext/upb-gen/google/rpc/status.upb.h +12 -6
- data/src/core/ext/upb-gen/google/rpc/status.upb_minitable.c +10 -4
- data/src/core/ext/upb-gen/google/rpc/status.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/opencensus/proto/trace/v1/trace_config.upb.h +22 -14
- data/src/core/ext/upb-gen/opencensus/proto/trace/v1/trace_config.upb_minitable.c +24 -6
- data/src/core/ext/upb-gen/opencensus/proto/trace/v1/trace_config.upb_minitable.h +9 -4
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/altscontext.upb.h +19 -10
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/altscontext.upb_minitable.c +15 -5
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/altscontext.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb.h +98 -39
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb_minitable.c +87 -37
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb_minitable.h +17 -4
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/transport_security_common.upb.h +14 -8
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/transport_security_common.upb_minitable.c +15 -5
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/transport_security_common.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/src/proto/grpc/health/v1/health.upb.h +8 -6
- data/src/core/ext/upb-gen/src/proto/grpc/health/v1/health.upb_minitable.c +11 -1
- data/src/core/ext/upb-gen/src/proto/grpc/health/v1/health.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/src/proto/grpc/lb/v1/load_balancer.upb.h +47 -22
- data/src/core/ext/upb-gen/src/proto/grpc/lb/v1/load_balancer.upb_minitable.c +58 -20
- data/src/core/ext/upb-gen/src/proto/grpc/lb/v1/load_balancer.upb_minitable.h +14 -4
- data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls.upb.h +16 -8
- data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls.upb_minitable.c +18 -4
- data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls.upb_minitable.h +8 -4
- data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls_config.upb.h +72 -19
- data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls_config.upb_minitable.c +60 -22
- data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls_config.upb_minitable.h +14 -4
- data/src/core/ext/upb-gen/udpa/annotations/migrate.upb.h +69 -23
- data/src/core/ext/upb-gen/udpa/annotations/migrate.upb_minitable.c +31 -12
- data/src/core/ext/upb-gen/udpa/annotations/migrate.upb_minitable.h +8 -4
- data/src/core/ext/upb-gen/udpa/annotations/security.upb.h +19 -9
- data/src/core/ext/upb-gen/udpa/annotations/security.upb_minitable.c +13 -6
- data/src/core/ext/upb-gen/udpa/annotations/security.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/udpa/annotations/sensitive.upb.h +6 -5
- data/src/core/ext/upb-gen/udpa/annotations/sensitive.upb_minitable.c +4 -1
- data/src/core/ext/upb-gen/udpa/annotations/sensitive.upb_minitable.h +5 -4
- data/src/core/ext/upb-gen/udpa/annotations/status.upb.h +19 -9
- data/src/core/ext/upb-gen/udpa/annotations/status.upb_minitable.c +13 -6
- data/src/core/ext/upb-gen/udpa/annotations/status.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/udpa/annotations/versioning.upb.h +18 -8
- data/src/core/ext/upb-gen/udpa/annotations/versioning.upb_minitable.c +13 -6
- data/src/core/ext/upb-gen/udpa/annotations/versioning.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/validate/validate.upb.h +264 -172
- data/src/core/ext/upb-gen/validate/validate.upb_minitable.c +185 -87
- data/src/core/ext/upb-gen/validate/validate.upb_minitable.h +29 -5
- data/src/core/ext/upb-gen/xds/annotations/v3/migrate.upb.h +69 -23
- data/src/core/ext/upb-gen/xds/annotations/v3/migrate.upb_minitable.c +31 -12
- data/src/core/ext/upb-gen/xds/annotations/v3/migrate.upb_minitable.h +8 -4
- data/src/core/ext/upb-gen/xds/annotations/v3/security.upb.h +19 -9
- data/src/core/ext/upb-gen/xds/annotations/v3/security.upb_minitable.c +13 -6
- data/src/core/ext/upb-gen/xds/annotations/v3/security.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/xds/annotations/v3/sensitive.upb.h +6 -5
- data/src/core/ext/upb-gen/xds/annotations/v3/sensitive.upb_minitable.c +4 -1
- data/src/core/ext/upb-gen/xds/annotations/v3/sensitive.upb_minitable.h +5 -4
- data/src/core/ext/upb-gen/xds/annotations/v3/status.upb.h +46 -18
- data/src/core/ext/upb-gen/xds/annotations/v3/status.upb_minitable.c +32 -11
- data/src/core/ext/upb-gen/xds/annotations/v3/status.upb_minitable.h +9 -4
- data/src/core/ext/upb-gen/xds/annotations/v3/versioning.upb.h +18 -8
- data/src/core/ext/upb-gen/xds/annotations/v3/versioning.upb_minitable.c +13 -6
- data/src/core/ext/upb-gen/xds/annotations/v3/versioning.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/xds/core/v3/authority.upb.h +6 -5
- data/src/core/ext/upb-gen/xds/core/v3/authority.upb_minitable.c +7 -1
- data/src/core/ext/upb-gen/xds/core/v3/authority.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/xds/core/v3/cidr.upb.h +9 -6
- data/src/core/ext/upb-gen/xds/core/v3/cidr.upb_minitable.c +10 -4
- data/src/core/ext/upb-gen/xds/core/v3/cidr.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/xds/core/v3/collection_entry.upb.h +16 -9
- data/src/core/ext/upb-gen/xds/core/v3/collection_entry.upb_minitable.c +18 -8
- data/src/core/ext/upb-gen/xds/core/v3/collection_entry.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/xds/core/v3/context_params.upb.h +11 -4
- data/src/core/ext/upb-gen/xds/core/v3/context_params.upb_minitable.c +14 -4
- data/src/core/ext/upb-gen/xds/core/v3/context_params.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/xds/core/v3/extension.upb.h +9 -6
- data/src/core/ext/upb-gen/xds/core/v3/extension.upb_minitable.c +10 -4
- data/src/core/ext/upb-gen/xds/core/v3/extension.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/xds/core/v3/resource.upb.h +12 -7
- data/src/core/ext/upb-gen/xds/core/v3/resource.upb_minitable.c +11 -5
- data/src/core/ext/upb-gen/xds/core/v3/resource.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/xds/core/v3/resource_locator.upb.h +21 -11
- data/src/core/ext/upb-gen/xds/core/v3/resource_locator.upb_minitable.c +18 -8
- data/src/core/ext/upb-gen/xds/core/v3/resource_locator.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/xds/core/v3/resource_name.upb.h +11 -8
- data/src/core/ext/upb-gen/xds/core/v3/resource_name.upb_minitable.c +10 -4
- data/src/core/ext/upb-gen/xds/core/v3/resource_name.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/xds/data/orca/v3/orca_load_report.upb.h +29 -10
- data/src/core/ext/upb-gen/xds/data/orca/v3/orca_load_report.upb_minitable.c +24 -6
- data/src/core/ext/upb-gen/xds/data/orca/v3/orca_load_report.upb_minitable.h +9 -4
- data/src/core/ext/upb-gen/xds/service/orca/v3/orca.upb.h +8 -5
- data/src/core/ext/upb-gen/xds/service/orca/v3/orca.upb_minitable.c +10 -4
- data/src/core/ext/upb-gen/xds/service/orca/v3/orca.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb.h +9 -6
- data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb_minitable.c +10 -4
- data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/xds/type/matcher/v3/domain.upb.h +13 -5
- data/src/core/ext/upb-gen/xds/type/matcher/v3/domain.upb_minitable.c +17 -7
- data/src/core/ext/upb-gen/xds/type/matcher/v3/domain.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/xds/type/matcher/v3/http_inputs.upb.h +5 -4
- data/src/core/ext/upb-gen/xds/type/matcher/v3/http_inputs.upb_minitable.c +7 -1
- data/src/core/ext/upb-gen/xds/type/matcher/v3/http_inputs.upb_minitable.h +6 -4
- data/src/core/ext/upb-gen/xds/type/matcher/v3/ip.upb.h +19 -6
- data/src/core/ext/upb-gen/xds/type/matcher/v3/ip.upb_minitable.c +18 -8
- data/src/core/ext/upb-gen/xds/type/matcher/v3/ip.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb.h +81 -22
- data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb_minitable.c +85 -43
- data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb_minitable.h +15 -4
- data/src/core/ext/upb-gen/xds/type/matcher/v3/range.upb.h +44 -7
- data/src/core/ext/upb-gen/xds/type/matcher/v3/range.upb_minitable.c +48 -22
- data/src/core/ext/upb-gen/xds/type/matcher/v3/range.upb_minitable.h +11 -4
- data/src/core/ext/upb-gen/xds/type/matcher/v3/regex.upb.h +9 -6
- data/src/core/ext/upb-gen/xds/type/matcher/v3/regex.upb_minitable.c +14 -4
- data/src/core/ext/upb-gen/xds/type/matcher/v3/regex.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/xds/type/matcher/v3/string.upb.h +18 -10
- data/src/core/ext/upb-gen/xds/type/matcher/v3/string.upb_minitable.c +17 -7
- data/src/core/ext/upb-gen/xds/type/matcher/v3/string.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/xds/type/v3/cel.upb.h +17 -8
- data/src/core/ext/upb-gen/xds/type/v3/cel.upb_minitable.c +19 -9
- data/src/core/ext/upb-gen/xds/type/v3/cel.upb_minitable.h +7 -4
- data/src/core/ext/upb-gen/xds/type/v3/range.upb.h +12 -10
- data/src/core/ext/upb-gen/xds/type/v3/range.upb_minitable.c +15 -1
- data/src/core/ext/upb-gen/xds/type/v3/range.upb_minitable.h +8 -4
- data/src/core/ext/upb-gen/xds/type/v3/typed_struct.upb.h +9 -6
- data/src/core/ext/upb-gen/xds/type/v3/typed_struct.upb_minitable.c +10 -4
- data/src/core/ext/upb-gen/xds/type/v3/typed_struct.upb_minitable.h +6 -4
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/certs.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/certs.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/clusters.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/clusters.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/config_dump.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/config_dump.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/config_dump_shared.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/config_dump_shared.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/init_dump.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/init_dump.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/listeners.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/listeners.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/memory.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/memory.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/metrics.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/metrics.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/mutex_stats.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/mutex_stats.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/server_info.upbdefs.c +88 -82
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/server_info.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/tap.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/admin/v3/tap.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/annotations/deprecation.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/annotations/deprecation.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/annotations/resource.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/annotations/resource.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/accesslog/v3/accesslog.upbdefs.c +63 -61
- data/src/core/ext/upbdefs-gen/envoy/config/accesslog/v3/accesslog.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +223 -211
- data/src/core/ext/upbdefs-gen/envoy/config/bootstrap/v3/bootstrap.upbdefs.h +10 -4
- data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/circuit_breaker.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/circuit_breaker.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/cluster.upbdefs.c +319 -298
- data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/cluster.upbdefs.h +10 -4
- data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/filter.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/filter.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/outlier_detection.upbdefs.c +116 -106
- data/src/core/ext/upbdefs-gen/envoy/config/cluster/v3/outlier_detection.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/common/matcher/v3/matcher.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/common/matcher/v3/matcher.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/address.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/address.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/backoff.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/backoff.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/base.upbdefs.c +187 -141
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/base.upbdefs.h +30 -4
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/config_source.upbdefs.c +12 -12
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/config_source.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/event_service_config.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/event_service_config.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/extension.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/extension.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/grpc_method_list.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/grpc_method_list.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/grpc_service.upbdefs.c +175 -165
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/grpc_service.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/health_check.upbdefs.c +199 -188
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/health_check.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/http_service.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/http_service.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/http_uri.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/http_uri.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/protocol.upbdefs.c +231 -223
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/protocol.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/proxy_protocol.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/proxy_protocol.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/resolver.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/resolver.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/socket_option.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/socket_option.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/substitution_format_string.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/substitution_format_string.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/udp_socket_config.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/core/v3/udp_socket_config.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/endpoint/v3/endpoint.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/endpoint/v3/endpoint.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +41 -37
- data/src/core/ext/upbdefs-gen/envoy/config/endpoint/v3/endpoint_components.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/endpoint/v3/load_report.upbdefs.c +124 -94
- data/src/core/ext/upbdefs-gen/envoy/config/endpoint/v3/load_report.upbdefs.h +10 -4
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/api_listener.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/api_listener.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/listener.upbdefs.c +43 -40
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/listener.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/listener_components.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/listener_components.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/quic_config.upbdefs.c +22 -13
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/quic_config.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/udp_listener_config.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/listener/v3/udp_listener_config.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/metrics/v3/metrics_service.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/metrics/v3/metrics_service.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/metrics/v3/stats.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/metrics/v3/stats.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/overload/v3/overload.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/overload/v3/overload.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/rbac/v3/rbac.upbdefs.c +71 -66
- data/src/core/ext/upbdefs-gen/envoy/config/rbac/v3/rbac.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/route/v3/route.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/route/v3/route.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/route/v3/route_components.upbdefs.c +613 -605
- data/src/core/ext/upbdefs-gen/envoy/config/route/v3/route_components.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/route/v3/scoped_route.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/route/v3/scoped_route.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/tap/v3/common.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/tap/v3/common.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/datadog.upbdefs.c +32 -21
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/datadog.upbdefs.h +10 -4
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/dynamic_ot.upbdefs.c +20 -18
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/dynamic_ot.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/http_tracer.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/http_tracer.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/lightstep.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/lightstep.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/opencensus.upbdefs.c +64 -60
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/opencensus.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/opentelemetry.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/opentelemetry.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/service.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/service.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/skywalking.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/skywalking.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/trace.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/trace.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/xray.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/xray.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/zipkin.upbdefs.c +23 -21
- data/src/core/ext/upbdefs-gen/envoy/config/trace/v3/zipkin.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/data/accesslog/v3/accesslog.upbdefs.c +147 -143
- data/src/core/ext/upbdefs-gen/envoy/data/accesslog/v3/accesslog.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.c +87 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.h +48 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c +38 -34
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/router/v3/router.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/router/v3/router.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +292 -289
- data/src/core/ext/upbdefs-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/extensions/http/stateful_session/cookie/v3/cookie.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/extensions/http/stateful_session/cookie/v3/cookie.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upbdefs.c +53 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/http_11_proxy/v3/upstream_http_11_connect.upbdefs.h +33 -0
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +84 -76
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h +10 -4
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/service/discovery/v3/ads.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/service/discovery/v3/ads.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/service/discovery/v3/discovery.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/service/discovery/v3/discovery.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/service/load_stats/v3/lrs.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/service/load_stats/v3/lrs.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/service/status/v3/csds.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/service/status/v3/csds.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/type/http/v3/cookie.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/type/http/v3/cookie.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/type/http/v3/path_transformation.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/type/http/v3/path_transformation.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/filter_state.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/filter_state.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/http_inputs.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/http_inputs.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/metadata.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/metadata.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/node.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/node.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/number.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/number.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/path.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/path.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/regex.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/regex.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/status_code_input.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/status_code_input.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/string.upbdefs.c +41 -34
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/string.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/struct.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/struct.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/value.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/type/matcher/v3/value.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/type/metadata/v3/metadata.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/type/metadata/v3/metadata.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/type/tracing/v3/custom_tag.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/type/tracing/v3/custom_tag.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/type/v3/hash_policy.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/type/v3/hash_policy.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/type/v3/http.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/type/v3/http.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/type/v3/http_status.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/type/v3/http_status.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/type/v3/percent.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/type/v3/percent.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/type/v3/range.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/type/v3/range.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/type/v3/ratelimit_strategy.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/type/v3/ratelimit_strategy.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/type/v3/ratelimit_unit.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/type/v3/ratelimit_unit.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/type/v3/semantic_version.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/type/v3/semantic_version.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/envoy/type/v3/token_bucket.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/envoy/type/v3/token_bucket.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/google/api/annotations.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/google/api/annotations.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/google/api/expr/v1alpha1/checked.upbdefs.c +110 -108
- data/src/core/ext/upbdefs-gen/google/api/expr/v1alpha1/checked.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/google/api/expr/v1alpha1/syntax.upbdefs.c +103 -79
- data/src/core/ext/upbdefs-gen/google/api/expr/v1alpha1/syntax.upbdefs.h +15 -4
- data/src/core/ext/upbdefs-gen/google/api/http.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/google/api/http.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/google/api/httpbody.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/google/api/httpbody.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/google/protobuf/any.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/google/protobuf/any.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/google/protobuf/descriptor.upbdefs.c +485 -458
- data/src/core/ext/upbdefs-gen/google/protobuf/descriptor.upbdefs.h +10 -4
- data/src/core/ext/upbdefs-gen/google/protobuf/duration.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/google/protobuf/duration.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/google/protobuf/empty.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/google/protobuf/empty.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/google/protobuf/struct.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/google/protobuf/struct.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/google/protobuf/timestamp.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/google/protobuf/timestamp.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/google/protobuf/wrappers.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/google/protobuf/wrappers.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/google/rpc/status.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/google/rpc/status.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/opencensus/proto/trace/v1/trace_config.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/opencensus/proto/trace/v1/trace_config.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/src/proto/grpc/lookup/v1/rls_config.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/src/proto/grpc/lookup/v1/rls_config.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/udpa/annotations/migrate.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/udpa/annotations/migrate.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/udpa/annotations/security.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/udpa/annotations/security.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/udpa/annotations/sensitive.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/udpa/annotations/sensitive.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/udpa/annotations/status.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/udpa/annotations/status.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/udpa/annotations/versioning.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/udpa/annotations/versioning.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/validate/validate.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/validate/validate.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/xds/annotations/v3/migrate.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/xds/annotations/v3/migrate.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/xds/annotations/v3/security.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/xds/annotations/v3/security.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/xds/annotations/v3/sensitive.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/xds/annotations/v3/sensitive.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/xds/annotations/v3/status.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/xds/annotations/v3/status.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/xds/annotations/v3/versioning.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/xds/annotations/v3/versioning.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/xds/core/v3/authority.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/xds/core/v3/authority.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/xds/core/v3/cidr.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/xds/core/v3/cidr.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/xds/core/v3/collection_entry.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/xds/core/v3/collection_entry.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/xds/core/v3/context_params.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/xds/core/v3/context_params.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/xds/core/v3/extension.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/xds/core/v3/extension.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/xds/core/v3/resource.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/xds/core/v3/resource.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/xds/core/v3/resource_locator.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/xds/core/v3/resource_locator.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/xds/core/v3/resource_name.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/xds/core/v3/resource_name.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/cel.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/cel.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/domain.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/domain.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/http_inputs.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/http_inputs.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/ip.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/ip.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/matcher.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/matcher.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/range.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/range.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/regex.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/regex.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/string.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/xds/type/matcher/v3/string.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/xds/type/v3/cel.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/xds/type/v3/cel.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/xds/type/v3/range.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/xds/type/v3/range.upbdefs.h +5 -4
- data/src/core/ext/upbdefs-gen/xds/type/v3/typed_struct.upbdefs.c +2 -1
- data/src/core/ext/upbdefs-gen/xds/type/v3/typed_struct.upbdefs.h +5 -4
- data/src/core/filter/blackboard.cc +33 -0
- data/src/core/filter/blackboard.h +70 -0
- data/src/core/{lib/transport → handshaker/endpoint_info}/endpoint_info_handshaker.cc +16 -15
- data/src/core/{lib/transport → handshaker/endpoint_info}/endpoint_info_handshaker.h +4 -4
- data/src/core/handshaker/handshaker.cc +199 -0
- data/src/core/{lib/transport → handshaker}/handshaker.h +60 -55
- data/src/core/{lib/transport → handshaker}/handshaker_factory.h +19 -3
- data/src/core/{lib/transport → handshaker}/handshaker_registry.cc +2 -3
- data/src/core/{lib/transport → handshaker}/handshaker_registry.h +4 -4
- data/src/core/{lib/transport → handshaker/http_connect}/http_connect_handshaker.cc +123 -164
- data/src/core/{lib/transport → handshaker/http_connect}/http_connect_handshaker.h +4 -4
- data/src/core/{client_channel → handshaker/http_connect}/http_proxy_mapper.cc +35 -42
- data/src/core/{client_channel → handshaker/http_connect}/http_proxy_mapper.h +5 -6
- data/src/core/handshaker/http_connect/xds_http_proxy_mapper.cc +57 -0
- data/src/core/handshaker/http_connect/xds_http_proxy_mapper.h +46 -0
- data/src/core/{lib/handshaker → handshaker}/proxy_mapper.h +3 -4
- data/src/core/{lib/handshaker → handshaker}/proxy_mapper_registry.cc +2 -2
- data/src/core/{lib/handshaker → handshaker}/proxy_mapper_registry.h +4 -5
- data/src/core/{lib/security/transport → handshaker/security}/secure_endpoint.cc +98 -85
- data/src/core/{lib/security/transport → handshaker/security}/secure_endpoint.h +10 -12
- data/src/core/{lib/security/transport → handshaker/security}/security_handshaker.cc +176 -230
- data/src/core/{lib/security/transport → handshaker/security}/security_handshaker.h +7 -9
- data/src/core/{lib/transport → handshaker/tcp_connect}/tcp_connect_handshaker.cc +53 -67
- data/src/core/{lib/transport → handshaker/tcp_connect}/tcp_connect_handshaker.h +4 -4
- data/src/core/lib/address_utils/parse_address.cc +33 -44
- data/src/core/lib/address_utils/parse_address.h +1 -3
- data/src/core/lib/address_utils/sockaddr_utils.cc +22 -19
- data/src/core/lib/address_utils/sockaddr_utils.h +0 -2
- data/src/core/lib/channel/channel_args.cc +20 -26
- data/src/core/lib/channel/channel_args.h +34 -21
- data/src/core/lib/channel/channel_args_preconditioning.cc +2 -2
- data/src/core/lib/channel/channel_args_preconditioning.h +2 -3
- data/src/core/lib/channel/channel_stack.cc +19 -81
- data/src/core/lib/channel/channel_stack.h +27 -63
- data/src/core/lib/channel/channel_stack_builder.cc +2 -2
- data/src/core/lib/channel/channel_stack_builder.h +1 -7
- data/src/core/lib/channel/channel_stack_builder_impl.cc +5 -157
- data/src/core/lib/channel/channel_stack_builder_impl.h +13 -3
- data/src/core/lib/channel/connected_channel.cc +49 -706
- data/src/core/lib/channel/promise_based_filter.cc +249 -324
- data/src/core/lib/channel/promise_based_filter.h +264 -559
- data/src/core/lib/channel/status_util.cc +2 -4
- data/src/core/lib/channel/status_util.h +1 -2
- data/src/core/lib/compression/compression.cc +7 -10
- data/src/core/lib/compression/compression_internal.cc +7 -10
- data/src/core/lib/compression/compression_internal.h +2 -5
- data/src/core/lib/compression/message_compress.cc +16 -18
- data/src/core/lib/compression/message_compress.h +1 -2
- data/src/core/lib/debug/trace.cc +48 -67
- data/src/core/lib/debug/trace.h +2 -97
- data/src/core/lib/debug/trace_flags.cc +242 -0
- data/src/core/lib/debug/trace_flags.h +131 -0
- data/src/core/lib/debug/trace_impl.h +125 -0
- data/src/core/lib/event_engine/ares_resolver.cc +165 -92
- data/src/core/lib/event_engine/ares_resolver.h +11 -18
- data/src/core/lib/event_engine/cf_engine/cf_engine.cc +14 -15
- data/src/core/lib/event_engine/cf_engine/cf_engine.h +1 -1
- data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc +47 -34
- data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.h +4 -6
- data/src/core/lib/event_engine/cf_engine/cftype_unique_ref.h +1 -1
- data/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc +28 -31
- data/src/core/lib/event_engine/cf_engine/dns_service_resolver.h +5 -6
- data/src/core/lib/event_engine/channel_args_endpoint_config.cc +3 -5
- data/src/core/lib/event_engine/channel_args_endpoint_config.h +1 -3
- data/src/core/lib/event_engine/common_closures.h +1 -2
- data/src/core/lib/event_engine/default_event_engine.cc +13 -16
- data/src/core/lib/event_engine/default_event_engine.h +3 -4
- data/src/core/lib/event_engine/default_event_engine_factory.cc +3 -4
- data/src/core/lib/event_engine/default_event_engine_factory.h +1 -2
- data/src/core/lib/event_engine/event_engine.cc +35 -5
- data/src/core/lib/event_engine/event_engine_context.h +5 -4
- data/src/core/lib/event_engine/extensions/chaotic_good_extension.h +0 -1
- data/src/core/lib/event_engine/extensions/supports_fd.h +25 -2
- data/src/core/lib/event_engine/extensions/tcp_trace.h +42 -0
- data/src/core/lib/event_engine/forkable.cc +12 -13
- data/src/core/lib/event_engine/forkable.h +0 -13
- data/src/core/lib/event_engine/grpc_polled_fd.h +2 -4
- data/src/core/lib/event_engine/handle_containers.h +1 -3
- data/src/core/lib/event_engine/memory_allocator_factory.h +1 -3
- data/src/core/lib/event_engine/nameser.h +1 -1
- data/src/core/lib/event_engine/poller.h +1 -2
- data/src/core/lib/event_engine/posix.h +1 -2
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +28 -30
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h +6 -8
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +27 -31
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.h +2 -4
- data/src/core/lib/event_engine/posix_engine/event_poller.h +1 -3
- data/src/core/lib/event_engine/posix_engine/event_poller_posix_default.cc +2 -3
- data/src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h +3 -6
- data/src/core/lib/event_engine/posix_engine/internal_errqueue.cc +5 -6
- data/src/core/lib/event_engine/posix_engine/internal_errqueue.h +0 -1
- data/src/core/lib/event_engine/posix_engine/lockfree_event.cc +7 -9
- data/src/core/lib/event_engine/posix_engine/lockfree_event.h +0 -1
- data/src/core/lib/event_engine/posix_engine/native_posix_dns_resolver.cc +3 -4
- data/src/core/lib/event_engine/posix_engine/native_posix_dns_resolver.h +0 -1
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +96 -103
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +22 -23
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +84 -65
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +16 -13
- data/src/core/lib/event_engine/posix_engine/posix_engine_closure.h +1 -2
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +27 -30
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.h +13 -13
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +27 -33
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.h +1 -3
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +46 -40
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +10 -10
- data/src/core/lib/event_engine/posix_engine/timer.cc +5 -6
- data/src/core/lib/event_engine/posix_engine/timer.h +4 -7
- data/src/core/lib/event_engine/posix_engine/timer_heap.cc +2 -3
- data/src/core/lib/event_engine/posix_engine/timer_manager.cc +16 -25
- data/src/core/lib/event_engine/posix_engine/timer_manager.h +4 -7
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc +7 -10
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.h +2 -5
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.cc +3 -4
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.h +0 -1
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.cc +2 -3
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.h +0 -1
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.cc +0 -1
- data/src/core/lib/event_engine/query_extensions.h +3 -2
- data/src/core/lib/event_engine/ref_counted_dns_resolver_interface.h +2 -5
- data/src/core/lib/event_engine/resolved_address.cc +8 -7
- data/src/core/lib/event_engine/resolved_address_internal.h +1 -2
- data/src/core/lib/event_engine/shim.cc +3 -3
- data/src/core/lib/event_engine/slice.cc +5 -7
- data/src/core/lib/event_engine/slice_buffer.cc +2 -4
- data/src/core/lib/event_engine/tcp_socket_utils.cc +21 -26
- data/src/core/lib/event_engine/tcp_socket_utils.h +1 -2
- data/src/core/lib/event_engine/thread_local.cc +2 -2
- data/src/core/lib/event_engine/thread_local.h +1 -1
- data/src/core/lib/event_engine/thread_pool/thread_count.cc +5 -8
- data/src/core/lib/event_engine/thread_pool/thread_count.h +4 -6
- data/src/core/lib/event_engine/thread_pool/thread_pool.h +1 -4
- data/src/core/lib/event_engine/thread_pool/thread_pool_factory.cc +1 -2
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +46 -53
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h +9 -15
- data/src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc +50 -23
- data/src/core/lib/event_engine/thready_event_engine/thready_event_engine.h +7 -7
- data/src/core/lib/event_engine/time_util.cc +3 -4
- data/src/core/lib/event_engine/time_util.h +1 -3
- data/src/core/lib/event_engine/utils.cc +19 -6
- data/src/core/lib/event_engine/utils.h +9 -4
- data/src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc +158 -132
- data/src/core/lib/event_engine/windows/grpc_polled_fd_windows.h +4 -6
- data/src/core/lib/event_engine/windows/iocp.cc +24 -22
- data/src/core/lib/event_engine/windows/iocp.h +2 -3
- data/src/core/lib/event_engine/windows/native_windows_dns_resolver.cc +4 -6
- data/src/core/lib/event_engine/windows/win_socket.cc +47 -36
- data/src/core/lib/event_engine/windows/win_socket.h +8 -10
- data/src/core/lib/event_engine/windows/windows_endpoint.cc +58 -44
- data/src/core/lib/event_engine/windows/windows_engine.cc +245 -136
- data/src/core/lib/event_engine/windows/windows_engine.h +143 -33
- data/src/core/lib/event_engine/windows/windows_listener.cc +29 -43
- data/src/core/lib/event_engine/windows/windows_listener.h +4 -5
- data/src/core/lib/event_engine/work_queue/basic_work_queue.cc +3 -3
- data/src/core/lib/event_engine/work_queue/basic_work_queue.h +2 -5
- data/src/core/lib/event_engine/work_queue/work_queue.h +1 -3
- data/src/core/lib/experiments/config.cc +59 -32
- data/src/core/lib/experiments/config.h +55 -2
- data/src/core/lib/experiments/experiments.cc +310 -293
- data/src/core/lib/experiments/experiments.h +145 -122
- data/src/core/lib/iomgr/buffer_list.cc +7 -8
- data/src/core/lib/iomgr/buffer_list.h +2 -4
- data/src/core/lib/iomgr/call_combiner.cc +42 -68
- data/src/core/lib/iomgr/call_combiner.h +12 -17
- data/src/core/lib/iomgr/cfstream_handle.cc +14 -20
- data/src/core/lib/iomgr/cfstream_handle.h +1 -1
- data/src/core/lib/iomgr/closure.cc +2 -2
- data/src/core/lib/iomgr/closure.h +17 -21
- data/src/core/lib/iomgr/combiner.cc +38 -52
- data/src/core/lib/iomgr/combiner.h +2 -6
- data/src/core/lib/iomgr/endpoint.cc +1 -7
- data/src/core/lib/iomgr/endpoint.h +4 -6
- data/src/core/lib/iomgr/endpoint_cfstream.cc +45 -76
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +8 -10
- data/src/core/lib/iomgr/endpoint_pair_windows.cc +16 -17
- data/src/core/lib/iomgr/error.cc +24 -34
- data/src/core/lib/iomgr/error.h +8 -11
- data/src/core/lib/iomgr/error_cfstream.cc +1 -3
- data/src/core/lib/iomgr/ev_apple.cc +16 -24
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +81 -126
- data/src/core/lib/iomgr/ev_poll_posix.cc +62 -62
- data/src/core/lib/iomgr/ev_posix.cc +68 -60
- data/src/core/lib/iomgr/ev_posix.h +9 -12
- data/src/core/lib/iomgr/event_engine_shims/closure.cc +11 -15
- data/src/core/lib/iomgr/event_engine_shims/closure.h +1 -3
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +35 -53
- data/src/core/lib/iomgr/event_engine_shims/endpoint.h +1 -2
- data/src/core/lib/iomgr/event_engine_shims/tcp_client.cc +10 -15
- data/src/core/lib/iomgr/event_engine_shims/tcp_client.h +1 -2
- data/src/core/lib/iomgr/exec_ctx.cc +14 -18
- data/src/core/lib/iomgr/exec_ctx.h +33 -23
- data/src/core/lib/iomgr/executor.cc +60 -59
- data/src/core/lib/iomgr/executor.h +2 -2
- data/src/core/lib/iomgr/fork_posix.cc +11 -15
- data/src/core/lib/iomgr/fork_windows.cc +3 -2
- data/src/core/lib/iomgr/internal_errqueue.cc +5 -6
- data/src/core/lib/iomgr/iocp_windows.cc +16 -15
- data/src/core/lib/iomgr/iocp_windows.h +0 -1
- data/src/core/lib/iomgr/iomgr.cc +19 -26
- data/src/core/lib/iomgr/iomgr.h +0 -1
- data/src/core/lib/iomgr/iomgr_internal.cc +1 -2
- data/src/core/lib/iomgr/iomgr_internal.h +0 -1
- data/src/core/lib/iomgr/iomgr_posix.cc +2 -1
- data/src/core/lib/iomgr/iomgr_windows.cc +7 -6
- data/src/core/lib/iomgr/lockfree_event.cc +12 -21
- data/src/core/lib/iomgr/lockfree_event.h +1 -2
- data/src/core/lib/iomgr/nameser.h +1 -1
- data/src/core/lib/iomgr/polling_entity.cc +17 -11
- data/src/core/lib/iomgr/pollset.cc +2 -2
- data/src/core/lib/iomgr/pollset.h +0 -3
- data/src/core/lib/iomgr/pollset_set.cc +2 -2
- data/src/core/lib/iomgr/pollset_set_windows.cc +0 -1
- data/src/core/lib/iomgr/pollset_windows.cc +2 -6
- data/src/core/lib/iomgr/pollset_windows.h +0 -1
- data/src/core/lib/iomgr/port.h +2 -2
- data/src/core/lib/iomgr/python_util.h +1 -2
- data/src/core/lib/iomgr/resolve_address.cc +4 -7
- data/src/core/lib/iomgr/resolve_address.h +3 -6
- data/src/core/lib/iomgr/resolve_address_impl.h +0 -1
- data/src/core/lib/iomgr/resolve_address_posix.cc +12 -21
- data/src/core/lib/iomgr/resolve_address_windows.cc +9 -12
- data/src/core/lib/iomgr/resolved_address.h +0 -1
- data/src/core/lib/iomgr/sockaddr_utils_posix.cc +5 -6
- data/src/core/lib/iomgr/socket_factory_posix.cc +1 -1
- data/src/core/lib/iomgr/socket_factory_posix.h +1 -2
- data/src/core/lib/iomgr/socket_mutator.cc +3 -5
- data/src/core/lib/iomgr/socket_mutator.h +2 -4
- data/src/core/lib/iomgr/socket_utils.h +0 -1
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +45 -52
- data/src/core/lib/iomgr/socket_utils_linux.cc +1 -3
- data/src/core/lib/iomgr/socket_utils_posix.cc +3 -6
- data/src/core/lib/iomgr/socket_utils_posix.h +1 -2
- data/src/core/lib/iomgr/socket_utils_windows.cc +1 -3
- data/src/core/lib/iomgr/socket_windows.cc +11 -14
- data/src/core/lib/iomgr/socket_windows.h +1 -2
- data/src/core/lib/iomgr/tcp_client.cc +2 -2
- data/src/core/lib/iomgr/tcp_client.h +1 -2
- data/src/core/lib/iomgr/tcp_client_cfstream.cc +12 -20
- data/src/core/lib/iomgr/tcp_client_posix.cc +24 -36
- data/src/core/lib/iomgr/tcp_client_windows.cc +9 -12
- data/src/core/lib/iomgr/tcp_posix.cc +124 -193
- data/src/core/lib/iomgr/tcp_posix.h +1 -3
- data/src/core/lib/iomgr/tcp_server.cc +2 -2
- data/src/core/lib/iomgr/tcp_server.h +3 -4
- data/src/core/lib/iomgr/tcp_server_posix.cc +61 -79
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +0 -1
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +13 -17
- data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +13 -14
- data/src/core/lib/iomgr/tcp_server_windows.cc +34 -41
- data/src/core/lib/iomgr/tcp_windows.cc +38 -66
- data/src/core/lib/iomgr/timer.cc +2 -2
- data/src/core/lib/iomgr/timer.h +2 -3
- data/src/core/lib/iomgr/timer_generic.cc +73 -106
- data/src/core/lib/iomgr/timer_generic.h +0 -1
- data/src/core/lib/iomgr/timer_heap.cc +4 -6
- data/src/core/lib/iomgr/timer_manager.cc +27 -44
- data/src/core/lib/iomgr/timer_manager.h +0 -1
- data/src/core/lib/iomgr/unix_sockets_posix.cc +5 -6
- data/src/core/lib/iomgr/unix_sockets_posix.h +1 -3
- data/src/core/lib/iomgr/unix_sockets_posix_noop.cc +2 -4
- data/src/core/lib/iomgr/vsock.cc +5 -8
- data/src/core/lib/iomgr/vsock.h +1 -3
- data/src/core/lib/iomgr/wakeup_fd_eventfd.cc +2 -4
- data/src/core/lib/iomgr/wakeup_fd_pipe.cc +6 -7
- data/src/core/lib/promise/activity.cc +4 -5
- data/src/core/lib/promise/activity.h +54 -23
- data/src/core/lib/promise/all_ok.h +52 -9
- data/src/core/lib/promise/arena_promise.h +1 -3
- data/src/core/lib/promise/cancel_callback.h +34 -6
- data/src/core/lib/promise/context.h +18 -9
- data/src/core/lib/promise/detail/basic_seq.h +33 -20
- data/src/core/lib/promise/detail/join_state.h +555 -760
- data/src/core/lib/promise/detail/promise_factory.h +45 -29
- data/src/core/lib/promise/detail/promise_like.h +49 -11
- data/src/core/lib/promise/detail/seq_state.h +1314 -1977
- data/src/core/lib/promise/detail/status.h +36 -14
- data/src/core/lib/promise/exec_ctx_wakeup_scheduler.h +1 -2
- data/src/core/lib/promise/for_each.h +97 -39
- data/src/core/lib/promise/if.h +21 -17
- data/src/core/lib/promise/interceptor_list.h +22 -36
- data/src/core/lib/promise/latch.h +25 -40
- data/src/core/lib/promise/loop.h +23 -10
- data/src/core/lib/promise/map.h +77 -9
- data/src/core/lib/promise/observable.h +181 -0
- data/src/core/lib/promise/party.cc +262 -154
- data/src/core/lib/promise/party.h +186 -388
- data/src/core/lib/promise/pipe.h +34 -57
- data/src/core/lib/promise/poll.h +117 -39
- data/src/core/lib/promise/promise.h +12 -6
- data/src/core/lib/promise/race.h +10 -5
- data/src/core/lib/promise/seq.h +57 -64
- data/src/core/lib/promise/sleep.cc +4 -5
- data/src/core/lib/promise/sleep.h +2 -4
- data/src/core/lib/promise/status_flag.h +160 -54
- data/src/core/lib/promise/try_join.h +37 -20
- data/src/core/lib/promise/try_seq.h +113 -77
- data/src/core/lib/resource_quota/api.cc +4 -7
- data/src/core/lib/resource_quota/api.h +3 -5
- data/src/core/lib/resource_quota/arena.cc +64 -87
- data/src/core/lib/resource_quota/arena.h +142 -215
- data/src/core/lib/resource_quota/connection_quota.cc +8 -10
- data/src/core/lib/resource_quota/connection_quota.h +3 -4
- data/src/core/lib/resource_quota/memory_quota.cc +51 -52
- data/src/core/lib/resource_quota/memory_quota.h +27 -21
- data/src/core/lib/resource_quota/periodic_update.cc +5 -5
- data/src/core/lib/resource_quota/periodic_update.h +1 -3
- data/src/core/lib/resource_quota/resource_quota.cc +2 -2
- data/src/core/lib/resource_quota/resource_quota.h +6 -8
- data/src/core/lib/resource_quota/thread_quota.cc +4 -4
- data/src/core/lib/resource_quota/thread_quota.h +3 -4
- data/src/core/lib/security/authorization/audit_logging.cc +10 -12
- data/src/core/lib/security/authorization/audit_logging.h +3 -5
- data/src/core/lib/security/authorization/authorization_engine.h +1 -1
- data/src/core/lib/security/authorization/authorization_policy_provider.h +5 -7
- data/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc +3 -4
- data/src/core/lib/security/authorization/evaluate_args.cc +11 -16
- data/src/core/lib/security/authorization/evaluate_args.h +1 -3
- data/src/core/lib/security/authorization/grpc_authorization_engine.cc +4 -5
- data/src/core/lib/security/authorization/grpc_authorization_engine.h +1 -3
- data/src/core/lib/security/authorization/grpc_server_authz_filter.cc +25 -34
- data/src/core/lib/security/authorization/grpc_server_authz_filter.h +11 -10
- data/src/core/lib/security/authorization/matchers.cc +5 -8
- data/src/core/lib/security/authorization/matchers.h +1 -3
- data/src/core/lib/security/authorization/rbac_policy.cc +2 -2
- data/src/core/lib/security/authorization/rbac_policy.h +2 -5
- data/src/core/lib/security/authorization/stdout_logger.cc +7 -7
- data/src/core/lib/security/authorization/stdout_logger.h +2 -3
- data/src/core/lib/security/certificate_provider/certificate_provider_factory.h +7 -8
- data/src/core/lib/security/certificate_provider/certificate_provider_registry.cc +6 -6
- data/src/core/lib/security/certificate_provider/certificate_provider_registry.h +0 -1
- data/src/core/lib/security/context/security_context.cc +51 -49
- data/src/core/lib/security/context/security_context.h +46 -17
- data/src/core/lib/security/credentials/alts/alts_credentials.cc +6 -7
- data/src/core/lib/security/credentials/alts/alts_credentials.h +11 -7
- data/src/core/lib/security/credentials/alts/check_gcp_environment.cc +4 -5
- data/src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc +1 -2
- data/src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc +3 -5
- data/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc +3 -5
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc +5 -7
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc +4 -5
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h +2 -2
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc +1 -2
- data/src/core/lib/security/credentials/call_creds_util.cc +8 -8
- data/src/core/lib/security/credentials/call_creds_util.h +2 -2
- data/src/core/lib/security/credentials/channel_creds_registry.h +5 -6
- data/src/core/lib/security/credentials/channel_creds_registry_init.cc +14 -13
- data/src/core/lib/security/credentials/composite/composite_credentials.cc +18 -21
- data/src/core/lib/security/credentials/composite/composite_credentials.h +9 -8
- data/src/core/lib/security/credentials/credentials.cc +20 -20
- data/src/core/lib/security/credentials/credentials.h +13 -14
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +336 -339
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.h +58 -46
- data/src/core/lib/security/credentials/external/aws_request_signer.cc +4 -5
- data/src/core/lib/security/credentials/external/aws_request_signer.h +1 -1
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +410 -374
- data/src/core/lib/security/credentials/external/external_account_credentials.h +127 -59
- data/src/core/lib/security/credentials/external/file_external_account_credentials.cc +90 -53
- data/src/core/lib/security/credentials/external/file_external_account_credentials.h +30 -9
- data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +103 -129
- data/src/core/lib/security/credentials/external/url_external_account_credentials.h +20 -22
- data/src/core/lib/security/credentials/fake/fake_credentials.cc +2 -4
- data/src/core/lib/security/credentials/fake/fake_credentials.h +10 -9
- data/src/core/lib/security/credentials/gcp_service_account_identity/gcp_service_account_identity_credentials.cc +195 -0
- data/src/core/lib/security/credentials/gcp_service_account_identity/gcp_service_account_identity_credentials.h +90 -0
- data/src/core/lib/security/credentials/google_default/credentials_generic.cc +4 -6
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +60 -77
- data/src/core/lib/security/credentials/google_default/google_default_credentials.h +9 -7
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +9 -14
- data/src/core/lib/security/credentials/iam/iam_credentials.h +6 -5
- data/src/core/lib/security/credentials/insecure/insecure_credentials.cc +2 -2
- data/src/core/lib/security/credentials/insecure/insecure_credentials.h +4 -4
- data/src/core/lib/security/credentials/jwt/json_token.cc +28 -31
- data/src/core/lib/security/credentials/jwt/json_token.h +2 -4
- data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +24 -30
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +9 -9
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +80 -87
- data/src/core/lib/security/credentials/jwt/jwt_verifier.h +3 -5
- data/src/core/lib/security/credentials/local/local_credentials.cc +3 -4
- data/src/core/lib/security/credentials/local/local_credentials.h +5 -5
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +202 -302
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +48 -71
- data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +22 -35
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +11 -13
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +47 -59
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +8 -9
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc +28 -28
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h +2 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_match.cc +0 -2
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +107 -46
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +15 -14
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc +8 -12
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h +9 -10
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +27 -29
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +2 -1
- data/src/core/lib/security/credentials/tls/grpc_tls_crl_provider.cc +6 -10
- data/src/core/lib/security/credentials/tls/grpc_tls_crl_provider.h +6 -9
- data/src/core/lib/security/credentials/tls/tls_credentials.cc +20 -24
- data/src/core/lib/security/credentials/tls/tls_credentials.h +7 -5
- data/src/core/lib/security/credentials/tls/tls_utils.cc +5 -7
- data/src/core/lib/security/credentials/tls/tls_utils.h +1 -2
- data/src/core/lib/security/credentials/token_fetcher/token_fetcher_credentials.cc +305 -0
- data/src/core/lib/security/credentials/token_fetcher/token_fetcher_credentials.h +181 -0
- data/src/core/lib/security/credentials/xds/xds_credentials.cc +21 -19
- data/src/core/lib/security/credentials/xds/xds_credentials.h +7 -9
- data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +35 -40
- data/src/core/lib/security/security_connector/alts/alts_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +28 -28
- data/src/core/lib/security/security_connector/fake/fake_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc +8 -10
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +5 -6
- data/src/core/lib/security/security_connector/load_system_roots.h +1 -2
- data/src/core/lib/security/security_connector/load_system_roots_supported.cc +8 -10
- data/src/core/lib/security/security_connector/load_system_roots_supported.h +1 -2
- data/src/core/lib/security/security_connector/load_system_roots_windows.cc +4 -6
- data/src/core/lib/security/security_connector/local/local_security_connector.cc +35 -35
- data/src/core/lib/security/security_connector/local/local_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/security_connector.cc +11 -15
- data/src/core/lib/security/security_connector/security_connector.h +8 -11
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +28 -32
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +4 -5
- data/src/core/lib/security/security_connector/ssl_utils.cc +42 -42
- data/src/core/lib/security/security_connector/ssl_utils.h +6 -9
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +49 -62
- data/src/core/lib/security/security_connector/tls/tls_security_connector.h +6 -7
- data/src/core/lib/security/transport/auth_filters.h +20 -16
- data/src/core/lib/security/transport/client_auth_filter.cc +19 -27
- data/src/core/lib/security/transport/server_auth_filter.cc +23 -32
- data/src/core/lib/security/util/json_util.cc +4 -6
- data/src/core/lib/security/util/json_util.h +1 -1
- data/src/core/lib/slice/percent_encoding.cc +4 -6
- data/src/core/lib/slice/slice.cc +13 -15
- data/src/core/lib/slice/slice.h +8 -11
- data/src/core/lib/slice/slice_buffer.cc +18 -19
- data/src/core/lib/slice/slice_buffer.h +2 -4
- data/src/core/lib/slice/slice_internal.h +4 -7
- data/src/core/lib/slice/slice_refcount.h +7 -15
- data/src/core/lib/slice/slice_string_helpers.cc +3 -3
- data/src/core/lib/slice/slice_string_helpers.h +1 -3
- data/src/core/lib/surface/byte_buffer.cc +2 -4
- data/src/core/lib/surface/byte_buffer_reader.cc +5 -7
- data/src/core/lib/surface/call.cc +205 -3992
- data/src/core/lib/surface/call.h +176 -100
- data/src/core/lib/surface/call_details.cc +5 -5
- data/src/core/lib/surface/call_log_batch.cc +7 -11
- data/src/core/lib/surface/call_test_only.h +2 -4
- data/src/core/lib/surface/call_utils.cc +231 -0
- data/src/core/lib/surface/call_utils.h +486 -0
- data/src/core/lib/surface/channel.cc +47 -45
- data/src/core/lib/surface/channel.h +20 -19
- data/src/core/lib/surface/channel_create.cc +31 -15
- data/src/core/lib/surface/channel_create.h +3 -3
- data/src/core/lib/surface/channel_init.cc +273 -270
- data/src/core/lib/surface/channel_init.h +179 -120
- data/src/core/lib/surface/channel_stack_type.cc +2 -2
- data/src/core/lib/surface/client_call.cc +441 -0
- data/src/core/lib/surface/client_call.h +187 -0
- data/src/core/lib/surface/completion_queue.cc +127 -124
- data/src/core/lib/surface/completion_queue.h +4 -14
- data/src/core/lib/surface/completion_queue_factory.cc +8 -9
- data/src/core/lib/surface/completion_queue_factory.h +1 -2
- data/src/core/lib/surface/connection_context.cc +77 -0
- data/src/core/lib/surface/connection_context.h +156 -0
- data/src/core/lib/surface/event_string.cc +2 -2
- data/src/core/lib/surface/event_string.h +1 -2
- data/src/core/lib/surface/filter_stack_call.cc +1156 -0
- data/src/core/lib/surface/filter_stack_call.h +366 -0
- data/src/core/lib/surface/init.cc +60 -21
- data/src/core/lib/surface/init.h +5 -0
- data/src/core/lib/surface/init_internally.cc +2 -2
- data/src/core/lib/surface/lame_client.cc +20 -26
- data/src/core/lib/surface/lame_client.h +9 -13
- data/src/core/lib/surface/legacy_channel.cc +69 -55
- data/src/core/lib/surface/legacy_channel.h +14 -25
- data/src/core/lib/surface/metadata_array.cc +6 -7
- data/src/core/lib/surface/server_call.cc +227 -0
- data/src/core/lib/surface/server_call.h +167 -0
- data/src/core/lib/surface/validate_metadata.cc +4 -6
- data/src/core/lib/surface/validate_metadata.h +3 -6
- data/src/core/lib/surface/version.cc +3 -4
- data/src/core/lib/transport/bdp_estimator.cc +14 -20
- data/src/core/lib/transport/bdp_estimator.h +12 -18
- data/src/core/{resolver/xds/xds_resolver_trace.cc → lib/transport/call_arena_allocator.cc} +7 -5
- data/src/core/lib/transport/call_arena_allocator.h +91 -0
- data/src/core/lib/transport/call_destination.h +76 -0
- data/src/core/lib/transport/call_filters.cc +64 -393
- data/src/core/lib/transport/call_filters.h +810 -710
- data/src/core/lib/transport/call_final_info.cc +2 -2
- data/src/core/lib/transport/call_final_info.h +3 -4
- data/src/core/lib/transport/call_spine.cc +99 -79
- data/src/core/lib/transport/call_spine.h +252 -251
- data/src/core/lib/transport/call_state.cc +39 -0
- data/src/core/lib/transport/call_state.h +1061 -0
- data/src/core/lib/transport/connectivity_state.cc +38 -47
- data/src/core/lib/transport/connectivity_state.h +3 -7
- data/src/core/lib/transport/error_utils.cc +3 -5
- data/src/core/lib/transport/error_utils.h +2 -4
- data/src/core/lib/transport/interception_chain.cc +147 -0
- data/src/core/lib/transport/interception_chain.h +253 -0
- data/src/core/lib/transport/message.cc +3 -4
- data/src/core/lib/transport/message.h +5 -0
- data/src/core/lib/transport/metadata.cc +29 -5
- data/src/core/lib/transport/metadata.h +37 -2
- data/src/core/lib/transport/metadata_batch.cc +12 -5
- data/src/core/lib/transport/metadata_batch.h +104 -15
- data/src/core/lib/transport/metadata_compression_traits.h +2 -3
- data/src/core/lib/transport/metadata_info.cc +2 -2
- data/src/core/lib/transport/metadata_info.h +1 -1
- data/src/core/lib/transport/parsed_metadata.cc +2 -2
- data/src/core/lib/transport/parsed_metadata.h +2 -5
- data/src/core/lib/transport/simple_slice_based_metadata.h +0 -1
- data/src/core/lib/transport/status_conversion.cc +2 -2
- data/src/core/lib/transport/status_conversion.h +2 -3
- data/src/core/lib/transport/timeout_encoding.cc +11 -12
- data/src/core/lib/transport/timeout_encoding.h +1 -3
- data/src/core/lib/transport/transport.cc +7 -13
- data/src/core/lib/transport/transport.h +94 -88
- data/src/core/lib/transport/transport_framing_endpoint_extension.h +47 -0
- data/src/core/lib/transport/transport_op_string.cc +2 -5
- data/src/core/load_balancing/address_filtering.cc +2 -4
- data/src/core/load_balancing/address_filtering.h +2 -3
- data/src/core/load_balancing/backend_metric_parser.cc +1 -2
- data/src/core/load_balancing/backend_metric_parser.h +0 -2
- data/src/core/load_balancing/child_policy_handler.cc +42 -46
- data/src/core/load_balancing/child_policy_handler.h +2 -3
- data/src/core/load_balancing/delegating_helper.h +6 -8
- data/src/core/load_balancing/endpoint_list.cc +17 -21
- data/src/core/load_balancing/endpoint_list.h +20 -16
- data/src/core/load_balancing/grpclb/client_load_reporting_filter.cc +38 -34
- data/src/core/load_balancing/grpclb/client_load_reporting_filter.h +21 -7
- data/src/core/load_balancing/grpclb/grpclb.cc +180 -214
- data/src/core/load_balancing/grpclb/grpclb_balancer_addresses.cc +2 -3
- data/src/core/load_balancing/grpclb/grpclb_balancer_addresses.h +1 -2
- data/src/core/load_balancing/grpclb/grpclb_client_stats.cc +3 -5
- data/src/core/load_balancing/grpclb/grpclb_client_stats.h +4 -7
- data/src/core/load_balancing/grpclb/load_balancer_api.cc +7 -11
- data/src/core/load_balancing/grpclb/load_balancer_api.h +3 -6
- data/src/core/load_balancing/health_check_client.cc +62 -83
- data/src/core/load_balancing/health_check_client.h +1 -1
- data/src/core/load_balancing/health_check_client_internal.h +6 -8
- data/src/core/load_balancing/lb_policy.cc +7 -10
- data/src/core/load_balancing/lb_policy.h +72 -39
- data/src/core/load_balancing/lb_policy_factory.h +3 -4
- data/src/core/load_balancing/lb_policy_registry.cc +7 -9
- data/src/core/load_balancing/lb_policy_registry.h +3 -4
- data/src/core/load_balancing/oob_backend_metric.cc +22 -29
- data/src/core/load_balancing/oob_backend_metric.h +1 -1
- data/src/core/load_balancing/oob_backend_metric_internal.h +6 -8
- data/src/core/load_balancing/outlier_detection/outlier_detection.cc +143 -188
- data/src/core/load_balancing/outlier_detection/outlier_detection.h +5 -7
- data/src/core/load_balancing/pick_first/pick_first.cc +1190 -286
- data/src/core/load_balancing/priority/priority.cc +107 -146
- data/src/core/load_balancing/ring_hash/ring_hash.cc +86 -93
- data/src/core/load_balancing/ring_hash/ring_hash.h +5 -6
- data/src/core/load_balancing/rls/rls.cc +364 -362
- data/src/core/load_balancing/round_robin/round_robin.cc +81 -97
- data/src/core/load_balancing/subchannel_interface.h +15 -5
- data/src/core/load_balancing/weighted_round_robin/static_stride_scheduler.cc +7 -8
- data/src/core/load_balancing/weighted_round_robin/static_stride_scheduler.h +1 -2
- data/src/core/load_balancing/weighted_round_robin/weighted_round_robin.cc +162 -169
- data/src/core/load_balancing/weighted_target/weighted_target.cc +79 -115
- data/src/core/load_balancing/weighted_target/weighted_target.h +1 -1
- data/src/core/load_balancing/xds/cds.cc +62 -79
- data/src/core/load_balancing/xds/xds_cluster_impl.cc +188 -163
- data/src/core/load_balancing/xds/xds_cluster_manager.cc +53 -86
- data/src/core/load_balancing/xds/xds_override_host.cc +126 -188
- data/src/core/load_balancing/xds/xds_override_host.h +5 -6
- data/src/core/load_balancing/xds/xds_wrr_locality.cc +37 -48
- data/src/core/plugin_registry/grpc_plugin_registry.cc +12 -17
- data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +7 -3
- data/src/core/resolver/dns/c_ares/dns_resolver_ares.cc +89 -65
- data/src/core/resolver/dns/c_ares/dns_resolver_ares.h +1 -2
- data/src/core/resolver/dns/c_ares/grpc_ares_ev_driver.h +3 -5
- data/src/core/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +6 -9
- data/src/core/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +153 -134
- data/src/core/resolver/dns/c_ares/grpc_ares_wrapper.cc +176 -161
- data/src/core/resolver/dns/c_ares/grpc_ares_wrapper.h +3 -18
- data/src/core/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc +1 -1
- data/src/core/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +2 -2
- data/src/core/resolver/dns/dns_resolver_plugin.cc +11 -13
- data/src/core/resolver/dns/dns_resolver_plugin.h +1 -1
- data/src/core/resolver/dns/event_engine/event_engine_client_channel_resolver.cc +56 -63
- data/src/core/resolver/dns/event_engine/event_engine_client_channel_resolver.h +2 -3
- data/src/core/resolver/dns/event_engine/service_config_helper.cc +8 -10
- data/src/core/resolver/dns/native/dns_resolver.cc +21 -31
- data/src/core/resolver/dns/native/dns_resolver.h +1 -1
- data/src/core/resolver/endpoint_addresses.cc +5 -8
- data/src/core/resolver/endpoint_addresses.h +3 -1
- data/src/core/resolver/fake/fake_resolver.cc +10 -12
- data/src/core/resolver/fake/fake_resolver.h +6 -8
- data/src/core/resolver/google_c2p/google_c2p_resolver.cc +29 -31
- data/src/core/resolver/polling_resolver.cc +42 -58
- data/src/core/resolver/polling_resolver.h +6 -8
- data/src/core/resolver/resolver.cc +3 -7
- data/src/core/resolver/resolver.h +2 -8
- data/src/core/resolver/resolver_factory.h +2 -3
- data/src/core/resolver/resolver_registry.cc +12 -14
- data/src/core/resolver/resolver_registry.h +2 -3
- data/src/core/resolver/sockaddr/sockaddr_resolver.cc +6 -8
- data/src/core/resolver/xds/xds_config.cc +95 -0
- data/src/core/resolver/xds/xds_config.h +108 -0
- data/src/core/resolver/xds/xds_dependency_manager.cc +86 -174
- data/src/core/resolver/xds/xds_dependency_manager.h +11 -76
- data/src/core/resolver/xds/xds_resolver.cc +140 -126
- data/src/core/resolver/xds/xds_resolver_attributes.h +6 -3
- data/src/core/{lib/surface → server}/server.cc +420 -519
- data/src/core/{lib/surface → server}/server.h +52 -38
- data/src/core/{lib/channel → server}/server_call_tracer_filter.cc +27 -23
- data/src/core/{lib/channel → server}/server_call_tracer_filter.h +4 -4
- data/src/core/{ext/filters/server_config_selector → server}/server_config_selector.h +7 -8
- data/src/core/{ext/filters/server_config_selector → server}/server_config_selector_filter.cc +51 -47
- data/src/core/{ext/filters/server_config_selector → server}/server_config_selector_filter.h +3 -3
- data/src/core/{lib/surface → server}/server_interface.h +6 -4
- data/src/core/{ext/xds → server}/xds_channel_stack_modifier.cc +5 -5
- data/src/core/{ext/xds → server}/xds_channel_stack_modifier.h +7 -9
- data/src/core/{ext/xds → server}/xds_server_config_fetcher.cc +83 -92
- data/src/core/service_config/service_config.h +3 -6
- data/src/core/service_config/service_config_call_data.h +20 -19
- data/src/core/service_config/service_config_channel_arg_filter.cc +20 -17
- data/src/core/service_config/service_config_impl.cc +9 -11
- data/src/core/service_config/service_config_impl.h +6 -9
- data/src/core/service_config/service_config_parser.cc +4 -9
- data/src/core/service_config/service_config_parser.h +2 -4
- data/src/core/{lib/channel → telemetry}/call_tracer.cc +58 -36
- data/src/core/{lib/channel → telemetry}/call_tracer.h +50 -14
- data/src/core/{lib/debug → telemetry}/histogram_view.cc +5 -5
- data/src/core/{lib/debug → telemetry}/histogram_view.h +3 -4
- data/src/core/telemetry/metrics.cc +180 -0
- data/src/core/telemetry/metrics.h +569 -0
- data/src/core/{lib/debug → telemetry}/stats.cc +2 -3
- data/src/core/{lib/debug → telemetry}/stats.h +6 -8
- data/src/core/{lib/debug → telemetry}/stats_data.cc +182 -3
- data/src/core/{lib/debug → telemetry}/stats_data.h +133 -7
- data/src/core/{lib/channel → telemetry}/tcp_tracer.h +3 -4
- data/src/core/tsi/alts/crypt/aes_gcm.cc +4 -8
- data/src/core/tsi/alts/crypt/gsec.cc +2 -4
- data/src/core/tsi/alts/crypt/gsec.h +3 -5
- data/src/core/tsi/alts/frame_protector/alts_counter.cc +2 -4
- data/src/core/tsi/alts/frame_protector/alts_counter.h +2 -4
- data/src/core/tsi/alts/frame_protector/alts_crypter.cc +2 -4
- data/src/core/tsi/alts/frame_protector/alts_crypter.h +1 -3
- data/src/core/tsi/alts/frame_protector/alts_frame_protector.cc +16 -19
- data/src/core/tsi/alts/frame_protector/alts_frame_protector.h +0 -1
- data/src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.cc +1 -2
- data/src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.h +1 -2
- data/src/core/tsi/alts/frame_protector/alts_seal_privacy_integrity_crypter.cc +2 -3
- data/src/core/tsi/alts/frame_protector/alts_unseal_privacy_integrity_crypter.cc +2 -3
- data/src/core/tsi/alts/frame_protector/frame_handler.cc +11 -13
- data/src/core/tsi/alts/frame_protector/frame_handler.h +0 -1
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +78 -82
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.h +1 -2
- data/src/core/tsi/alts/handshaker/alts_shared_resource.cc +5 -6
- data/src/core/tsi/alts/handshaker/alts_shared_resource.h +2 -3
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +76 -76
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +1 -2
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.cc +6 -5
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.h +1 -2
- data/src/core/tsi/alts/handshaker/transport_security_common_api.cc +17 -24
- data/src/core/tsi/alts/handshaker/transport_security_common_api.h +4 -6
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc +17 -19
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h +0 -1
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc +12 -14
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.h +0 -1
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h +1 -2
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc +16 -14
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.cc +3 -6
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h +0 -1
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +13 -16
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h +0 -1
- data/src/core/tsi/fake_transport_security.cc +31 -34
- data/src/core/tsi/local_transport_security.cc +9 -11
- data/src/core/tsi/local_transport_security.h +1 -2
- data/src/core/tsi/ssl/key_logging/ssl_key_logging.cc +13 -15
- data/src/core/tsi/ssl/key_logging/ssl_key_logging.h +7 -10
- data/src/core/tsi/ssl/session_cache/ssl_session.h +3 -5
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +16 -17
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +8 -10
- data/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc +4 -7
- data/src/core/tsi/ssl_transport_security.cc +154 -131
- data/src/core/tsi/ssl_transport_security.h +5 -8
- data/src/core/tsi/ssl_transport_security_utils.cc +86 -32
- data/src/core/tsi/ssl_transport_security_utils.h +13 -5
- data/src/core/tsi/ssl_types.h +0 -1
- data/src/core/tsi/transport_security.cc +3 -9
- data/src/core/tsi/transport_security.h +0 -3
- data/src/core/tsi/transport_security_grpc.cc +2 -2
- data/src/core/tsi/transport_security_grpc.h +1 -2
- data/src/core/tsi/transport_security_interface.h +2 -7
- data/src/core/{lib/gpr → util}/alloc.cc +4 -6
- data/src/core/{lib/gpr → util}/alloc.h +3 -3
- data/src/core/{lib/gpr → util}/atm.cc +2 -3
- data/src/core/{lib/gprpp → util}/atomic_utils.h +3 -3
- data/src/core/{lib/avl → util}/avl.h +6 -7
- data/src/core/{lib/backoff → util}/backoff.cc +9 -10
- data/src/core/{lib/backoff → util}/backoff.h +8 -11
- data/src/core/{lib/gprpp → util}/bitset.h +5 -6
- data/src/core/{lib/gprpp → util}/chunked_vector.h +8 -9
- data/src/core/{lib/gprpp → util}/construct_destruct.h +6 -5
- data/src/core/{lib/gprpp → util}/cpp_impl_of.h +3 -3
- data/src/core/{lib/gprpp → util}/crash.cc +4 -7
- data/src/core/{lib/gprpp → util}/crash.h +4 -5
- data/src/core/{lib/gprpp → util}/debug_location.h +10 -3
- data/src/core/{lib/gprpp → util}/directory_reader.h +3 -3
- data/src/core/{lib/gprpp → util}/down_cast.h +7 -8
- data/src/core/{lib/gprpp → util}/dual_ref_counted.h +59 -47
- data/src/core/util/dump_args.cc +54 -0
- data/src/core/util/dump_args.h +122 -0
- data/src/core/{lib/gprpp → util}/env.h +3 -3
- data/src/core/{lib/debug → util}/event_log.cc +4 -5
- data/src/core/{lib/debug → util}/event_log.h +6 -8
- data/src/core/{lib/gprpp → util}/examine_stack.cc +2 -2
- data/src/core/{lib/gprpp → util}/examine_stack.h +3 -3
- data/src/core/{lib/gprpp → util}/fork.cc +6 -7
- data/src/core/{lib/gprpp → util}/fork.h +5 -5
- data/src/core/{ext/gcp/metadata_query.cc → util/gcp_metadata_query.cc} +33 -37
- data/src/core/{ext/gcp/metadata_query.h → util/gcp_metadata_query.h} +11 -12
- data/src/core/{lib/iomgr → util}/gethostname.h +3 -3
- data/src/core/{lib/iomgr → util}/gethostname_fallback.cc +1 -1
- data/src/core/{lib/iomgr → util}/gethostname_host_name_max.cc +2 -3
- data/src/core/{lib/iomgr → util}/gethostname_sysconf.cc +2 -3
- data/src/core/util/glob.cc +70 -0
- data/src/core/util/glob.h +29 -0
- data/src/core/{lib/gpr/time.cc → util/gpr_time.cc} +16 -17
- data/src/core/{lib/iomgr → util}/grpc_if_nametoindex.h +3 -4
- data/src/core/{lib/iomgr → util}/grpc_if_nametoindex_posix.cc +4 -6
- data/src/core/{lib/iomgr → util}/grpc_if_nametoindex_unsupported.cc +5 -8
- data/src/core/{lib/gprpp → util}/host_port.cc +7 -7
- data/src/core/{lib/gprpp → util}/host_port.h +3 -3
- data/src/core/{lib/http → util/http_client}/format_request.cc +4 -7
- data/src/core/{lib/http → util/http_client}/format_request.h +5 -6
- data/src/core/{lib/http → util/http_client}/httpcli.cc +62 -74
- data/src/core/{lib/http → util/http_client}/httpcli.h +32 -31
- data/src/core/{lib/http → util/http_client}/httpcli_security_connector.cc +18 -21
- data/src/core/{lib/http → util/http_client}/httpcli_ssl_credentials.h +5 -6
- data/src/core/{lib/http → util/http_client}/parser.cc +11 -15
- data/src/core/{lib/http → util/http_client}/parser.h +4 -8
- data/src/core/{lib/gprpp → util}/if_list.h +3 -3
- data/src/core/{lib/gpr → util}/iphone/cpu.cc +1 -2
- data/src/core/{lib → util}/json/json.h +4 -5
- data/src/core/{lib → util}/json/json_args.h +3 -3
- data/src/core/{lib → util}/json/json_channel_args.h +4 -5
- data/src/core/{lib → util}/json/json_object_loader.cc +3 -4
- data/src/core/{lib → util}/json/json_object_loader.h +13 -14
- data/src/core/{lib → util}/json/json_reader.cc +6 -9
- data/src/core/{lib → util}/json/json_reader.h +4 -5
- data/src/core/{lib → util}/json/json_util.cc +6 -6
- data/src/core/{lib → util}/json/json_util.h +5 -6
- data/src/core/{lib → util}/json/json_writer.cc +2 -4
- data/src/core/{lib → util}/json/json_writer.h +4 -4
- data/src/core/util/latent_see.cc +163 -0
- data/src/core/util/latent_see.h +334 -0
- data/src/core/{lib/gpr → util}/linux/cpu.cc +11 -12
- data/src/core/{lib/gprpp → util}/linux/env.cc +1 -1
- data/src/core/{lib/gprpp → util}/load_file.cc +4 -7
- data/src/core/{lib/gprpp → util}/load_file.h +3 -4
- data/src/core/util/log.cc +127 -0
- data/src/core/util/lru_cache.h +122 -0
- data/src/core/{lib/gprpp → util}/manual_constructor.h +4 -5
- data/src/core/{lib/gprpp → util}/match.h +4 -5
- data/src/core/{lib/matchers → util}/matchers.cc +9 -2
- data/src/core/{lib/matchers → util}/matchers.h +8 -4
- data/src/core/{lib/gprpp → util}/memory.h +4 -5
- data/src/core/{lib/gprpp → util}/mpscq.cc +2 -2
- data/src/core/{lib/gprpp → util}/mpscq.h +7 -8
- data/src/core/{lib/gpr → util}/msys/tmpfile.cc +5 -7
- data/src/core/{lib/gprpp → util}/no_destruct.h +4 -4
- data/src/core/{lib/gprpp → util}/notification.h +4 -5
- data/src/core/{lib/gprpp → util}/orphanable.h +7 -7
- data/src/core/{lib/gprpp → util}/overload.h +3 -3
- data/src/core/{lib/gprpp → util}/packed_table.h +5 -5
- data/src/core/{lib/gprpp → util}/per_cpu.cc +3 -4
- data/src/core/{lib/gprpp → util}/per_cpu.h +4 -6
- data/src/core/{lib/gpr → util}/posix/cpu.cc +6 -7
- data/src/core/{lib/gprpp → util}/posix/directory_reader.cc +2 -2
- data/src/core/{lib/gprpp → util}/posix/env.cc +1 -1
- data/src/core/{lib/gprpp → util}/posix/stat.cc +8 -8
- data/src/core/{lib/gpr → util}/posix/string.cc +2 -3
- data/src/core/{lib/gpr → util}/posix/sync.cc +26 -27
- data/src/core/{lib/gprpp → util}/posix/thd.cc +22 -26
- data/src/core/{lib/gpr → util}/posix/time.cc +12 -11
- data/src/core/{lib/gpr → util}/posix/tmpfile.cc +13 -13
- data/src/core/{lib/backoff → util}/random_early_detection.cc +2 -2
- data/src/core/{lib/backoff → util}/random_early_detection.h +3 -4
- data/src/core/{lib/gprpp → util}/ref_counted.h +40 -32
- data/src/core/{lib/gprpp → util}/ref_counted_ptr.h +5 -7
- data/src/core/{lib/gprpp → util}/ref_counted_string.cc +3 -5
- data/src/core/{lib/gprpp → util}/ref_counted_string.h +5 -7
- data/src/core/util/ring_buffer.h +123 -0
- data/src/core/{lib/gprpp → util}/single_set_ptr.h +10 -8
- data/src/core/{lib/gprpp → util}/sorted_pack.h +4 -4
- data/src/core/{lib/gpr → util}/spinlock.h +5 -7
- data/src/core/{lib/gprpp → util}/stat.h +3 -4
- data/src/core/{lib/gprpp → util}/status_helper.cc +18 -40
- data/src/core/{lib/gprpp → util}/status_helper.h +7 -37
- data/src/core/{lib/gprpp → util}/strerror.cc +2 -3
- data/src/core/{lib/gprpp → util}/strerror.h +3 -3
- data/src/core/{lib/gpr → util}/string.cc +15 -18
- data/src/core/{lib/gpr → util}/string.h +4 -6
- data/src/core/{lib/gpr → util}/sync.cc +6 -7
- data/src/core/{lib/gprpp → util}/sync.h +9 -10
- data/src/core/{lib/gpr → util}/sync_abseil.cc +5 -8
- data/src/core/{lib/gprpp → util}/table.h +56 -22
- data/src/core/{lib/gprpp → util}/tchar.cc +2 -2
- data/src/core/{lib/gprpp → util}/tchar.h +3 -3
- data/src/core/{lib/gprpp → util}/thd.h +10 -12
- data/src/core/{lib/gprpp → util}/time.cc +16 -18
- data/src/core/{lib/gprpp → util}/time.h +29 -29
- data/src/core/{lib/gprpp → util}/time_averaged_stats.cc +2 -2
- data/src/core/{lib/gprpp → util}/time_averaged_stats.h +3 -3
- data/src/core/{lib/gpr → util}/time_precise.cc +7 -7
- data/src/core/{lib/gpr → util}/time_precise.h +3 -4
- data/src/core/{lib/gprpp → util}/time_util.cc +6 -7
- data/src/core/{lib/gprpp → util}/time_util.h +4 -5
- data/src/core/{lib/gpr → util}/tmpfile.h +3 -4
- data/src/core/{lib/gprpp → util}/type_list.h +3 -3
- data/src/core/util/unique_ptr_with_bitset.h +86 -0
- data/src/core/{lib/gprpp → util}/unique_type_name.h +32 -13
- data/src/core/{ext/xds → util}/upb_utils.h +3 -5
- data/src/core/{lib/uri/uri_parser.cc → util/uri.cc} +14 -10
- data/src/core/{lib/uri/uri_parser.h → util/uri.h} +8 -4
- data/src/core/{lib/gpr → util}/useful.h +23 -52
- data/src/core/{lib/gprpp → util}/uuid_v4.cc +2 -2
- data/src/core/{lib/gprpp → util}/uuid_v4.h +3 -4
- data/src/core/{lib/gprpp → util}/validation_errors.cc +11 -3
- data/src/core/{lib/gprpp → util}/validation_errors.h +14 -4
- data/src/core/{lib/gpr → util}/windows/cpu.cc +1 -2
- data/src/core/{lib/gprpp → util}/windows/directory_reader.cc +1 -3
- data/src/core/{lib/gprpp → util}/windows/env.cc +2 -2
- data/src/core/{lib/gprpp → util}/windows/stat.cc +9 -9
- data/src/core/{lib/gpr → util}/windows/string.cc +3 -4
- data/src/core/{lib/gpr → util}/windows/string_util.cc +6 -8
- data/src/core/{lib/gpr → util}/windows/sync.cc +3 -3
- data/src/core/{lib/gprpp → util}/windows/thd.cc +10 -10
- data/src/core/{lib/gpr → util}/windows/time.cc +6 -6
- data/src/core/{lib/gpr → util}/windows/tmpfile.cc +5 -7
- data/src/core/{lib/gprpp → util}/work_serializer.cc +79 -99
- data/src/core/{lib/gprpp → util}/work_serializer.h +6 -8
- data/src/core/{lib/gprpp → util}/xxhash_inline.h +3 -3
- data/src/core/{ext/xds → xds/grpc}/certificate_provider_store.cc +7 -9
- data/src/core/{ext/xds → xds/grpc}/certificate_provider_store.h +14 -16
- data/src/core/{ext/xds → xds/grpc}/file_watcher_certificate_provider_factory.cc +7 -9
- data/src/core/{ext/xds → xds/grpc}/file_watcher_certificate_provider_factory.h +10 -12
- data/src/core/{ext/xds → xds/grpc}/xds_audit_logger_registry.cc +6 -6
- data/src/core/{ext/xds → xds/grpc}/xds_audit_logger_registry.h +6 -7
- data/src/core/{ext/xds → xds/grpc}/xds_bootstrap_grpc.cc +9 -168
- data/src/core/{ext/xds → xds/grpc}/xds_bootstrap_grpc.h +15 -45
- data/src/core/{ext/xds → xds/grpc}/xds_certificate_provider.cc +7 -8
- data/src/core/{ext/xds → xds/grpc}/xds_certificate_provider.h +13 -13
- data/src/core/{ext/xds → xds/grpc}/xds_client_grpc.cc +119 -84
- data/src/core/{ext/xds → xds/grpc}/xds_client_grpc.h +21 -16
- data/src/core/xds/grpc/xds_cluster.cc +79 -0
- data/src/core/{ext/xds → xds/grpc}/xds_cluster.h +43 -53
- data/src/core/{ext/xds/xds_cluster.cc → xds/grpc/xds_cluster_parser.cc} +184 -207
- data/src/core/xds/grpc/xds_cluster_parser.h +61 -0
- data/src/core/{ext/xds → xds/grpc}/xds_cluster_specifier_plugin.cc +9 -12
- data/src/core/{ext/xds → xds/grpc}/xds_cluster_specifier_plugin.h +6 -7
- data/src/core/xds/grpc/xds_common_types.cc +103 -0
- data/src/core/{ext/xds → xds/grpc}/xds_common_types.h +13 -31
- data/src/core/{ext/xds/xds_common_types.cc → xds/grpc/xds_common_types_parser.cc} +79 -85
- data/src/core/xds/grpc/xds_common_types_parser.h +76 -0
- data/src/core/xds/grpc/xds_endpoint.cc +97 -0
- data/src/core/{ext/xds → xds/grpc}/xds_endpoint.h +12 -34
- data/src/core/{ext/xds/xds_endpoint.cc → xds/grpc/xds_endpoint_parser.cc} +88 -161
- data/src/core/xds/grpc/xds_endpoint_parser.h +47 -0
- data/src/core/{ext/xds → xds/grpc}/xds_health_status.cc +1 -3
- data/src/core/{ext/xds → xds/grpc}/xds_health_status.h +3 -6
- data/src/core/{ext/xds → xds/grpc}/xds_http_fault_filter.cc +30 -19
- data/src/core/{ext/xds → xds/grpc}/xds_http_fault_filter.h +14 -10
- data/src/core/{ext/xds/xds_http_filters.h → xds/grpc/xds_http_filter.h} +23 -71
- data/src/core/{ext/xds/xds_http_filters.cc → xds/grpc/xds_http_filter_registry.cc} +16 -11
- data/src/core/xds/grpc/xds_http_filter_registry.h +104 -0
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.cc +141 -0
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.h +60 -0
- data/src/core/{ext/xds → xds/grpc}/xds_http_rbac_filter.cc +68 -54
- data/src/core/{ext/xds → xds/grpc}/xds_http_rbac_filter.h +14 -10
- data/src/core/{ext/xds → xds/grpc}/xds_http_stateful_session_filter.cc +25 -13
- data/src/core/{ext/xds → xds/grpc}/xds_http_stateful_session_filter.h +14 -10
- data/src/core/{ext/xds → xds/grpc}/xds_lb_policy_registry.cc +25 -31
- data/src/core/{ext/xds → xds/grpc}/xds_lb_policy_registry.h +7 -8
- data/src/core/xds/grpc/xds_listener.cc +175 -0
- data/src/core/{ext/xds → xds/grpc}/xds_listener.h +9 -42
- data/src/core/{ext/xds/xds_listener.cc → xds/grpc/xds_listener_parser.cc} +66 -215
- data/src/core/xds/grpc/xds_listener_parser.h +59 -0
- data/src/core/xds/grpc/xds_metadata.cc +62 -0
- data/src/core/xds/grpc/xds_metadata.h +150 -0
- data/src/core/xds/grpc/xds_metadata_parser.cc +184 -0
- data/src/core/xds/grpc/xds_metadata_parser.h +35 -0
- data/src/core/xds/grpc/xds_route_config.cc +282 -0
- data/src/core/{ext/xds → xds/grpc}/xds_route_config.h +13 -46
- data/src/core/{ext/xds/xds_route_config.cc → xds/grpc/xds_route_config_parser.cc} +77 -313
- data/src/core/xds/grpc/xds_route_config_parser.h +77 -0
- data/src/core/{ext/xds → xds/grpc}/xds_routing.cc +64 -31
- data/src/core/{ext/xds → xds/grpc}/xds_routing.h +16 -10
- data/src/core/xds/grpc/xds_server_grpc.cc +160 -0
- data/src/core/xds/grpc/xds_server_grpc.h +63 -0
- data/src/core/{ext/xds → xds/grpc}/xds_transport_grpc.cc +112 -69
- data/src/core/{ext/xds → xds/grpc}/xds_transport_grpc.h +37 -27
- data/src/core/xds/xds_client/lrs_client.cc +1292 -0
- data/src/core/xds/xds_client/lrs_client.h +394 -0
- data/src/core/{ext/xds → xds/xds_client}/xds_api.cc +39 -258
- data/src/core/{ext/xds → xds/xds_client}/xds_api.h +15 -38
- data/src/core/xds/xds_client/xds_backend_metric_propagation.cc +63 -0
- data/src/core/xds/xds_client/xds_backend_metric_propagation.h +59 -0
- data/src/core/{ext/xds → xds/xds_client}/xds_bootstrap.cc +4 -5
- data/src/core/{ext/xds → xds/xds_client}/xds_bootstrap.h +4 -4
- data/src/core/{ext/xds → xds/xds_client}/xds_channel_args.h +3 -3
- data/src/core/{ext/xds → xds/xds_client}/xds_client.cc +190 -804
- data/src/core/{ext/xds → xds/xds_client}/xds_client.h +39 -96
- data/src/core/xds/xds_client/xds_locality.h +102 -0
- data/src/core/{ext/xds → xds/xds_client}/xds_metrics.h +5 -3
- data/src/core/{ext/xds → xds/xds_client}/xds_resource_type.h +5 -6
- data/src/core/{ext/xds → xds/xds_client}/xds_resource_type_impl.h +6 -7
- data/src/core/{ext/xds → xds/xds_client}/xds_transport.h +33 -18
- data/src/ruby/bin/math_pb.rb +1 -22
- data/src/ruby/ext/grpc/extconf.rb +1 -1
- data/src/ruby/ext/grpc/rb_byte_buffer.c +3 -3
- data/src/ruby/ext/grpc/rb_call.c +15 -8
- data/src/ruby/ext/grpc/rb_call_credentials.c +39 -32
- data/src/ruby/ext/grpc/rb_call_credentials.h +1 -0
- data/src/ruby/ext/grpc/rb_channel.c +42 -36
- data/src/ruby/ext/grpc/rb_channel_args.c +4 -4
- data/src/ruby/ext/grpc/rb_channel_credentials.c +5 -5
- data/src/ruby/ext/grpc/rb_channel_credentials.h +1 -2
- data/src/ruby/ext/grpc/rb_completion_queue.c +18 -36
- data/src/ruby/ext/grpc/rb_completion_queue.h +7 -1
- data/src/ruby/ext/grpc/rb_compression_options.c +9 -10
- data/src/ruby/ext/grpc/rb_event_thread.c +9 -9
- data/src/ruby/ext/grpc/rb_grpc.c +16 -16
- data/src/ruby/ext/grpc/rb_grpc.h +8 -1
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +136 -144
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +205 -216
- data/src/ruby/ext/grpc/rb_server.c +47 -27
- data/src/ruby/ext/grpc/rb_server_credentials.c +4 -3
- data/src/ruby/ext/grpc/rb_server_credentials.h +2 -2
- data/src/ruby/ext/grpc/rb_xds_channel_credentials.c +5 -5
- data/src/ruby/ext/grpc/rb_xds_channel_credentials.h +1 -2
- data/src/ruby/ext/grpc/rb_xds_server_credentials.c +5 -4
- data/src/ruby/ext/grpc/rb_xds_server_credentials.h +2 -2
- data/src/ruby/lib/grpc/generic/active_call.rb +8 -5
- data/src/ruby/lib/grpc/logconfig.rb +13 -0
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/grpc/health/v1/health_pb.rb +1 -22
- data/src/ruby/pb/grpc/testing/duplicate/echo_duplicate_services_pb.rb +5 -5
- data/src/ruby/pb/grpc/testing/metrics_pb.rb +10 -19
- data/src/ruby/pb/grpc/testing/metrics_services_pb.rb +5 -5
- data/src/ruby/pb/src/proto/grpc/testing/empty_pb.rb +1 -22
- data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +1 -22
- data/src/ruby/pb/src/proto/grpc/testing/test_pb.rb +1 -22
- data/src/ruby/spec/call_spec.rb +53 -40
- data/src/ruby/spec/channel_spec.rb +4 -2
- data/src/ruby/spec/client_server_spec.rb +148 -507
- data/src/ruby/spec/generic/active_call_spec.rb +64 -86
- data/src/ruby/spec/generic/client_stub_spec.rb +20 -20
- data/src/ruby/spec/logconfig_spec.rb +30 -0
- data/src/ruby/spec/support/services.rb +3 -0
- data/third_party/abseil-cpp/absl/algorithm/container.h +57 -18
- data/third_party/abseil-cpp/absl/base/attributes.h +84 -0
- data/third_party/abseil-cpp/absl/base/config.h +32 -51
- data/third_party/abseil-cpp/absl/base/dynamic_annotations.h +0 -16
- data/third_party/abseil-cpp/absl/base/internal/nullability_impl.h +3 -1
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +13 -3
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +0 -12
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock_config.h +4 -4
- data/third_party/abseil-cpp/absl/base/macros.h +48 -0
- data/third_party/abseil-cpp/absl/base/no_destructor.h +35 -40
- data/third_party/abseil-cpp/absl/base/nullability.h +33 -7
- data/third_party/abseil-cpp/absl/base/optimization.h +11 -0
- data/third_party/abseil-cpp/absl/base/options.h +1 -1
- data/third_party/abseil-cpp/absl/base/prefetch.h +1 -1
- data/third_party/abseil-cpp/absl/container/flat_hash_map.h +68 -12
- data/third_party/abseil-cpp/absl/container/flat_hash_set.h +60 -6
- data/third_party/abseil-cpp/absl/container/hash_container_defaults.h +45 -0
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +13 -0
- data/third_party/abseil-cpp/absl/container/internal/common_policy_traits.h +20 -11
- data/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h +15 -16
- data/third_party/abseil-cpp/absl/container/internal/container_memory.h +34 -1
- data/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +68 -1
- data/third_party/abseil-cpp/absl/container/internal/hash_policy_traits.h +50 -0
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +22 -7
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +26 -8
- data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +39 -35
- data/third_party/abseil-cpp/absl/container/internal/layout.h +190 -74
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +8 -6
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +334 -71
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +1299 -458
- data/third_party/abseil-cpp/absl/crc/internal/crc32_x86_arm_combined_simd.h +19 -17
- data/third_party/abseil-cpp/absl/crc/internal/crc_cord_state.cc +4 -3
- data/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_fallback.cc +2 -1
- data/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_x86_arm_combined.cc +12 -8
- data/third_party/abseil-cpp/absl/crc/internal/crc_non_temporal_memcpy.cc +1 -1
- data/third_party/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc +11 -7
- data/third_party/abseil-cpp/absl/crc/internal/non_temporal_memcpy.h +18 -17
- data/third_party/abseil-cpp/absl/debugging/internal/bounded_utf8_length_sequence.h +126 -0
- data/third_party/abseil-cpp/absl/debugging/internal/decode_rust_punycode.cc +258 -0
- data/third_party/abseil-cpp/absl/debugging/internal/decode_rust_punycode.h +55 -0
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +1057 -86
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.h +3 -0
- data/third_party/abseil-cpp/absl/debugging/internal/demangle_rust.cc +925 -0
- data/third_party/abseil-cpp/absl/debugging/internal/demangle_rust.h +42 -0
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc +43 -16
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h +8 -7
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +10 -7
- data/third_party/abseil-cpp/absl/debugging/internal/utf8_for_code_point.cc +70 -0
- data/third_party/abseil-cpp/absl/debugging/internal/utf8_for_code_point.h +47 -0
- data/third_party/abseil-cpp/absl/flags/commandlineflag.h +11 -0
- data/third_party/abseil-cpp/absl/flags/flag.h +2 -0
- data/third_party/abseil-cpp/absl/flags/internal/flag.cc +117 -30
- data/third_party/abseil-cpp/absl/flags/internal/flag.h +192 -30
- data/third_party/abseil-cpp/absl/flags/reflection.cc +10 -0
- data/third_party/abseil-cpp/absl/functional/any_invocable.h +13 -3
- data/third_party/abseil-cpp/absl/functional/bind_front.h +3 -2
- data/third_party/abseil-cpp/absl/functional/internal/any_invocable.h +7 -7
- data/third_party/abseil-cpp/absl/functional/internal/front_binder.h +9 -9
- data/third_party/abseil-cpp/absl/hash/internal/hash.cc +1 -1
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +13 -3
- data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc +60 -28
- data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.h +4 -0
- data/third_party/abseil-cpp/absl/log/absl_vlog_is_on.h +3 -3
- data/third_party/abseil-cpp/absl/log/check.h +209 -0
- data/third_party/abseil-cpp/absl/log/globals.h +28 -15
- data/third_party/abseil-cpp/absl/log/internal/check_impl.h +150 -0
- data/third_party/abseil-cpp/absl/log/internal/check_op.cc +138 -0
- data/third_party/abseil-cpp/absl/log/internal/check_op.h +462 -0
- data/third_party/abseil-cpp/absl/log/internal/conditions.h +2 -2
- data/third_party/abseil-cpp/absl/log/internal/log_impl.h +23 -23
- data/third_party/abseil-cpp/absl/log/internal/log_message.cc +104 -47
- data/third_party/abseil-cpp/absl/log/internal/log_message.h +23 -4
- data/third_party/abseil-cpp/absl/log/internal/nullstream.h +1 -10
- data/third_party/abseil-cpp/absl/log/internal/strip.h +36 -0
- data/third_party/abseil-cpp/absl/log/log.h +5 -1
- data/third_party/abseil-cpp/absl/log/log_sink.h +11 -4
- data/third_party/abseil-cpp/absl/log/vlog_is_on.h +3 -3
- data/third_party/abseil-cpp/absl/meta/type_traits.h +138 -42
- data/third_party/abseil-cpp/absl/numeric/int128.cc +0 -3
- data/third_party/abseil-cpp/absl/numeric/int128.h +35 -5
- data/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc +14 -0
- data/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc +18 -0
- data/third_party/abseil-cpp/absl/numeric/internal/bits.h +6 -2
- data/third_party/abseil-cpp/absl/random/beta_distribution.h +8 -8
- data/third_party/abseil-cpp/absl/random/bit_gen_ref.h +9 -7
- data/third_party/abseil-cpp/absl/random/distributions.h +11 -11
- data/third_party/abseil-cpp/absl/random/seed_sequences.h +2 -0
- data/third_party/abseil-cpp/absl/status/internal/statusor_internal.h +61 -2
- data/third_party/abseil-cpp/absl/status/status.cc +0 -4
- data/third_party/abseil-cpp/absl/status/status.h +4 -4
- data/third_party/abseil-cpp/absl/status/statusor.h +108 -142
- data/third_party/abseil-cpp/absl/strings/ascii.cc +32 -71
- data/third_party/abseil-cpp/absl/strings/cord.cc +20 -15
- data/third_party/abseil-cpp/absl/strings/cord.h +68 -7
- data/third_party/abseil-cpp/absl/strings/escaping.cc +96 -21
- data/third_party/abseil-cpp/absl/strings/escaping.h +25 -8
- data/third_party/abseil-cpp/absl/strings/has_absl_stringify.h +1 -0
- data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.h +10 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +29 -9
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h +2 -2
- data/third_party/abseil-cpp/absl/strings/internal/cordz_functions.cc +19 -13
- data/third_party/abseil-cpp/absl/strings/internal/cordz_functions.h +23 -13
- data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.cc +24 -24
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +12 -7
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.h +9 -4
- data/third_party/abseil-cpp/absl/strings/internal/escaping.cc +5 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_join_internal.h +23 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +5 -1
- data/third_party/abseil-cpp/absl/strings/numbers.cc +107 -333
- data/third_party/abseil-cpp/absl/strings/numbers.h +12 -151
- data/third_party/abseil-cpp/absl/strings/str_cat.cc +49 -142
- data/third_party/abseil-cpp/absl/strings/str_cat.h +70 -85
- data/third_party/abseil-cpp/absl/strings/str_format.h +1 -1
- data/third_party/abseil-cpp/absl/strings/str_join.h +19 -5
- data/third_party/abseil-cpp/absl/strings/str_split.h +2 -2
- data/third_party/abseil-cpp/absl/strings/string_view.h +3 -2
- data/third_party/abseil-cpp/absl/strings/substitute.cc +4 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc +11 -2
- data/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.h +5 -0
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +5 -4
- data/third_party/abseil-cpp/absl/time/civil_time.h +2 -2
- data/third_party/abseil-cpp/absl/time/clock.cc +15 -1
- data/third_party/abseil-cpp/absl/time/duration.cc +58 -53
- data/third_party/abseil-cpp/absl/time/format.cc +2 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +0 -29
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +3 -3
- data/third_party/abseil-cpp/absl/time/time.h +73 -29
- data/third_party/abseil-cpp/absl/types/compare.h +505 -0
- data/third_party/abseil-cpp/absl/types/internal/optional.h +2 -2
- data/third_party/abseil-cpp/absl/types/internal/variant.h +55 -67
- data/third_party/abseil-cpp/absl/types/optional.h +15 -18
- data/third_party/abseil-cpp/absl/types/span.h +3 -2
- data/third_party/abseil-cpp/absl/types/variant.h +19 -24
- data/third_party/abseil-cpp/absl/utility/utility.h +3 -41
- data/third_party/boringssl-with-bazel/src/crypto/base64/base64.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/{fipsmodule/rand/fork_detect.h → bcm_support.h} +53 -7
- data/third_party/boringssl-with-bazel/src/crypto/bio/bio.c +13 -18
- data/third_party/boringssl-with-bazel/src/crypto/bio/file.c +25 -10
- data/third_party/boringssl-with-bazel/src/crypto/bytestring/cbs.c +3 -18
- data/third_party/boringssl-with-bazel/src/crypto/bytestring/unicode.c +3 -2
- data/third_party/boringssl-with-bazel/src/crypto/chacha/chacha.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/chacha/internal.h +19 -15
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_chacha20poly1305.c +7 -0
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_des.c +48 -66
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_null.c +7 -3
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_rc2.c +20 -28
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_rc4.c +9 -4
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/internal.h +43 -0
- data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/tls_cbc.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/conf/conf.c +66 -41
- data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_linux.c +4 -1
- data/third_party/boringssl-with-bazel/src/crypto/cpu_intel.c +71 -37
- data/third_party/boringssl-with-bazel/src/crypto/crypto.c +8 -62
- data/third_party/boringssl-with-bazel/src/crypto/curve25519/curve25519.c +7 -7
- data/third_party/boringssl-with-bazel/src/crypto/digest_extra/digest_extra.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/dilithium/dilithium.c +1539 -0
- data/third_party/boringssl-with-bazel/src/crypto/dilithium/internal.h +58 -0
- data/third_party/boringssl-with-bazel/src/crypto/dsa/dsa.c +36 -20
- data/third_party/boringssl-with-bazel/src/crypto/dsa/dsa_asn1.c +3 -4
- data/third_party/boringssl-with-bazel/src/crypto/dsa/internal.h +2 -0
- data/third_party/boringssl-with-bazel/src/crypto/ecdsa_extra/ecdsa_asn1.c +160 -14
- data/third_party/boringssl-with-bazel/src/crypto/err/err.c +81 -60
- data/third_party/boringssl-with-bazel/src/crypto/evp/evp.c +41 -120
- data/third_party/boringssl-with-bazel/src/crypto/evp/evp_asn1.c +13 -13
- data/third_party/boringssl-with-bazel/src/crypto/evp/internal.h +7 -0
- data/third_party/boringssl-with-bazel/src/crypto/evp/p_dh.c +137 -0
- data/third_party/boringssl-with-bazel/src/crypto/evp/p_dh_asn1.c +120 -0
- data/third_party/boringssl-with-bazel/src/crypto/evp/p_dsa_asn1.c +30 -0
- data/third_party/boringssl-with-bazel/src/crypto/evp/p_ec.c +3 -4
- data/third_party/boringssl-with-bazel/src/crypto/evp/p_ec_asn1.c +30 -0
- data/third_party/boringssl-with-bazel/src/crypto/evp/p_ed25519.c +1 -4
- data/third_party/boringssl-with-bazel/src/crypto/evp/p_rsa_asn1.c +30 -0
- data/third_party/boringssl-with-bazel/src/crypto/evp/p_x25519.c +1 -4
- data/third_party/boringssl-with-bazel/src/crypto/ex_data.c +6 -7
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/{aes.c → aes.c.inc} +21 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/internal.h +33 -7
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bcm.c +84 -80
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bcm_interface.h +89 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{bytes.c → bytes.c.inc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{div.c → div.c.inc} +149 -182
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{div_extra.c → div_extra.c.inc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{exponentiation.c → exponentiation.c.inc} +46 -2
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{gcd_extra.c → gcd_extra.c.inc} +8 -5
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/internal.h +33 -23
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{montgomery_inv.c → montgomery_inv.c.inc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{mul.c → mul.c.inc} +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{prime.c → prime.c.inc} +14 -7
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{random.c → random.c.inc} +8 -9
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{sqrt.c → sqrt.c.inc} +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/{e_aes.c → e_aes.c.inc} +9 -8
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/internal.h +0 -3
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{ec_key.c → ec_key.c.inc} +22 -14
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{p256-nistz.c → p256-nistz.c.inc} +104 -7
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p256-nistz.h +65 -8
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{scalar.c → scalar.c.inc} +5 -1
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/{ecdsa.c → ecdsa.c.inc} +52 -107
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/internal.h +28 -11
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/fips_shared_support.c +3 -6
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/internal.h +1 -80
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/{rand.c → rand.c.inc} +26 -40
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/{padding.c → padding.c.inc} +2 -5
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/{rsa.c → rsa.c.inc} +11 -11
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/{rsa_impl.c → rsa_impl.c.inc} +23 -9
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/{fips.c → fips.c.inc} +6 -4
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/{self_check.c → self_check.c.inc} +9 -35
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/service_indicator/internal.h +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/service_indicator/{service_indicator.c → service_indicator.c.inc} +5 -8
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/internal.h +78 -29
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/{sha1.c → sha1.c.inc} +4 -4
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/{sha256.c → sha256.c.inc} +3 -3
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/sha/{sha512.c → sha512.c.inc} +10 -4
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/tls/{kdf.c → kdf.c.inc} +7 -0
- data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +295 -2
- data/third_party/boringssl-with-bazel/src/crypto/internal.h +131 -41
- data/third_party/boringssl-with-bazel/src/crypto/kyber/internal.h +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/kyber/kyber.c +2 -1
- data/third_party/boringssl-with-bazel/src/crypto/mem.c +25 -12
- data/third_party/boringssl-with-bazel/src/crypto/mldsa/internal.h +73 -0
- data/third_party/boringssl-with-bazel/src/crypto/mldsa/mldsa.c +1687 -0
- data/third_party/boringssl-with-bazel/src/crypto/mlkem/internal.h +90 -0
- data/third_party/boringssl-with-bazel/src/crypto/mlkem/mlkem.cc +1097 -0
- data/third_party/boringssl-with-bazel/src/crypto/obj/obj_dat.h +4 -1
- data/third_party/boringssl-with-bazel/src/crypto/pem/pem_lib.c +19 -19
- data/third_party/boringssl-with-bazel/src/crypto/pem/pem_pk8.c +43 -41
- data/third_party/boringssl-with-bazel/src/crypto/pem/pem_pkey.c +13 -12
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/internal.h +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/deterministic.c +9 -1
- data/third_party/boringssl-with-bazel/src/crypto/{fipsmodule/rand → rand_extra}/fork_detect.c +26 -28
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/getentropy.c +9 -1
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/ios.c +9 -1
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/passive.c +19 -3
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/rand_extra.c +26 -23
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/sysrand_internal.h +37 -0
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/trusty.c +9 -1
- data/third_party/boringssl-with-bazel/src/crypto/{fipsmodule/rand → rand_extra}/urandom.c +19 -19
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/windows.c +8 -1
- data/third_party/boringssl-with-bazel/src/crypto/rsa_extra/internal.h +2 -0
- data/third_party/boringssl-with-bazel/src/crypto/spx/spx.c +7 -6
- data/third_party/boringssl-with-bazel/src/crypto/x509/by_dir.c +26 -33
- data/third_party/boringssl-with-bazel/src/crypto/x509/by_file.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/internal.h +4 -5
- data/third_party/boringssl-with-bazel/src/crypto/x509/rsa_pss.c +5 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/v3_cpols.c +9 -4
- data/third_party/boringssl-with-bazel/src/crypto/x509/v3_crld.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/v3_info.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509/v3_lib.c +2 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/v3_utl.c +49 -16
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_lu.c +0 -10
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_trs.c +21 -25
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_vfy.c +8 -25
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_algor.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509/x_x509.c +1 -6
- data/third_party/boringssl-with-bazel/{err_data.c → src/gen/crypto/err_data.c} +487 -485
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1.h +14 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/base.h +9 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/bio.h +85 -42
- data/third_party/boringssl-with-bazel/src/include/openssl/bn.h +14 -9
- data/third_party/boringssl-with-bazel/src/include/openssl/bytestring.h +12 -4
- data/third_party/boringssl-with-bazel/src/include/openssl/crypto.h +10 -11
- data/third_party/boringssl-with-bazel/src/include/openssl/dh.h +17 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/dsa.h +10 -3
- data/third_party/boringssl-with-bazel/src/include/openssl/err.h +13 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +25 -14
- data/third_party/boringssl-with-bazel/src/include/openssl/evp_errors.h +1 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/ex_data.h +15 -3
- data/third_party/boringssl-with-bazel/src/include/openssl/experimental/dilithium.h +129 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/{kyber.h → experimental/kyber.h} +10 -0
- data/third_party/boringssl-with-bazel/src/{crypto/spx/internal.h → include/openssl/experimental/spx.h} +24 -13
- data/third_party/boringssl-with-bazel/src/include/openssl/hpke.h +8 -6
- data/third_party/boringssl-with-bazel/src/include/openssl/mldsa.h +136 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/mlkem.h +246 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/nid.h +3 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/obj.h +2 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/pem.h +66 -57
- data/third_party/boringssl-with-bazel/src/include/openssl/rand.h +19 -10
- data/third_party/boringssl-with-bazel/src/include/openssl/service_indicator.h +2 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/span.h +48 -12
- data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +393 -107
- data/third_party/boringssl-with-bazel/src/include/openssl/stack.h +10 -3
- data/third_party/boringssl-with-bazel/src/include/openssl/target.h +13 -10
- data/third_party/boringssl-with-bazel/src/include/openssl/tls1.h +2 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +2931 -2453
- data/third_party/boringssl-with-bazel/src/ssl/d1_both.cc +9 -12
- data/third_party/boringssl-with-bazel/src/ssl/d1_lib.cc +6 -0
- data/third_party/boringssl-with-bazel/src/ssl/d1_pkt.cc +10 -5
- data/third_party/boringssl-with-bazel/src/ssl/dtls_method.cc +14 -2
- data/third_party/boringssl-with-bazel/src/ssl/dtls_record.cc +301 -66
- data/third_party/boringssl-with-bazel/src/ssl/encrypted_client_hello.cc +3 -9
- data/third_party/boringssl-with-bazel/src/ssl/extensions.cc +66 -58
- data/third_party/boringssl-with-bazel/src/ssl/handoff.cc +1 -1
- data/third_party/boringssl-with-bazel/src/ssl/handshake.cc +17 -7
- data/third_party/boringssl-with-bazel/src/ssl/handshake_client.cc +138 -54
- data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +159 -117
- data/third_party/boringssl-with-bazel/src/ssl/internal.h +349 -202
- data/third_party/boringssl-with-bazel/src/ssl/s3_both.cc +45 -17
- data/third_party/boringssl-with-bazel/src/ssl/s3_lib.cc +0 -1
- data/third_party/boringssl-with-bazel/src/ssl/s3_pkt.cc +21 -1
- data/third_party/boringssl-with-bazel/src/ssl/ssl_aead_ctx.cc +86 -1
- data/third_party/boringssl-with-bazel/src/ssl/ssl_buffer.cc +7 -4
- data/third_party/boringssl-with-bazel/src/ssl/ssl_cert.cc +59 -385
- data/third_party/boringssl-with-bazel/src/ssl/ssl_cipher.cc +21 -19
- data/third_party/boringssl-with-bazel/src/ssl/ssl_credential.cc +423 -0
- data/third_party/boringssl-with-bazel/src/ssl/ssl_file.cc +2 -2
- data/third_party/boringssl-with-bazel/src/ssl/ssl_key_share.cc +99 -4
- data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +139 -83
- data/third_party/boringssl-with-bazel/src/ssl/ssl_privkey.cc +116 -93
- data/third_party/boringssl-with-bazel/src/ssl/ssl_session.cc +6 -14
- data/third_party/boringssl-with-bazel/src/ssl/ssl_versions.cc +7 -1
- data/third_party/boringssl-with-bazel/src/ssl/ssl_x509.cc +48 -116
- data/third_party/boringssl-with-bazel/src/ssl/tls13_both.cc +21 -27
- data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +54 -7
- data/third_party/boringssl-with-bazel/src/ssl/tls13_enc.cc +96 -34
- data/third_party/boringssl-with-bazel/src/ssl/tls13_server.cc +68 -23
- data/third_party/boringssl-with-bazel/src/ssl/tls_record.cc +4 -24
- data/third_party/upb/upb/base/string_view.h +1 -1
- data/third_party/upb/upb/json/decode.c +60 -13
- data/third_party/upb/upb/json/decode.h +26 -3
- data/third_party/upb/upb/json/encode.c +2 -2
- data/third_party/upb/upb/lex/round_trip.c +10 -0
- data/third_party/upb/upb/mem/arena.c +80 -4
- data/third_party/upb/upb/mem/arena.h +20 -9
- data/third_party/upb/upb/mem/arena.hpp +5 -1
- data/third_party/upb/upb/mem/internal/arena.h +11 -8
- data/third_party/upb/upb/message/accessors.c +6 -7
- data/third_party/upb/upb/message/accessors.h +186 -376
- data/third_party/upb/upb/message/array.c +26 -3
- data/third_party/upb/upb/message/array.h +17 -9
- data/third_party/upb/upb/message/compat.c +5 -5
- data/third_party/upb/upb/message/compat.h +3 -3
- data/third_party/upb/upb/message/copy.c +23 -20
- data/third_party/upb/upb/message/internal/accessors.h +617 -55
- data/third_party/upb/upb/message/internal/array.h +23 -15
- data/third_party/upb/upb/message/internal/compare_unknown.c +289 -0
- data/third_party/upb/upb/message/internal/compare_unknown.h +49 -0
- data/third_party/upb/upb/message/internal/extension.c +12 -12
- data/third_party/upb/upb/message/internal/extension.h +9 -12
- data/third_party/upb/upb/message/internal/map.h +15 -0
- data/third_party/upb/upb/message/internal/map_sorter.h +4 -5
- data/third_party/upb/upb/message/internal/message.c +22 -6
- data/third_party/upb/upb/message/internal/message.h +11 -0
- data/third_party/upb/upb/message/internal/tagged_ptr.h +5 -5
- data/third_party/upb/upb/message/internal/types.h +41 -1
- data/third_party/upb/upb/message/map.c +25 -0
- data/third_party/upb/upb/message/map.h +11 -7
- data/third_party/upb/upb/message/merge.c +38 -0
- data/third_party/upb/upb/message/merge.h +26 -0
- data/third_party/upb/upb/message/message.c +83 -4
- data/third_party/upb/upb/message/message.h +16 -1
- data/third_party/upb/upb/message/tagged_ptr.h +4 -8
- data/third_party/upb/upb/message/value.h +26 -0
- data/third_party/upb/upb/mini_descriptor/build_enum.c +3 -3
- data/third_party/upb/upb/mini_descriptor/build_enum.h +6 -14
- data/third_party/upb/upb/mini_descriptor/decode.c +19 -3
- data/third_party/upb/upb/mini_descriptor/link.c +23 -21
- data/third_party/upb/upb/mini_table/enum.h +2 -4
- data/third_party/upb/upb/mini_table/extension.h +4 -12
- data/third_party/upb/upb/mini_table/extension_registry.c +18 -0
- data/third_party/upb/upb/mini_table/extension_registry.h +17 -0
- data/third_party/upb/upb/mini_table/field.h +12 -38
- data/third_party/upb/upb/mini_table/file.h +6 -19
- data/third_party/upb/upb/mini_table/internal/enum.h +1 -1
- data/third_party/upb/upb/mini_table/internal/extension.h +18 -9
- data/third_party/upb/upb/mini_table/internal/field.h +23 -23
- data/third_party/upb/upb/mini_table/internal/file.h +7 -7
- data/third_party/upb/upb/mini_table/internal/message.c +21 -1
- data/third_party/upb/upb/mini_table/internal/message.h +80 -36
- data/third_party/upb/upb/mini_table/internal/sub.h +9 -4
- data/third_party/upb/upb/mini_table/message.h +23 -22
- data/third_party/upb/upb/mini_table/sub.h +4 -12
- data/third_party/upb/upb/port/def.inc +108 -12
- data/third_party/upb/upb/port/undef.inc +8 -1
- data/third_party/upb/upb/reflection/common.h +1 -11
- data/third_party/upb/upb/reflection/def.hpp +35 -0
- data/third_party/upb/upb/reflection/def_pool.h +2 -2
- data/third_party/upb/upb/reflection/descriptor_bootstrap.h +19 -0
- data/third_party/upb/upb/reflection/enum_def.c +5 -1
- data/third_party/upb/upb/reflection/enum_def.h +1 -0
- data/third_party/upb/upb/reflection/enum_value_def.c +3 -8
- data/third_party/upb/upb/reflection/field_def.c +72 -46
- data/third_party/upb/upb/reflection/field_def.h +4 -0
- data/third_party/upb/upb/reflection/file_def.c +30 -4
- data/third_party/upb/upb/reflection/file_def.h +3 -0
- data/third_party/upb/upb/reflection/internal/upb_edition_defaults.h +1 -1
- data/third_party/upb/upb/reflection/message.c +26 -9
- data/third_party/upb/upb/reflection/message.h +2 -2
- data/third_party/upb/upb/reflection/message_def.c +14 -9
- data/third_party/upb/upb/reflection/method_def.h +8 -7
- data/third_party/upb/upb/reflection/service_def.h +6 -5
- data/third_party/upb/upb/text/encode.c +53 -389
- data/third_party/upb/upb/text/encode.h +1 -11
- data/third_party/upb/upb/text/internal/encode.c +180 -0
- data/third_party/upb/upb/text/internal/encode.h +240 -0
- data/third_party/upb/upb/text/options.h +22 -0
- data/third_party/upb/upb/wire/decode.c +160 -94
- data/third_party/upb/upb/wire/decode.h +15 -2
- data/third_party/upb/upb/wire/encode.c +89 -48
- data/third_party/upb/upb/wire/encode.h +12 -1
- data/third_party/upb/upb/wire/eps_copy_input_stream.h +3 -3
- data/third_party/upb/upb/wire/internal/decode_fast.c +28 -29
- data/third_party/upb/upb/wire/internal/reader.h +3 -3
- data/third_party/upb/upb/wire/reader.c +1 -2
- data/third_party/upb/upb/wire/reader.h +4 -8
- metadata +472 -383
- data/src/core/client_channel/client_channel_channelz.cc +0 -93
- data/src/core/client_channel/client_channel_channelz.h +0 -85
- data/src/core/client_channel/config_selector.cc +0 -60
- data/src/core/ext/filters/deadline/deadline_filter.cc +0 -407
- data/src/core/ext/filters/deadline/deadline_filter.h +0 -85
- data/src/core/ext/transport/chttp2/transport/http_trace.cc +0 -19
- data/src/core/ext/transport/chttp2/transport/http_trace.h +0 -24
- data/src/core/ext/transport/chttp2/transport/max_concurrent_streams_policy.cc +0 -44
- data/src/core/ext/transport/chttp2/transport/max_concurrent_streams_policy.h +0 -67
- data/src/core/ext/transport/inproc/inproc_plugin.cc +0 -23
- data/src/core/ext/xds/xds_client_stats.cc +0 -173
- data/src/core/ext/xds/xds_client_stats.h +0 -258
- data/src/core/lib/channel/channel_stack_trace.cc +0 -19
- data/src/core/lib/channel/channel_stack_trace.h +0 -24
- data/src/core/lib/channel/context.h +0 -77
- data/src/core/lib/channel/metrics.cc +0 -396
- data/src/core/lib/channel/metrics.h +0 -406
- data/src/core/lib/event_engine/trace.cc +0 -25
- data/src/core/lib/event_engine/trace.h +0 -49
- data/src/core/lib/gpr/android/log.cc +0 -79
- data/src/core/lib/gpr/linux/log.cc +0 -114
- data/src/core/lib/gpr/log.cc +0 -166
- data/src/core/lib/gpr/log_internal.h +0 -55
- data/src/core/lib/gpr/posix/log.cc +0 -111
- data/src/core/lib/gpr/windows/log.cc +0 -116
- data/src/core/lib/iomgr/ev_windows.cc +0 -30
- data/src/core/lib/promise/trace.cc +0 -20
- data/src/core/lib/promise/trace.h +0 -24
- data/src/core/lib/resource_quota/trace.cc +0 -19
- data/src/core/lib/resource_quota/trace.h +0 -24
- data/src/core/lib/security/transport/tsi_error.cc +0 -31
- data/src/core/lib/security/transport/tsi_error.h +0 -30
- data/src/core/lib/slice/slice_refcount.cc +0 -20
- data/src/core/lib/surface/api_trace.cc +0 -25
- data/src/core/lib/surface/api_trace.h +0 -53
- data/src/core/lib/surface/call_trace.h +0 -24
- data/src/core/lib/surface/wait_for_cq_end_op.cc +0 -75
- data/src/core/lib/surface/wait_for_cq_end_op.h +0 -72
- data/src/core/lib/transport/batch_builder.cc +0 -170
- data/src/core/lib/transport/batch_builder.h +0 -476
- data/src/core/lib/transport/call_size_estimator.cc +0 -41
- data/src/core/lib/transport/call_size_estimator.h +0 -52
- data/src/core/lib/transport/handshaker.cc +0 -229
- data/src/core/resolver/binder/binder_resolver.cc +0 -154
- data/src/core/resolver/xds/xds_resolver_trace.h +0 -30
- data/third_party/abseil-cpp/absl/strings/internal/has_absl_stringify.h +0 -44
- data/third_party/boringssl-with-bazel/src/crypto/conf/conf_def.h +0 -122
- data/third_party/boringssl-with-bazel/src/include/openssl/pki/certificate.h +0 -83
- data/third_party/boringssl-with-bazel/src/include/openssl/pki/signature_verify_cache.h +0 -41
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/{aes_nohw.c → aes_nohw.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/{key_wrap.c → key_wrap.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/{mode_wrappers.c → mode_wrappers.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{add.c → add.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/asm/{x86_64-gcc.c → x86_64-gcc.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{bn.c → bn.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{cmp.c → cmp.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{ctx.c → ctx.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{gcd.c → gcd.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{generic.c → generic.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{jacobi.c → jacobi.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{montgomery.c → montgomery.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{rsaz_exp.c → rsaz_exp.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bn/{shift.c → shift.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/{aead.c → aead.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/{cipher.c → cipher.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/{e_aesccm.c → e_aesccm.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cmac/{cmac.c → cmac.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/{check.c → check.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/{dh.c → dh.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digest/{digest.c → digest.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digest/{digests.c → digests.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/digestsign/{digestsign.c → digestsign.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{ec.c → ec.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{ec_montgomery.c → ec_montgomery.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{felem.c → felem.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{oct.c → oct.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{p224-64.c → p224-64.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{p256.c → p256.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{simple.c → simple.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{simple_mul.c → simple_mul.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{util.c → util.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/{wnaf.c → wnaf.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdh/{ecdh.c → ecdh.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/hkdf/{hkdf.c → hkdf.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/hmac/{hmac.c → hmac.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/md4/{md4.c → md4.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/md5/{md5.c → md5.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/{cbc.c → cbc.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/{cfb.c → cfb.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/{ctr.c → ctr.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/{gcm.c → gcm.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/{gcm_nohw.c → gcm_nohw.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/{ofb.c → ofb.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/{polyval.c → polyval.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/{ctrdrbg.c → ctrdrbg.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/{blinding.c → blinding.c.inc} +0 -0
- /data/third_party/boringssl-with-bazel/src/crypto/{fipsmodule/rand → rand_extra}/getrandom_fillin.h +0 -0
|
@@ -16,10 +16,21 @@
|
|
|
16
16
|
//
|
|
17
17
|
//
|
|
18
18
|
|
|
19
|
-
#include <grpc/support/port_platform.h>
|
|
20
|
-
|
|
21
19
|
#include "src/core/lib/surface/call.h"
|
|
22
20
|
|
|
21
|
+
#include <grpc/byte_buffer.h>
|
|
22
|
+
#include <grpc/compression.h>
|
|
23
|
+
#include <grpc/event_engine/event_engine.h>
|
|
24
|
+
#include <grpc/grpc.h>
|
|
25
|
+
#include <grpc/impl/call.h>
|
|
26
|
+
#include <grpc/impl/propagation_bits.h>
|
|
27
|
+
#include <grpc/slice.h>
|
|
28
|
+
#include <grpc/slice_buffer.h>
|
|
29
|
+
#include <grpc/status.h>
|
|
30
|
+
#include <grpc/support/alloc.h>
|
|
31
|
+
#include <grpc/support/atm.h>
|
|
32
|
+
#include <grpc/support/port_platform.h>
|
|
33
|
+
#include <grpc/support/string_util.h>
|
|
23
34
|
#include <inttypes.h>
|
|
24
35
|
#include <limits.h>
|
|
25
36
|
#include <stdlib.h>
|
|
@@ -27,254 +38,97 @@
|
|
|
27
38
|
|
|
28
39
|
#include <algorithm>
|
|
29
40
|
#include <atomic>
|
|
41
|
+
#include <cstdint>
|
|
30
42
|
#include <memory>
|
|
31
43
|
#include <new>
|
|
44
|
+
#include <queue>
|
|
32
45
|
#include <string>
|
|
33
46
|
#include <type_traits>
|
|
34
47
|
#include <utility>
|
|
35
48
|
#include <vector>
|
|
36
49
|
|
|
37
50
|
#include "absl/base/thread_annotations.h"
|
|
51
|
+
#include "absl/log/check.h"
|
|
52
|
+
#include "absl/log/log.h"
|
|
38
53
|
#include "absl/status/status.h"
|
|
39
54
|
#include "absl/strings/str_cat.h"
|
|
40
55
|
#include "absl/strings/str_format.h"
|
|
41
56
|
#include "absl/strings/str_join.h"
|
|
42
57
|
#include "absl/strings/string_view.h"
|
|
43
|
-
|
|
44
|
-
#include <grpc/byte_buffer.h>
|
|
45
|
-
#include <grpc/compression.h>
|
|
46
|
-
#include <grpc/event_engine/event_engine.h>
|
|
47
|
-
#include <grpc/grpc.h>
|
|
48
|
-
#include <grpc/impl/call.h>
|
|
49
|
-
#include <grpc/impl/propagation_bits.h>
|
|
50
|
-
#include <grpc/slice.h>
|
|
51
|
-
#include <grpc/slice_buffer.h>
|
|
52
|
-
#include <grpc/status.h>
|
|
53
|
-
#include <grpc/support/alloc.h>
|
|
54
|
-
#include <grpc/support/atm.h>
|
|
55
|
-
#include <grpc/support/log.h>
|
|
56
|
-
#include <grpc/support/string_util.h>
|
|
57
|
-
|
|
58
|
+
#include "src/core/channelz/channelz.h"
|
|
58
59
|
#include "src/core/lib/channel/call_finalization.h"
|
|
59
|
-
#include "src/core/lib/channel/call_tracer.h"
|
|
60
60
|
#include "src/core/lib/channel/channel_stack.h"
|
|
61
|
-
#include "src/core/lib/channel/channelz.h"
|
|
62
|
-
#include "src/core/lib/channel/context.h"
|
|
63
61
|
#include "src/core/lib/channel/status_util.h"
|
|
64
62
|
#include "src/core/lib/compression/compression_internal.h"
|
|
65
|
-
#include "src/core/lib/
|
|
66
|
-
#include "src/core/lib/debug/stats_data.h"
|
|
63
|
+
#include "src/core/lib/event_engine/event_engine_context.h"
|
|
67
64
|
#include "src/core/lib/experiments/experiments.h"
|
|
68
|
-
#include "src/core/lib/gpr/alloc.h"
|
|
69
|
-
#include "src/core/lib/gpr/time_precise.h"
|
|
70
|
-
#include "src/core/lib/gpr/useful.h"
|
|
71
|
-
#include "src/core/lib/gprpp/bitset.h"
|
|
72
|
-
#include "src/core/lib/gprpp/cpp_impl_of.h"
|
|
73
|
-
#include "src/core/lib/gprpp/crash.h"
|
|
74
|
-
#include "src/core/lib/gprpp/debug_location.h"
|
|
75
|
-
#include "src/core/lib/gprpp/ref_counted.h"
|
|
76
|
-
#include "src/core/lib/gprpp/ref_counted_ptr.h"
|
|
77
|
-
#include "src/core/lib/gprpp/status_helper.h"
|
|
78
|
-
#include "src/core/lib/gprpp/sync.h"
|
|
79
65
|
#include "src/core/lib/iomgr/call_combiner.h"
|
|
80
66
|
#include "src/core/lib/iomgr/exec_ctx.h"
|
|
81
67
|
#include "src/core/lib/iomgr/polling_entity.h"
|
|
82
68
|
#include "src/core/lib/promise/activity.h"
|
|
83
69
|
#include "src/core/lib/promise/all_ok.h"
|
|
84
70
|
#include "src/core/lib/promise/arena_promise.h"
|
|
71
|
+
#include "src/core/lib/promise/cancel_callback.h"
|
|
85
72
|
#include "src/core/lib/promise/context.h"
|
|
86
73
|
#include "src/core/lib/promise/latch.h"
|
|
87
74
|
#include "src/core/lib/promise/map.h"
|
|
88
|
-
#include "src/core/lib/promise/party.h"
|
|
89
75
|
#include "src/core/lib/promise/pipe.h"
|
|
90
76
|
#include "src/core/lib/promise/poll.h"
|
|
91
77
|
#include "src/core/lib/promise/race.h"
|
|
92
78
|
#include "src/core/lib/promise/seq.h"
|
|
93
79
|
#include "src/core/lib/promise/status_flag.h"
|
|
80
|
+
#include "src/core/lib/promise/try_seq.h"
|
|
94
81
|
#include "src/core/lib/resource_quota/arena.h"
|
|
95
82
|
#include "src/core/lib/slice/slice_buffer.h"
|
|
96
83
|
#include "src/core/lib/slice/slice_internal.h"
|
|
97
|
-
#include "src/core/lib/surface/api_trace.h"
|
|
98
84
|
#include "src/core/lib/surface/call_test_only.h"
|
|
99
85
|
#include "src/core/lib/surface/channel.h"
|
|
100
86
|
#include "src/core/lib/surface/completion_queue.h"
|
|
101
|
-
#include "src/core/lib/surface/server_interface.h"
|
|
102
87
|
#include "src/core/lib/surface/validate_metadata.h"
|
|
103
|
-
#include "src/core/lib/surface/wait_for_cq_end_op.h"
|
|
104
|
-
#include "src/core/lib/transport/batch_builder.h"
|
|
105
88
|
#include "src/core/lib/transport/error_utils.h"
|
|
89
|
+
#include "src/core/lib/transport/metadata.h"
|
|
106
90
|
#include "src/core/lib/transport/metadata_batch.h"
|
|
107
91
|
#include "src/core/lib/transport/transport.h"
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
92
|
+
#include "src/core/server/server_interface.h"
|
|
93
|
+
#include "src/core/telemetry/call_tracer.h"
|
|
94
|
+
#include "src/core/telemetry/stats.h"
|
|
95
|
+
#include "src/core/telemetry/stats_data.h"
|
|
96
|
+
#include "src/core/util/alloc.h"
|
|
97
|
+
#include "src/core/util/bitset.h"
|
|
98
|
+
#include "src/core/util/cpp_impl_of.h"
|
|
99
|
+
#include "src/core/util/crash.h"
|
|
100
|
+
#include "src/core/util/debug_location.h"
|
|
101
|
+
#include "src/core/util/match.h"
|
|
102
|
+
#include "src/core/util/ref_counted.h"
|
|
103
|
+
#include "src/core/util/ref_counted_ptr.h"
|
|
104
|
+
#include "src/core/util/status_helper.h"
|
|
105
|
+
#include "src/core/util/sync.h"
|
|
106
|
+
#include "src/core/util/time_precise.h"
|
|
107
|
+
#include "src/core/util/useful.h"
|
|
113
108
|
|
|
114
109
|
namespace grpc_core {
|
|
115
110
|
|
|
111
|
+
// Alias to make this type available in Call implementation without a grpc_core
|
|
112
|
+
// prefix.
|
|
113
|
+
using GrpcClosure = Closure;
|
|
114
|
+
|
|
116
115
|
///////////////////////////////////////////////////////////////////////////////
|
|
117
116
|
// Call
|
|
118
117
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
void CancelWithStatus(grpc_status_code status, const char* description);
|
|
129
|
-
virtual void CancelWithError(grpc_error_handle error) = 0;
|
|
130
|
-
virtual void SetCompletionQueue(grpc_completion_queue* cq) = 0;
|
|
131
|
-
char* GetPeer();
|
|
132
|
-
virtual grpc_call_error StartBatch(const grpc_op* ops, size_t nops,
|
|
133
|
-
void* notify_tag,
|
|
134
|
-
bool is_notify_tag_closure) = 0;
|
|
135
|
-
virtual bool failed_before_recv_message() const = 0;
|
|
136
|
-
virtual bool is_trailers_only() const = 0;
|
|
137
|
-
virtual absl::string_view GetServerAuthority() const = 0;
|
|
138
|
-
virtual void ExternalRef() = 0;
|
|
139
|
-
virtual void ExternalUnref() = 0;
|
|
140
|
-
virtual void InternalRef(const char* reason) = 0;
|
|
141
|
-
virtual void InternalUnref(const char* reason) = 0;
|
|
142
|
-
|
|
143
|
-
grpc_compression_algorithm test_only_compression_algorithm() {
|
|
144
|
-
return incoming_compression_algorithm_;
|
|
145
|
-
}
|
|
146
|
-
uint32_t test_only_message_flags() { return test_only_last_message_flags_; }
|
|
147
|
-
CompressionAlgorithmSet encodings_accepted_by_peer() {
|
|
148
|
-
return encodings_accepted_by_peer_;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// This should return nullptr for the promise stack (and alternative means
|
|
152
|
-
// for that functionality be invented)
|
|
153
|
-
virtual grpc_call_stack* call_stack() = 0;
|
|
154
|
-
|
|
155
|
-
// Return the EventEngine used for this call's async execution.
|
|
156
|
-
virtual grpc_event_engine::experimental::EventEngine* event_engine()
|
|
157
|
-
const = 0;
|
|
158
|
-
|
|
159
|
-
protected:
|
|
160
|
-
// The maximum number of concurrent batches possible.
|
|
161
|
-
// Based upon the maximum number of individually queueable ops in the batch
|
|
162
|
-
// api:
|
|
163
|
-
// - initial metadata send
|
|
164
|
-
// - message send
|
|
165
|
-
// - status/close send (depending on client/server)
|
|
166
|
-
// - initial metadata recv
|
|
167
|
-
// - message recv
|
|
168
|
-
// - status/close recv (depending on client/server)
|
|
169
|
-
static constexpr size_t kMaxConcurrentBatches = 6;
|
|
170
|
-
|
|
171
|
-
struct ParentCall {
|
|
172
|
-
Mutex child_list_mu;
|
|
173
|
-
Call* first_child ABSL_GUARDED_BY(child_list_mu) = nullptr;
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
struct ChildCall {
|
|
177
|
-
explicit ChildCall(Call* parent) : parent(parent) {}
|
|
178
|
-
Call* parent;
|
|
179
|
-
/// siblings: children of the same parent form a list, and this list is
|
|
180
|
-
/// protected under
|
|
181
|
-
/// parent->mu
|
|
182
|
-
Call* sibling_next = nullptr;
|
|
183
|
-
Call* sibling_prev = nullptr;
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
Call(Arena* arena, bool is_client, Timestamp send_deadline,
|
|
187
|
-
RefCountedPtr<Channel> channel)
|
|
188
|
-
: channel_(std::move(channel)),
|
|
189
|
-
arena_(arena),
|
|
190
|
-
send_deadline_(send_deadline),
|
|
191
|
-
is_client_(is_client) {
|
|
192
|
-
GPR_DEBUG_ASSERT(arena_ != nullptr);
|
|
193
|
-
GPR_DEBUG_ASSERT(channel_ != nullptr);
|
|
194
|
-
}
|
|
195
|
-
virtual ~Call() = default;
|
|
196
|
-
|
|
197
|
-
void DeleteThis();
|
|
198
|
-
|
|
199
|
-
ParentCall* GetOrCreateParentCall();
|
|
200
|
-
ParentCall* parent_call();
|
|
201
|
-
Channel* channel() const {
|
|
202
|
-
GPR_DEBUG_ASSERT(channel_ != nullptr);
|
|
203
|
-
return channel_.get();
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
absl::Status InitParent(Call* parent, uint32_t propagation_mask);
|
|
207
|
-
void PublishToParent(Call* parent);
|
|
208
|
-
void MaybeUnpublishFromParent();
|
|
209
|
-
void PropagateCancellationToChildren();
|
|
210
|
-
|
|
211
|
-
Timestamp send_deadline() const { return send_deadline_; }
|
|
212
|
-
void set_send_deadline(Timestamp send_deadline) {
|
|
213
|
-
send_deadline_ = send_deadline;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
Slice GetPeerString() const {
|
|
217
|
-
MutexLock lock(&peer_mu_);
|
|
218
|
-
return peer_string_.Ref();
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
void SetPeerString(Slice peer_string) {
|
|
222
|
-
MutexLock lock(&peer_mu_);
|
|
223
|
-
peer_string_ = std::move(peer_string);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
void ClearPeerString() { SetPeerString(Slice(grpc_empty_slice())); }
|
|
227
|
-
|
|
228
|
-
// TODO(ctiller): cancel_func is for cancellation of the call - filter stack
|
|
229
|
-
// holds no mutexes here, promise stack does, and so locking is different.
|
|
230
|
-
// Remove this and cancel directly once promise conversion is done.
|
|
231
|
-
void ProcessIncomingInitialMetadata(grpc_metadata_batch& md);
|
|
232
|
-
// Fixup outgoing metadata before sending - adds compression, protects
|
|
233
|
-
// internal headers against external modification.
|
|
234
|
-
void PrepareOutgoingInitialMetadata(const grpc_op& op,
|
|
235
|
-
grpc_metadata_batch& md);
|
|
236
|
-
void NoteLastMessageFlags(uint32_t flags) {
|
|
237
|
-
test_only_last_message_flags_ = flags;
|
|
238
|
-
}
|
|
239
|
-
grpc_compression_algorithm incoming_compression_algorithm() const {
|
|
240
|
-
return incoming_compression_algorithm_;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
void HandleCompressionAlgorithmDisabled(
|
|
244
|
-
grpc_compression_algorithm compression_algorithm) GPR_ATTRIBUTE_NOINLINE;
|
|
245
|
-
void HandleCompressionAlgorithmNotAccepted(
|
|
246
|
-
grpc_compression_algorithm compression_algorithm) GPR_ATTRIBUTE_NOINLINE;
|
|
247
|
-
|
|
248
|
-
gpr_cycle_counter start_time() const { return start_time_; }
|
|
249
|
-
|
|
250
|
-
private:
|
|
251
|
-
RefCountedPtr<Channel> channel_;
|
|
252
|
-
Arena* const arena_;
|
|
253
|
-
std::atomic<ParentCall*> parent_call_{nullptr};
|
|
254
|
-
ChildCall* child_ = nullptr;
|
|
255
|
-
Timestamp send_deadline_;
|
|
256
|
-
const bool is_client_;
|
|
257
|
-
// flag indicating that cancellation is inherited
|
|
258
|
-
bool cancellation_is_inherited_ = false;
|
|
259
|
-
// Compression algorithm for *incoming* data
|
|
260
|
-
grpc_compression_algorithm incoming_compression_algorithm_ =
|
|
261
|
-
GRPC_COMPRESS_NONE;
|
|
262
|
-
// Supported encodings (compression algorithms), a bitset.
|
|
263
|
-
// Always support no compression.
|
|
264
|
-
CompressionAlgorithmSet encodings_accepted_by_peer_{GRPC_COMPRESS_NONE};
|
|
265
|
-
uint32_t test_only_last_message_flags_ = 0;
|
|
266
|
-
// Peer name is protected by a mutex because it can be accessed by the
|
|
267
|
-
// application at the same moment as it is being set by the completion
|
|
268
|
-
// of the recv_initial_metadata op. The mutex should be mostly uncontended.
|
|
269
|
-
mutable Mutex peer_mu_;
|
|
270
|
-
Slice peer_string_;
|
|
271
|
-
gpr_cycle_counter start_time_ = gpr_get_cycle_counter();
|
|
272
|
-
};
|
|
118
|
+
Call::Call(bool is_client, Timestamp send_deadline, RefCountedPtr<Arena> arena)
|
|
119
|
+
: arena_(std::move(arena)),
|
|
120
|
+
send_deadline_(send_deadline),
|
|
121
|
+
is_client_(is_client) {
|
|
122
|
+
DCHECK_NE(arena_.get(), nullptr);
|
|
123
|
+
DCHECK_NE(arena_->GetContext<grpc_event_engine::experimental::EventEngine>(),
|
|
124
|
+
nullptr);
|
|
125
|
+
arena_->SetContext<Call>(this);
|
|
126
|
+
}
|
|
273
127
|
|
|
274
128
|
Call::ParentCall* Call::GetOrCreateParentCall() {
|
|
275
129
|
ParentCall* p = parent_call_.load(std::memory_order_acquire);
|
|
276
130
|
if (p == nullptr) {
|
|
277
|
-
p =
|
|
131
|
+
p = arena()->New<ParentCall>();
|
|
278
132
|
ParentCall* expected = nullptr;
|
|
279
133
|
if (!parent_call_.compare_exchange_strong(expected, p,
|
|
280
134
|
std::memory_order_release,
|
|
@@ -294,8 +148,8 @@ absl::Status Call::InitParent(Call* parent, uint32_t propagation_mask) {
|
|
|
294
148
|
child_ = arena()->New<ChildCall>(parent);
|
|
295
149
|
|
|
296
150
|
parent->InternalRef("child");
|
|
297
|
-
|
|
298
|
-
|
|
151
|
+
CHECK(is_client_);
|
|
152
|
+
CHECK(!parent->is_client_);
|
|
299
153
|
|
|
300
154
|
if (propagation_mask & GRPC_PROPAGATE_DEADLINE) {
|
|
301
155
|
send_deadline_ = std::min(send_deadline_, parent->send_deadline_);
|
|
@@ -310,8 +164,8 @@ absl::Status Call::InitParent(Call* parent, uint32_t propagation_mask) {
|
|
|
310
164
|
"Census tracing propagation requested without Census context "
|
|
311
165
|
"propagation");
|
|
312
166
|
}
|
|
313
|
-
|
|
314
|
-
|
|
167
|
+
arena()->SetContext<census_context>(
|
|
168
|
+
parent->arena()->GetContext<census_context>());
|
|
315
169
|
} else if (propagation_mask & GRPC_PROPAGATE_CENSUS_STATS_CONTEXT) {
|
|
316
170
|
return absl::UnknownError(
|
|
317
171
|
"Census context propagation requested without Census tracing "
|
|
@@ -393,28 +247,6 @@ void Call::PropagateCancellationToChildren() {
|
|
|
393
247
|
}
|
|
394
248
|
}
|
|
395
249
|
|
|
396
|
-
char* Call::GetPeer() {
|
|
397
|
-
Slice peer_slice = GetPeerString();
|
|
398
|
-
if (!peer_slice.empty()) {
|
|
399
|
-
absl::string_view peer_string_view = peer_slice.as_string_view();
|
|
400
|
-
char* peer_string =
|
|
401
|
-
static_cast<char*>(gpr_malloc(peer_string_view.size() + 1));
|
|
402
|
-
memcpy(peer_string, peer_string_view.data(), peer_string_view.size());
|
|
403
|
-
peer_string[peer_string_view.size()] = '\0';
|
|
404
|
-
return peer_string;
|
|
405
|
-
}
|
|
406
|
-
char* peer_string = grpc_channel_get_target(channel_->c_ptr());
|
|
407
|
-
if (peer_string != nullptr) return peer_string;
|
|
408
|
-
return gpr_strdup("unknown");
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
void Call::DeleteThis() {
|
|
412
|
-
RefCountedPtr<Channel> channel = std::move(channel_);
|
|
413
|
-
Arena* arena = arena_;
|
|
414
|
-
this->~Call();
|
|
415
|
-
channel->DestroyArena(arena);
|
|
416
|
-
}
|
|
417
|
-
|
|
418
250
|
void Call::PrepareOutgoingInitialMetadata(const grpc_op& op,
|
|
419
251
|
grpc_metadata_batch& md) {
|
|
420
252
|
// TODO(juanlishen): If the user has already specified a compression
|
|
@@ -429,7 +261,7 @@ void Call::PrepareOutgoingInitialMetadata(const grpc_op& op,
|
|
|
429
261
|
op.data.send_initial_metadata.maybe_compression_level.level;
|
|
430
262
|
level_set = true;
|
|
431
263
|
} else {
|
|
432
|
-
const grpc_compression_options copts =
|
|
264
|
+
const grpc_compression_options copts = compression_options();
|
|
433
265
|
if (copts.default_level.is_set) {
|
|
434
266
|
level_set = true;
|
|
435
267
|
effective_compression_level = copts.default_level.level;
|
|
@@ -455,26 +287,25 @@ void Call::ProcessIncomingInitialMetadata(grpc_metadata_batch& md) {
|
|
|
455
287
|
Slice* peer_string = md.get_pointer(PeerString());
|
|
456
288
|
if (peer_string != nullptr) SetPeerString(peer_string->Ref());
|
|
457
289
|
|
|
458
|
-
|
|
459
|
-
md.Take(GrpcEncodingMetadata()).value_or(GRPC_COMPRESS_NONE);
|
|
290
|
+
SetIncomingCompressionAlgorithm(
|
|
291
|
+
md.Take(GrpcEncodingMetadata()).value_or(GRPC_COMPRESS_NONE));
|
|
460
292
|
encodings_accepted_by_peer_ =
|
|
461
293
|
md.Take(GrpcAcceptEncodingMetadata())
|
|
462
294
|
.value_or(CompressionAlgorithmSet{GRPC_COMPRESS_NONE});
|
|
463
295
|
|
|
464
|
-
const grpc_compression_options
|
|
465
|
-
channel_->compression_options();
|
|
296
|
+
const grpc_compression_options copts = compression_options();
|
|
466
297
|
const grpc_compression_algorithm compression_algorithm =
|
|
467
|
-
|
|
468
|
-
if (GPR_UNLIKELY(
|
|
469
|
-
|
|
470
|
-
|
|
298
|
+
incoming_compression_algorithm();
|
|
299
|
+
if (GPR_UNLIKELY(
|
|
300
|
+
!CompressionAlgorithmSet::FromUint32(copts.enabled_algorithms_bitset)
|
|
301
|
+
.IsSet(compression_algorithm))) {
|
|
471
302
|
// check if algorithm is supported by current channel config
|
|
472
303
|
HandleCompressionAlgorithmDisabled(compression_algorithm);
|
|
473
304
|
}
|
|
474
305
|
// GRPC_COMPRESS_NONE is always set.
|
|
475
|
-
|
|
306
|
+
DCHECK(encodings_accepted_by_peer_.IsSet(GRPC_COMPRESS_NONE));
|
|
476
307
|
if (GPR_UNLIKELY(!encodings_accepted_by_peer_.IsSet(compression_algorithm))) {
|
|
477
|
-
if (GRPC_TRACE_FLAG_ENABLED(
|
|
308
|
+
if (GRPC_TRACE_FLAG_ENABLED(compression)) {
|
|
478
309
|
HandleCompressionAlgorithmNotAccepted(compression_algorithm);
|
|
479
310
|
}
|
|
480
311
|
}
|
|
@@ -484,11 +315,9 @@ void Call::HandleCompressionAlgorithmNotAccepted(
|
|
|
484
315
|
grpc_compression_algorithm compression_algorithm) {
|
|
485
316
|
const char* algo_name = nullptr;
|
|
486
317
|
grpc_compression_algorithm_name(compression_algorithm, &algo_name);
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
algo_name,
|
|
491
|
-
std::string(encodings_accepted_by_peer_.ToString()).c_str());
|
|
318
|
+
LOG(ERROR) << "Compression algorithm ('" << algo_name
|
|
319
|
+
<< "') not present in the accepted encodings ("
|
|
320
|
+
<< encodings_accepted_by_peer_.ToString() << ")";
|
|
492
321
|
}
|
|
493
322
|
|
|
494
323
|
void Call::HandleCompressionAlgorithmDisabled(
|
|
@@ -497,3804 +326,185 @@ void Call::HandleCompressionAlgorithmDisabled(
|
|
|
497
326
|
grpc_compression_algorithm_name(compression_algorithm, &algo_name);
|
|
498
327
|
std::string error_msg =
|
|
499
328
|
absl::StrFormat("Compression algorithm '%s' is disabled.", algo_name);
|
|
500
|
-
|
|
329
|
+
LOG(ERROR) << error_msg;
|
|
501
330
|
CancelWithError(grpc_error_set_int(absl::UnimplementedError(error_msg),
|
|
502
331
|
StatusIntProperty::kRpcStatus,
|
|
503
332
|
GRPC_STATUS_UNIMPLEMENTED));
|
|
504
333
|
}
|
|
505
334
|
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
gpr_free(static_cast<void*>(const_cast<char*>(final_info_.error_string)));
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
bool Completed() override {
|
|
522
|
-
return gpr_atm_acq_load(&received_final_op_atm_) != 0;
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
// TODO(ctiller): return absl::StatusOr<SomeSmartPointer<Call>>?
|
|
526
|
-
static grpc_error_handle Create(grpc_call_create_args* args,
|
|
527
|
-
grpc_call** out_call);
|
|
528
|
-
|
|
529
|
-
static Call* FromTopElem(grpc_call_element* elem) {
|
|
530
|
-
return FromCallStack(grpc_call_stack_from_top_element(elem));
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
grpc_call_stack* call_stack() override {
|
|
534
|
-
return reinterpret_cast<grpc_call_stack*>(
|
|
535
|
-
reinterpret_cast<char*>(this) +
|
|
536
|
-
GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(*this)));
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
grpc_event_engine::experimental::EventEngine* event_engine() const override {
|
|
540
|
-
return channel()->event_engine();
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
grpc_call_element* call_elem(size_t idx) {
|
|
544
|
-
return grpc_call_stack_element(call_stack(), idx);
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
CallCombiner* call_combiner() { return &call_combiner_; }
|
|
548
|
-
|
|
549
|
-
void CancelWithError(grpc_error_handle error) override;
|
|
550
|
-
void SetCompletionQueue(grpc_completion_queue* cq) override;
|
|
551
|
-
grpc_call_error StartBatch(const grpc_op* ops, size_t nops, void* notify_tag,
|
|
552
|
-
bool is_notify_tag_closure) override;
|
|
553
|
-
void ExternalRef() override { ext_ref_.Ref(); }
|
|
554
|
-
void ExternalUnref() override;
|
|
555
|
-
void InternalRef(const char* reason) override {
|
|
556
|
-
GRPC_CALL_STACK_REF(call_stack(), reason);
|
|
557
|
-
}
|
|
558
|
-
void InternalUnref(const char* reason) override {
|
|
559
|
-
GRPC_CALL_STACK_UNREF(call_stack(), reason);
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
void ContextSet(grpc_context_index elem, void* value,
|
|
563
|
-
void (*destroy)(void* value)) override;
|
|
564
|
-
void* ContextGet(grpc_context_index elem) const override {
|
|
565
|
-
return context_[elem].value;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
bool is_trailers_only() const override {
|
|
569
|
-
bool result = is_trailers_only_;
|
|
570
|
-
GPR_DEBUG_ASSERT(!result || recv_initial_metadata_.TransportSize() == 0);
|
|
571
|
-
return result;
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
bool failed_before_recv_message() const override {
|
|
575
|
-
return call_failed_before_recv_message_;
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
absl::string_view GetServerAuthority() const override {
|
|
579
|
-
const Slice* authority_metadata =
|
|
580
|
-
recv_initial_metadata_.get_pointer(HttpAuthorityMetadata());
|
|
581
|
-
if (authority_metadata == nullptr) return "";
|
|
582
|
-
return authority_metadata->as_string_view();
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
static size_t InitialSizeEstimate() {
|
|
586
|
-
return sizeof(FilterStackCall) +
|
|
587
|
-
sizeof(BatchControl) * kMaxConcurrentBatches;
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
private:
|
|
591
|
-
class ScopedContext : public promise_detail::Context<Arena> {
|
|
592
|
-
public:
|
|
593
|
-
explicit ScopedContext(FilterStackCall* call)
|
|
594
|
-
: promise_detail::Context<Arena>(call->arena()) {}
|
|
595
|
-
};
|
|
596
|
-
|
|
597
|
-
static constexpr gpr_atm kRecvNone = 0;
|
|
598
|
-
static constexpr gpr_atm kRecvInitialMetadataFirst = 1;
|
|
599
|
-
|
|
600
|
-
enum class PendingOp {
|
|
601
|
-
kRecvMessage,
|
|
602
|
-
kRecvInitialMetadata,
|
|
603
|
-
kRecvTrailingMetadata,
|
|
604
|
-
kSends
|
|
605
|
-
};
|
|
606
|
-
static intptr_t PendingOpMask(PendingOp op) {
|
|
607
|
-
return static_cast<intptr_t>(1) << static_cast<intptr_t>(op);
|
|
608
|
-
}
|
|
609
|
-
static std::string PendingOpString(intptr_t pending_ops) {
|
|
610
|
-
std::vector<absl::string_view> pending_op_strings;
|
|
611
|
-
if (pending_ops & PendingOpMask(PendingOp::kRecvMessage)) {
|
|
612
|
-
pending_op_strings.push_back("kRecvMessage");
|
|
613
|
-
}
|
|
614
|
-
if (pending_ops & PendingOpMask(PendingOp::kRecvInitialMetadata)) {
|
|
615
|
-
pending_op_strings.push_back("kRecvInitialMetadata");
|
|
616
|
-
}
|
|
617
|
-
if (pending_ops & PendingOpMask(PendingOp::kRecvTrailingMetadata)) {
|
|
618
|
-
pending_op_strings.push_back("kRecvTrailingMetadata");
|
|
619
|
-
}
|
|
620
|
-
if (pending_ops & PendingOpMask(PendingOp::kSends)) {
|
|
621
|
-
pending_op_strings.push_back("kSends");
|
|
622
|
-
}
|
|
623
|
-
return absl::StrCat("{", absl::StrJoin(pending_op_strings, ","), "}");
|
|
335
|
+
void Call::UpdateDeadline(Timestamp deadline) {
|
|
336
|
+
ReleasableMutexLock lock(&deadline_mu_);
|
|
337
|
+
GRPC_TRACE_LOG(call, INFO)
|
|
338
|
+
<< "[call " << this << "] UpdateDeadline from=" << deadline_.ToString()
|
|
339
|
+
<< " to=" << deadline.ToString();
|
|
340
|
+
if (deadline >= deadline_) return;
|
|
341
|
+
if (deadline < Timestamp::Now()) {
|
|
342
|
+
lock.Release();
|
|
343
|
+
CancelWithError(grpc_error_set_int(
|
|
344
|
+
absl::DeadlineExceededError("Deadline Exceeded"),
|
|
345
|
+
StatusIntProperty::kRpcStatus, GRPC_STATUS_DEADLINE_EXCEEDED));
|
|
346
|
+
return;
|
|
624
347
|
}
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
// per call, so any savings we can make are worthwhile,
|
|
632
|
-
|
|
633
|
-
// We use notify_tag to determine whether or not to send notification to the
|
|
634
|
-
// completion queue. Once we've made that determination, we can reuse the
|
|
635
|
-
// memory for cq_completion.
|
|
636
|
-
union {
|
|
637
|
-
grpc_cq_completion cq_completion;
|
|
638
|
-
struct {
|
|
639
|
-
// Any given op indicates completion by either (a) calling a closure or
|
|
640
|
-
// (b) sending a notification on the call's completion queue. If
|
|
641
|
-
// \a is_closure is true, \a tag indicates a closure to be invoked;
|
|
642
|
-
// otherwise, \a tag indicates the tag to be used in the notification to
|
|
643
|
-
// be sent to the completion queue.
|
|
644
|
-
void* tag;
|
|
645
|
-
bool is_closure;
|
|
646
|
-
} notify_tag;
|
|
647
|
-
} completion_data_;
|
|
648
|
-
grpc_closure start_batch_;
|
|
649
|
-
grpc_closure finish_batch_;
|
|
650
|
-
std::atomic<intptr_t> ops_pending_{0};
|
|
651
|
-
AtomicError batch_error_;
|
|
652
|
-
void set_pending_ops(uintptr_t ops) {
|
|
653
|
-
ops_pending_.store(ops, std::memory_order_release);
|
|
654
|
-
}
|
|
655
|
-
bool completed_batch_step(PendingOp op) {
|
|
656
|
-
auto mask = PendingOpMask(op);
|
|
657
|
-
auto r = ops_pending_.fetch_sub(mask, std::memory_order_acq_rel);
|
|
658
|
-
if (grpc_call_trace.enabled()) {
|
|
659
|
-
gpr_log(GPR_DEBUG, "BATCH:%p COMPLETE:%s REMAINING:%s (tag:%p)", this,
|
|
660
|
-
PendingOpString(mask).c_str(),
|
|
661
|
-
PendingOpString(r & ~mask).c_str(),
|
|
662
|
-
completion_data_.notify_tag.tag);
|
|
663
|
-
}
|
|
664
|
-
GPR_ASSERT((r & mask) != 0);
|
|
665
|
-
return r == mask;
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
void PostCompletion();
|
|
669
|
-
void FinishStep(PendingOp op);
|
|
670
|
-
void ProcessDataAfterMetadata();
|
|
671
|
-
void ReceivingStreamReady(grpc_error_handle error);
|
|
672
|
-
void ReceivingInitialMetadataReady(grpc_error_handle error);
|
|
673
|
-
void ReceivingTrailingMetadataReady(grpc_error_handle error);
|
|
674
|
-
void FinishBatch(grpc_error_handle error);
|
|
675
|
-
};
|
|
676
|
-
|
|
677
|
-
FilterStackCall(Arena* arena, const grpc_call_create_args& args)
|
|
678
|
-
: Call(arena, args.server_transport_data == nullptr, args.send_deadline,
|
|
679
|
-
args.channel->Ref()),
|
|
680
|
-
cq_(args.cq),
|
|
681
|
-
stream_op_payload_(context_) {}
|
|
682
|
-
|
|
683
|
-
static void ReleaseCall(void* call, grpc_error_handle);
|
|
684
|
-
static void DestroyCall(void* call, grpc_error_handle);
|
|
685
|
-
|
|
686
|
-
static FilterStackCall* FromCallStack(grpc_call_stack* call_stack) {
|
|
687
|
-
return reinterpret_cast<FilterStackCall*>(
|
|
688
|
-
reinterpret_cast<char*>(call_stack) -
|
|
689
|
-
GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(FilterStackCall)));
|
|
348
|
+
auto* event_engine =
|
|
349
|
+
arena_->GetContext<grpc_event_engine::experimental::EventEngine>();
|
|
350
|
+
if (deadline_ != Timestamp::InfFuture()) {
|
|
351
|
+
if (!event_engine->Cancel(deadline_task_)) return;
|
|
352
|
+
} else {
|
|
353
|
+
InternalRef("deadline");
|
|
690
354
|
}
|
|
355
|
+
deadline_ = deadline;
|
|
356
|
+
deadline_task_ = event_engine->RunAfter(deadline - Timestamp::Now(), this);
|
|
357
|
+
}
|
|
691
358
|
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
void RecvInitialFilter(grpc_metadata_batch* b);
|
|
700
|
-
void RecvTrailingFilter(grpc_metadata_batch* b,
|
|
701
|
-
grpc_error_handle batch_error);
|
|
702
|
-
|
|
703
|
-
RefCount ext_ref_;
|
|
704
|
-
CallCombiner call_combiner_;
|
|
705
|
-
grpc_completion_queue* cq_;
|
|
706
|
-
grpc_polling_entity pollent_;
|
|
707
|
-
|
|
708
|
-
/// has grpc_call_unref been called
|
|
709
|
-
bool destroy_called_ = false;
|
|
710
|
-
// Trailers-only response status
|
|
711
|
-
bool is_trailers_only_ = false;
|
|
712
|
-
/// which ops are in-flight
|
|
713
|
-
bool sent_initial_metadata_ = false;
|
|
714
|
-
bool sending_message_ = false;
|
|
715
|
-
bool sent_final_op_ = false;
|
|
716
|
-
bool received_initial_metadata_ = false;
|
|
717
|
-
bool receiving_message_ = false;
|
|
718
|
-
bool requested_final_op_ = false;
|
|
719
|
-
gpr_atm received_final_op_atm_ = 0;
|
|
720
|
-
|
|
721
|
-
BatchControl* active_batches_[kMaxConcurrentBatches] = {};
|
|
722
|
-
grpc_transport_stream_op_batch_payload stream_op_payload_;
|
|
723
|
-
|
|
724
|
-
// first idx: is_receiving, second idx: is_trailing
|
|
725
|
-
grpc_metadata_batch send_initial_metadata_;
|
|
726
|
-
grpc_metadata_batch send_trailing_metadata_;
|
|
727
|
-
grpc_metadata_batch recv_initial_metadata_;
|
|
728
|
-
grpc_metadata_batch recv_trailing_metadata_;
|
|
729
|
-
|
|
730
|
-
// Buffered read metadata waiting to be returned to the application.
|
|
731
|
-
// Element 0 is initial metadata, element 1 is trailing metadata.
|
|
732
|
-
grpc_metadata_array* buffered_metadata_[2] = {};
|
|
733
|
-
|
|
734
|
-
// Call data useful used for reporting. Only valid after the call has
|
|
735
|
-
// completed
|
|
736
|
-
grpc_call_final_info final_info_;
|
|
737
|
-
|
|
738
|
-
// Contexts for various subsystems (security, tracing, ...).
|
|
739
|
-
grpc_call_context_element context_[GRPC_CONTEXT_COUNT] = {};
|
|
740
|
-
|
|
741
|
-
SliceBuffer send_slice_buffer_;
|
|
742
|
-
absl::optional<SliceBuffer> receiving_slice_buffer_;
|
|
743
|
-
uint32_t receiving_stream_flags_;
|
|
744
|
-
|
|
745
|
-
bool call_failed_before_recv_message_ = false;
|
|
746
|
-
grpc_byte_buffer** receiving_buffer_ = nullptr;
|
|
747
|
-
grpc_slice receiving_slice_ = grpc_empty_slice();
|
|
748
|
-
grpc_closure receiving_stream_ready_;
|
|
749
|
-
grpc_closure receiving_initial_metadata_ready_;
|
|
750
|
-
grpc_closure receiving_trailing_metadata_ready_;
|
|
751
|
-
// Status about operation of call
|
|
752
|
-
bool sent_server_trailing_metadata_ = false;
|
|
753
|
-
gpr_atm cancelled_with_error_ = 0;
|
|
754
|
-
|
|
755
|
-
grpc_closure release_call_;
|
|
756
|
-
|
|
757
|
-
union {
|
|
758
|
-
struct {
|
|
759
|
-
grpc_status_code* status;
|
|
760
|
-
grpc_slice* status_details;
|
|
761
|
-
const char** error_string;
|
|
762
|
-
} client;
|
|
763
|
-
struct {
|
|
764
|
-
int* cancelled;
|
|
765
|
-
// backpointer to owning server if this is a server side call.
|
|
766
|
-
ServerInterface* core_server;
|
|
767
|
-
} server;
|
|
768
|
-
} final_op_;
|
|
769
|
-
AtomicError status_error_;
|
|
770
|
-
|
|
771
|
-
// recv_state can contain one of the following values:
|
|
772
|
-
// RECV_NONE : : no initial metadata and messages received
|
|
773
|
-
// RECV_INITIAL_METADATA_FIRST : received initial metadata first
|
|
774
|
-
// a batch_control* : received messages first
|
|
775
|
-
|
|
776
|
-
// +------1------RECV_NONE------3-----+
|
|
777
|
-
// | |
|
|
778
|
-
// | |
|
|
779
|
-
// v v
|
|
780
|
-
// RECV_INITIAL_METADATA_FIRST receiving_stream_ready_bctlp
|
|
781
|
-
// | ^ | ^
|
|
782
|
-
// | | | |
|
|
783
|
-
// +-----2-----+ +-----4-----+
|
|
784
|
-
|
|
785
|
-
// For 1, 4: See receiving_initial_metadata_ready() function
|
|
786
|
-
// For 2, 3: See receiving_stream_ready() function
|
|
787
|
-
gpr_atm recv_state_ = 0;
|
|
788
|
-
};
|
|
789
|
-
|
|
790
|
-
grpc_error_handle FilterStackCall::Create(grpc_call_create_args* args,
|
|
791
|
-
grpc_call** out_call) {
|
|
792
|
-
Channel* channel = args->channel.get();
|
|
793
|
-
|
|
794
|
-
auto add_init_error = [](grpc_error_handle* composite,
|
|
795
|
-
grpc_error_handle new_err) {
|
|
796
|
-
if (new_err.ok()) return;
|
|
797
|
-
if (composite->ok()) {
|
|
798
|
-
*composite = GRPC_ERROR_CREATE("Call creation failed");
|
|
799
|
-
}
|
|
800
|
-
*composite = grpc_error_add_child(*composite, new_err);
|
|
801
|
-
};
|
|
802
|
-
|
|
803
|
-
FilterStackCall* call;
|
|
804
|
-
grpc_error_handle error;
|
|
805
|
-
grpc_channel_stack* channel_stack = channel->channel_stack();
|
|
806
|
-
size_t call_alloc_size =
|
|
807
|
-
GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(FilterStackCall)) +
|
|
808
|
-
channel_stack->call_stack_size;
|
|
809
|
-
|
|
810
|
-
Arena* arena = channel->CreateArena();
|
|
811
|
-
call = new (arena->Alloc(call_alloc_size)) FilterStackCall(arena, *args);
|
|
812
|
-
GPR_DEBUG_ASSERT(FromC(call->c_ptr()) == call);
|
|
813
|
-
GPR_DEBUG_ASSERT(FromCallStack(call->call_stack()) == call);
|
|
814
|
-
*out_call = call->c_ptr();
|
|
815
|
-
grpc_slice path = grpc_empty_slice();
|
|
816
|
-
ScopedContext ctx(call);
|
|
817
|
-
if (call->is_client()) {
|
|
818
|
-
call->final_op_.client.status_details = nullptr;
|
|
819
|
-
call->final_op_.client.status = nullptr;
|
|
820
|
-
call->final_op_.client.error_string = nullptr;
|
|
821
|
-
global_stats().IncrementClientCallsCreated();
|
|
822
|
-
path = CSliceRef(args->path->c_slice());
|
|
823
|
-
call->send_initial_metadata_.Set(HttpPathMetadata(),
|
|
824
|
-
std::move(*args->path));
|
|
825
|
-
if (args->authority.has_value()) {
|
|
826
|
-
call->send_initial_metadata_.Set(HttpAuthorityMetadata(),
|
|
827
|
-
std::move(*args->authority));
|
|
828
|
-
}
|
|
829
|
-
call->send_initial_metadata_.Set(
|
|
830
|
-
GrpcRegisteredMethod(), reinterpret_cast<void*>(static_cast<uintptr_t>(
|
|
831
|
-
args->registered_method)));
|
|
832
|
-
channel_stack->stats_plugin_group->AddClientCallTracers(
|
|
833
|
-
Slice(CSliceRef(path)), args->registered_method, call->context_);
|
|
834
|
-
} else {
|
|
835
|
-
global_stats().IncrementServerCallsCreated();
|
|
836
|
-
call->final_op_.server.cancelled = nullptr;
|
|
837
|
-
call->final_op_.server.core_server = args->server;
|
|
838
|
-
// TODO(yashykt): In the future, we want to also enable stats and trace
|
|
839
|
-
// collecting from when the call is created at the transport. The idea is
|
|
840
|
-
// that the transport would create the call tracer and pass it in as part of
|
|
841
|
-
// the metadata.
|
|
842
|
-
// TODO(yijiem): OpenCensus and internal Census is still using this way to
|
|
843
|
-
// set server call tracer. We need to refactor them to stats plugins
|
|
844
|
-
// (including removing the client channel filters).
|
|
845
|
-
if (args->server != nullptr &&
|
|
846
|
-
args->server->server_call_tracer_factory() != nullptr) {
|
|
847
|
-
auto* server_call_tracer =
|
|
848
|
-
args->server->server_call_tracer_factory()->CreateNewServerCallTracer(
|
|
849
|
-
arena, args->server->channel_args());
|
|
850
|
-
if (server_call_tracer != nullptr) {
|
|
851
|
-
// Note that we are setting both
|
|
852
|
-
// GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE and
|
|
853
|
-
// GRPC_CONTEXT_CALL_TRACER as a matter of convenience. In the future
|
|
854
|
-
// promise-based world, we would just a single tracer object for each
|
|
855
|
-
// stack (call, subchannel_call, server_call.)
|
|
856
|
-
call->ContextSet(GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE,
|
|
857
|
-
server_call_tracer, nullptr);
|
|
858
|
-
call->ContextSet(GRPC_CONTEXT_CALL_TRACER, server_call_tracer, nullptr);
|
|
859
|
-
}
|
|
359
|
+
void Call::ResetDeadline() {
|
|
360
|
+
{
|
|
361
|
+
MutexLock lock(&deadline_mu_);
|
|
362
|
+
if (deadline_ == Timestamp::InfFuture()) return;
|
|
363
|
+
if (!arena_->GetContext<grpc_event_engine::experimental::EventEngine>()
|
|
364
|
+
->Cancel(deadline_task_)) {
|
|
365
|
+
return;
|
|
860
366
|
}
|
|
861
|
-
|
|
367
|
+
deadline_ = Timestamp::InfFuture();
|
|
862
368
|
}
|
|
369
|
+
InternalUnref("deadline[reset]");
|
|
370
|
+
}
|
|
863
371
|
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
add_init_error(&error, grpc_call_stack_init(channel_stack, 1, DestroyCall,
|
|
876
|
-
call, &call_args));
|
|
877
|
-
// Publish this call to parent only after the call stack has been initialized.
|
|
878
|
-
if (parent != nullptr) {
|
|
879
|
-
call->PublishToParent(parent);
|
|
880
|
-
}
|
|
372
|
+
void Call::Run() {
|
|
373
|
+
ApplicationCallbackExecCtx callback_exec_ctx;
|
|
374
|
+
ExecCtx exec_ctx;
|
|
375
|
+
GRPC_TRACE_LOG(call, INFO)
|
|
376
|
+
<< "call deadline expired "
|
|
377
|
+
<< GRPC_DUMP_ARGS(Timestamp::Now(), send_deadline_);
|
|
378
|
+
CancelWithError(grpc_error_set_int(
|
|
379
|
+
absl::DeadlineExceededError("Deadline Exceeded"),
|
|
380
|
+
StatusIntProperty::kRpcStatus, GRPC_STATUS_DEADLINE_EXCEEDED));
|
|
381
|
+
InternalUnref("deadline[run]");
|
|
382
|
+
}
|
|
881
383
|
|
|
882
|
-
|
|
883
|
-
call->CancelWithError(error);
|
|
884
|
-
}
|
|
885
|
-
if (args->cq != nullptr) {
|
|
886
|
-
GPR_ASSERT(args->pollset_set_alternative == nullptr &&
|
|
887
|
-
"Only one of 'cq' and 'pollset_set_alternative' should be "
|
|
888
|
-
"non-nullptr.");
|
|
889
|
-
GRPC_CQ_INTERNAL_REF(args->cq, "bind");
|
|
890
|
-
call->pollent_ =
|
|
891
|
-
grpc_polling_entity_create_from_pollset(grpc_cq_pollset(args->cq));
|
|
892
|
-
}
|
|
893
|
-
if (args->pollset_set_alternative != nullptr) {
|
|
894
|
-
call->pollent_ = grpc_polling_entity_create_from_pollset_set(
|
|
895
|
-
args->pollset_set_alternative);
|
|
896
|
-
}
|
|
897
|
-
if (!grpc_polling_entity_is_empty(&call->pollent_)) {
|
|
898
|
-
grpc_call_stack_set_pollset_or_pollset_set(call->call_stack(),
|
|
899
|
-
&call->pollent_);
|
|
900
|
-
}
|
|
384
|
+
} // namespace grpc_core
|
|
901
385
|
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
if (channelz_channel != nullptr) {
|
|
905
|
-
channelz_channel->RecordCallStarted();
|
|
906
|
-
}
|
|
907
|
-
} else if (call->final_op_.server.core_server != nullptr) {
|
|
908
|
-
channelz::ServerNode* channelz_node =
|
|
909
|
-
call->final_op_.server.core_server->channelz_node();
|
|
910
|
-
if (channelz_node != nullptr) {
|
|
911
|
-
channelz_node->RecordCallStarted();
|
|
912
|
-
}
|
|
913
|
-
}
|
|
386
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
387
|
+
// C-based API
|
|
914
388
|
|
|
915
|
-
|
|
389
|
+
void* grpc_call_arena_alloc(grpc_call* call, size_t size) {
|
|
390
|
+
grpc_core::ExecCtx exec_ctx;
|
|
391
|
+
return grpc_core::Call::FromC(call)->arena()->Alloc(size);
|
|
392
|
+
}
|
|
916
393
|
|
|
917
|
-
|
|
394
|
+
void grpc_call_set_completion_queue(grpc_call* call,
|
|
395
|
+
grpc_completion_queue* cq) {
|
|
396
|
+
grpc_core::Call::FromC(call)->SetCompletionQueue(cq);
|
|
918
397
|
}
|
|
919
398
|
|
|
920
|
-
void
|
|
921
|
-
GPR_ASSERT(cq);
|
|
399
|
+
void grpc_call_ref(grpc_call* c) { grpc_core::Call::FromC(c)->ExternalRef(); }
|
|
922
400
|
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
cq_ = cq;
|
|
927
|
-
GRPC_CQ_INTERNAL_REF(cq, "bind");
|
|
928
|
-
pollent_ = grpc_polling_entity_create_from_pollset(grpc_cq_pollset(cq));
|
|
929
|
-
grpc_call_stack_set_pollset_or_pollset_set(call_stack(), &pollent_);
|
|
401
|
+
void grpc_call_unref(grpc_call* c) {
|
|
402
|
+
grpc_core::ExecCtx exec_ctx;
|
|
403
|
+
grpc_core::Call::FromC(c)->ExternalUnref();
|
|
930
404
|
}
|
|
931
405
|
|
|
932
|
-
|
|
933
|
-
|
|
406
|
+
char* grpc_call_get_peer(grpc_call* call) {
|
|
407
|
+
return grpc_core::Call::FromC(call)->GetPeer();
|
|
934
408
|
}
|
|
935
409
|
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
if (pc != nullptr) {
|
|
943
|
-
pc->~ParentCall();
|
|
944
|
-
}
|
|
945
|
-
if (c->cq_) {
|
|
946
|
-
GRPC_CQ_INTERNAL_UNREF(c->cq_, "bind");
|
|
410
|
+
grpc_call_error grpc_call_cancel(grpc_call* call, void* reserved) {
|
|
411
|
+
GRPC_TRACE_LOG(api, INFO)
|
|
412
|
+
<< "grpc_call_cancel(call=" << call << ", reserved=" << reserved << ")";
|
|
413
|
+
CHECK_EQ(reserved, nullptr);
|
|
414
|
+
if (call == nullptr) {
|
|
415
|
+
return GRPC_CALL_ERROR;
|
|
947
416
|
}
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
&(c->final_info_.error_string));
|
|
953
|
-
c->status_error_.set(absl::OkStatus());
|
|
954
|
-
c->final_info_.stats.latency =
|
|
955
|
-
gpr_cycle_counter_sub(gpr_get_cycle_counter(), c->start_time());
|
|
956
|
-
grpc_call_stack_destroy(c->call_stack(), &c->final_info_,
|
|
957
|
-
GRPC_CLOSURE_INIT(&c->release_call_, ReleaseCall, c,
|
|
958
|
-
grpc_schedule_on_exec_ctx));
|
|
417
|
+
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
|
|
418
|
+
grpc_core::ExecCtx exec_ctx;
|
|
419
|
+
grpc_core::Call::FromC(call)->CancelWithError(absl::CancelledError());
|
|
420
|
+
return GRPC_CALL_OK;
|
|
959
421
|
}
|
|
960
422
|
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
GPR_ASSERT(!destroy_called_);
|
|
972
|
-
destroy_called_ = true;
|
|
973
|
-
bool cancel = gpr_atm_acq_load(&received_final_op_atm_) == 0;
|
|
974
|
-
if (cancel) {
|
|
975
|
-
CancelWithError(absl::CancelledError());
|
|
976
|
-
} else {
|
|
977
|
-
// Unset the call combiner cancellation closure. This has the
|
|
978
|
-
// effect of scheduling the previously set cancellation closure, if
|
|
979
|
-
// any, so that it can release any internal references it may be
|
|
980
|
-
// holding to the call stack.
|
|
981
|
-
call_combiner_.SetNotifyOnCancel(nullptr);
|
|
423
|
+
grpc_call_error grpc_call_cancel_with_status(grpc_call* c,
|
|
424
|
+
grpc_status_code status,
|
|
425
|
+
const char* description,
|
|
426
|
+
void* reserved) {
|
|
427
|
+
GRPC_TRACE_LOG(api, INFO)
|
|
428
|
+
<< "grpc_call_cancel_with_status(c=" << c << ", status=" << (int)status
|
|
429
|
+
<< ", description=" << description << ", reserved=" << reserved << ")";
|
|
430
|
+
CHECK_EQ(reserved, nullptr);
|
|
431
|
+
if (c == nullptr) {
|
|
432
|
+
return GRPC_CALL_ERROR;
|
|
982
433
|
}
|
|
983
|
-
|
|
434
|
+
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
|
|
435
|
+
grpc_core::ExecCtx exec_ctx;
|
|
436
|
+
grpc_core::Call::FromC(c)->CancelWithStatus(status, description);
|
|
437
|
+
return GRPC_CALL_OK;
|
|
984
438
|
}
|
|
985
439
|
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
void FilterStackCall::ExecuteBatch(grpc_transport_stream_op_batch* batch,
|
|
989
|
-
grpc_closure* start_batch_closure) {
|
|
990
|
-
// This is called via the call combiner to start sending a batch down
|
|
991
|
-
// the filter stack.
|
|
992
|
-
auto execute_batch_in_call_combiner = [](void* arg, grpc_error_handle) {
|
|
993
|
-
grpc_transport_stream_op_batch* batch =
|
|
994
|
-
static_cast<grpc_transport_stream_op_batch*>(arg);
|
|
995
|
-
auto* call =
|
|
996
|
-
static_cast<FilterStackCall*>(batch->handler_private.extra_arg);
|
|
997
|
-
grpc_call_element* elem = call->call_elem(0);
|
|
998
|
-
GRPC_CALL_LOG_OP(GPR_INFO, elem, batch);
|
|
999
|
-
elem->filter->start_transport_stream_op_batch(elem, batch);
|
|
1000
|
-
};
|
|
1001
|
-
batch->handler_private.extra_arg = this;
|
|
1002
|
-
GRPC_CLOSURE_INIT(start_batch_closure, execute_batch_in_call_combiner, batch,
|
|
1003
|
-
grpc_schedule_on_exec_ctx);
|
|
1004
|
-
GRPC_CALL_COMBINER_START(call_combiner(), start_batch_closure,
|
|
1005
|
-
absl::OkStatus(), "executing batch");
|
|
440
|
+
void grpc_call_cancel_internal(grpc_call* call) {
|
|
441
|
+
grpc_core::Call::FromC(call)->CancelWithError(absl::CancelledError());
|
|
1006
442
|
}
|
|
1007
443
|
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
grpc_closure start_batch;
|
|
1012
|
-
grpc_closure finish_batch;
|
|
1013
|
-
};
|
|
1014
|
-
} // namespace
|
|
1015
|
-
|
|
1016
|
-
// The on_complete callback used when sending a cancel_stream batch down
|
|
1017
|
-
// the filter stack. Yields the call combiner when the batch is done.
|
|
1018
|
-
static void done_termination(void* arg, grpc_error_handle /*error*/) {
|
|
1019
|
-
CancelState* state = static_cast<CancelState*>(arg);
|
|
1020
|
-
GRPC_CALL_COMBINER_STOP(state->call->call_combiner(),
|
|
1021
|
-
"on_complete for cancel_stream op");
|
|
1022
|
-
state->call->InternalUnref("termination");
|
|
1023
|
-
delete state;
|
|
444
|
+
grpc_compression_algorithm grpc_call_test_only_get_compression_algorithm(
|
|
445
|
+
grpc_call* call) {
|
|
446
|
+
return grpc_core::Call::FromC(call)->incoming_compression_algorithm();
|
|
1024
447
|
}
|
|
1025
448
|
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
return;
|
|
1029
|
-
}
|
|
1030
|
-
ClearPeerString();
|
|
1031
|
-
InternalRef("termination");
|
|
1032
|
-
// Inform the call combiner of the cancellation, so that it can cancel
|
|
1033
|
-
// any in-flight asynchronous actions that may be holding the call
|
|
1034
|
-
// combiner. This ensures that the cancel_stream batch can be sent
|
|
1035
|
-
// down the filter stack in a timely manner.
|
|
1036
|
-
call_combiner_.Cancel(error);
|
|
1037
|
-
CancelState* state = new CancelState;
|
|
1038
|
-
state->call = this;
|
|
1039
|
-
GRPC_CLOSURE_INIT(&state->finish_batch, done_termination, state,
|
|
1040
|
-
grpc_schedule_on_exec_ctx);
|
|
1041
|
-
grpc_transport_stream_op_batch* op =
|
|
1042
|
-
grpc_make_transport_stream_op(&state->finish_batch);
|
|
1043
|
-
op->cancel_stream = true;
|
|
1044
|
-
op->payload->cancel_stream.cancel_error = error;
|
|
1045
|
-
ExecuteBatch(op, &state->start_batch);
|
|
449
|
+
uint32_t grpc_call_test_only_get_message_flags(grpc_call* call) {
|
|
450
|
+
return grpc_core::Call::FromC(call)->test_only_message_flags();
|
|
1046
451
|
}
|
|
1047
452
|
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
}
|
|
1053
|
-
if (is_client()) {
|
|
1054
|
-
std::string status_details;
|
|
1055
|
-
grpc_error_get_status(error, send_deadline(), final_op_.client.status,
|
|
1056
|
-
&status_details, nullptr,
|
|
1057
|
-
final_op_.client.error_string);
|
|
1058
|
-
*final_op_.client.status_details =
|
|
1059
|
-
grpc_slice_from_cpp_string(std::move(status_details));
|
|
1060
|
-
status_error_.set(error);
|
|
1061
|
-
channelz::ChannelNode* channelz_channel = channel()->channelz_node();
|
|
1062
|
-
if (channelz_channel != nullptr) {
|
|
1063
|
-
if (*final_op_.client.status != GRPC_STATUS_OK) {
|
|
1064
|
-
channelz_channel->RecordCallFailed();
|
|
1065
|
-
} else {
|
|
1066
|
-
channelz_channel->RecordCallSucceeded();
|
|
1067
|
-
}
|
|
1068
|
-
}
|
|
1069
|
-
} else {
|
|
1070
|
-
*final_op_.server.cancelled =
|
|
1071
|
-
!error.ok() || !sent_server_trailing_metadata_;
|
|
1072
|
-
channelz::ServerNode* channelz_node =
|
|
1073
|
-
final_op_.server.core_server->channelz_node();
|
|
1074
|
-
if (channelz_node != nullptr) {
|
|
1075
|
-
if (*final_op_.server.cancelled || !status_error_.ok()) {
|
|
1076
|
-
channelz_node->RecordCallFailed();
|
|
1077
|
-
} else {
|
|
1078
|
-
channelz_node->RecordCallSucceeded();
|
|
1079
|
-
}
|
|
1080
|
-
}
|
|
1081
|
-
}
|
|
453
|
+
uint32_t grpc_call_test_only_get_encodings_accepted_by_peer(grpc_call* call) {
|
|
454
|
+
return grpc_core::Call::FromC(call)
|
|
455
|
+
->encodings_accepted_by_peer()
|
|
456
|
+
.ToLegacyBitmask();
|
|
1082
457
|
}
|
|
1083
458
|
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
bool is_trailing) {
|
|
1087
|
-
grpc_metadata_batch* batch =
|
|
1088
|
-
is_trailing ? &send_trailing_metadata_ : &send_initial_metadata_;
|
|
1089
|
-
for (size_t i = 0; i < count; i++) {
|
|
1090
|
-
grpc_metadata* md = &metadata[i];
|
|
1091
|
-
if (!GRPC_LOG_IF_ERROR("validate_metadata",
|
|
1092
|
-
grpc_validate_header_key_is_legal(md->key))) {
|
|
1093
|
-
return false;
|
|
1094
|
-
} else if (!grpc_is_binary_header_internal(md->key) &&
|
|
1095
|
-
!GRPC_LOG_IF_ERROR(
|
|
1096
|
-
"validate_metadata",
|
|
1097
|
-
grpc_validate_header_nonbin_value_is_legal(md->value))) {
|
|
1098
|
-
return false;
|
|
1099
|
-
} else if (GRPC_SLICE_LENGTH(md->value) >= UINT32_MAX) {
|
|
1100
|
-
// HTTP2 hpack encoding has a maximum limit.
|
|
1101
|
-
return false;
|
|
1102
|
-
} else if (grpc_slice_str_cmp(md->key, "content-length") == 0) {
|
|
1103
|
-
// Filter "content-length metadata"
|
|
1104
|
-
continue;
|
|
1105
|
-
}
|
|
1106
|
-
batch->Append(StringViewFromSlice(md->key), Slice(CSliceRef(md->value)),
|
|
1107
|
-
[md](absl::string_view error, const Slice& value) {
|
|
1108
|
-
gpr_log(GPR_DEBUG, "Append error: %s",
|
|
1109
|
-
absl::StrCat("key=", StringViewFromSlice(md->key),
|
|
1110
|
-
" error=", error,
|
|
1111
|
-
" value=", value.as_string_view())
|
|
1112
|
-
.c_str());
|
|
1113
|
-
});
|
|
1114
|
-
}
|
|
1115
|
-
|
|
1116
|
-
return true;
|
|
459
|
+
grpc_core::Arena* grpc_call_get_arena(grpc_call* call) {
|
|
460
|
+
return grpc_core::Call::FromC(call)->arena();
|
|
1117
461
|
}
|
|
1118
462
|
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
explicit PublishToAppEncoder(grpc_metadata_array* dest,
|
|
1123
|
-
const grpc_metadata_batch* encoding,
|
|
1124
|
-
bool is_client)
|
|
1125
|
-
: dest_(dest), encoding_(encoding), is_client_(is_client) {}
|
|
1126
|
-
|
|
1127
|
-
void Encode(const Slice& key, const Slice& value) {
|
|
1128
|
-
Append(key.c_slice(), value.c_slice());
|
|
1129
|
-
}
|
|
1130
|
-
|
|
1131
|
-
// Catch anything that is not explicitly handled, and do not publish it to the
|
|
1132
|
-
// application. If new metadata is added to a batch that needs to be
|
|
1133
|
-
// published, it should be called out here.
|
|
1134
|
-
template <typename Which>
|
|
1135
|
-
void Encode(Which, const typename Which::ValueType&) {}
|
|
463
|
+
grpc_call_stack* grpc_call_get_call_stack(grpc_call* call) {
|
|
464
|
+
return grpc_core::Call::FromC(call)->call_stack();
|
|
465
|
+
}
|
|
1136
466
|
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
467
|
+
grpc_call_error grpc_call_start_batch(grpc_call* call, const grpc_op* ops,
|
|
468
|
+
size_t nops, void* tag, void* reserved) {
|
|
469
|
+
GRPC_TRACE_LOG(api, INFO)
|
|
470
|
+
<< "grpc_call_start_batch(call=" << call << ", ops=" << ops
|
|
471
|
+
<< ", nops=" << (unsigned long)nops << ", tag=" << tag
|
|
472
|
+
<< ", reserved=" << reserved << ")";
|
|
1140
473
|
|
|
1141
|
-
|
|
1142
|
-
|
|
474
|
+
if (reserved != nullptr || call == nullptr) {
|
|
475
|
+
return GRPC_CALL_ERROR;
|
|
476
|
+
} else {
|
|
477
|
+
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
|
|
478
|
+
grpc_core::ExecCtx exec_ctx;
|
|
479
|
+
return grpc_core::Call::FromC(call)->StartBatch(ops, nops, tag, false);
|
|
1143
480
|
}
|
|
481
|
+
}
|
|
1144
482
|
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
483
|
+
grpc_call_error grpc_call_start_batch_and_execute(grpc_call* call,
|
|
484
|
+
const grpc_op* ops,
|
|
485
|
+
size_t nops,
|
|
486
|
+
grpc_closure* closure) {
|
|
487
|
+
return grpc_core::Call::FromC(call)->StartBatch(ops, nops, closure, true);
|
|
488
|
+
}
|
|
1148
489
|
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
void Encode(LbTokenMetadata, const Slice& slice) {
|
|
1154
|
-
Append(LbTokenMetadata::key(), slice);
|
|
1155
|
-
}
|
|
1156
|
-
|
|
1157
|
-
private:
|
|
1158
|
-
void Append(absl::string_view key, int64_t value) {
|
|
1159
|
-
Append(StaticSlice::FromStaticString(key).c_slice(),
|
|
1160
|
-
Slice::FromInt64(value).c_slice());
|
|
1161
|
-
}
|
|
1162
|
-
|
|
1163
|
-
void Append(absl::string_view key, const Slice& value) {
|
|
1164
|
-
Append(StaticSlice::FromStaticString(key).c_slice(), value.c_slice());
|
|
1165
|
-
}
|
|
1166
|
-
|
|
1167
|
-
void Append(grpc_slice key, grpc_slice value) {
|
|
1168
|
-
if (dest_->count == dest_->capacity) {
|
|
1169
|
-
Crash(absl::StrCat(
|
|
1170
|
-
"Too many metadata entries: capacity=", dest_->capacity, " on ",
|
|
1171
|
-
is_client_ ? "client" : "server", " encoding ", encoding_->count(),
|
|
1172
|
-
" elements: ", encoding_->DebugString().c_str()));
|
|
1173
|
-
}
|
|
1174
|
-
auto* mdusr = &dest_->metadata[dest_->count++];
|
|
1175
|
-
mdusr->key = key;
|
|
1176
|
-
mdusr->value = value;
|
|
1177
|
-
}
|
|
1178
|
-
|
|
1179
|
-
grpc_metadata_array* const dest_;
|
|
1180
|
-
const grpc_metadata_batch* const encoding_;
|
|
1181
|
-
const bool is_client_;
|
|
1182
|
-
};
|
|
1183
|
-
} // namespace
|
|
1184
|
-
|
|
1185
|
-
void FilterStackCall::PublishAppMetadata(grpc_metadata_batch* b,
|
|
1186
|
-
bool is_trailing) {
|
|
1187
|
-
if (b->count() == 0) return;
|
|
1188
|
-
if (!is_client() && is_trailing) return;
|
|
1189
|
-
if (is_trailing && buffered_metadata_[1] == nullptr) return;
|
|
1190
|
-
grpc_metadata_array* dest;
|
|
1191
|
-
dest = buffered_metadata_[is_trailing];
|
|
1192
|
-
if (dest->count + b->count() > dest->capacity) {
|
|
1193
|
-
dest->capacity =
|
|
1194
|
-
std::max(dest->capacity + b->count(), dest->capacity * 3 / 2);
|
|
1195
|
-
dest->metadata = static_cast<grpc_metadata*>(
|
|
1196
|
-
gpr_realloc(dest->metadata, sizeof(grpc_metadata) * dest->capacity));
|
|
1197
|
-
}
|
|
1198
|
-
PublishToAppEncoder encoder(dest, b, is_client());
|
|
1199
|
-
b->Encode(&encoder);
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
void FilterStackCall::RecvInitialFilter(grpc_metadata_batch* b) {
|
|
1203
|
-
ProcessIncomingInitialMetadata(*b);
|
|
1204
|
-
PublishAppMetadata(b, false);
|
|
1205
|
-
}
|
|
1206
|
-
|
|
1207
|
-
void FilterStackCall::RecvTrailingFilter(grpc_metadata_batch* b,
|
|
1208
|
-
grpc_error_handle batch_error) {
|
|
1209
|
-
if (!batch_error.ok()) {
|
|
1210
|
-
SetFinalStatus(batch_error);
|
|
1211
|
-
} else {
|
|
1212
|
-
absl::optional<grpc_status_code> grpc_status =
|
|
1213
|
-
b->Take(GrpcStatusMetadata());
|
|
1214
|
-
if (grpc_status.has_value()) {
|
|
1215
|
-
grpc_status_code status_code = *grpc_status;
|
|
1216
|
-
grpc_error_handle error;
|
|
1217
|
-
if (status_code != GRPC_STATUS_OK) {
|
|
1218
|
-
Slice peer = GetPeerString();
|
|
1219
|
-
error = grpc_error_set_int(
|
|
1220
|
-
GRPC_ERROR_CREATE(absl::StrCat("Error received from peer ",
|
|
1221
|
-
peer.as_string_view())),
|
|
1222
|
-
StatusIntProperty::kRpcStatus, static_cast<intptr_t>(status_code));
|
|
1223
|
-
}
|
|
1224
|
-
auto grpc_message = b->Take(GrpcMessageMetadata());
|
|
1225
|
-
if (grpc_message.has_value()) {
|
|
1226
|
-
error = grpc_error_set_str(error, StatusStrProperty::kGrpcMessage,
|
|
1227
|
-
grpc_message->as_string_view());
|
|
1228
|
-
} else if (!error.ok()) {
|
|
1229
|
-
error = grpc_error_set_str(error, StatusStrProperty::kGrpcMessage, "");
|
|
1230
|
-
}
|
|
1231
|
-
SetFinalStatus(error);
|
|
1232
|
-
} else if (!is_client()) {
|
|
1233
|
-
SetFinalStatus(absl::OkStatus());
|
|
1234
|
-
} else {
|
|
1235
|
-
gpr_log(GPR_DEBUG,
|
|
1236
|
-
"Received trailing metadata with no error and no status");
|
|
1237
|
-
SetFinalStatus(grpc_error_set_int(GRPC_ERROR_CREATE("No status received"),
|
|
1238
|
-
StatusIntProperty::kRpcStatus,
|
|
1239
|
-
GRPC_STATUS_UNKNOWN));
|
|
1240
|
-
}
|
|
1241
|
-
}
|
|
1242
|
-
PublishAppMetadata(b, true);
|
|
1243
|
-
}
|
|
1244
|
-
|
|
1245
|
-
namespace {
|
|
1246
|
-
bool AreWriteFlagsValid(uint32_t flags) {
|
|
1247
|
-
// check that only bits in GRPC_WRITE_(INTERNAL?)_USED_MASK are set
|
|
1248
|
-
const uint32_t allowed_write_positions =
|
|
1249
|
-
(GRPC_WRITE_USED_MASK | GRPC_WRITE_INTERNAL_USED_MASK);
|
|
1250
|
-
const uint32_t invalid_positions = ~allowed_write_positions;
|
|
1251
|
-
return !(flags & invalid_positions);
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1254
|
-
bool AreInitialMetadataFlagsValid(uint32_t flags) {
|
|
1255
|
-
// check that only bits in GRPC_WRITE_(INTERNAL?)_USED_MASK are set
|
|
1256
|
-
uint32_t invalid_positions = ~GRPC_INITIAL_METADATA_USED_MASK;
|
|
1257
|
-
return !(flags & invalid_positions);
|
|
1258
|
-
}
|
|
1259
|
-
|
|
1260
|
-
size_t BatchSlotForOp(grpc_op_type type) {
|
|
1261
|
-
switch (type) {
|
|
1262
|
-
case GRPC_OP_SEND_INITIAL_METADATA:
|
|
1263
|
-
return 0;
|
|
1264
|
-
case GRPC_OP_SEND_MESSAGE:
|
|
1265
|
-
return 1;
|
|
1266
|
-
case GRPC_OP_SEND_CLOSE_FROM_CLIENT:
|
|
1267
|
-
case GRPC_OP_SEND_STATUS_FROM_SERVER:
|
|
1268
|
-
return 2;
|
|
1269
|
-
case GRPC_OP_RECV_INITIAL_METADATA:
|
|
1270
|
-
return 3;
|
|
1271
|
-
case GRPC_OP_RECV_MESSAGE:
|
|
1272
|
-
return 4;
|
|
1273
|
-
case GRPC_OP_RECV_CLOSE_ON_SERVER:
|
|
1274
|
-
case GRPC_OP_RECV_STATUS_ON_CLIENT:
|
|
1275
|
-
return 5;
|
|
1276
|
-
}
|
|
1277
|
-
GPR_UNREACHABLE_CODE(return 123456789);
|
|
1278
|
-
}
|
|
1279
|
-
} // namespace
|
|
1280
|
-
|
|
1281
|
-
FilterStackCall::BatchControl* FilterStackCall::ReuseOrAllocateBatchControl(
|
|
1282
|
-
const grpc_op* ops) {
|
|
1283
|
-
size_t slot_idx = BatchSlotForOp(ops[0].op);
|
|
1284
|
-
BatchControl** pslot = &active_batches_[slot_idx];
|
|
1285
|
-
BatchControl* bctl;
|
|
1286
|
-
if (*pslot != nullptr) {
|
|
1287
|
-
bctl = *pslot;
|
|
1288
|
-
if (bctl->call_ != nullptr) {
|
|
1289
|
-
return nullptr;
|
|
1290
|
-
}
|
|
1291
|
-
bctl->~BatchControl();
|
|
1292
|
-
bctl->op_ = {};
|
|
1293
|
-
new (&bctl->batch_error_) AtomicError();
|
|
1294
|
-
} else {
|
|
1295
|
-
bctl = arena()->New<BatchControl>();
|
|
1296
|
-
*pslot = bctl;
|
|
1297
|
-
}
|
|
1298
|
-
bctl->call_ = this;
|
|
1299
|
-
bctl->call_tracer_ = static_cast<CallTracerAnnotationInterface*>(
|
|
1300
|
-
ContextGet(GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE));
|
|
1301
|
-
bctl->op_.payload = &stream_op_payload_;
|
|
1302
|
-
return bctl;
|
|
1303
|
-
}
|
|
1304
|
-
|
|
1305
|
-
void FilterStackCall::BatchControl::PostCompletion() {
|
|
1306
|
-
FilterStackCall* call = call_;
|
|
1307
|
-
grpc_error_handle error = batch_error_.get();
|
|
1308
|
-
|
|
1309
|
-
if (IsCallStatusOverrideOnCancellationEnabled()) {
|
|
1310
|
-
// On the client side, if final call status is already known (i.e if this op
|
|
1311
|
-
// includes recv_trailing_metadata) and if the call status is known to be
|
|
1312
|
-
// OK, then disregard the batch error to ensure call->receiving_buffer_ is
|
|
1313
|
-
// not cleared.
|
|
1314
|
-
if (op_.recv_trailing_metadata && call->is_client() &&
|
|
1315
|
-
call->status_error_.ok()) {
|
|
1316
|
-
error = absl::OkStatus();
|
|
1317
|
-
}
|
|
1318
|
-
}
|
|
1319
|
-
|
|
1320
|
-
if (grpc_call_trace.enabled()) {
|
|
1321
|
-
gpr_log(GPR_DEBUG, "tag:%p batch_error=%s op:%s",
|
|
1322
|
-
completion_data_.notify_tag.tag, error.ToString().c_str(),
|
|
1323
|
-
grpc_transport_stream_op_batch_string(&op_, false).c_str());
|
|
1324
|
-
}
|
|
1325
|
-
|
|
1326
|
-
if (op_.send_initial_metadata) {
|
|
1327
|
-
call->send_initial_metadata_.Clear();
|
|
1328
|
-
}
|
|
1329
|
-
if (op_.send_message) {
|
|
1330
|
-
if (op_.payload->send_message.stream_write_closed && error.ok()) {
|
|
1331
|
-
error = grpc_error_add_child(
|
|
1332
|
-
error, GRPC_ERROR_CREATE(
|
|
1333
|
-
"Attempt to send message after stream was closed."));
|
|
1334
|
-
}
|
|
1335
|
-
call->sending_message_ = false;
|
|
1336
|
-
call->send_slice_buffer_.Clear();
|
|
1337
|
-
}
|
|
1338
|
-
if (op_.send_trailing_metadata) {
|
|
1339
|
-
call->send_trailing_metadata_.Clear();
|
|
1340
|
-
}
|
|
1341
|
-
|
|
1342
|
-
if (!error.ok() && op_.recv_message && *call->receiving_buffer_ != nullptr) {
|
|
1343
|
-
grpc_byte_buffer_destroy(*call->receiving_buffer_);
|
|
1344
|
-
*call->receiving_buffer_ = nullptr;
|
|
1345
|
-
}
|
|
1346
|
-
if (op_.recv_trailing_metadata) {
|
|
1347
|
-
// propagate cancellation to any interested children
|
|
1348
|
-
gpr_atm_rel_store(&call->received_final_op_atm_, 1);
|
|
1349
|
-
call->PropagateCancellationToChildren();
|
|
1350
|
-
error = absl::OkStatus();
|
|
1351
|
-
}
|
|
1352
|
-
batch_error_.set(absl::OkStatus());
|
|
1353
|
-
|
|
1354
|
-
if (completion_data_.notify_tag.is_closure) {
|
|
1355
|
-
call_ = nullptr;
|
|
1356
|
-
Closure::Run(DEBUG_LOCATION,
|
|
1357
|
-
static_cast<grpc_closure*>(completion_data_.notify_tag.tag),
|
|
1358
|
-
error);
|
|
1359
|
-
call->InternalUnref("completion");
|
|
1360
|
-
} else {
|
|
1361
|
-
grpc_cq_end_op(
|
|
1362
|
-
call->cq_, completion_data_.notify_tag.tag, error,
|
|
1363
|
-
[](void* user_data, grpc_cq_completion* /*storage*/) {
|
|
1364
|
-
BatchControl* bctl = static_cast<BatchControl*>(user_data);
|
|
1365
|
-
Call* call = bctl->call_;
|
|
1366
|
-
bctl->call_ = nullptr;
|
|
1367
|
-
call->InternalUnref("completion");
|
|
1368
|
-
},
|
|
1369
|
-
this, &completion_data_.cq_completion);
|
|
1370
|
-
}
|
|
1371
|
-
}
|
|
1372
|
-
|
|
1373
|
-
void FilterStackCall::BatchControl::FinishStep(PendingOp op) {
|
|
1374
|
-
if (GPR_UNLIKELY(completed_batch_step(op))) {
|
|
1375
|
-
PostCompletion();
|
|
1376
|
-
}
|
|
1377
|
-
}
|
|
1378
|
-
|
|
1379
|
-
void FilterStackCall::BatchControl::ProcessDataAfterMetadata() {
|
|
1380
|
-
FilterStackCall* call = call_;
|
|
1381
|
-
if (!call->receiving_slice_buffer_.has_value()) {
|
|
1382
|
-
*call->receiving_buffer_ = nullptr;
|
|
1383
|
-
call->receiving_message_ = false;
|
|
1384
|
-
FinishStep(PendingOp::kRecvMessage);
|
|
1385
|
-
} else {
|
|
1386
|
-
call->NoteLastMessageFlags(call->receiving_stream_flags_);
|
|
1387
|
-
if ((call->receiving_stream_flags_ & GRPC_WRITE_INTERNAL_COMPRESS) &&
|
|
1388
|
-
(call->incoming_compression_algorithm() != GRPC_COMPRESS_NONE)) {
|
|
1389
|
-
*call->receiving_buffer_ = grpc_raw_compressed_byte_buffer_create(
|
|
1390
|
-
nullptr, 0, call->incoming_compression_algorithm());
|
|
1391
|
-
} else {
|
|
1392
|
-
*call->receiving_buffer_ = grpc_raw_byte_buffer_create(nullptr, 0);
|
|
1393
|
-
}
|
|
1394
|
-
grpc_slice_buffer_move_into(
|
|
1395
|
-
call->receiving_slice_buffer_->c_slice_buffer(),
|
|
1396
|
-
&(*call->receiving_buffer_)->data.raw.slice_buffer);
|
|
1397
|
-
call->receiving_message_ = false;
|
|
1398
|
-
call->receiving_slice_buffer_.reset();
|
|
1399
|
-
FinishStep(PendingOp::kRecvMessage);
|
|
1400
|
-
}
|
|
1401
|
-
}
|
|
1402
|
-
|
|
1403
|
-
void FilterStackCall::BatchControl::ReceivingStreamReady(
|
|
1404
|
-
grpc_error_handle error) {
|
|
1405
|
-
if (grpc_call_trace.enabled()) {
|
|
1406
|
-
gpr_log(GPR_DEBUG,
|
|
1407
|
-
"tag:%p ReceivingStreamReady error=%s "
|
|
1408
|
-
"receiving_slice_buffer.has_value=%d recv_state=%" PRIdPTR,
|
|
1409
|
-
completion_data_.notify_tag.tag, error.ToString().c_str(),
|
|
1410
|
-
call_->receiving_slice_buffer_.has_value(),
|
|
1411
|
-
gpr_atm_no_barrier_load(&call_->recv_state_));
|
|
1412
|
-
}
|
|
1413
|
-
FilterStackCall* call = call_;
|
|
1414
|
-
if (!error.ok()) {
|
|
1415
|
-
call->receiving_slice_buffer_.reset();
|
|
1416
|
-
if (batch_error_.ok()) {
|
|
1417
|
-
batch_error_.set(error);
|
|
1418
|
-
}
|
|
1419
|
-
call->CancelWithError(error);
|
|
1420
|
-
}
|
|
1421
|
-
// If recv_state is kRecvNone, we will save the batch_control
|
|
1422
|
-
// object with rel_cas, and will not use it after the cas. Its corresponding
|
|
1423
|
-
// acq_load is in receiving_initial_metadata_ready()
|
|
1424
|
-
if (!error.ok() || !call->receiving_slice_buffer_.has_value() ||
|
|
1425
|
-
!gpr_atm_rel_cas(&call->recv_state_, kRecvNone,
|
|
1426
|
-
reinterpret_cast<gpr_atm>(this))) {
|
|
1427
|
-
ProcessDataAfterMetadata();
|
|
1428
|
-
}
|
|
1429
|
-
}
|
|
1430
|
-
|
|
1431
|
-
void FilterStackCall::BatchControl::ReceivingInitialMetadataReady(
|
|
1432
|
-
grpc_error_handle error) {
|
|
1433
|
-
FilterStackCall* call = call_;
|
|
1434
|
-
|
|
1435
|
-
GRPC_CALL_COMBINER_STOP(call->call_combiner(), "recv_initial_metadata_ready");
|
|
1436
|
-
|
|
1437
|
-
if (error.ok()) {
|
|
1438
|
-
grpc_metadata_batch* md = &call->recv_initial_metadata_;
|
|
1439
|
-
call->RecvInitialFilter(md);
|
|
1440
|
-
|
|
1441
|
-
absl::optional<Timestamp> deadline = md->get(GrpcTimeoutMetadata());
|
|
1442
|
-
if (deadline.has_value() && !call->is_client()) {
|
|
1443
|
-
call_->set_send_deadline(*deadline);
|
|
1444
|
-
}
|
|
1445
|
-
} else {
|
|
1446
|
-
if (batch_error_.ok()) {
|
|
1447
|
-
batch_error_.set(error);
|
|
1448
|
-
}
|
|
1449
|
-
call->CancelWithError(error);
|
|
1450
|
-
}
|
|
1451
|
-
|
|
1452
|
-
grpc_closure* saved_rsr_closure = nullptr;
|
|
1453
|
-
while (true) {
|
|
1454
|
-
gpr_atm rsr_bctlp = gpr_atm_acq_load(&call->recv_state_);
|
|
1455
|
-
// Should only receive initial metadata once
|
|
1456
|
-
GPR_ASSERT(rsr_bctlp != 1);
|
|
1457
|
-
if (rsr_bctlp == 0) {
|
|
1458
|
-
// We haven't seen initial metadata and messages before, thus initial
|
|
1459
|
-
// metadata is received first.
|
|
1460
|
-
// no_barrier_cas is used, as this function won't access the batch_control
|
|
1461
|
-
// object saved by receiving_stream_ready() if the initial metadata is
|
|
1462
|
-
// received first.
|
|
1463
|
-
if (gpr_atm_no_barrier_cas(&call->recv_state_, kRecvNone,
|
|
1464
|
-
kRecvInitialMetadataFirst)) {
|
|
1465
|
-
break;
|
|
1466
|
-
}
|
|
1467
|
-
} else {
|
|
1468
|
-
// Already received messages
|
|
1469
|
-
saved_rsr_closure = GRPC_CLOSURE_CREATE(
|
|
1470
|
-
[](void* bctl, grpc_error_handle error) {
|
|
1471
|
-
static_cast<BatchControl*>(bctl)->ReceivingStreamReady(error);
|
|
1472
|
-
},
|
|
1473
|
-
reinterpret_cast<BatchControl*>(rsr_bctlp),
|
|
1474
|
-
grpc_schedule_on_exec_ctx);
|
|
1475
|
-
// No need to modify recv_state
|
|
1476
|
-
break;
|
|
1477
|
-
}
|
|
1478
|
-
}
|
|
1479
|
-
if (saved_rsr_closure != nullptr) {
|
|
1480
|
-
Closure::Run(DEBUG_LOCATION, saved_rsr_closure, error);
|
|
1481
|
-
}
|
|
1482
|
-
|
|
1483
|
-
FinishStep(PendingOp::kRecvInitialMetadata);
|
|
1484
|
-
}
|
|
1485
|
-
|
|
1486
|
-
void FilterStackCall::BatchControl::ReceivingTrailingMetadataReady(
|
|
1487
|
-
grpc_error_handle error) {
|
|
1488
|
-
GRPC_CALL_COMBINER_STOP(call_->call_combiner(),
|
|
1489
|
-
"recv_trailing_metadata_ready");
|
|
1490
|
-
grpc_metadata_batch* md = &call_->recv_trailing_metadata_;
|
|
1491
|
-
call_->RecvTrailingFilter(md, error);
|
|
1492
|
-
FinishStep(PendingOp::kRecvTrailingMetadata);
|
|
1493
|
-
}
|
|
1494
|
-
|
|
1495
|
-
void FilterStackCall::BatchControl::FinishBatch(grpc_error_handle error) {
|
|
1496
|
-
GRPC_CALL_COMBINER_STOP(call_->call_combiner(), "on_complete");
|
|
1497
|
-
if (batch_error_.ok()) {
|
|
1498
|
-
batch_error_.set(error);
|
|
1499
|
-
}
|
|
1500
|
-
if (!error.ok()) {
|
|
1501
|
-
call_->CancelWithError(error);
|
|
1502
|
-
}
|
|
1503
|
-
FinishStep(PendingOp::kSends);
|
|
1504
|
-
}
|
|
1505
|
-
|
|
1506
|
-
namespace {
|
|
1507
|
-
void EndOpImmediately(grpc_completion_queue* cq, void* notify_tag,
|
|
1508
|
-
bool is_notify_tag_closure) {
|
|
1509
|
-
if (!is_notify_tag_closure) {
|
|
1510
|
-
GPR_ASSERT(grpc_cq_begin_op(cq, notify_tag));
|
|
1511
|
-
grpc_cq_end_op(
|
|
1512
|
-
cq, notify_tag, absl::OkStatus(),
|
|
1513
|
-
[](void*, grpc_cq_completion* completion) { gpr_free(completion); },
|
|
1514
|
-
nullptr,
|
|
1515
|
-
static_cast<grpc_cq_completion*>(
|
|
1516
|
-
gpr_malloc(sizeof(grpc_cq_completion))));
|
|
1517
|
-
} else {
|
|
1518
|
-
Closure::Run(DEBUG_LOCATION, static_cast<grpc_closure*>(notify_tag),
|
|
1519
|
-
absl::OkStatus());
|
|
1520
|
-
}
|
|
1521
|
-
}
|
|
1522
|
-
} // namespace
|
|
1523
|
-
|
|
1524
|
-
grpc_call_error FilterStackCall::StartBatch(const grpc_op* ops, size_t nops,
|
|
1525
|
-
void* notify_tag,
|
|
1526
|
-
bool is_notify_tag_closure) {
|
|
1527
|
-
size_t i;
|
|
1528
|
-
const grpc_op* op;
|
|
1529
|
-
BatchControl* bctl;
|
|
1530
|
-
grpc_call_error error = GRPC_CALL_OK;
|
|
1531
|
-
grpc_transport_stream_op_batch* stream_op;
|
|
1532
|
-
grpc_transport_stream_op_batch_payload* stream_op_payload;
|
|
1533
|
-
uint32_t seen_ops = 0;
|
|
1534
|
-
intptr_t pending_ops = 0;
|
|
1535
|
-
|
|
1536
|
-
for (i = 0; i < nops; i++) {
|
|
1537
|
-
if (seen_ops & (1u << ops[i].op)) {
|
|
1538
|
-
return GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
|
1539
|
-
}
|
|
1540
|
-
seen_ops |= (1u << ops[i].op);
|
|
1541
|
-
}
|
|
1542
|
-
|
|
1543
|
-
if (!is_client() &&
|
|
1544
|
-
(seen_ops & (1u << GRPC_OP_SEND_STATUS_FROM_SERVER)) != 0 &&
|
|
1545
|
-
(seen_ops & (1u << GRPC_OP_RECV_MESSAGE)) != 0) {
|
|
1546
|
-
gpr_log(GPR_ERROR,
|
|
1547
|
-
"******************* SEND_STATUS WITH RECV_MESSAGE "
|
|
1548
|
-
"*******************");
|
|
1549
|
-
return GRPC_CALL_ERROR;
|
|
1550
|
-
}
|
|
1551
|
-
|
|
1552
|
-
GRPC_CALL_LOG_BATCH(GPR_INFO, ops, nops);
|
|
1553
|
-
|
|
1554
|
-
if (nops == 0) {
|
|
1555
|
-
EndOpImmediately(cq_, notify_tag, is_notify_tag_closure);
|
|
1556
|
-
error = GRPC_CALL_OK;
|
|
1557
|
-
goto done;
|
|
1558
|
-
}
|
|
1559
|
-
|
|
1560
|
-
bctl = ReuseOrAllocateBatchControl(ops);
|
|
1561
|
-
if (bctl == nullptr) {
|
|
1562
|
-
return GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
|
1563
|
-
}
|
|
1564
|
-
bctl->completion_data_.notify_tag.tag = notify_tag;
|
|
1565
|
-
bctl->completion_data_.notify_tag.is_closure =
|
|
1566
|
-
static_cast<uint8_t>(is_notify_tag_closure != 0);
|
|
1567
|
-
|
|
1568
|
-
stream_op = &bctl->op_;
|
|
1569
|
-
stream_op_payload = &stream_op_payload_;
|
|
1570
|
-
|
|
1571
|
-
// rewrite batch ops into a transport op
|
|
1572
|
-
for (i = 0; i < nops; i++) {
|
|
1573
|
-
op = &ops[i];
|
|
1574
|
-
if (op->reserved != nullptr) {
|
|
1575
|
-
error = GRPC_CALL_ERROR;
|
|
1576
|
-
goto done_with_error;
|
|
1577
|
-
}
|
|
1578
|
-
switch (op->op) {
|
|
1579
|
-
case GRPC_OP_SEND_INITIAL_METADATA: {
|
|
1580
|
-
// Flag validation: currently allow no flags
|
|
1581
|
-
if (!AreInitialMetadataFlagsValid(op->flags)) {
|
|
1582
|
-
error = GRPC_CALL_ERROR_INVALID_FLAGS;
|
|
1583
|
-
goto done_with_error;
|
|
1584
|
-
}
|
|
1585
|
-
if (sent_initial_metadata_) {
|
|
1586
|
-
error = GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
|
1587
|
-
goto done_with_error;
|
|
1588
|
-
}
|
|
1589
|
-
if (op->data.send_initial_metadata.count > INT_MAX) {
|
|
1590
|
-
error = GRPC_CALL_ERROR_INVALID_METADATA;
|
|
1591
|
-
goto done_with_error;
|
|
1592
|
-
}
|
|
1593
|
-
stream_op->send_initial_metadata = true;
|
|
1594
|
-
sent_initial_metadata_ = true;
|
|
1595
|
-
if (!PrepareApplicationMetadata(op->data.send_initial_metadata.count,
|
|
1596
|
-
op->data.send_initial_metadata.metadata,
|
|
1597
|
-
false)) {
|
|
1598
|
-
error = GRPC_CALL_ERROR_INVALID_METADATA;
|
|
1599
|
-
goto done_with_error;
|
|
1600
|
-
}
|
|
1601
|
-
PrepareOutgoingInitialMetadata(*op, send_initial_metadata_);
|
|
1602
|
-
// TODO(ctiller): just make these the same variable?
|
|
1603
|
-
if (is_client() && send_deadline() != Timestamp::InfFuture()) {
|
|
1604
|
-
send_initial_metadata_.Set(GrpcTimeoutMetadata(), send_deadline());
|
|
1605
|
-
}
|
|
1606
|
-
if (is_client()) {
|
|
1607
|
-
send_initial_metadata_.Set(
|
|
1608
|
-
WaitForReady(),
|
|
1609
|
-
WaitForReady::ValueType{
|
|
1610
|
-
(op->flags & GRPC_INITIAL_METADATA_WAIT_FOR_READY) != 0,
|
|
1611
|
-
(op->flags &
|
|
1612
|
-
GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET) != 0});
|
|
1613
|
-
}
|
|
1614
|
-
stream_op_payload->send_initial_metadata.send_initial_metadata =
|
|
1615
|
-
&send_initial_metadata_;
|
|
1616
|
-
pending_ops |= PendingOpMask(PendingOp::kSends);
|
|
1617
|
-
break;
|
|
1618
|
-
}
|
|
1619
|
-
case GRPC_OP_SEND_MESSAGE: {
|
|
1620
|
-
if (!AreWriteFlagsValid(op->flags)) {
|
|
1621
|
-
error = GRPC_CALL_ERROR_INVALID_FLAGS;
|
|
1622
|
-
goto done_with_error;
|
|
1623
|
-
}
|
|
1624
|
-
if (op->data.send_message.send_message == nullptr) {
|
|
1625
|
-
error = GRPC_CALL_ERROR_INVALID_MESSAGE;
|
|
1626
|
-
goto done_with_error;
|
|
1627
|
-
}
|
|
1628
|
-
if (sending_message_) {
|
|
1629
|
-
error = GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
|
1630
|
-
goto done_with_error;
|
|
1631
|
-
}
|
|
1632
|
-
uint32_t flags = op->flags;
|
|
1633
|
-
// If the outgoing buffer is already compressed, mark it as so in the
|
|
1634
|
-
// flags. These will be picked up by the compression filter and further
|
|
1635
|
-
// (wasteful) attempts at compression skipped.
|
|
1636
|
-
if (op->data.send_message.send_message->data.raw.compression >
|
|
1637
|
-
GRPC_COMPRESS_NONE) {
|
|
1638
|
-
flags |= GRPC_WRITE_INTERNAL_COMPRESS;
|
|
1639
|
-
}
|
|
1640
|
-
stream_op->send_message = true;
|
|
1641
|
-
sending_message_ = true;
|
|
1642
|
-
send_slice_buffer_.Clear();
|
|
1643
|
-
grpc_slice_buffer_move_into(
|
|
1644
|
-
&op->data.send_message.send_message->data.raw.slice_buffer,
|
|
1645
|
-
send_slice_buffer_.c_slice_buffer());
|
|
1646
|
-
stream_op_payload->send_message.flags = flags;
|
|
1647
|
-
stream_op_payload->send_message.send_message = &send_slice_buffer_;
|
|
1648
|
-
pending_ops |= PendingOpMask(PendingOp::kSends);
|
|
1649
|
-
break;
|
|
1650
|
-
}
|
|
1651
|
-
case GRPC_OP_SEND_CLOSE_FROM_CLIENT: {
|
|
1652
|
-
// Flag validation: currently allow no flags
|
|
1653
|
-
if (op->flags != 0) {
|
|
1654
|
-
error = GRPC_CALL_ERROR_INVALID_FLAGS;
|
|
1655
|
-
goto done_with_error;
|
|
1656
|
-
}
|
|
1657
|
-
if (!is_client()) {
|
|
1658
|
-
error = GRPC_CALL_ERROR_NOT_ON_SERVER;
|
|
1659
|
-
goto done_with_error;
|
|
1660
|
-
}
|
|
1661
|
-
if (sent_final_op_) {
|
|
1662
|
-
error = GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
|
1663
|
-
goto done_with_error;
|
|
1664
|
-
}
|
|
1665
|
-
stream_op->send_trailing_metadata = true;
|
|
1666
|
-
sent_final_op_ = true;
|
|
1667
|
-
stream_op_payload->send_trailing_metadata.send_trailing_metadata =
|
|
1668
|
-
&send_trailing_metadata_;
|
|
1669
|
-
pending_ops |= PendingOpMask(PendingOp::kSends);
|
|
1670
|
-
break;
|
|
1671
|
-
}
|
|
1672
|
-
case GRPC_OP_SEND_STATUS_FROM_SERVER: {
|
|
1673
|
-
// Flag validation: currently allow no flags
|
|
1674
|
-
if (op->flags != 0) {
|
|
1675
|
-
error = GRPC_CALL_ERROR_INVALID_FLAGS;
|
|
1676
|
-
goto done_with_error;
|
|
1677
|
-
}
|
|
1678
|
-
if (is_client()) {
|
|
1679
|
-
error = GRPC_CALL_ERROR_NOT_ON_CLIENT;
|
|
1680
|
-
goto done_with_error;
|
|
1681
|
-
}
|
|
1682
|
-
if (sent_final_op_) {
|
|
1683
|
-
error = GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
|
1684
|
-
goto done_with_error;
|
|
1685
|
-
}
|
|
1686
|
-
if (op->data.send_status_from_server.trailing_metadata_count >
|
|
1687
|
-
INT_MAX) {
|
|
1688
|
-
error = GRPC_CALL_ERROR_INVALID_METADATA;
|
|
1689
|
-
goto done_with_error;
|
|
1690
|
-
}
|
|
1691
|
-
stream_op->send_trailing_metadata = true;
|
|
1692
|
-
sent_final_op_ = true;
|
|
1693
|
-
|
|
1694
|
-
if (!PrepareApplicationMetadata(
|
|
1695
|
-
op->data.send_status_from_server.trailing_metadata_count,
|
|
1696
|
-
op->data.send_status_from_server.trailing_metadata, true)) {
|
|
1697
|
-
error = GRPC_CALL_ERROR_INVALID_METADATA;
|
|
1698
|
-
goto done_with_error;
|
|
1699
|
-
}
|
|
1700
|
-
|
|
1701
|
-
grpc_error_handle status_error =
|
|
1702
|
-
op->data.send_status_from_server.status == GRPC_STATUS_OK
|
|
1703
|
-
? absl::OkStatus()
|
|
1704
|
-
: grpc_error_set_int(
|
|
1705
|
-
GRPC_ERROR_CREATE("Server returned error"),
|
|
1706
|
-
StatusIntProperty::kRpcStatus,
|
|
1707
|
-
static_cast<intptr_t>(
|
|
1708
|
-
op->data.send_status_from_server.status));
|
|
1709
|
-
if (op->data.send_status_from_server.status_details != nullptr) {
|
|
1710
|
-
send_trailing_metadata_.Set(
|
|
1711
|
-
GrpcMessageMetadata(),
|
|
1712
|
-
Slice(grpc_slice_copy(
|
|
1713
|
-
*op->data.send_status_from_server.status_details)));
|
|
1714
|
-
if (!status_error.ok()) {
|
|
1715
|
-
status_error = grpc_error_set_str(
|
|
1716
|
-
status_error, StatusStrProperty::kGrpcMessage,
|
|
1717
|
-
StringViewFromSlice(
|
|
1718
|
-
*op->data.send_status_from_server.status_details));
|
|
1719
|
-
}
|
|
1720
|
-
}
|
|
1721
|
-
|
|
1722
|
-
status_error_.set(status_error);
|
|
1723
|
-
|
|
1724
|
-
send_trailing_metadata_.Set(GrpcStatusMetadata(),
|
|
1725
|
-
op->data.send_status_from_server.status);
|
|
1726
|
-
|
|
1727
|
-
// Ignore any te metadata key value pairs specified.
|
|
1728
|
-
send_trailing_metadata_.Remove(TeMetadata());
|
|
1729
|
-
stream_op_payload->send_trailing_metadata.send_trailing_metadata =
|
|
1730
|
-
&send_trailing_metadata_;
|
|
1731
|
-
stream_op_payload->send_trailing_metadata.sent =
|
|
1732
|
-
&sent_server_trailing_metadata_;
|
|
1733
|
-
pending_ops |= PendingOpMask(PendingOp::kSends);
|
|
1734
|
-
break;
|
|
1735
|
-
}
|
|
1736
|
-
case GRPC_OP_RECV_INITIAL_METADATA: {
|
|
1737
|
-
// Flag validation: currently allow no flags
|
|
1738
|
-
if (op->flags != 0) {
|
|
1739
|
-
error = GRPC_CALL_ERROR_INVALID_FLAGS;
|
|
1740
|
-
goto done_with_error;
|
|
1741
|
-
}
|
|
1742
|
-
if (received_initial_metadata_) {
|
|
1743
|
-
error = GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
|
1744
|
-
goto done_with_error;
|
|
1745
|
-
}
|
|
1746
|
-
received_initial_metadata_ = true;
|
|
1747
|
-
buffered_metadata_[0] =
|
|
1748
|
-
op->data.recv_initial_metadata.recv_initial_metadata;
|
|
1749
|
-
GRPC_CLOSURE_INIT(
|
|
1750
|
-
&receiving_initial_metadata_ready_,
|
|
1751
|
-
[](void* bctl, grpc_error_handle error) {
|
|
1752
|
-
static_cast<BatchControl*>(bctl)->ReceivingInitialMetadataReady(
|
|
1753
|
-
error);
|
|
1754
|
-
},
|
|
1755
|
-
bctl, grpc_schedule_on_exec_ctx);
|
|
1756
|
-
stream_op->recv_initial_metadata = true;
|
|
1757
|
-
stream_op_payload->recv_initial_metadata.recv_initial_metadata =
|
|
1758
|
-
&recv_initial_metadata_;
|
|
1759
|
-
stream_op_payload->recv_initial_metadata.recv_initial_metadata_ready =
|
|
1760
|
-
&receiving_initial_metadata_ready_;
|
|
1761
|
-
if (is_client()) {
|
|
1762
|
-
stream_op_payload->recv_initial_metadata.trailing_metadata_available =
|
|
1763
|
-
&is_trailers_only_;
|
|
1764
|
-
}
|
|
1765
|
-
pending_ops |= PendingOpMask(PendingOp::kRecvInitialMetadata);
|
|
1766
|
-
break;
|
|
1767
|
-
}
|
|
1768
|
-
case GRPC_OP_RECV_MESSAGE: {
|
|
1769
|
-
// Flag validation: currently allow no flags
|
|
1770
|
-
if (op->flags != 0) {
|
|
1771
|
-
error = GRPC_CALL_ERROR_INVALID_FLAGS;
|
|
1772
|
-
goto done_with_error;
|
|
1773
|
-
}
|
|
1774
|
-
if (receiving_message_) {
|
|
1775
|
-
error = GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
|
1776
|
-
goto done_with_error;
|
|
1777
|
-
}
|
|
1778
|
-
receiving_message_ = true;
|
|
1779
|
-
stream_op->recv_message = true;
|
|
1780
|
-
receiving_slice_buffer_.reset();
|
|
1781
|
-
receiving_buffer_ = op->data.recv_message.recv_message;
|
|
1782
|
-
stream_op_payload->recv_message.recv_message = &receiving_slice_buffer_;
|
|
1783
|
-
receiving_stream_flags_ = 0;
|
|
1784
|
-
stream_op_payload->recv_message.flags = &receiving_stream_flags_;
|
|
1785
|
-
stream_op_payload->recv_message.call_failed_before_recv_message =
|
|
1786
|
-
&call_failed_before_recv_message_;
|
|
1787
|
-
GRPC_CLOSURE_INIT(
|
|
1788
|
-
&receiving_stream_ready_,
|
|
1789
|
-
[](void* bctlp, grpc_error_handle error) {
|
|
1790
|
-
auto* bctl = static_cast<BatchControl*>(bctlp);
|
|
1791
|
-
auto* call = bctl->call_;
|
|
1792
|
-
// Yields the call combiner before processing the received
|
|
1793
|
-
// message.
|
|
1794
|
-
GRPC_CALL_COMBINER_STOP(call->call_combiner(),
|
|
1795
|
-
"recv_message_ready");
|
|
1796
|
-
bctl->ReceivingStreamReady(error);
|
|
1797
|
-
},
|
|
1798
|
-
bctl, grpc_schedule_on_exec_ctx);
|
|
1799
|
-
stream_op_payload->recv_message.recv_message_ready =
|
|
1800
|
-
&receiving_stream_ready_;
|
|
1801
|
-
pending_ops |= PendingOpMask(PendingOp::kRecvMessage);
|
|
1802
|
-
break;
|
|
1803
|
-
}
|
|
1804
|
-
case GRPC_OP_RECV_STATUS_ON_CLIENT: {
|
|
1805
|
-
// Flag validation: currently allow no flags
|
|
1806
|
-
if (op->flags != 0) {
|
|
1807
|
-
error = GRPC_CALL_ERROR_INVALID_FLAGS;
|
|
1808
|
-
goto done_with_error;
|
|
1809
|
-
}
|
|
1810
|
-
if (!is_client()) {
|
|
1811
|
-
error = GRPC_CALL_ERROR_NOT_ON_SERVER;
|
|
1812
|
-
goto done_with_error;
|
|
1813
|
-
}
|
|
1814
|
-
if (requested_final_op_) {
|
|
1815
|
-
error = GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
|
1816
|
-
goto done_with_error;
|
|
1817
|
-
}
|
|
1818
|
-
requested_final_op_ = true;
|
|
1819
|
-
buffered_metadata_[1] =
|
|
1820
|
-
op->data.recv_status_on_client.trailing_metadata;
|
|
1821
|
-
final_op_.client.status = op->data.recv_status_on_client.status;
|
|
1822
|
-
final_op_.client.status_details =
|
|
1823
|
-
op->data.recv_status_on_client.status_details;
|
|
1824
|
-
final_op_.client.error_string =
|
|
1825
|
-
op->data.recv_status_on_client.error_string;
|
|
1826
|
-
stream_op->recv_trailing_metadata = true;
|
|
1827
|
-
stream_op_payload->recv_trailing_metadata.recv_trailing_metadata =
|
|
1828
|
-
&recv_trailing_metadata_;
|
|
1829
|
-
stream_op_payload->recv_trailing_metadata.collect_stats =
|
|
1830
|
-
&final_info_.stats.transport_stream_stats;
|
|
1831
|
-
GRPC_CLOSURE_INIT(
|
|
1832
|
-
&receiving_trailing_metadata_ready_,
|
|
1833
|
-
[](void* bctl, grpc_error_handle error) {
|
|
1834
|
-
static_cast<BatchControl*>(bctl)->ReceivingTrailingMetadataReady(
|
|
1835
|
-
error);
|
|
1836
|
-
},
|
|
1837
|
-
bctl, grpc_schedule_on_exec_ctx);
|
|
1838
|
-
stream_op_payload->recv_trailing_metadata.recv_trailing_metadata_ready =
|
|
1839
|
-
&receiving_trailing_metadata_ready_;
|
|
1840
|
-
pending_ops |= PendingOpMask(PendingOp::kRecvTrailingMetadata);
|
|
1841
|
-
break;
|
|
1842
|
-
}
|
|
1843
|
-
case GRPC_OP_RECV_CLOSE_ON_SERVER: {
|
|
1844
|
-
// Flag validation: currently allow no flags
|
|
1845
|
-
if (op->flags != 0) {
|
|
1846
|
-
error = GRPC_CALL_ERROR_INVALID_FLAGS;
|
|
1847
|
-
goto done_with_error;
|
|
1848
|
-
}
|
|
1849
|
-
if (is_client()) {
|
|
1850
|
-
error = GRPC_CALL_ERROR_NOT_ON_CLIENT;
|
|
1851
|
-
goto done_with_error;
|
|
1852
|
-
}
|
|
1853
|
-
if (requested_final_op_) {
|
|
1854
|
-
error = GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
|
1855
|
-
goto done_with_error;
|
|
1856
|
-
}
|
|
1857
|
-
requested_final_op_ = true;
|
|
1858
|
-
final_op_.server.cancelled = op->data.recv_close_on_server.cancelled;
|
|
1859
|
-
stream_op->recv_trailing_metadata = true;
|
|
1860
|
-
stream_op_payload->recv_trailing_metadata.recv_trailing_metadata =
|
|
1861
|
-
&recv_trailing_metadata_;
|
|
1862
|
-
stream_op_payload->recv_trailing_metadata.collect_stats =
|
|
1863
|
-
&final_info_.stats.transport_stream_stats;
|
|
1864
|
-
GRPC_CLOSURE_INIT(
|
|
1865
|
-
&receiving_trailing_metadata_ready_,
|
|
1866
|
-
[](void* bctl, grpc_error_handle error) {
|
|
1867
|
-
static_cast<BatchControl*>(bctl)->ReceivingTrailingMetadataReady(
|
|
1868
|
-
error);
|
|
1869
|
-
},
|
|
1870
|
-
bctl, grpc_schedule_on_exec_ctx);
|
|
1871
|
-
stream_op_payload->recv_trailing_metadata.recv_trailing_metadata_ready =
|
|
1872
|
-
&receiving_trailing_metadata_ready_;
|
|
1873
|
-
pending_ops |= PendingOpMask(PendingOp::kRecvTrailingMetadata);
|
|
1874
|
-
break;
|
|
1875
|
-
}
|
|
1876
|
-
}
|
|
1877
|
-
}
|
|
1878
|
-
|
|
1879
|
-
InternalRef("completion");
|
|
1880
|
-
if (!is_notify_tag_closure) {
|
|
1881
|
-
GPR_ASSERT(grpc_cq_begin_op(cq_, notify_tag));
|
|
1882
|
-
}
|
|
1883
|
-
bctl->set_pending_ops(pending_ops);
|
|
1884
|
-
|
|
1885
|
-
if (pending_ops & PendingOpMask(PendingOp::kSends)) {
|
|
1886
|
-
GRPC_CLOSURE_INIT(
|
|
1887
|
-
&bctl->finish_batch_,
|
|
1888
|
-
[](void* bctl, grpc_error_handle error) {
|
|
1889
|
-
static_cast<BatchControl*>(bctl)->FinishBatch(error);
|
|
1890
|
-
},
|
|
1891
|
-
bctl, grpc_schedule_on_exec_ctx);
|
|
1892
|
-
stream_op->on_complete = &bctl->finish_batch_;
|
|
1893
|
-
}
|
|
1894
|
-
|
|
1895
|
-
if (grpc_call_trace.enabled()) {
|
|
1896
|
-
gpr_log(GPR_DEBUG, "BATCH:%p START:%s BATCH:%s (tag:%p)", bctl,
|
|
1897
|
-
PendingOpString(pending_ops).c_str(),
|
|
1898
|
-
grpc_transport_stream_op_batch_string(stream_op, false).c_str(),
|
|
1899
|
-
bctl->completion_data_.notify_tag.tag);
|
|
1900
|
-
}
|
|
1901
|
-
ExecuteBatch(stream_op, &bctl->start_batch_);
|
|
1902
|
-
|
|
1903
|
-
done:
|
|
1904
|
-
return error;
|
|
1905
|
-
|
|
1906
|
-
done_with_error:
|
|
1907
|
-
// reverse any mutations that occurred
|
|
1908
|
-
if (stream_op->send_initial_metadata) {
|
|
1909
|
-
sent_initial_metadata_ = false;
|
|
1910
|
-
send_initial_metadata_.Clear();
|
|
1911
|
-
}
|
|
1912
|
-
if (stream_op->send_message) {
|
|
1913
|
-
sending_message_ = false;
|
|
1914
|
-
}
|
|
1915
|
-
if (stream_op->send_trailing_metadata) {
|
|
1916
|
-
sent_final_op_ = false;
|
|
1917
|
-
send_trailing_metadata_.Clear();
|
|
1918
|
-
}
|
|
1919
|
-
if (stream_op->recv_initial_metadata) {
|
|
1920
|
-
received_initial_metadata_ = false;
|
|
1921
|
-
}
|
|
1922
|
-
if (stream_op->recv_message) {
|
|
1923
|
-
receiving_message_ = false;
|
|
1924
|
-
}
|
|
1925
|
-
if (stream_op->recv_trailing_metadata) {
|
|
1926
|
-
requested_final_op_ = false;
|
|
1927
|
-
}
|
|
1928
|
-
goto done;
|
|
1929
|
-
}
|
|
1930
|
-
|
|
1931
|
-
void FilterStackCall::ContextSet(grpc_context_index elem, void* value,
|
|
1932
|
-
void (*destroy)(void*)) {
|
|
1933
|
-
if (context_[elem].destroy) {
|
|
1934
|
-
context_[elem].destroy(context_[elem].value);
|
|
1935
|
-
}
|
|
1936
|
-
context_[elem].value = value;
|
|
1937
|
-
context_[elem].destroy = destroy;
|
|
1938
|
-
}
|
|
1939
|
-
|
|
1940
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
1941
|
-
// Metadata validation helpers
|
|
1942
|
-
|
|
1943
|
-
namespace {
|
|
1944
|
-
bool ValidateMetadata(size_t count, grpc_metadata* metadata) {
|
|
1945
|
-
if (count > INT_MAX) {
|
|
1946
|
-
return false;
|
|
1947
|
-
}
|
|
1948
|
-
for (size_t i = 0; i < count; i++) {
|
|
1949
|
-
grpc_metadata* md = &metadata[i];
|
|
1950
|
-
if (!GRPC_LOG_IF_ERROR("validate_metadata",
|
|
1951
|
-
grpc_validate_header_key_is_legal(md->key))) {
|
|
1952
|
-
return false;
|
|
1953
|
-
} else if (!grpc_is_binary_header_internal(md->key) &&
|
|
1954
|
-
!GRPC_LOG_IF_ERROR(
|
|
1955
|
-
"validate_metadata",
|
|
1956
|
-
grpc_validate_header_nonbin_value_is_legal(md->value))) {
|
|
1957
|
-
return false;
|
|
1958
|
-
} else if (GRPC_SLICE_LENGTH(md->value) >= UINT32_MAX) {
|
|
1959
|
-
// HTTP2 hpack encoding has a maximum limit.
|
|
1960
|
-
return false;
|
|
1961
|
-
}
|
|
1962
|
-
}
|
|
1963
|
-
return true;
|
|
1964
|
-
}
|
|
1965
|
-
} // namespace
|
|
1966
|
-
|
|
1967
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
1968
|
-
// PromiseBasedCall
|
|
1969
|
-
// Will be folded into Call once the promise conversion is done
|
|
1970
|
-
|
|
1971
|
-
class BasicPromiseBasedCall : public Call,
|
|
1972
|
-
public Party,
|
|
1973
|
-
public grpc_event_engine::experimental::
|
|
1974
|
-
EventEngine::Closure /* for deadlines */ {
|
|
1975
|
-
public:
|
|
1976
|
-
using Call::arena;
|
|
1977
|
-
|
|
1978
|
-
BasicPromiseBasedCall(Arena* arena, uint32_t initial_external_refs,
|
|
1979
|
-
uint32_t initial_internal_refs,
|
|
1980
|
-
const grpc_call_create_args& args)
|
|
1981
|
-
: Call(arena, args.server_transport_data == nullptr, args.send_deadline,
|
|
1982
|
-
args.channel->Ref()),
|
|
1983
|
-
Party(initial_internal_refs),
|
|
1984
|
-
external_refs_(initial_external_refs),
|
|
1985
|
-
cq_(args.cq) {
|
|
1986
|
-
if (args.cq != nullptr) {
|
|
1987
|
-
GRPC_CQ_INTERNAL_REF(args.cq, "bind");
|
|
1988
|
-
}
|
|
1989
|
-
}
|
|
1990
|
-
|
|
1991
|
-
~BasicPromiseBasedCall() override {
|
|
1992
|
-
if (cq_) GRPC_CQ_INTERNAL_UNREF(cq_, "bind");
|
|
1993
|
-
for (int i = 0; i < GRPC_CONTEXT_COUNT; i++) {
|
|
1994
|
-
if (context_[i].destroy) {
|
|
1995
|
-
context_[i].destroy(context_[i].value);
|
|
1996
|
-
}
|
|
1997
|
-
}
|
|
1998
|
-
}
|
|
1999
|
-
|
|
2000
|
-
// Implementation of EventEngine::Closure, called when deadline expires
|
|
2001
|
-
void Run() final;
|
|
2002
|
-
|
|
2003
|
-
virtual void OrphanCall() = 0;
|
|
2004
|
-
|
|
2005
|
-
virtual ServerCallContext* server_call_context() { return nullptr; }
|
|
2006
|
-
void SetCompletionQueue(grpc_completion_queue* cq) final {
|
|
2007
|
-
cq_ = cq;
|
|
2008
|
-
GRPC_CQ_INTERNAL_REF(cq, "bind");
|
|
2009
|
-
}
|
|
2010
|
-
|
|
2011
|
-
// Implementation of call refcounting: move this to DualRefCounted once we
|
|
2012
|
-
// don't need to maintain FilterStackCall compatibility
|
|
2013
|
-
void ExternalRef() final {
|
|
2014
|
-
if (external_refs_.fetch_add(1, std::memory_order_relaxed) == 0) {
|
|
2015
|
-
InternalRef("external");
|
|
2016
|
-
}
|
|
2017
|
-
}
|
|
2018
|
-
void ExternalUnref() final {
|
|
2019
|
-
if (external_refs_.fetch_sub(1, std::memory_order_acq_rel) == 1) {
|
|
2020
|
-
OrphanCall();
|
|
2021
|
-
InternalUnref("external");
|
|
2022
|
-
}
|
|
2023
|
-
}
|
|
2024
|
-
void InternalRef(const char* reason) final {
|
|
2025
|
-
if (grpc_call_refcount_trace.enabled()) {
|
|
2026
|
-
gpr_log(GPR_DEBUG, "INTERNAL_REF:%p:%s", this, reason);
|
|
2027
|
-
}
|
|
2028
|
-
Party::IncrementRefCount();
|
|
2029
|
-
}
|
|
2030
|
-
void InternalUnref(const char* reason) final {
|
|
2031
|
-
if (grpc_call_refcount_trace.enabled()) {
|
|
2032
|
-
gpr_log(GPR_DEBUG, "INTERNAL_UNREF:%p:%s", this, reason);
|
|
2033
|
-
}
|
|
2034
|
-
Party::Unref();
|
|
2035
|
-
}
|
|
2036
|
-
|
|
2037
|
-
void RunInContext(absl::AnyInvocable<void()> fn) {
|
|
2038
|
-
Spawn(
|
|
2039
|
-
"run_in_context",
|
|
2040
|
-
[fn = std::move(fn)]() mutable {
|
|
2041
|
-
fn();
|
|
2042
|
-
return Empty{};
|
|
2043
|
-
},
|
|
2044
|
-
[](Empty) {});
|
|
2045
|
-
}
|
|
2046
|
-
|
|
2047
|
-
void ContextSet(grpc_context_index elem, void* value,
|
|
2048
|
-
void (*destroy)(void*)) final {
|
|
2049
|
-
if (context_[elem].destroy != nullptr) {
|
|
2050
|
-
context_[elem].destroy(context_[elem].value);
|
|
2051
|
-
}
|
|
2052
|
-
context_[elem].value = value;
|
|
2053
|
-
context_[elem].destroy = destroy;
|
|
2054
|
-
}
|
|
2055
|
-
|
|
2056
|
-
void* ContextGet(grpc_context_index elem) const final {
|
|
2057
|
-
return context_[elem].value;
|
|
2058
|
-
}
|
|
2059
|
-
|
|
2060
|
-
void UpdateDeadline(Timestamp deadline) ABSL_LOCKS_EXCLUDED(deadline_mu_);
|
|
2061
|
-
void ResetDeadline() ABSL_LOCKS_EXCLUDED(deadline_mu_);
|
|
2062
|
-
Timestamp deadline() {
|
|
2063
|
-
MutexLock lock(&deadline_mu_);
|
|
2064
|
-
return deadline_;
|
|
2065
|
-
}
|
|
2066
|
-
|
|
2067
|
-
// Accept the stats from the context (call once we have proof the transport is
|
|
2068
|
-
// done with them).
|
|
2069
|
-
void AcceptTransportStatsFromContext() {
|
|
2070
|
-
final_stats_ = *call_context_.call_stats();
|
|
2071
|
-
}
|
|
2072
|
-
|
|
2073
|
-
// This should return nullptr for the promise stack (and alternative means
|
|
2074
|
-
// for that functionality be invented)
|
|
2075
|
-
grpc_call_stack* call_stack() final { return nullptr; }
|
|
2076
|
-
|
|
2077
|
-
virtual RefCountedPtr<CallSpineInterface> MakeCallSpine(CallArgs) {
|
|
2078
|
-
Crash("Not implemented");
|
|
2079
|
-
}
|
|
2080
|
-
|
|
2081
|
-
protected:
|
|
2082
|
-
class ScopedContext
|
|
2083
|
-
: public ScopedActivity,
|
|
2084
|
-
public promise_detail::Context<Arena>,
|
|
2085
|
-
public promise_detail::Context<grpc_call_context_element>,
|
|
2086
|
-
public promise_detail::Context<CallContext>,
|
|
2087
|
-
public promise_detail::Context<CallFinalization> {
|
|
2088
|
-
public:
|
|
2089
|
-
explicit ScopedContext(BasicPromiseBasedCall* call)
|
|
2090
|
-
: ScopedActivity(call),
|
|
2091
|
-
promise_detail::Context<Arena>(call->arena()),
|
|
2092
|
-
promise_detail::Context<grpc_call_context_element>(call->context_),
|
|
2093
|
-
promise_detail::Context<CallContext>(&call->call_context_),
|
|
2094
|
-
promise_detail::Context<CallFinalization>(&call->finalization_) {}
|
|
2095
|
-
};
|
|
2096
|
-
|
|
2097
|
-
grpc_call_context_element* context() { return context_; }
|
|
2098
|
-
|
|
2099
|
-
grpc_completion_queue* cq() { return cq_; }
|
|
2100
|
-
|
|
2101
|
-
// At the end of the call run any finalization actions.
|
|
2102
|
-
void SetFinalizationStatus(grpc_status_code status, Slice status_details) {
|
|
2103
|
-
final_message_ = std::move(status_details);
|
|
2104
|
-
final_status_ = status;
|
|
2105
|
-
}
|
|
2106
|
-
|
|
2107
|
-
grpc_event_engine::experimental::EventEngine* event_engine() const override {
|
|
2108
|
-
return channel()->event_engine();
|
|
2109
|
-
}
|
|
2110
|
-
|
|
2111
|
-
private:
|
|
2112
|
-
void PartyOver() final {
|
|
2113
|
-
{
|
|
2114
|
-
ScopedContext ctx(this);
|
|
2115
|
-
std::string message;
|
|
2116
|
-
grpc_call_final_info final_info;
|
|
2117
|
-
final_info.stats = final_stats_;
|
|
2118
|
-
final_info.final_status = final_status_;
|
|
2119
|
-
// TODO(ctiller): change type here so we don't need to copy this string.
|
|
2120
|
-
final_info.error_string = nullptr;
|
|
2121
|
-
if (!final_message_.empty()) {
|
|
2122
|
-
message = std::string(final_message_.begin(), final_message_.end());
|
|
2123
|
-
final_info.error_string = message.c_str();
|
|
2124
|
-
}
|
|
2125
|
-
final_info.stats.latency =
|
|
2126
|
-
gpr_cycle_counter_sub(gpr_get_cycle_counter(), start_time());
|
|
2127
|
-
finalization_.Run(&final_info);
|
|
2128
|
-
CancelRemainingParticipants();
|
|
2129
|
-
arena()->DestroyManagedNewObjects();
|
|
2130
|
-
}
|
|
2131
|
-
DeleteThis();
|
|
2132
|
-
}
|
|
2133
|
-
|
|
2134
|
-
// Double refcounted for now: party owns the internal refcount, we track the
|
|
2135
|
-
// external refcount. Figure out a better scheme post-promise conversion.
|
|
2136
|
-
std::atomic<size_t> external_refs_;
|
|
2137
|
-
CallFinalization finalization_;
|
|
2138
|
-
CallContext call_context_{this};
|
|
2139
|
-
// Contexts for various subsystems (security, tracing, ...).
|
|
2140
|
-
grpc_call_context_element context_[GRPC_CONTEXT_COUNT] = {};
|
|
2141
|
-
grpc_call_stats final_stats_{};
|
|
2142
|
-
// Current deadline.
|
|
2143
|
-
Mutex deadline_mu_;
|
|
2144
|
-
Timestamp deadline_ ABSL_GUARDED_BY(deadline_mu_) = Timestamp::InfFuture();
|
|
2145
|
-
grpc_event_engine::experimental::EventEngine::TaskHandle ABSL_GUARDED_BY(
|
|
2146
|
-
deadline_mu_) deadline_task_;
|
|
2147
|
-
Slice final_message_;
|
|
2148
|
-
grpc_status_code final_status_ = GRPC_STATUS_UNKNOWN;
|
|
2149
|
-
grpc_completion_queue* cq_;
|
|
2150
|
-
};
|
|
2151
|
-
|
|
2152
|
-
void BasicPromiseBasedCall::UpdateDeadline(Timestamp deadline) {
|
|
2153
|
-
MutexLock lock(&deadline_mu_);
|
|
2154
|
-
if (grpc_call_trace.enabled()) {
|
|
2155
|
-
gpr_log(GPR_DEBUG, "%s[call] UpdateDeadline from=%s to=%s",
|
|
2156
|
-
DebugTag().c_str(), deadline_.ToString().c_str(),
|
|
2157
|
-
deadline.ToString().c_str());
|
|
2158
|
-
}
|
|
2159
|
-
if (deadline >= deadline_) return;
|
|
2160
|
-
auto* const event_engine = channel()->event_engine();
|
|
2161
|
-
if (deadline_ != Timestamp::InfFuture()) {
|
|
2162
|
-
if (!event_engine->Cancel(deadline_task_)) return;
|
|
2163
|
-
} else {
|
|
2164
|
-
InternalRef("deadline");
|
|
2165
|
-
}
|
|
2166
|
-
deadline_ = deadline;
|
|
2167
|
-
deadline_task_ = event_engine->RunAfter(deadline - Timestamp::Now(), this);
|
|
2168
|
-
}
|
|
2169
|
-
|
|
2170
|
-
void BasicPromiseBasedCall::ResetDeadline() {
|
|
2171
|
-
{
|
|
2172
|
-
MutexLock lock(&deadline_mu_);
|
|
2173
|
-
if (deadline_ == Timestamp::InfFuture()) return;
|
|
2174
|
-
auto* const event_engine = channel()->event_engine();
|
|
2175
|
-
if (!event_engine->Cancel(deadline_task_)) return;
|
|
2176
|
-
deadline_ = Timestamp::InfFuture();
|
|
2177
|
-
}
|
|
2178
|
-
InternalUnref("deadline[reset]");
|
|
2179
|
-
}
|
|
2180
|
-
|
|
2181
|
-
void BasicPromiseBasedCall::Run() {
|
|
2182
|
-
ApplicationCallbackExecCtx callback_exec_ctx;
|
|
2183
|
-
ExecCtx exec_ctx;
|
|
2184
|
-
CancelWithError(absl::DeadlineExceededError("Deadline exceeded"));
|
|
2185
|
-
InternalUnref("deadline[run]");
|
|
2186
|
-
}
|
|
2187
|
-
|
|
2188
|
-
class PromiseBasedCall : public BasicPromiseBasedCall {
|
|
2189
|
-
public:
|
|
2190
|
-
PromiseBasedCall(Arena* arena, uint32_t initial_external_refs,
|
|
2191
|
-
const grpc_call_create_args& args);
|
|
2192
|
-
|
|
2193
|
-
bool Completed() final { return finished_.IsSet(); }
|
|
2194
|
-
|
|
2195
|
-
bool failed_before_recv_message() const final {
|
|
2196
|
-
return failed_before_recv_message_.load(std::memory_order_relaxed);
|
|
2197
|
-
}
|
|
2198
|
-
|
|
2199
|
-
using Call::arena;
|
|
2200
|
-
|
|
2201
|
-
protected:
|
|
2202
|
-
class ScopedContext : public BasicPromiseBasedCall::ScopedContext,
|
|
2203
|
-
public BatchBuilder,
|
|
2204
|
-
public promise_detail::Context<BatchBuilder> {
|
|
2205
|
-
public:
|
|
2206
|
-
explicit ScopedContext(PromiseBasedCall* call)
|
|
2207
|
-
: BasicPromiseBasedCall::ScopedContext(call),
|
|
2208
|
-
BatchBuilder(&call->batch_payload_),
|
|
2209
|
-
promise_detail::Context<BatchBuilder>(this) {}
|
|
2210
|
-
};
|
|
2211
|
-
|
|
2212
|
-
class Completion {
|
|
2213
|
-
public:
|
|
2214
|
-
Completion() : index_(kNullIndex) {}
|
|
2215
|
-
~Completion() { GPR_ASSERT(index_ == kNullIndex); }
|
|
2216
|
-
explicit Completion(uint8_t index) : index_(index) {}
|
|
2217
|
-
Completion(const Completion& other) = delete;
|
|
2218
|
-
Completion& operator=(const Completion& other) = delete;
|
|
2219
|
-
Completion(Completion&& other) noexcept : index_(other.index_) {
|
|
2220
|
-
other.index_ = kNullIndex;
|
|
2221
|
-
}
|
|
2222
|
-
Completion& operator=(Completion&& other) noexcept {
|
|
2223
|
-
GPR_ASSERT(index_ == kNullIndex);
|
|
2224
|
-
index_ = other.index_;
|
|
2225
|
-
other.index_ = kNullIndex;
|
|
2226
|
-
return *this;
|
|
2227
|
-
}
|
|
2228
|
-
|
|
2229
|
-
uint8_t index() const { return index_; }
|
|
2230
|
-
uint8_t TakeIndex() { return std::exchange(index_, kNullIndex); }
|
|
2231
|
-
bool has_value() const { return index_ != kNullIndex; }
|
|
2232
|
-
|
|
2233
|
-
private:
|
|
2234
|
-
enum : uint8_t { kNullIndex = 0xff };
|
|
2235
|
-
uint8_t index_;
|
|
2236
|
-
};
|
|
2237
|
-
|
|
2238
|
-
// Enumerates why a Completion is still pending
|
|
2239
|
-
enum class PendingOp {
|
|
2240
|
-
// We're in the midst of starting a batch of operations
|
|
2241
|
-
kStartingBatch = 0,
|
|
2242
|
-
// The following correspond with the batch operations from above
|
|
2243
|
-
kSendInitialMetadata,
|
|
2244
|
-
kReceiveInitialMetadata,
|
|
2245
|
-
kReceiveStatusOnClient,
|
|
2246
|
-
kReceiveCloseOnServer = kReceiveStatusOnClient,
|
|
2247
|
-
kSendMessage,
|
|
2248
|
-
kReceiveMessage,
|
|
2249
|
-
kSendStatusFromServer,
|
|
2250
|
-
kSendCloseFromClient = kSendStatusFromServer,
|
|
2251
|
-
};
|
|
2252
|
-
|
|
2253
|
-
bool RunParty() override {
|
|
2254
|
-
ScopedContext ctx(this);
|
|
2255
|
-
return Party::RunParty();
|
|
2256
|
-
}
|
|
2257
|
-
|
|
2258
|
-
const char* PendingOpString(PendingOp reason) const {
|
|
2259
|
-
switch (reason) {
|
|
2260
|
-
case PendingOp::kStartingBatch:
|
|
2261
|
-
return "StartingBatch";
|
|
2262
|
-
case PendingOp::kSendInitialMetadata:
|
|
2263
|
-
return "SendInitialMetadata";
|
|
2264
|
-
case PendingOp::kReceiveInitialMetadata:
|
|
2265
|
-
return "ReceiveInitialMetadata";
|
|
2266
|
-
case PendingOp::kReceiveStatusOnClient:
|
|
2267
|
-
return is_client() ? "ReceiveStatusOnClient" : "ReceiveCloseOnServer";
|
|
2268
|
-
case PendingOp::kSendMessage:
|
|
2269
|
-
return "SendMessage";
|
|
2270
|
-
case PendingOp::kReceiveMessage:
|
|
2271
|
-
return "ReceiveMessage";
|
|
2272
|
-
case PendingOp::kSendStatusFromServer:
|
|
2273
|
-
return is_client() ? "SendCloseFromClient" : "SendStatusFromServer";
|
|
2274
|
-
}
|
|
2275
|
-
return "Unknown";
|
|
2276
|
-
}
|
|
2277
|
-
|
|
2278
|
-
static constexpr uint32_t PendingOpBit(PendingOp reason) {
|
|
2279
|
-
return 1 << static_cast<int>(reason);
|
|
2280
|
-
}
|
|
2281
|
-
|
|
2282
|
-
// Begin work on a completion, recording the tag/closure to notify.
|
|
2283
|
-
// Use the op selected in \a ops to determine the index to allocate into.
|
|
2284
|
-
// Starts the "StartingBatch" PendingOp immediately.
|
|
2285
|
-
// Assumes at least one operation in \a ops.
|
|
2286
|
-
Completion StartCompletion(void* tag, bool is_closure, const grpc_op* ops);
|
|
2287
|
-
// Add one pending op to the completion, and return it.
|
|
2288
|
-
Completion AddOpToCompletion(const Completion& completion, PendingOp reason);
|
|
2289
|
-
// Stringify a completion
|
|
2290
|
-
std::string CompletionString(const Completion& completion) const {
|
|
2291
|
-
return completion.has_value()
|
|
2292
|
-
? completion_info_[completion.index()].pending.ToString(this)
|
|
2293
|
-
: "no-completion";
|
|
2294
|
-
}
|
|
2295
|
-
// Finish one op on the completion. Must have been previously been added.
|
|
2296
|
-
// The completion as a whole finishes when all pending ops finish.
|
|
2297
|
-
void FinishOpOnCompletion(Completion* completion, PendingOp reason);
|
|
2298
|
-
// Mark the completion as failed. Does not finish it.
|
|
2299
|
-
void FailCompletion(const Completion& completion,
|
|
2300
|
-
SourceLocation source_location = {});
|
|
2301
|
-
// Mark the completion as infallible. Overrides FailCompletion to report
|
|
2302
|
-
// success always.
|
|
2303
|
-
void ForceCompletionSuccess(const Completion& completion);
|
|
2304
|
-
|
|
2305
|
-
std::string PresentAndCompletionText(const char* caption, bool has,
|
|
2306
|
-
const Completion& completion) const {
|
|
2307
|
-
if (has) {
|
|
2308
|
-
if (completion.has_value()) {
|
|
2309
|
-
return absl::StrCat(caption, ":", CompletionString(completion), " ");
|
|
2310
|
-
} else {
|
|
2311
|
-
return absl::StrCat(caption,
|
|
2312
|
-
":!!BUG:operation is present, no completion!! ");
|
|
2313
|
-
}
|
|
2314
|
-
} else {
|
|
2315
|
-
if (!completion.has_value()) {
|
|
2316
|
-
return "";
|
|
2317
|
-
} else {
|
|
2318
|
-
return absl::StrCat(caption, ":no-op:", CompletionString(completion),
|
|
2319
|
-
" ");
|
|
2320
|
-
}
|
|
2321
|
-
}
|
|
2322
|
-
}
|
|
2323
|
-
|
|
2324
|
-
// Spawn a job that will first do FirstPromise then receive a message
|
|
2325
|
-
template <typename FirstPromise>
|
|
2326
|
-
void StartRecvMessage(const grpc_op& op, const Completion& completion,
|
|
2327
|
-
FirstPromise first,
|
|
2328
|
-
PipeReceiver<MessageHandle>* receiver,
|
|
2329
|
-
bool cancel_on_error, Party::BulkSpawner& spawner);
|
|
2330
|
-
void StartSendMessage(const grpc_op& op, const Completion& completion,
|
|
2331
|
-
PipeSender<MessageHandle>* sender,
|
|
2332
|
-
Party::BulkSpawner& spawner);
|
|
2333
|
-
|
|
2334
|
-
void set_completed() { finished_.Set(); }
|
|
2335
|
-
|
|
2336
|
-
// Returns a promise that resolves to Empty whenever the call is completed.
|
|
2337
|
-
auto finished() { return finished_.Wait(); }
|
|
2338
|
-
|
|
2339
|
-
// Returns a promise that resolves to Empty whenever there is no outstanding
|
|
2340
|
-
// send operation
|
|
2341
|
-
auto WaitForSendingStarted() {
|
|
2342
|
-
return [this]() -> Poll<Empty> {
|
|
2343
|
-
int n = sends_queued_.load(std::memory_order_relaxed);
|
|
2344
|
-
if (grpc_call_trace.enabled()) {
|
|
2345
|
-
gpr_log(GPR_DEBUG, "%s[call] WaitForSendingStarted n=%d",
|
|
2346
|
-
DebugTag().c_str(), n);
|
|
2347
|
-
}
|
|
2348
|
-
if (n != 0) return waiting_for_queued_sends_.pending();
|
|
2349
|
-
return Empty{};
|
|
2350
|
-
};
|
|
2351
|
-
}
|
|
2352
|
-
|
|
2353
|
-
// Mark that a send has been queued - blocks sending trailing metadata.
|
|
2354
|
-
void QueueSend() {
|
|
2355
|
-
if (grpc_call_trace.enabled()) {
|
|
2356
|
-
gpr_log(GPR_DEBUG, "%s[call] QueueSend", DebugTag().c_str());
|
|
2357
|
-
}
|
|
2358
|
-
sends_queued_.fetch_add(1, std::memory_order_relaxed);
|
|
2359
|
-
}
|
|
2360
|
-
// Mark that a send has been dequeued - allows sending trailing metadata once
|
|
2361
|
-
// zero sends are queued.
|
|
2362
|
-
void EnactSend() {
|
|
2363
|
-
if (grpc_call_trace.enabled()) {
|
|
2364
|
-
gpr_log(GPR_DEBUG, "%s[call] EnactSend", DebugTag().c_str());
|
|
2365
|
-
}
|
|
2366
|
-
if (1 == sends_queued_.fetch_sub(1, std::memory_order_relaxed)) {
|
|
2367
|
-
waiting_for_queued_sends_.Wake();
|
|
2368
|
-
}
|
|
2369
|
-
}
|
|
2370
|
-
|
|
2371
|
-
void set_failed_before_recv_message() {
|
|
2372
|
-
failed_before_recv_message_.store(true, std::memory_order_relaxed);
|
|
2373
|
-
}
|
|
2374
|
-
|
|
2375
|
-
private:
|
|
2376
|
-
union CompletionInfo {
|
|
2377
|
-
static constexpr uint32_t kOpFailed = 0x8000'0000u;
|
|
2378
|
-
static constexpr uint32_t kOpForceSuccess = 0x4000'0000u;
|
|
2379
|
-
CompletionInfo() {}
|
|
2380
|
-
enum CompletionState {
|
|
2381
|
-
kPending,
|
|
2382
|
-
kSuccess,
|
|
2383
|
-
kFailure,
|
|
2384
|
-
};
|
|
2385
|
-
struct Pending {
|
|
2386
|
-
// Bitmask of PendingOps at the bottom, and kOpFailed, kOpForceSuccess at
|
|
2387
|
-
// the top.
|
|
2388
|
-
std::atomic<uint32_t> state;
|
|
2389
|
-
bool is_closure;
|
|
2390
|
-
// True if this completion was for a recv_message op.
|
|
2391
|
-
// In that case if the completion as a whole fails we need to cleanup the
|
|
2392
|
-
// returned message.
|
|
2393
|
-
bool is_recv_message;
|
|
2394
|
-
void* tag;
|
|
2395
|
-
|
|
2396
|
-
void Start(bool is_closure, void* tag) {
|
|
2397
|
-
this->is_closure = is_closure;
|
|
2398
|
-
this->is_recv_message = false;
|
|
2399
|
-
this->tag = tag;
|
|
2400
|
-
state.store(PendingOpBit(PendingOp::kStartingBatch),
|
|
2401
|
-
std::memory_order_release);
|
|
2402
|
-
}
|
|
2403
|
-
|
|
2404
|
-
void AddPendingBit(PendingOp reason) {
|
|
2405
|
-
if (reason == PendingOp::kReceiveMessage) is_recv_message = true;
|
|
2406
|
-
auto prev =
|
|
2407
|
-
state.fetch_or(PendingOpBit(reason), std::memory_order_relaxed);
|
|
2408
|
-
GPR_ASSERT((prev & PendingOpBit(reason)) == 0);
|
|
2409
|
-
}
|
|
2410
|
-
|
|
2411
|
-
CompletionState RemovePendingBit(PendingOp reason) {
|
|
2412
|
-
const uint32_t mask = ~PendingOpBit(reason);
|
|
2413
|
-
auto prev = state.fetch_and(mask, std::memory_order_acq_rel);
|
|
2414
|
-
GPR_ASSERT((prev & PendingOpBit(reason)) != 0);
|
|
2415
|
-
switch (prev & mask) {
|
|
2416
|
-
case kOpFailed:
|
|
2417
|
-
return kFailure;
|
|
2418
|
-
case kOpFailed | kOpForceSuccess:
|
|
2419
|
-
case kOpForceSuccess:
|
|
2420
|
-
case 0:
|
|
2421
|
-
return kSuccess;
|
|
2422
|
-
default:
|
|
2423
|
-
return kPending;
|
|
2424
|
-
}
|
|
2425
|
-
}
|
|
2426
|
-
|
|
2427
|
-
void MarkFailed() {
|
|
2428
|
-
state.fetch_or(kOpFailed, std::memory_order_relaxed);
|
|
2429
|
-
}
|
|
2430
|
-
|
|
2431
|
-
void MarkForceSuccess() {
|
|
2432
|
-
state.fetch_or(kOpForceSuccess, std::memory_order_relaxed);
|
|
2433
|
-
}
|
|
2434
|
-
|
|
2435
|
-
std::string ToString(const PromiseBasedCall* call) const {
|
|
2436
|
-
auto state = this->state.load(std::memory_order_relaxed);
|
|
2437
|
-
std::vector<absl::string_view> pending_ops;
|
|
2438
|
-
for (size_t i = 0; i < 24; i++) {
|
|
2439
|
-
if (state & (1u << i)) {
|
|
2440
|
-
pending_ops.push_back(
|
|
2441
|
-
call->PendingOpString(static_cast<PendingOp>(i)));
|
|
2442
|
-
}
|
|
2443
|
-
}
|
|
2444
|
-
return absl::StrFormat("{%s}%s:tag=%p", absl::StrJoin(pending_ops, ","),
|
|
2445
|
-
(state & kOpForceSuccess) ? ":force-success"
|
|
2446
|
-
: (state & kOpFailed) ? ":failed"
|
|
2447
|
-
: ":success",
|
|
2448
|
-
tag);
|
|
2449
|
-
}
|
|
2450
|
-
} pending;
|
|
2451
|
-
grpc_cq_completion completion;
|
|
2452
|
-
};
|
|
2453
|
-
|
|
2454
|
-
CompletionInfo completion_info_[6];
|
|
2455
|
-
ExternallyObservableLatch<void> finished_;
|
|
2456
|
-
// Non-zero with an outstanding GRPC_OP_SEND_INITIAL_METADATA or
|
|
2457
|
-
// GRPC_OP_SEND_MESSAGE (one count each), and 0 once those payloads have been
|
|
2458
|
-
// pushed onto the outgoing pipe.
|
|
2459
|
-
std::atomic<uint8_t> sends_queued_{0};
|
|
2460
|
-
std::atomic<bool> failed_before_recv_message_{false};
|
|
2461
|
-
// Waiter for when sends_queued_ becomes 0.
|
|
2462
|
-
IntraActivityWaiter waiting_for_queued_sends_;
|
|
2463
|
-
grpc_byte_buffer** recv_message_ = nullptr;
|
|
2464
|
-
grpc_transport_stream_op_batch_payload batch_payload_{context()};
|
|
2465
|
-
};
|
|
2466
|
-
|
|
2467
|
-
template <typename T>
|
|
2468
|
-
grpc_error_handle MakePromiseBasedCall(grpc_call_create_args* args,
|
|
2469
|
-
grpc_call** out_call) {
|
|
2470
|
-
Channel* channel = args->channel.get();
|
|
2471
|
-
|
|
2472
|
-
auto* arena = channel->CreateArena();
|
|
2473
|
-
PromiseBasedCall* call = arena->New<T>(arena, args);
|
|
2474
|
-
*out_call = call->c_ptr();
|
|
2475
|
-
GPR_DEBUG_ASSERT(Call::FromC(*out_call) == call);
|
|
2476
|
-
return absl::OkStatus();
|
|
2477
|
-
}
|
|
2478
|
-
|
|
2479
|
-
PromiseBasedCall::PromiseBasedCall(Arena* arena, uint32_t initial_external_refs,
|
|
2480
|
-
const grpc_call_create_args& args)
|
|
2481
|
-
: BasicPromiseBasedCall(arena, initial_external_refs,
|
|
2482
|
-
initial_external_refs != 0 ? 1 : 0, args) {}
|
|
2483
|
-
|
|
2484
|
-
static void CToMetadata(grpc_metadata* metadata, size_t count,
|
|
2485
|
-
grpc_metadata_batch* b) {
|
|
2486
|
-
for (size_t i = 0; i < count; i++) {
|
|
2487
|
-
grpc_metadata* md = &metadata[i];
|
|
2488
|
-
auto key = StringViewFromSlice(md->key);
|
|
2489
|
-
// Filter "content-length metadata"
|
|
2490
|
-
if (key == "content-length") continue;
|
|
2491
|
-
b->Append(key, Slice(CSliceRef(md->value)),
|
|
2492
|
-
[md](absl::string_view error, const Slice& value) {
|
|
2493
|
-
gpr_log(GPR_DEBUG, "Append error: %s",
|
|
2494
|
-
absl::StrCat("key=", StringViewFromSlice(md->key),
|
|
2495
|
-
" error=", error,
|
|
2496
|
-
" value=", value.as_string_view())
|
|
2497
|
-
.c_str());
|
|
2498
|
-
});
|
|
2499
|
-
}
|
|
2500
|
-
}
|
|
2501
|
-
|
|
2502
|
-
PromiseBasedCall::Completion PromiseBasedCall::StartCompletion(
|
|
2503
|
-
void* tag, bool is_closure, const grpc_op* ops) {
|
|
2504
|
-
Completion c(BatchSlotForOp(ops[0].op));
|
|
2505
|
-
if (!is_closure) {
|
|
2506
|
-
grpc_cq_begin_op(cq(), tag);
|
|
2507
|
-
}
|
|
2508
|
-
completion_info_[c.index()].pending.Start(is_closure, tag);
|
|
2509
|
-
if (grpc_call_trace.enabled()) {
|
|
2510
|
-
gpr_log(GPR_INFO, "%s[call] StartCompletion %s", DebugTag().c_str(),
|
|
2511
|
-
CompletionString(c).c_str());
|
|
2512
|
-
}
|
|
2513
|
-
return c;
|
|
2514
|
-
}
|
|
2515
|
-
|
|
2516
|
-
PromiseBasedCall::Completion PromiseBasedCall::AddOpToCompletion(
|
|
2517
|
-
const Completion& completion, PendingOp reason) {
|
|
2518
|
-
if (grpc_call_trace.enabled()) {
|
|
2519
|
-
gpr_log(GPR_INFO, "%s[call] AddOpToCompletion %s %s", DebugTag().c_str(),
|
|
2520
|
-
CompletionString(completion).c_str(), PendingOpString(reason));
|
|
2521
|
-
}
|
|
2522
|
-
GPR_ASSERT(completion.has_value());
|
|
2523
|
-
completion_info_[completion.index()].pending.AddPendingBit(reason);
|
|
2524
|
-
return Completion(completion.index());
|
|
2525
|
-
}
|
|
2526
|
-
|
|
2527
|
-
void PromiseBasedCall::FailCompletion(const Completion& completion,
|
|
2528
|
-
SourceLocation location) {
|
|
2529
|
-
if (grpc_call_trace.enabled()) {
|
|
2530
|
-
gpr_log(location.file(), location.line(), GPR_LOG_SEVERITY_ERROR,
|
|
2531
|
-
"%s[call] FailCompletion %s", DebugTag().c_str(),
|
|
2532
|
-
CompletionString(completion).c_str());
|
|
2533
|
-
}
|
|
2534
|
-
completion_info_[completion.index()].pending.MarkFailed();
|
|
2535
|
-
}
|
|
2536
|
-
|
|
2537
|
-
void PromiseBasedCall::ForceCompletionSuccess(const Completion& completion) {
|
|
2538
|
-
completion_info_[completion.index()].pending.MarkForceSuccess();
|
|
2539
|
-
}
|
|
2540
|
-
|
|
2541
|
-
void PromiseBasedCall::FinishOpOnCompletion(Completion* completion,
|
|
2542
|
-
PendingOp reason) {
|
|
2543
|
-
if (grpc_call_trace.enabled()) {
|
|
2544
|
-
gpr_log(GPR_INFO, "%s[call] FinishOpOnCompletion completion:%s finish:%s",
|
|
2545
|
-
DebugTag().c_str(), CompletionString(*completion).c_str(),
|
|
2546
|
-
PendingOpString(reason));
|
|
2547
|
-
}
|
|
2548
|
-
const uint8_t i = completion->TakeIndex();
|
|
2549
|
-
GPR_ASSERT(i < GPR_ARRAY_SIZE(completion_info_));
|
|
2550
|
-
CompletionInfo::Pending& pending = completion_info_[i].pending;
|
|
2551
|
-
bool success;
|
|
2552
|
-
switch (pending.RemovePendingBit(reason)) {
|
|
2553
|
-
case CompletionInfo::kPending:
|
|
2554
|
-
return; // Early out
|
|
2555
|
-
case CompletionInfo::kSuccess:
|
|
2556
|
-
success = true;
|
|
2557
|
-
break;
|
|
2558
|
-
case CompletionInfo::kFailure:
|
|
2559
|
-
success = false;
|
|
2560
|
-
break;
|
|
2561
|
-
}
|
|
2562
|
-
if (pending.is_recv_message && !success && *recv_message_ != nullptr) {
|
|
2563
|
-
grpc_byte_buffer_destroy(*recv_message_);
|
|
2564
|
-
*recv_message_ = nullptr;
|
|
2565
|
-
}
|
|
2566
|
-
auto error = success ? absl::OkStatus() : absl::CancelledError();
|
|
2567
|
-
if (pending.is_closure) {
|
|
2568
|
-
ExecCtx::Run(DEBUG_LOCATION, static_cast<grpc_closure*>(pending.tag),
|
|
2569
|
-
error);
|
|
2570
|
-
} else {
|
|
2571
|
-
InternalRef("cq_end_op");
|
|
2572
|
-
grpc_cq_end_op(
|
|
2573
|
-
cq(), pending.tag, error,
|
|
2574
|
-
[](void* p, grpc_cq_completion*) {
|
|
2575
|
-
static_cast<PromiseBasedCall*>(p)->InternalUnref("cq_end_op");
|
|
2576
|
-
},
|
|
2577
|
-
this, &completion_info_[i].completion);
|
|
2578
|
-
}
|
|
2579
|
-
}
|
|
2580
|
-
|
|
2581
|
-
void PromiseBasedCall::StartSendMessage(const grpc_op& op,
|
|
2582
|
-
const Completion& completion,
|
|
2583
|
-
PipeSender<MessageHandle>* sender,
|
|
2584
|
-
Party::BulkSpawner& spawner) {
|
|
2585
|
-
QueueSend();
|
|
2586
|
-
SliceBuffer send;
|
|
2587
|
-
grpc_slice_buffer_swap(
|
|
2588
|
-
&op.data.send_message.send_message->data.raw.slice_buffer,
|
|
2589
|
-
send.c_slice_buffer());
|
|
2590
|
-
auto msg = arena()->MakePooled<Message>(std::move(send), op.flags);
|
|
2591
|
-
spawner.Spawn(
|
|
2592
|
-
"call_send_message",
|
|
2593
|
-
[this, sender, msg = std::move(msg)]() mutable {
|
|
2594
|
-
EnactSend();
|
|
2595
|
-
return sender->Push(std::move(msg));
|
|
2596
|
-
},
|
|
2597
|
-
[this, completion = AddOpToCompletion(
|
|
2598
|
-
completion, PendingOp::kSendMessage)](bool result) mutable {
|
|
2599
|
-
if (grpc_call_trace.enabled()) {
|
|
2600
|
-
gpr_log(GPR_DEBUG, "%sSendMessage completes %s", DebugTag().c_str(),
|
|
2601
|
-
result ? "successfully" : "with failure");
|
|
2602
|
-
}
|
|
2603
|
-
if (!result) FailCompletion(completion);
|
|
2604
|
-
FinishOpOnCompletion(&completion, PendingOp::kSendMessage);
|
|
2605
|
-
});
|
|
2606
|
-
}
|
|
2607
|
-
|
|
2608
|
-
template <typename FirstPromiseFactory>
|
|
2609
|
-
void PromiseBasedCall::StartRecvMessage(
|
|
2610
|
-
const grpc_op& op, const Completion& completion,
|
|
2611
|
-
FirstPromiseFactory first_promise_factory,
|
|
2612
|
-
PipeReceiver<MessageHandle>* receiver, bool cancel_on_error,
|
|
2613
|
-
Party::BulkSpawner& spawner) {
|
|
2614
|
-
if (grpc_call_trace.enabled()) {
|
|
2615
|
-
gpr_log(GPR_INFO, "%s[call] Start RecvMessage: %s", DebugTag().c_str(),
|
|
2616
|
-
CompletionString(completion).c_str());
|
|
2617
|
-
}
|
|
2618
|
-
recv_message_ = op.data.recv_message.recv_message;
|
|
2619
|
-
spawner.Spawn(
|
|
2620
|
-
"call_recv_message",
|
|
2621
|
-
[first_promise_factory = std::move(first_promise_factory), receiver]() {
|
|
2622
|
-
return Seq(first_promise_factory(), receiver->Next());
|
|
2623
|
-
},
|
|
2624
|
-
[this, cancel_on_error,
|
|
2625
|
-
completion = AddOpToCompletion(completion, PendingOp::kReceiveMessage)](
|
|
2626
|
-
NextResult<MessageHandle> result) mutable {
|
|
2627
|
-
if (result.has_value()) {
|
|
2628
|
-
MessageHandle& message = *result;
|
|
2629
|
-
NoteLastMessageFlags(message->flags());
|
|
2630
|
-
if ((message->flags() & GRPC_WRITE_INTERNAL_COMPRESS) &&
|
|
2631
|
-
(incoming_compression_algorithm() != GRPC_COMPRESS_NONE)) {
|
|
2632
|
-
*recv_message_ = grpc_raw_compressed_byte_buffer_create(
|
|
2633
|
-
nullptr, 0, incoming_compression_algorithm());
|
|
2634
|
-
} else {
|
|
2635
|
-
*recv_message_ = grpc_raw_byte_buffer_create(nullptr, 0);
|
|
2636
|
-
}
|
|
2637
|
-
grpc_slice_buffer_move_into(message->payload()->c_slice_buffer(),
|
|
2638
|
-
&(*recv_message_)->data.raw.slice_buffer);
|
|
2639
|
-
if (grpc_call_trace.enabled()) {
|
|
2640
|
-
gpr_log(GPR_INFO,
|
|
2641
|
-
"%s[call] RecvMessage: outstanding_recv "
|
|
2642
|
-
"finishes: received %" PRIdPTR " byte message",
|
|
2643
|
-
DebugTag().c_str(),
|
|
2644
|
-
(*recv_message_)->data.raw.slice_buffer.length);
|
|
2645
|
-
}
|
|
2646
|
-
} else if (result.cancelled()) {
|
|
2647
|
-
if (grpc_call_trace.enabled()) {
|
|
2648
|
-
gpr_log(GPR_INFO,
|
|
2649
|
-
"%s[call] RecvMessage: outstanding_recv "
|
|
2650
|
-
"finishes: received end-of-stream with error",
|
|
2651
|
-
DebugTag().c_str());
|
|
2652
|
-
}
|
|
2653
|
-
set_failed_before_recv_message();
|
|
2654
|
-
FailCompletion(completion);
|
|
2655
|
-
if (cancel_on_error) CancelWithError(absl::CancelledError());
|
|
2656
|
-
*recv_message_ = nullptr;
|
|
2657
|
-
} else {
|
|
2658
|
-
if (grpc_call_trace.enabled()) {
|
|
2659
|
-
gpr_log(GPR_INFO,
|
|
2660
|
-
"%s[call] RecvMessage: outstanding_recv "
|
|
2661
|
-
"finishes: received end-of-stream",
|
|
2662
|
-
DebugTag().c_str());
|
|
2663
|
-
}
|
|
2664
|
-
*recv_message_ = nullptr;
|
|
2665
|
-
}
|
|
2666
|
-
FinishOpOnCompletion(&completion, PendingOp::kReceiveMessage);
|
|
2667
|
-
});
|
|
2668
|
-
}
|
|
2669
|
-
|
|
2670
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
2671
|
-
// CallContext
|
|
2672
|
-
|
|
2673
|
-
void CallContext::RunInContext(absl::AnyInvocable<void()> fn) {
|
|
2674
|
-
call_->RunInContext(std::move(fn));
|
|
2675
|
-
}
|
|
2676
|
-
|
|
2677
|
-
void CallContext::IncrementRefCount(const char* reason) {
|
|
2678
|
-
call_->InternalRef(reason);
|
|
2679
|
-
}
|
|
2680
|
-
|
|
2681
|
-
void CallContext::Unref(const char* reason) { call_->InternalUnref(reason); }
|
|
2682
|
-
|
|
2683
|
-
void CallContext::UpdateDeadline(Timestamp deadline) {
|
|
2684
|
-
call_->UpdateDeadline(deadline);
|
|
2685
|
-
}
|
|
2686
|
-
|
|
2687
|
-
Timestamp CallContext::deadline() const { return call_->deadline(); }
|
|
2688
|
-
|
|
2689
|
-
ServerCallContext* CallContext::server_call_context() {
|
|
2690
|
-
return call_->server_call_context();
|
|
2691
|
-
}
|
|
2692
|
-
|
|
2693
|
-
RefCountedPtr<CallSpineInterface> CallContext::MakeCallSpine(
|
|
2694
|
-
CallArgs call_args) {
|
|
2695
|
-
return call_->MakeCallSpine(std::move(call_args));
|
|
2696
|
-
}
|
|
2697
|
-
|
|
2698
|
-
grpc_call* CallContext::c_call() { return call_->c_ptr(); }
|
|
2699
|
-
|
|
2700
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
2701
|
-
// PublishMetadataArray
|
|
2702
|
-
|
|
2703
|
-
namespace {
|
|
2704
|
-
void PublishMetadataArray(grpc_metadata_batch* md, grpc_metadata_array* array,
|
|
2705
|
-
bool is_client) {
|
|
2706
|
-
const auto md_count = md->count();
|
|
2707
|
-
if (md_count > array->capacity) {
|
|
2708
|
-
array->capacity =
|
|
2709
|
-
std::max(array->capacity + md->count(), array->capacity * 3 / 2);
|
|
2710
|
-
array->metadata = static_cast<grpc_metadata*>(
|
|
2711
|
-
gpr_realloc(array->metadata, sizeof(grpc_metadata) * array->capacity));
|
|
2712
|
-
}
|
|
2713
|
-
PublishToAppEncoder encoder(array, md, is_client);
|
|
2714
|
-
md->Encode(&encoder);
|
|
2715
|
-
}
|
|
2716
|
-
} // namespace
|
|
2717
|
-
|
|
2718
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
2719
|
-
// ClientPromiseBasedCall
|
|
2720
|
-
|
|
2721
|
-
#ifdef GRPC_EXPERIMENT_IS_INCLUDED_PROMISE_BASED_CLIENT_CALL
|
|
2722
|
-
class ClientPromiseBasedCall final : public PromiseBasedCall {
|
|
2723
|
-
public:
|
|
2724
|
-
ClientPromiseBasedCall(Arena* arena, grpc_call_create_args* args)
|
|
2725
|
-
: PromiseBasedCall(arena, 1, *args),
|
|
2726
|
-
polling_entity_(
|
|
2727
|
-
args->cq != nullptr
|
|
2728
|
-
? grpc_polling_entity_create_from_pollset(
|
|
2729
|
-
grpc_cq_pollset(args->cq))
|
|
2730
|
-
: (args->pollset_set_alternative != nullptr
|
|
2731
|
-
? grpc_polling_entity_create_from_pollset_set(
|
|
2732
|
-
args->pollset_set_alternative)
|
|
2733
|
-
: grpc_polling_entity{})) {
|
|
2734
|
-
global_stats().IncrementClientCallsCreated();
|
|
2735
|
-
if (args->cq != nullptr) {
|
|
2736
|
-
GPR_ASSERT(args->pollset_set_alternative == nullptr &&
|
|
2737
|
-
"Only one of 'cq' and 'pollset_set_alternative' should be "
|
|
2738
|
-
"non-nullptr.");
|
|
2739
|
-
}
|
|
2740
|
-
ScopedContext context(this);
|
|
2741
|
-
args->channel->channel_stack()->stats_plugin_group->AddClientCallTracers(
|
|
2742
|
-
*args->path, args->registered_method, this->context());
|
|
2743
|
-
send_initial_metadata_ = GetContext<Arena>()->MakePooled<ClientMetadata>();
|
|
2744
|
-
send_initial_metadata_->Set(HttpPathMetadata(), std::move(*args->path));
|
|
2745
|
-
if (args->authority.has_value()) {
|
|
2746
|
-
send_initial_metadata_->Set(HttpAuthorityMetadata(),
|
|
2747
|
-
std::move(*args->authority));
|
|
2748
|
-
}
|
|
2749
|
-
send_initial_metadata_->Set(GrpcRegisteredMethod(),
|
|
2750
|
-
reinterpret_cast<void*>(static_cast<uintptr_t>(
|
|
2751
|
-
args->registered_method)));
|
|
2752
|
-
if (auto* channelz_channel = channel()->channelz_node()) {
|
|
2753
|
-
channelz_channel->RecordCallStarted();
|
|
2754
|
-
}
|
|
2755
|
-
if (args->send_deadline != Timestamp::InfFuture()) {
|
|
2756
|
-
UpdateDeadline(args->send_deadline);
|
|
2757
|
-
}
|
|
2758
|
-
Call* parent = Call::FromC(args->parent);
|
|
2759
|
-
if (parent != nullptr) {
|
|
2760
|
-
auto parent_status = InitParent(parent, args->propagation_mask);
|
|
2761
|
-
if (!parent_status.ok()) {
|
|
2762
|
-
CancelWithError(std::move(parent_status));
|
|
2763
|
-
}
|
|
2764
|
-
PublishToParent(parent);
|
|
2765
|
-
}
|
|
2766
|
-
}
|
|
2767
|
-
|
|
2768
|
-
void OrphanCall() override { MaybeUnpublishFromParent(); }
|
|
2769
|
-
|
|
2770
|
-
~ClientPromiseBasedCall() override {
|
|
2771
|
-
ScopedContext context(this);
|
|
2772
|
-
send_initial_metadata_.reset();
|
|
2773
|
-
// Need to destroy the pipes under the ScopedContext above, so we
|
|
2774
|
-
// move them out here and then allow the destructors to run at
|
|
2775
|
-
// end of scope, but before context.
|
|
2776
|
-
auto c2s = std::move(client_to_server_messages_);
|
|
2777
|
-
auto s2c = std::move(server_to_client_messages_);
|
|
2778
|
-
auto sim = std::move(server_initial_metadata_);
|
|
2779
|
-
}
|
|
2780
|
-
|
|
2781
|
-
void CancelWithError(absl::Status error) override {
|
|
2782
|
-
if (cancel_with_error_called_.exchange(true, std::memory_order_relaxed)) {
|
|
2783
|
-
return;
|
|
2784
|
-
}
|
|
2785
|
-
if (!started_.exchange(true, std::memory_order_relaxed)) {
|
|
2786
|
-
// Initial metadata not sent yet, so we can just fail the call.
|
|
2787
|
-
Spawn(
|
|
2788
|
-
"cancel_before_initial_metadata",
|
|
2789
|
-
[error = std::move(error), this]() {
|
|
2790
|
-
server_to_client_messages_.sender.Close();
|
|
2791
|
-
auto md = ServerMetadataFromStatus(error);
|
|
2792
|
-
md->Set(GrpcCallWasCancelled(), true);
|
|
2793
|
-
Finish(std::move(md));
|
|
2794
|
-
return Empty{};
|
|
2795
|
-
},
|
|
2796
|
-
[](Empty) {});
|
|
2797
|
-
} else {
|
|
2798
|
-
Spawn(
|
|
2799
|
-
"cancel_with_error",
|
|
2800
|
-
[error = std::move(error), this]() {
|
|
2801
|
-
if (!cancel_error_.is_set()) {
|
|
2802
|
-
auto md = ServerMetadataFromStatus(error);
|
|
2803
|
-
md->Set(GrpcCallWasCancelled(), true);
|
|
2804
|
-
cancel_error_.Set(std::move(md));
|
|
2805
|
-
}
|
|
2806
|
-
return Empty{};
|
|
2807
|
-
},
|
|
2808
|
-
[](Empty) {});
|
|
2809
|
-
}
|
|
2810
|
-
}
|
|
2811
|
-
absl::string_view GetServerAuthority() const override { abort(); }
|
|
2812
|
-
bool is_trailers_only() const override { return is_trailers_only_; }
|
|
2813
|
-
|
|
2814
|
-
grpc_call_error StartBatch(const grpc_op* ops, size_t nops, void* notify_tag,
|
|
2815
|
-
bool is_notify_tag_closure) override;
|
|
2816
|
-
|
|
2817
|
-
std::string DebugTag() const override {
|
|
2818
|
-
return absl::StrFormat("CLIENT_CALL[%p]: ", this);
|
|
2819
|
-
}
|
|
2820
|
-
|
|
2821
|
-
RefCountedPtr<CallSpineInterface> MakeCallSpine(CallArgs call_args) final {
|
|
2822
|
-
class WrappingCallSpine final : public CallSpineInterface {
|
|
2823
|
-
public:
|
|
2824
|
-
WrappingCallSpine(ClientPromiseBasedCall* call,
|
|
2825
|
-
ClientMetadataHandle metadata)
|
|
2826
|
-
: call_(call) {
|
|
2827
|
-
call_->InternalRef("call-spine");
|
|
2828
|
-
SpawnInfallible(
|
|
2829
|
-
"send_client_initial_metadata",
|
|
2830
|
-
[self = Ref(), metadata = std::move(metadata)]() mutable {
|
|
2831
|
-
return Map(self->client_initial_metadata_.sender.Push(
|
|
2832
|
-
std::move(metadata)),
|
|
2833
|
-
[self](bool) { return Empty{}; });
|
|
2834
|
-
});
|
|
2835
|
-
}
|
|
2836
|
-
|
|
2837
|
-
~WrappingCallSpine() override {
|
|
2838
|
-
{
|
|
2839
|
-
ScopedContext context(call_);
|
|
2840
|
-
// Move these out and destroy before the internal unref.
|
|
2841
|
-
auto client_initial_metadata = std::move(client_initial_metadata_);
|
|
2842
|
-
auto server_trailing_metadata = std::move(server_trailing_metadata_);
|
|
2843
|
-
}
|
|
2844
|
-
call_->InternalUnref("call-spine");
|
|
2845
|
-
}
|
|
2846
|
-
|
|
2847
|
-
Pipe<ClientMetadataHandle>& client_initial_metadata() override {
|
|
2848
|
-
return client_initial_metadata_;
|
|
2849
|
-
}
|
|
2850
|
-
|
|
2851
|
-
Pipe<MessageHandle>& client_to_server_messages() override {
|
|
2852
|
-
return call_->client_to_server_messages_;
|
|
2853
|
-
}
|
|
2854
|
-
|
|
2855
|
-
Pipe<ServerMetadataHandle>& server_initial_metadata() override {
|
|
2856
|
-
return call_->server_initial_metadata_;
|
|
2857
|
-
}
|
|
2858
|
-
|
|
2859
|
-
Pipe<MessageHandle>& server_to_client_messages() override {
|
|
2860
|
-
return call_->server_to_client_messages_;
|
|
2861
|
-
}
|
|
2862
|
-
|
|
2863
|
-
Pipe<ServerMetadataHandle>& server_trailing_metadata() override {
|
|
2864
|
-
return server_trailing_metadata_;
|
|
2865
|
-
}
|
|
2866
|
-
|
|
2867
|
-
Latch<ServerMetadataHandle>& cancel_latch() override {
|
|
2868
|
-
return cancel_error_;
|
|
2869
|
-
}
|
|
2870
|
-
|
|
2871
|
-
Party& party() override { return *call_; }
|
|
2872
|
-
Arena* arena() override { return call_->arena(); }
|
|
2873
|
-
|
|
2874
|
-
void IncrementRefCount() override { refs_.Ref(); }
|
|
2875
|
-
void Unref() override {
|
|
2876
|
-
if (refs_.Unref()) delete this;
|
|
2877
|
-
}
|
|
2878
|
-
RefCountedPtr<WrappingCallSpine> Ref() {
|
|
2879
|
-
IncrementRefCount();
|
|
2880
|
-
return RefCountedPtr<WrappingCallSpine>(this);
|
|
2881
|
-
}
|
|
2882
|
-
|
|
2883
|
-
private:
|
|
2884
|
-
RefCount refs_;
|
|
2885
|
-
ClientPromiseBasedCall* const call_;
|
|
2886
|
-
std::atomic<bool> sent_trailing_metadata_{false};
|
|
2887
|
-
Pipe<ClientMetadataHandle> client_initial_metadata_{call_->arena()};
|
|
2888
|
-
Pipe<ServerMetadataHandle> server_trailing_metadata_{call_->arena()};
|
|
2889
|
-
Latch<ServerMetadataHandle> cancel_error_;
|
|
2890
|
-
};
|
|
2891
|
-
GPR_ASSERT(call_args.server_initial_metadata ==
|
|
2892
|
-
&server_initial_metadata_.sender);
|
|
2893
|
-
GPR_ASSERT(call_args.client_to_server_messages ==
|
|
2894
|
-
&client_to_server_messages_.receiver);
|
|
2895
|
-
GPR_ASSERT(call_args.server_to_client_messages ==
|
|
2896
|
-
&server_to_client_messages_.sender);
|
|
2897
|
-
call_args.client_initial_metadata_outstanding.Complete(true);
|
|
2898
|
-
return MakeRefCounted<WrappingCallSpine>(
|
|
2899
|
-
this, std::move(call_args.client_initial_metadata));
|
|
2900
|
-
}
|
|
2901
|
-
|
|
2902
|
-
private:
|
|
2903
|
-
// Finish the call with the given status/trailing metadata.
|
|
2904
|
-
void Finish(ServerMetadataHandle trailing_metadata);
|
|
2905
|
-
// Validate that a set of ops is valid for a client call.
|
|
2906
|
-
grpc_call_error ValidateBatch(const grpc_op* ops, size_t nops) const;
|
|
2907
|
-
// Commit a valid batch of operations to be executed.
|
|
2908
|
-
void CommitBatch(const grpc_op* ops, size_t nops,
|
|
2909
|
-
const Completion& completion);
|
|
2910
|
-
// Start the underlying promise.
|
|
2911
|
-
void StartPromise(ClientMetadataHandle client_initial_metadata,
|
|
2912
|
-
const Completion& completion, Party::BulkSpawner& spawner);
|
|
2913
|
-
// Start receiving initial metadata
|
|
2914
|
-
void StartRecvInitialMetadata(grpc_metadata_array* array,
|
|
2915
|
-
const Completion& completion,
|
|
2916
|
-
Party::BulkSpawner& spawner);
|
|
2917
|
-
void StartRecvStatusOnClient(
|
|
2918
|
-
const Completion& completion,
|
|
2919
|
-
grpc_op::grpc_op_data::grpc_op_recv_status_on_client op_args,
|
|
2920
|
-
Party::BulkSpawner& spawner);
|
|
2921
|
-
// Publish status out to the application.
|
|
2922
|
-
void PublishStatus(
|
|
2923
|
-
grpc_op::grpc_op_data::grpc_op_recv_status_on_client op_args,
|
|
2924
|
-
ServerMetadataHandle trailing_metadata);
|
|
2925
|
-
// Publish server initial metadata out to the application.
|
|
2926
|
-
void PublishInitialMetadata(ServerMetadata* metadata);
|
|
2927
|
-
|
|
2928
|
-
ClientMetadataHandle send_initial_metadata_;
|
|
2929
|
-
Pipe<ServerMetadataHandle> server_initial_metadata_{arena()};
|
|
2930
|
-
Latch<ServerMetadataHandle> server_trailing_metadata_;
|
|
2931
|
-
Latch<ServerMetadataHandle> cancel_error_;
|
|
2932
|
-
Latch<grpc_polling_entity> polling_entity_;
|
|
2933
|
-
Pipe<MessageHandle> client_to_server_messages_{arena()};
|
|
2934
|
-
Pipe<MessageHandle> server_to_client_messages_{arena()};
|
|
2935
|
-
bool is_trailers_only_ = false;
|
|
2936
|
-
bool scheduled_receive_status_ = false;
|
|
2937
|
-
bool scheduled_send_close_ = false;
|
|
2938
|
-
// True once the promise for the call is started.
|
|
2939
|
-
// This corresponds to sending initial metadata, or cancelling before doing
|
|
2940
|
-
// so.
|
|
2941
|
-
// In the latter case real world code sometimes does not sent the initial
|
|
2942
|
-
// metadata, and so gating based upon that does not work out.
|
|
2943
|
-
std::atomic<bool> started_{false};
|
|
2944
|
-
// True after the first CancelWithError call - prevents spamming cancels from
|
|
2945
|
-
// overflowing the party.
|
|
2946
|
-
std::atomic<bool> cancel_with_error_called_{false};
|
|
2947
|
-
// TODO(ctiller): delete when we remove the filter based API (may require some
|
|
2948
|
-
// cleanup in wrapped languages: they depend on this to hold slice refs)
|
|
2949
|
-
ServerMetadataHandle recv_initial_metadata_;
|
|
2950
|
-
ServerMetadataHandle recv_trailing_metadata_;
|
|
2951
|
-
};
|
|
2952
|
-
|
|
2953
|
-
void ClientPromiseBasedCall::StartPromise(
|
|
2954
|
-
ClientMetadataHandle client_initial_metadata, const Completion& completion,
|
|
2955
|
-
Party::BulkSpawner& spawner) {
|
|
2956
|
-
auto token = ClientInitialMetadataOutstandingToken::New(arena());
|
|
2957
|
-
spawner.Spawn(
|
|
2958
|
-
"call_send_initial_metadata", token.Wait(),
|
|
2959
|
-
[this,
|
|
2960
|
-
completion = AddOpToCompletion(
|
|
2961
|
-
completion, PendingOp::kSendInitialMetadata)](bool result) mutable {
|
|
2962
|
-
if (!result) FailCompletion(completion);
|
|
2963
|
-
FinishOpOnCompletion(&completion, PendingOp::kSendInitialMetadata);
|
|
2964
|
-
});
|
|
2965
|
-
spawner.Spawn(
|
|
2966
|
-
"client_promise",
|
|
2967
|
-
[this, client_initial_metadata = std::move(client_initial_metadata),
|
|
2968
|
-
token = std::move(token)]() mutable {
|
|
2969
|
-
return Race(
|
|
2970
|
-
cancel_error_.Wait(),
|
|
2971
|
-
Map(channel()->channel_stack()->MakeClientCallPromise(CallArgs{
|
|
2972
|
-
std::move(client_initial_metadata), std::move(token),
|
|
2973
|
-
&polling_entity_, &server_initial_metadata_.sender,
|
|
2974
|
-
&client_to_server_messages_.receiver,
|
|
2975
|
-
&server_to_client_messages_.sender}),
|
|
2976
|
-
[this](ServerMetadataHandle trailing_metadata) {
|
|
2977
|
-
// If we're cancelled the transport doesn't get to return
|
|
2978
|
-
// stats.
|
|
2979
|
-
AcceptTransportStatsFromContext();
|
|
2980
|
-
return trailing_metadata;
|
|
2981
|
-
}));
|
|
2982
|
-
},
|
|
2983
|
-
[this](ServerMetadataHandle trailing_metadata) {
|
|
2984
|
-
Finish(std::move(trailing_metadata));
|
|
2985
|
-
});
|
|
2986
|
-
}
|
|
2987
|
-
|
|
2988
|
-
grpc_call_error ClientPromiseBasedCall::ValidateBatch(const grpc_op* ops,
|
|
2989
|
-
size_t nops) const {
|
|
2990
|
-
BitSet<8> got_ops;
|
|
2991
|
-
for (size_t op_idx = 0; op_idx < nops; op_idx++) {
|
|
2992
|
-
const grpc_op& op = ops[op_idx];
|
|
2993
|
-
switch (op.op) {
|
|
2994
|
-
case GRPC_OP_SEND_INITIAL_METADATA:
|
|
2995
|
-
if (!AreInitialMetadataFlagsValid(op.flags)) {
|
|
2996
|
-
return GRPC_CALL_ERROR_INVALID_FLAGS;
|
|
2997
|
-
}
|
|
2998
|
-
if (!ValidateMetadata(op.data.send_initial_metadata.count,
|
|
2999
|
-
op.data.send_initial_metadata.metadata)) {
|
|
3000
|
-
return GRPC_CALL_ERROR_INVALID_METADATA;
|
|
3001
|
-
}
|
|
3002
|
-
break;
|
|
3003
|
-
case GRPC_OP_SEND_MESSAGE:
|
|
3004
|
-
if (!AreWriteFlagsValid(op.flags)) {
|
|
3005
|
-
return GRPC_CALL_ERROR_INVALID_FLAGS;
|
|
3006
|
-
}
|
|
3007
|
-
break;
|
|
3008
|
-
case GRPC_OP_RECV_INITIAL_METADATA:
|
|
3009
|
-
case GRPC_OP_RECV_MESSAGE:
|
|
3010
|
-
if (op.flags != 0) return GRPC_CALL_ERROR_INVALID_FLAGS;
|
|
3011
|
-
break;
|
|
3012
|
-
case GRPC_OP_SEND_CLOSE_FROM_CLIENT:
|
|
3013
|
-
if (scheduled_send_close_) return GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
|
3014
|
-
if (op.flags != 0) return GRPC_CALL_ERROR_INVALID_FLAGS;
|
|
3015
|
-
break;
|
|
3016
|
-
case GRPC_OP_RECV_STATUS_ON_CLIENT:
|
|
3017
|
-
if (op.flags != 0) return GRPC_CALL_ERROR_INVALID_FLAGS;
|
|
3018
|
-
if (scheduled_receive_status_) {
|
|
3019
|
-
return GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
|
3020
|
-
}
|
|
3021
|
-
break;
|
|
3022
|
-
case GRPC_OP_RECV_CLOSE_ON_SERVER:
|
|
3023
|
-
case GRPC_OP_SEND_STATUS_FROM_SERVER:
|
|
3024
|
-
return GRPC_CALL_ERROR_NOT_ON_CLIENT;
|
|
3025
|
-
}
|
|
3026
|
-
if (got_ops.is_set(op.op)) {
|
|
3027
|
-
return GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
|
3028
|
-
}
|
|
3029
|
-
got_ops.set(op.op);
|
|
3030
|
-
}
|
|
3031
|
-
return GRPC_CALL_OK;
|
|
3032
|
-
}
|
|
3033
|
-
|
|
3034
|
-
void ClientPromiseBasedCall::CommitBatch(const grpc_op* ops, size_t nops,
|
|
3035
|
-
const Completion& completion) {
|
|
3036
|
-
Party::BulkSpawner spawner(this);
|
|
3037
|
-
for (size_t op_idx = 0; op_idx < nops; op_idx++) {
|
|
3038
|
-
const grpc_op& op = ops[op_idx];
|
|
3039
|
-
switch (op.op) {
|
|
3040
|
-
case GRPC_OP_SEND_INITIAL_METADATA: {
|
|
3041
|
-
if (started_.exchange(true, std::memory_order_relaxed)) break;
|
|
3042
|
-
CToMetadata(op.data.send_initial_metadata.metadata,
|
|
3043
|
-
op.data.send_initial_metadata.count,
|
|
3044
|
-
send_initial_metadata_.get());
|
|
3045
|
-
PrepareOutgoingInitialMetadata(op, *send_initial_metadata_);
|
|
3046
|
-
if (send_deadline() != Timestamp::InfFuture()) {
|
|
3047
|
-
send_initial_metadata_->Set(GrpcTimeoutMetadata(), send_deadline());
|
|
3048
|
-
}
|
|
3049
|
-
send_initial_metadata_->Set(
|
|
3050
|
-
WaitForReady(),
|
|
3051
|
-
WaitForReady::ValueType{
|
|
3052
|
-
(op.flags & GRPC_INITIAL_METADATA_WAIT_FOR_READY) != 0,
|
|
3053
|
-
(op.flags &
|
|
3054
|
-
GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET) != 0});
|
|
3055
|
-
StartPromise(std::move(send_initial_metadata_), completion, spawner);
|
|
3056
|
-
} break;
|
|
3057
|
-
case GRPC_OP_RECV_INITIAL_METADATA: {
|
|
3058
|
-
StartRecvInitialMetadata(
|
|
3059
|
-
op.data.recv_initial_metadata.recv_initial_metadata, completion,
|
|
3060
|
-
spawner);
|
|
3061
|
-
} break;
|
|
3062
|
-
case GRPC_OP_RECV_STATUS_ON_CLIENT: {
|
|
3063
|
-
scheduled_receive_status_ = true;
|
|
3064
|
-
StartRecvStatusOnClient(completion, op.data.recv_status_on_client,
|
|
3065
|
-
spawner);
|
|
3066
|
-
} break;
|
|
3067
|
-
case GRPC_OP_SEND_MESSAGE:
|
|
3068
|
-
StartSendMessage(op, completion, &client_to_server_messages_.sender,
|
|
3069
|
-
spawner);
|
|
3070
|
-
break;
|
|
3071
|
-
case GRPC_OP_RECV_MESSAGE:
|
|
3072
|
-
StartRecvMessage(
|
|
3073
|
-
op, completion,
|
|
3074
|
-
[this]() {
|
|
3075
|
-
return Race(server_initial_metadata_.receiver.AwaitClosed(),
|
|
3076
|
-
server_to_client_messages_.receiver.AwaitClosed());
|
|
3077
|
-
},
|
|
3078
|
-
&server_to_client_messages_.receiver, false, spawner);
|
|
3079
|
-
break;
|
|
3080
|
-
case GRPC_OP_SEND_CLOSE_FROM_CLIENT:
|
|
3081
|
-
scheduled_send_close_ = true;
|
|
3082
|
-
spawner.Spawn(
|
|
3083
|
-
"send_close_from_client",
|
|
3084
|
-
[this]() {
|
|
3085
|
-
client_to_server_messages_.sender.Close();
|
|
3086
|
-
return Empty{};
|
|
3087
|
-
},
|
|
3088
|
-
[this,
|
|
3089
|
-
completion = AddOpToCompletion(
|
|
3090
|
-
completion, PendingOp::kSendCloseFromClient)](Empty) mutable {
|
|
3091
|
-
FinishOpOnCompletion(&completion,
|
|
3092
|
-
PendingOp::kSendCloseFromClient);
|
|
3093
|
-
});
|
|
3094
|
-
break;
|
|
3095
|
-
case GRPC_OP_SEND_STATUS_FROM_SERVER:
|
|
3096
|
-
case GRPC_OP_RECV_CLOSE_ON_SERVER:
|
|
3097
|
-
abort(); // unreachable
|
|
3098
|
-
}
|
|
3099
|
-
}
|
|
3100
|
-
}
|
|
3101
|
-
|
|
3102
|
-
grpc_call_error ClientPromiseBasedCall::StartBatch(const grpc_op* ops,
|
|
3103
|
-
size_t nops,
|
|
3104
|
-
void* notify_tag,
|
|
3105
|
-
bool is_notify_tag_closure) {
|
|
3106
|
-
if (nops == 0) {
|
|
3107
|
-
EndOpImmediately(cq(), notify_tag, is_notify_tag_closure);
|
|
3108
|
-
return GRPC_CALL_OK;
|
|
3109
|
-
}
|
|
3110
|
-
const grpc_call_error validation_result = ValidateBatch(ops, nops);
|
|
3111
|
-
if (validation_result != GRPC_CALL_OK) {
|
|
3112
|
-
return validation_result;
|
|
3113
|
-
}
|
|
3114
|
-
Completion completion =
|
|
3115
|
-
StartCompletion(notify_tag, is_notify_tag_closure, ops);
|
|
3116
|
-
CommitBatch(ops, nops, completion);
|
|
3117
|
-
FinishOpOnCompletion(&completion, PendingOp::kStartingBatch);
|
|
3118
|
-
return GRPC_CALL_OK;
|
|
3119
|
-
}
|
|
3120
|
-
|
|
3121
|
-
void ClientPromiseBasedCall::StartRecvInitialMetadata(
|
|
3122
|
-
grpc_metadata_array* array, const Completion& completion,
|
|
3123
|
-
Party::BulkSpawner& spawner) {
|
|
3124
|
-
spawner.Spawn(
|
|
3125
|
-
"recv_initial_metadata",
|
|
3126
|
-
[this]() {
|
|
3127
|
-
return Race(server_initial_metadata_.receiver.Next(),
|
|
3128
|
-
Map(finished(), [](Empty) {
|
|
3129
|
-
return NextResult<ServerMetadataHandle>(true);
|
|
3130
|
-
}));
|
|
3131
|
-
},
|
|
3132
|
-
[this, array,
|
|
3133
|
-
completion =
|
|
3134
|
-
AddOpToCompletion(completion, PendingOp::kReceiveInitialMetadata)](
|
|
3135
|
-
NextResult<ServerMetadataHandle> next_metadata) mutable {
|
|
3136
|
-
server_initial_metadata_.sender.Close();
|
|
3137
|
-
ServerMetadataHandle metadata;
|
|
3138
|
-
if (grpc_call_trace.enabled()) {
|
|
3139
|
-
gpr_log(GPR_INFO, "%s[call] RecvTrailingMetadata: %s",
|
|
3140
|
-
DebugTag().c_str(),
|
|
3141
|
-
next_metadata.has_value()
|
|
3142
|
-
? next_metadata.value()->DebugString().c_str()
|
|
3143
|
-
: "null");
|
|
3144
|
-
}
|
|
3145
|
-
if (next_metadata.has_value()) {
|
|
3146
|
-
metadata = std::move(next_metadata.value());
|
|
3147
|
-
is_trailers_only_ = metadata->get(GrpcTrailersOnly()).value_or(false);
|
|
3148
|
-
} else {
|
|
3149
|
-
is_trailers_only_ = true;
|
|
3150
|
-
metadata = arena()->MakePooled<ServerMetadata>();
|
|
3151
|
-
}
|
|
3152
|
-
ProcessIncomingInitialMetadata(*metadata);
|
|
3153
|
-
PublishMetadataArray(metadata.get(), array, true);
|
|
3154
|
-
recv_initial_metadata_ = std::move(metadata);
|
|
3155
|
-
FinishOpOnCompletion(&completion, PendingOp::kReceiveInitialMetadata);
|
|
3156
|
-
});
|
|
3157
|
-
}
|
|
3158
|
-
|
|
3159
|
-
void ClientPromiseBasedCall::Finish(ServerMetadataHandle trailing_metadata) {
|
|
3160
|
-
if (grpc_call_trace.enabled()) {
|
|
3161
|
-
gpr_log(GPR_INFO, "%s[call] Finish: %s", DebugTag().c_str(),
|
|
3162
|
-
trailing_metadata->DebugString().c_str());
|
|
3163
|
-
}
|
|
3164
|
-
ResetDeadline();
|
|
3165
|
-
set_completed();
|
|
3166
|
-
client_to_server_messages_.sender.CloseWithError();
|
|
3167
|
-
client_to_server_messages_.receiver.CloseWithError();
|
|
3168
|
-
if (trailing_metadata->get(GrpcCallWasCancelled()).value_or(false)) {
|
|
3169
|
-
server_to_client_messages_.receiver.CloseWithError();
|
|
3170
|
-
server_initial_metadata_.receiver.CloseWithError();
|
|
3171
|
-
}
|
|
3172
|
-
if (auto* channelz_channel = channel()->channelz_node()) {
|
|
3173
|
-
if (trailing_metadata->get(GrpcStatusMetadata())
|
|
3174
|
-
.value_or(GRPC_STATUS_UNKNOWN) == GRPC_STATUS_OK) {
|
|
3175
|
-
channelz_channel->RecordCallSucceeded();
|
|
3176
|
-
} else {
|
|
3177
|
-
channelz_channel->RecordCallFailed();
|
|
3178
|
-
}
|
|
3179
|
-
}
|
|
3180
|
-
server_trailing_metadata_.Set(std::move(trailing_metadata));
|
|
3181
|
-
}
|
|
3182
|
-
|
|
3183
|
-
namespace {
|
|
3184
|
-
std::string MakeErrorString(const ServerMetadata* trailing_metadata) {
|
|
3185
|
-
std::string out = absl::StrCat(
|
|
3186
|
-
trailing_metadata->get(GrpcStatusFromWire()).value_or(false)
|
|
3187
|
-
? "Error received from peer"
|
|
3188
|
-
: "Error generated by client",
|
|
3189
|
-
"grpc_status: ",
|
|
3190
|
-
grpc_status_code_to_string(trailing_metadata->get(GrpcStatusMetadata())
|
|
3191
|
-
.value_or(GRPC_STATUS_UNKNOWN)));
|
|
3192
|
-
if (const Slice* message =
|
|
3193
|
-
trailing_metadata->get_pointer(GrpcMessageMetadata())) {
|
|
3194
|
-
absl::StrAppend(&out, "\ngrpc_message: ", message->as_string_view());
|
|
3195
|
-
}
|
|
3196
|
-
if (auto annotations = trailing_metadata->get_pointer(GrpcStatusContext())) {
|
|
3197
|
-
absl::StrAppend(&out, "\nStatus Context:");
|
|
3198
|
-
for (const std::string& annotation : *annotations) {
|
|
3199
|
-
absl::StrAppend(&out, "\n ", annotation);
|
|
3200
|
-
}
|
|
3201
|
-
}
|
|
3202
|
-
return out;
|
|
3203
|
-
}
|
|
3204
|
-
} // namespace
|
|
3205
|
-
|
|
3206
|
-
void ClientPromiseBasedCall::StartRecvStatusOnClient(
|
|
3207
|
-
const Completion& completion,
|
|
3208
|
-
grpc_op::grpc_op_data::grpc_op_recv_status_on_client op_args,
|
|
3209
|
-
Party::BulkSpawner& spawner) {
|
|
3210
|
-
ForceCompletionSuccess(completion);
|
|
3211
|
-
spawner.Spawn(
|
|
3212
|
-
"recv_status_on_client", server_trailing_metadata_.Wait(),
|
|
3213
|
-
[this, op_args,
|
|
3214
|
-
completion =
|
|
3215
|
-
AddOpToCompletion(completion, PendingOp::kReceiveStatusOnClient)](
|
|
3216
|
-
ServerMetadataHandle trailing_metadata) mutable {
|
|
3217
|
-
const grpc_status_code status =
|
|
3218
|
-
trailing_metadata->get(GrpcStatusMetadata())
|
|
3219
|
-
.value_or(GRPC_STATUS_UNKNOWN);
|
|
3220
|
-
*op_args.status = status;
|
|
3221
|
-
Slice message_slice;
|
|
3222
|
-
if (Slice* message =
|
|
3223
|
-
trailing_metadata->get_pointer(GrpcMessageMetadata())) {
|
|
3224
|
-
message_slice = message->Ref();
|
|
3225
|
-
}
|
|
3226
|
-
SetFinalizationStatus(status, message_slice.Ref());
|
|
3227
|
-
*op_args.status_details = message_slice.TakeCSlice();
|
|
3228
|
-
if (op_args.error_string != nullptr && status != GRPC_STATUS_OK) {
|
|
3229
|
-
*op_args.error_string =
|
|
3230
|
-
gpr_strdup(MakeErrorString(trailing_metadata.get()).c_str());
|
|
3231
|
-
}
|
|
3232
|
-
PublishMetadataArray(trailing_metadata.get(), op_args.trailing_metadata,
|
|
3233
|
-
true);
|
|
3234
|
-
recv_trailing_metadata_ = std::move(trailing_metadata);
|
|
3235
|
-
FinishOpOnCompletion(&completion, PendingOp::kReceiveStatusOnClient);
|
|
3236
|
-
});
|
|
3237
|
-
}
|
|
3238
|
-
#endif
|
|
3239
|
-
|
|
3240
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
3241
|
-
// ServerPromiseBasedCall
|
|
3242
|
-
|
|
3243
|
-
#ifdef GRPC_EXPERIMENT_IS_INCLUDED_PROMISE_BASED_SERVER_CALL
|
|
3244
|
-
|
|
3245
|
-
class ServerPromiseBasedCall final : public PromiseBasedCall,
|
|
3246
|
-
public ServerCallContext {
|
|
3247
|
-
public:
|
|
3248
|
-
ServerPromiseBasedCall(Arena* arena, grpc_call_create_args* args);
|
|
3249
|
-
|
|
3250
|
-
void OrphanCall() override {}
|
|
3251
|
-
void CancelWithError(grpc_error_handle) override;
|
|
3252
|
-
grpc_call_error StartBatch(const grpc_op* ops, size_t nops, void* notify_tag,
|
|
3253
|
-
bool is_notify_tag_closure) override;
|
|
3254
|
-
bool is_trailers_only() const override {
|
|
3255
|
-
Crash("is_trailers_only not implemented for server calls");
|
|
3256
|
-
}
|
|
3257
|
-
absl::string_view GetServerAuthority() const override {
|
|
3258
|
-
const Slice* authority_metadata =
|
|
3259
|
-
client_initial_metadata_->get_pointer(HttpAuthorityMetadata());
|
|
3260
|
-
if (authority_metadata == nullptr) return "";
|
|
3261
|
-
return authority_metadata->as_string_view();
|
|
3262
|
-
}
|
|
3263
|
-
|
|
3264
|
-
// Polling order for the server promise stack:
|
|
3265
|
-
//
|
|
3266
|
-
// │ ┌───────────────────────────────────────┐
|
|
3267
|
-
// │ │ ServerPromiseBasedCall ├──► Lifetime management
|
|
3268
|
-
// │ ├───────────────────────────────────────┤
|
|
3269
|
-
// │ │ ConnectedChannel ├─┐
|
|
3270
|
-
// │ ├───────────────────────────────────────┤ └► Interactions with the
|
|
3271
|
-
// │ │ ... closest to transport filter │ transport - send/recv msgs
|
|
3272
|
-
// │ ├───────────────────────────────────────┤ and metadata, call phase
|
|
3273
|
-
// │ │ ... │ ordering
|
|
3274
|
-
// │ ├───────────────────────────────────────┤
|
|
3275
|
-
// │ │ ... closest to app filter │ ┌► Request matching, initial
|
|
3276
|
-
// │ ├───────────────────────────────────────┤ │ setup, publishing call to
|
|
3277
|
-
// │ │ Server::ChannelData::MakeCallPromise ├─┘ application
|
|
3278
|
-
// │ ├───────────────────────────────────────┤
|
|
3279
|
-
// │ │ MakeTopOfServerCallPromise ├──► Send trailing metadata
|
|
3280
|
-
// ▼ └───────────────────────────────────────┘
|
|
3281
|
-
// Polling &
|
|
3282
|
-
// instantiation
|
|
3283
|
-
// order
|
|
3284
|
-
|
|
3285
|
-
std::string DebugTag() const override {
|
|
3286
|
-
return absl::StrFormat("SERVER_CALL[%p]: ", this);
|
|
3287
|
-
}
|
|
3288
|
-
|
|
3289
|
-
ServerCallContext* server_call_context() override { return this; }
|
|
3290
|
-
|
|
3291
|
-
const void* server_stream_data() override { return server_transport_data_; }
|
|
3292
|
-
void PublishInitialMetadata(
|
|
3293
|
-
ClientMetadataHandle metadata,
|
|
3294
|
-
grpc_metadata_array* publish_initial_metadata) override;
|
|
3295
|
-
ArenaPromise<ServerMetadataHandle> MakeTopOfServerCallPromise(
|
|
3296
|
-
CallArgs call_args, grpc_completion_queue* cq,
|
|
3297
|
-
absl::FunctionRef<void(grpc_call* call)> publish) override;
|
|
3298
|
-
|
|
3299
|
-
private:
|
|
3300
|
-
class RecvCloseOpCancelState {
|
|
3301
|
-
public:
|
|
3302
|
-
// Request that receiver be filled in per
|
|
3303
|
-
// grpc_op_recv_close_on_server. Returns true if the request can
|
|
3304
|
-
// be fulfilled immediately. Returns false if the request will be
|
|
3305
|
-
// fulfilled later.
|
|
3306
|
-
bool ReceiveCloseOnServerOpStarted(int* receiver) {
|
|
3307
|
-
uintptr_t state = state_.load(std::memory_order_acquire);
|
|
3308
|
-
uintptr_t new_state;
|
|
3309
|
-
do {
|
|
3310
|
-
switch (state) {
|
|
3311
|
-
case kUnset:
|
|
3312
|
-
new_state = reinterpret_cast<uintptr_t>(receiver);
|
|
3313
|
-
break;
|
|
3314
|
-
case kFinishedWithFailure:
|
|
3315
|
-
*receiver = 1;
|
|
3316
|
-
return true;
|
|
3317
|
-
case kFinishedWithSuccess:
|
|
3318
|
-
*receiver = 0;
|
|
3319
|
-
return true;
|
|
3320
|
-
default:
|
|
3321
|
-
Crash("Two threads offered ReceiveCloseOnServerOpStarted");
|
|
3322
|
-
}
|
|
3323
|
-
} while (!state_.compare_exchange_weak(state, new_state,
|
|
3324
|
-
std::memory_order_acq_rel,
|
|
3325
|
-
std::memory_order_acquire));
|
|
3326
|
-
return false;
|
|
3327
|
-
}
|
|
3328
|
-
|
|
3329
|
-
// Mark the call as having completed.
|
|
3330
|
-
// Returns true if this finishes a previous
|
|
3331
|
-
// RequestReceiveCloseOnServer.
|
|
3332
|
-
bool CompleteCallWithCancelledSetTo(bool cancelled) {
|
|
3333
|
-
uintptr_t state = state_.load(std::memory_order_acquire);
|
|
3334
|
-
uintptr_t new_state;
|
|
3335
|
-
bool r;
|
|
3336
|
-
do {
|
|
3337
|
-
switch (state) {
|
|
3338
|
-
case kUnset:
|
|
3339
|
-
new_state = cancelled ? kFinishedWithFailure : kFinishedWithSuccess;
|
|
3340
|
-
r = false;
|
|
3341
|
-
break;
|
|
3342
|
-
case kFinishedWithFailure:
|
|
3343
|
-
return false;
|
|
3344
|
-
case kFinishedWithSuccess:
|
|
3345
|
-
Crash("unreachable");
|
|
3346
|
-
default:
|
|
3347
|
-
new_state = cancelled ? kFinishedWithFailure : kFinishedWithSuccess;
|
|
3348
|
-
r = true;
|
|
3349
|
-
}
|
|
3350
|
-
} while (!state_.compare_exchange_weak(state, new_state,
|
|
3351
|
-
std::memory_order_acq_rel,
|
|
3352
|
-
std::memory_order_acquire));
|
|
3353
|
-
if (r) *reinterpret_cast<int*>(state) = cancelled ? 1 : 0;
|
|
3354
|
-
return r;
|
|
3355
|
-
}
|
|
3356
|
-
|
|
3357
|
-
std::string ToString() const {
|
|
3358
|
-
auto state = state_.load(std::memory_order_relaxed);
|
|
3359
|
-
switch (state) {
|
|
3360
|
-
case kUnset:
|
|
3361
|
-
return "Unset";
|
|
3362
|
-
case kFinishedWithFailure:
|
|
3363
|
-
return "FinishedWithFailure";
|
|
3364
|
-
case kFinishedWithSuccess:
|
|
3365
|
-
return "FinishedWithSuccess";
|
|
3366
|
-
default:
|
|
3367
|
-
return absl::StrFormat("WaitingForReceiver(%p)",
|
|
3368
|
-
reinterpret_cast<void*>(state));
|
|
3369
|
-
}
|
|
3370
|
-
}
|
|
3371
|
-
|
|
3372
|
-
private:
|
|
3373
|
-
static constexpr uintptr_t kUnset = 0;
|
|
3374
|
-
static constexpr uintptr_t kFinishedWithFailure = 1;
|
|
3375
|
-
static constexpr uintptr_t kFinishedWithSuccess = 2;
|
|
3376
|
-
// Holds one of kUnset, kFinishedWithFailure, or
|
|
3377
|
-
// kFinishedWithSuccess OR an int* that wants to receive the
|
|
3378
|
-
// final status.
|
|
3379
|
-
std::atomic<uintptr_t> state_{kUnset};
|
|
3380
|
-
};
|
|
3381
|
-
|
|
3382
|
-
void CommitBatch(const grpc_op* ops, size_t nops,
|
|
3383
|
-
const Completion& completion);
|
|
3384
|
-
void Finish(ServerMetadataHandle result);
|
|
3385
|
-
|
|
3386
|
-
ServerInterface* const server_;
|
|
3387
|
-
const void* const server_transport_data_;
|
|
3388
|
-
PipeSender<ServerMetadataHandle>* server_initial_metadata_ = nullptr;
|
|
3389
|
-
PipeSender<MessageHandle>* server_to_client_messages_ = nullptr;
|
|
3390
|
-
PipeReceiver<MessageHandle>* client_to_server_messages_ = nullptr;
|
|
3391
|
-
Latch<ServerMetadataHandle> send_trailing_metadata_;
|
|
3392
|
-
RecvCloseOpCancelState recv_close_op_cancel_state_;
|
|
3393
|
-
ClientMetadataHandle client_initial_metadata_;
|
|
3394
|
-
Completion recv_close_completion_;
|
|
3395
|
-
std::atomic<bool> cancelled_{false};
|
|
3396
|
-
};
|
|
3397
|
-
|
|
3398
|
-
ServerPromiseBasedCall::ServerPromiseBasedCall(Arena* arena,
|
|
3399
|
-
grpc_call_create_args* args)
|
|
3400
|
-
: PromiseBasedCall(arena, 0, *args),
|
|
3401
|
-
server_(args->server),
|
|
3402
|
-
server_transport_data_(args->server_transport_data) {
|
|
3403
|
-
global_stats().IncrementServerCallsCreated();
|
|
3404
|
-
channelz::ServerNode* channelz_node = server_->channelz_node();
|
|
3405
|
-
if (channelz_node != nullptr) {
|
|
3406
|
-
channelz_node->RecordCallStarted();
|
|
3407
|
-
}
|
|
3408
|
-
ScopedContext activity_context(this);
|
|
3409
|
-
// TODO(yashykt): In the future, we want to also enable stats and trace
|
|
3410
|
-
// collecting from when the call is created at the transport. The idea is that
|
|
3411
|
-
// the transport would create the call tracer and pass it in as part of the
|
|
3412
|
-
// metadata.
|
|
3413
|
-
// TODO(yijiem): OpenCensus and internal Census is still using this way to
|
|
3414
|
-
// set server call tracer. We need to refactor them to stats plugins
|
|
3415
|
-
// (including removing the client channel filters).
|
|
3416
|
-
if (args->server != nullptr &&
|
|
3417
|
-
args->server->server_call_tracer_factory() != nullptr) {
|
|
3418
|
-
auto* server_call_tracer =
|
|
3419
|
-
args->server->server_call_tracer_factory()->CreateNewServerCallTracer(
|
|
3420
|
-
arena, args->server->channel_args());
|
|
3421
|
-
if (server_call_tracer != nullptr) {
|
|
3422
|
-
// Note that we are setting both
|
|
3423
|
-
// GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE and
|
|
3424
|
-
// GRPC_CONTEXT_CALL_TRACER as a matter of convenience. In the future
|
|
3425
|
-
// promise-based world, we would just a single tracer object for each
|
|
3426
|
-
// stack (call, subchannel_call, server_call.)
|
|
3427
|
-
ContextSet(GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE,
|
|
3428
|
-
server_call_tracer, nullptr);
|
|
3429
|
-
ContextSet(GRPC_CONTEXT_CALL_TRACER, server_call_tracer, nullptr);
|
|
3430
|
-
}
|
|
3431
|
-
}
|
|
3432
|
-
args->channel->channel_stack()->stats_plugin_group->AddServerCallTracers(
|
|
3433
|
-
context());
|
|
3434
|
-
Spawn("server_promise",
|
|
3435
|
-
channel()->channel_stack()->MakeServerCallPromise(
|
|
3436
|
-
CallArgs{nullptr, ClientInitialMetadataOutstandingToken::Empty(),
|
|
3437
|
-
nullptr, nullptr, nullptr, nullptr}),
|
|
3438
|
-
[this](ServerMetadataHandle result) { Finish(std::move(result)); });
|
|
3439
|
-
}
|
|
3440
|
-
|
|
3441
|
-
void ServerPromiseBasedCall::Finish(ServerMetadataHandle result) {
|
|
3442
|
-
if (grpc_call_trace.enabled()) {
|
|
3443
|
-
gpr_log(GPR_INFO, "%s[call] Finish: recv_close_state:%s result:%s",
|
|
3444
|
-
DebugTag().c_str(), recv_close_op_cancel_state_.ToString().c_str(),
|
|
3445
|
-
result->DebugString().c_str());
|
|
3446
|
-
}
|
|
3447
|
-
const auto status =
|
|
3448
|
-
result->get(GrpcStatusMetadata()).value_or(GRPC_STATUS_UNKNOWN);
|
|
3449
|
-
channelz::ServerNode* channelz_node = server_->channelz_node();
|
|
3450
|
-
if (channelz_node != nullptr) {
|
|
3451
|
-
if (status == GRPC_STATUS_OK) {
|
|
3452
|
-
channelz_node->RecordCallSucceeded();
|
|
3453
|
-
} else {
|
|
3454
|
-
channelz_node->RecordCallFailed();
|
|
3455
|
-
}
|
|
3456
|
-
}
|
|
3457
|
-
bool was_cancelled = result->get(GrpcCallWasCancelled()).value_or(true);
|
|
3458
|
-
if (recv_close_op_cancel_state_.CompleteCallWithCancelledSetTo(
|
|
3459
|
-
was_cancelled)) {
|
|
3460
|
-
FinishOpOnCompletion(&recv_close_completion_,
|
|
3461
|
-
PendingOp::kReceiveCloseOnServer);
|
|
3462
|
-
}
|
|
3463
|
-
if (was_cancelled) set_failed_before_recv_message();
|
|
3464
|
-
if (server_initial_metadata_ != nullptr) {
|
|
3465
|
-
server_initial_metadata_->Close();
|
|
3466
|
-
}
|
|
3467
|
-
Slice message_slice;
|
|
3468
|
-
if (Slice* message = result->get_pointer(GrpcMessageMetadata())) {
|
|
3469
|
-
message_slice = message->Ref();
|
|
3470
|
-
}
|
|
3471
|
-
AcceptTransportStatsFromContext();
|
|
3472
|
-
SetFinalizationStatus(status, std::move(message_slice));
|
|
3473
|
-
set_completed();
|
|
3474
|
-
ResetDeadline();
|
|
3475
|
-
PropagateCancellationToChildren();
|
|
3476
|
-
}
|
|
3477
|
-
|
|
3478
|
-
grpc_call_error ValidateServerBatch(const grpc_op* ops, size_t nops) {
|
|
3479
|
-
BitSet<8> got_ops;
|
|
3480
|
-
for (size_t op_idx = 0; op_idx < nops; op_idx++) {
|
|
3481
|
-
const grpc_op& op = ops[op_idx];
|
|
3482
|
-
switch (op.op) {
|
|
3483
|
-
case GRPC_OP_SEND_INITIAL_METADATA:
|
|
3484
|
-
if (!AreInitialMetadataFlagsValid(op.flags)) {
|
|
3485
|
-
return GRPC_CALL_ERROR_INVALID_FLAGS;
|
|
3486
|
-
}
|
|
3487
|
-
if (!ValidateMetadata(op.data.send_initial_metadata.count,
|
|
3488
|
-
op.data.send_initial_metadata.metadata)) {
|
|
3489
|
-
return GRPC_CALL_ERROR_INVALID_METADATA;
|
|
3490
|
-
}
|
|
3491
|
-
break;
|
|
3492
|
-
case GRPC_OP_SEND_MESSAGE:
|
|
3493
|
-
if (!AreWriteFlagsValid(op.flags)) {
|
|
3494
|
-
return GRPC_CALL_ERROR_INVALID_FLAGS;
|
|
3495
|
-
}
|
|
3496
|
-
break;
|
|
3497
|
-
case GRPC_OP_SEND_STATUS_FROM_SERVER:
|
|
3498
|
-
if (op.flags != 0) return GRPC_CALL_ERROR_INVALID_FLAGS;
|
|
3499
|
-
if (!ValidateMetadata(
|
|
3500
|
-
op.data.send_status_from_server.trailing_metadata_count,
|
|
3501
|
-
op.data.send_status_from_server.trailing_metadata)) {
|
|
3502
|
-
return GRPC_CALL_ERROR_INVALID_METADATA;
|
|
3503
|
-
}
|
|
3504
|
-
break;
|
|
3505
|
-
case GRPC_OP_RECV_MESSAGE:
|
|
3506
|
-
case GRPC_OP_RECV_CLOSE_ON_SERVER:
|
|
3507
|
-
if (op.flags != 0) return GRPC_CALL_ERROR_INVALID_FLAGS;
|
|
3508
|
-
break;
|
|
3509
|
-
case GRPC_OP_RECV_INITIAL_METADATA:
|
|
3510
|
-
case GRPC_OP_SEND_CLOSE_FROM_CLIENT:
|
|
3511
|
-
case GRPC_OP_RECV_STATUS_ON_CLIENT:
|
|
3512
|
-
return GRPC_CALL_ERROR_NOT_ON_SERVER;
|
|
3513
|
-
}
|
|
3514
|
-
if (got_ops.is_set(op.op)) return GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
|
|
3515
|
-
got_ops.set(op.op);
|
|
3516
|
-
}
|
|
3517
|
-
return GRPC_CALL_OK;
|
|
3518
|
-
}
|
|
3519
|
-
|
|
3520
|
-
void ServerPromiseBasedCall::CommitBatch(const grpc_op* ops, size_t nops,
|
|
3521
|
-
const Completion& completion) {
|
|
3522
|
-
Party::BulkSpawner spawner(this);
|
|
3523
|
-
for (size_t op_idx = 0; op_idx < nops; op_idx++) {
|
|
3524
|
-
const grpc_op& op = ops[op_idx];
|
|
3525
|
-
switch (op.op) {
|
|
3526
|
-
case GRPC_OP_SEND_INITIAL_METADATA: {
|
|
3527
|
-
auto metadata = arena()->MakePooled<ServerMetadata>();
|
|
3528
|
-
PrepareOutgoingInitialMetadata(op, *metadata);
|
|
3529
|
-
CToMetadata(op.data.send_initial_metadata.metadata,
|
|
3530
|
-
op.data.send_initial_metadata.count, metadata.get());
|
|
3531
|
-
if (grpc_call_trace.enabled()) {
|
|
3532
|
-
gpr_log(GPR_INFO, "%s[call] Send initial metadata",
|
|
3533
|
-
DebugTag().c_str());
|
|
3534
|
-
}
|
|
3535
|
-
QueueSend();
|
|
3536
|
-
spawner.Spawn(
|
|
3537
|
-
"call_send_initial_metadata",
|
|
3538
|
-
[this, metadata = std::move(metadata)]() mutable {
|
|
3539
|
-
EnactSend();
|
|
3540
|
-
return server_initial_metadata_->Push(std::move(metadata));
|
|
3541
|
-
},
|
|
3542
|
-
[this,
|
|
3543
|
-
completion = AddOpToCompletion(
|
|
3544
|
-
completion, PendingOp::kSendInitialMetadata)](bool r) mutable {
|
|
3545
|
-
if (!r) {
|
|
3546
|
-
set_failed_before_recv_message();
|
|
3547
|
-
FailCompletion(completion);
|
|
3548
|
-
}
|
|
3549
|
-
FinishOpOnCompletion(&completion,
|
|
3550
|
-
PendingOp::kSendInitialMetadata);
|
|
3551
|
-
});
|
|
3552
|
-
} break;
|
|
3553
|
-
case GRPC_OP_SEND_MESSAGE:
|
|
3554
|
-
StartSendMessage(op, completion, server_to_client_messages_, spawner);
|
|
3555
|
-
break;
|
|
3556
|
-
case GRPC_OP_RECV_MESSAGE:
|
|
3557
|
-
if (cancelled_.load(std::memory_order_relaxed)) {
|
|
3558
|
-
set_failed_before_recv_message();
|
|
3559
|
-
FailCompletion(completion);
|
|
3560
|
-
break;
|
|
3561
|
-
}
|
|
3562
|
-
StartRecvMessage(
|
|
3563
|
-
op, completion, []() { return []() { return Empty{}; }; },
|
|
3564
|
-
client_to_server_messages_, true, spawner);
|
|
3565
|
-
break;
|
|
3566
|
-
case GRPC_OP_SEND_STATUS_FROM_SERVER: {
|
|
3567
|
-
auto metadata = arena()->MakePooled<ServerMetadata>();
|
|
3568
|
-
CToMetadata(op.data.send_status_from_server.trailing_metadata,
|
|
3569
|
-
op.data.send_status_from_server.trailing_metadata_count,
|
|
3570
|
-
metadata.get());
|
|
3571
|
-
metadata->Set(GrpcStatusMetadata(),
|
|
3572
|
-
op.data.send_status_from_server.status);
|
|
3573
|
-
if (auto* details = op.data.send_status_from_server.status_details) {
|
|
3574
|
-
// TODO(ctiller): this should not be a copy, but we have callers that
|
|
3575
|
-
// allocate and pass in a slice created with
|
|
3576
|
-
// grpc_slice_from_static_string and then delete the string after
|
|
3577
|
-
// passing it in, which shouldn't be a supported API.
|
|
3578
|
-
metadata->Set(GrpcMessageMetadata(),
|
|
3579
|
-
Slice(grpc_slice_copy(*details)));
|
|
3580
|
-
}
|
|
3581
|
-
spawner.Spawn(
|
|
3582
|
-
"call_send_status_from_server",
|
|
3583
|
-
[this, metadata = std::move(metadata)]() mutable {
|
|
3584
|
-
bool r = true;
|
|
3585
|
-
if (send_trailing_metadata_.is_set()) {
|
|
3586
|
-
r = false;
|
|
3587
|
-
} else {
|
|
3588
|
-
send_trailing_metadata_.Set(std::move(metadata));
|
|
3589
|
-
}
|
|
3590
|
-
return Map(WaitForSendingStarted(), [this, r](Empty) {
|
|
3591
|
-
server_initial_metadata_->Close();
|
|
3592
|
-
server_to_client_messages_->Close();
|
|
3593
|
-
return r;
|
|
3594
|
-
});
|
|
3595
|
-
},
|
|
3596
|
-
[this, completion = AddOpToCompletion(
|
|
3597
|
-
completion, PendingOp::kSendStatusFromServer)](
|
|
3598
|
-
bool ok) mutable {
|
|
3599
|
-
if (!ok) {
|
|
3600
|
-
set_failed_before_recv_message();
|
|
3601
|
-
FailCompletion(completion);
|
|
3602
|
-
}
|
|
3603
|
-
FinishOpOnCompletion(&completion,
|
|
3604
|
-
PendingOp::kSendStatusFromServer);
|
|
3605
|
-
});
|
|
3606
|
-
} break;
|
|
3607
|
-
case GRPC_OP_RECV_CLOSE_ON_SERVER:
|
|
3608
|
-
if (grpc_call_trace.enabled()) {
|
|
3609
|
-
gpr_log(GPR_INFO, "%s[call] StartBatch: RecvClose %s",
|
|
3610
|
-
DebugTag().c_str(),
|
|
3611
|
-
recv_close_op_cancel_state_.ToString().c_str());
|
|
3612
|
-
}
|
|
3613
|
-
ForceCompletionSuccess(completion);
|
|
3614
|
-
recv_close_completion_ =
|
|
3615
|
-
AddOpToCompletion(completion, PendingOp::kReceiveCloseOnServer);
|
|
3616
|
-
if (recv_close_op_cancel_state_.ReceiveCloseOnServerOpStarted(
|
|
3617
|
-
op.data.recv_close_on_server.cancelled)) {
|
|
3618
|
-
FinishOpOnCompletion(&recv_close_completion_,
|
|
3619
|
-
PendingOp::kReceiveCloseOnServer);
|
|
3620
|
-
}
|
|
3621
|
-
break;
|
|
3622
|
-
case GRPC_OP_RECV_STATUS_ON_CLIENT:
|
|
3623
|
-
case GRPC_OP_SEND_CLOSE_FROM_CLIENT:
|
|
3624
|
-
case GRPC_OP_RECV_INITIAL_METADATA:
|
|
3625
|
-
abort(); // unreachable
|
|
3626
|
-
}
|
|
3627
|
-
}
|
|
3628
|
-
}
|
|
3629
|
-
|
|
3630
|
-
grpc_call_error ServerPromiseBasedCall::StartBatch(const grpc_op* ops,
|
|
3631
|
-
size_t nops,
|
|
3632
|
-
void* notify_tag,
|
|
3633
|
-
bool is_notify_tag_closure) {
|
|
3634
|
-
if (nops == 0) {
|
|
3635
|
-
EndOpImmediately(cq(), notify_tag, is_notify_tag_closure);
|
|
3636
|
-
return GRPC_CALL_OK;
|
|
3637
|
-
}
|
|
3638
|
-
const grpc_call_error validation_result = ValidateServerBatch(ops, nops);
|
|
3639
|
-
if (validation_result != GRPC_CALL_OK) {
|
|
3640
|
-
return validation_result;
|
|
3641
|
-
}
|
|
3642
|
-
Completion completion =
|
|
3643
|
-
StartCompletion(notify_tag, is_notify_tag_closure, ops);
|
|
3644
|
-
CommitBatch(ops, nops, completion);
|
|
3645
|
-
FinishOpOnCompletion(&completion, PendingOp::kStartingBatch);
|
|
3646
|
-
return GRPC_CALL_OK;
|
|
3647
|
-
}
|
|
3648
|
-
|
|
3649
|
-
void ServerPromiseBasedCall::CancelWithError(absl::Status error) {
|
|
3650
|
-
cancelled_.store(true, std::memory_order_relaxed);
|
|
3651
|
-
Spawn(
|
|
3652
|
-
"cancel_with_error",
|
|
3653
|
-
[this, error = std::move(error)]() {
|
|
3654
|
-
if (!send_trailing_metadata_.is_set()) {
|
|
3655
|
-
auto md = ServerMetadataFromStatus(error);
|
|
3656
|
-
md->Set(GrpcCallWasCancelled(), true);
|
|
3657
|
-
send_trailing_metadata_.Set(std::move(md));
|
|
3658
|
-
}
|
|
3659
|
-
if (server_to_client_messages_ != nullptr) {
|
|
3660
|
-
server_to_client_messages_->Close();
|
|
3661
|
-
}
|
|
3662
|
-
if (server_initial_metadata_ != nullptr) {
|
|
3663
|
-
server_initial_metadata_->Close();
|
|
3664
|
-
}
|
|
3665
|
-
return Empty{};
|
|
3666
|
-
},
|
|
3667
|
-
[](Empty) {});
|
|
3668
|
-
}
|
|
3669
|
-
#endif
|
|
3670
|
-
|
|
3671
|
-
#ifdef GRPC_EXPERIMENT_IS_INCLUDED_PROMISE_BASED_SERVER_CALL
|
|
3672
|
-
void ServerPromiseBasedCall::PublishInitialMetadata(
|
|
3673
|
-
ClientMetadataHandle metadata,
|
|
3674
|
-
grpc_metadata_array* publish_initial_metadata) {
|
|
3675
|
-
if (grpc_call_trace.enabled()) {
|
|
3676
|
-
gpr_log(GPR_INFO, "%s[call] PublishInitialMetadata: %s", DebugTag().c_str(),
|
|
3677
|
-
metadata->DebugString().c_str());
|
|
3678
|
-
}
|
|
3679
|
-
PublishMetadataArray(metadata.get(), publish_initial_metadata, false);
|
|
3680
|
-
client_initial_metadata_ = std::move(metadata);
|
|
3681
|
-
}
|
|
3682
|
-
|
|
3683
|
-
ArenaPromise<ServerMetadataHandle>
|
|
3684
|
-
ServerPromiseBasedCall::MakeTopOfServerCallPromise(
|
|
3685
|
-
CallArgs call_args, grpc_completion_queue* cq,
|
|
3686
|
-
absl::FunctionRef<void(grpc_call* call)> publish) {
|
|
3687
|
-
SetCompletionQueue(cq);
|
|
3688
|
-
call_args.polling_entity->Set(
|
|
3689
|
-
grpc_polling_entity_create_from_pollset(grpc_cq_pollset(cq)));
|
|
3690
|
-
server_to_client_messages_ = call_args.server_to_client_messages;
|
|
3691
|
-
client_to_server_messages_ = call_args.client_to_server_messages;
|
|
3692
|
-
server_initial_metadata_ = call_args.server_initial_metadata;
|
|
3693
|
-
set_send_deadline(deadline());
|
|
3694
|
-
ProcessIncomingInitialMetadata(*client_initial_metadata_);
|
|
3695
|
-
ExternalRef();
|
|
3696
|
-
publish(c_ptr());
|
|
3697
|
-
return Seq(server_to_client_messages_->AwaitClosed(),
|
|
3698
|
-
send_trailing_metadata_.Wait());
|
|
3699
|
-
}
|
|
3700
|
-
|
|
3701
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
3702
|
-
// CallSpine based Server Call
|
|
3703
|
-
|
|
3704
|
-
class ServerCallSpine final : public CallSpineInterface,
|
|
3705
|
-
public ServerCallContext,
|
|
3706
|
-
public BasicPromiseBasedCall {
|
|
3707
|
-
public:
|
|
3708
|
-
ServerCallSpine(ServerInterface* server, Channel* channel, Arena* arena);
|
|
3709
|
-
|
|
3710
|
-
// CallSpineInterface
|
|
3711
|
-
Pipe<ClientMetadataHandle>& client_initial_metadata() override {
|
|
3712
|
-
return client_initial_metadata_;
|
|
3713
|
-
}
|
|
3714
|
-
Pipe<ServerMetadataHandle>& server_initial_metadata() override {
|
|
3715
|
-
return server_initial_metadata_;
|
|
3716
|
-
}
|
|
3717
|
-
Pipe<MessageHandle>& client_to_server_messages() override {
|
|
3718
|
-
return client_to_server_messages_;
|
|
3719
|
-
}
|
|
3720
|
-
Pipe<MessageHandle>& server_to_client_messages() override {
|
|
3721
|
-
return server_to_client_messages_;
|
|
3722
|
-
}
|
|
3723
|
-
Pipe<ServerMetadataHandle>& server_trailing_metadata() override {
|
|
3724
|
-
return server_trailing_metadata_;
|
|
3725
|
-
}
|
|
3726
|
-
Latch<ServerMetadataHandle>& cancel_latch() override { return cancel_latch_; }
|
|
3727
|
-
Party& party() override { return *this; }
|
|
3728
|
-
Arena* arena() override { return BasicPromiseBasedCall::arena(); }
|
|
3729
|
-
void IncrementRefCount() override { InternalRef("CallSpine"); }
|
|
3730
|
-
void Unref() override { InternalUnref("CallSpine"); }
|
|
3731
|
-
|
|
3732
|
-
// PromiseBasedCall
|
|
3733
|
-
void OrphanCall() override {
|
|
3734
|
-
ResetDeadline();
|
|
3735
|
-
CancelWithError(absl::CancelledError());
|
|
3736
|
-
}
|
|
3737
|
-
void CancelWithError(grpc_error_handle error) override {
|
|
3738
|
-
SpawnInfallible("CancelWithError", [this, error = std::move(error)] {
|
|
3739
|
-
std::ignore = Cancel(ServerMetadataFromStatus(error));
|
|
3740
|
-
return Empty{};
|
|
3741
|
-
});
|
|
3742
|
-
}
|
|
3743
|
-
bool is_trailers_only() const override {
|
|
3744
|
-
Crash("is_trailers_only not implemented for server calls");
|
|
3745
|
-
}
|
|
3746
|
-
absl::string_view GetServerAuthority() const override {
|
|
3747
|
-
Crash("unimplemented");
|
|
3748
|
-
}
|
|
3749
|
-
grpc_call_error StartBatch(const grpc_op* ops, size_t nops, void* notify_tag,
|
|
3750
|
-
bool is_notify_tag_closure) override;
|
|
3751
|
-
|
|
3752
|
-
bool Completed() final { Crash("unimplemented"); }
|
|
3753
|
-
bool failed_before_recv_message() const final { Crash("unimplemented"); }
|
|
3754
|
-
|
|
3755
|
-
ServerCallContext* server_call_context() override { return this; }
|
|
3756
|
-
const void* server_stream_data() override { Crash("unimplemented"); }
|
|
3757
|
-
void PublishInitialMetadata(
|
|
3758
|
-
ClientMetadataHandle metadata,
|
|
3759
|
-
grpc_metadata_array* publish_initial_metadata) override;
|
|
3760
|
-
ArenaPromise<ServerMetadataHandle> MakeTopOfServerCallPromise(
|
|
3761
|
-
CallArgs, grpc_completion_queue*,
|
|
3762
|
-
absl::FunctionRef<void(grpc_call* call)>) override {
|
|
3763
|
-
Crash("unimplemented");
|
|
3764
|
-
}
|
|
3765
|
-
|
|
3766
|
-
bool RunParty() override {
|
|
3767
|
-
ScopedContext ctx(this);
|
|
3768
|
-
return Party::RunParty();
|
|
3769
|
-
}
|
|
3770
|
-
|
|
3771
|
-
private:
|
|
3772
|
-
void CommitBatch(const grpc_op* ops, size_t nops, void* notify_tag,
|
|
3773
|
-
bool is_notify_tag_closure);
|
|
3774
|
-
StatusFlag FinishRecvMessage(NextResult<MessageHandle> result);
|
|
3775
|
-
|
|
3776
|
-
std::string DebugTag() const override {
|
|
3777
|
-
return absl::StrFormat("SERVER_CALL_SPINE[%p]: ", this);
|
|
3778
|
-
}
|
|
3779
|
-
|
|
3780
|
-
// Initial metadata from client to server
|
|
3781
|
-
Pipe<ClientMetadataHandle> client_initial_metadata_;
|
|
3782
|
-
// Initial metadata from server to client
|
|
3783
|
-
Pipe<ServerMetadataHandle> server_initial_metadata_;
|
|
3784
|
-
// Messages travelling from the application to the transport.
|
|
3785
|
-
Pipe<MessageHandle> client_to_server_messages_;
|
|
3786
|
-
// Messages travelling from the transport to the application.
|
|
3787
|
-
Pipe<MessageHandle> server_to_client_messages_;
|
|
3788
|
-
// Trailing metadata from server to client
|
|
3789
|
-
Pipe<ServerMetadataHandle> server_trailing_metadata_;
|
|
3790
|
-
// Latch that can be set to terminate the call
|
|
3791
|
-
Latch<ServerMetadataHandle> cancel_latch_;
|
|
3792
|
-
grpc_byte_buffer** recv_message_ = nullptr;
|
|
3793
|
-
ClientMetadataHandle client_initial_metadata_stored_;
|
|
3794
|
-
};
|
|
3795
|
-
|
|
3796
|
-
ServerCallSpine::ServerCallSpine(ServerInterface* server, Channel* channel,
|
|
3797
|
-
Arena* arena)
|
|
3798
|
-
: BasicPromiseBasedCall(arena, 0, 1,
|
|
3799
|
-
[channel, server]() -> grpc_call_create_args {
|
|
3800
|
-
grpc_call_create_args args;
|
|
3801
|
-
args.channel = channel->Ref();
|
|
3802
|
-
args.server = server;
|
|
3803
|
-
args.parent = nullptr;
|
|
3804
|
-
args.propagation_mask = 0;
|
|
3805
|
-
args.cq = nullptr;
|
|
3806
|
-
args.pollset_set_alternative = nullptr;
|
|
3807
|
-
args.server_transport_data =
|
|
3808
|
-
&args; // Arbitrary non-null pointer
|
|
3809
|
-
args.send_deadline = Timestamp::InfFuture();
|
|
3810
|
-
return args;
|
|
3811
|
-
}()),
|
|
3812
|
-
client_initial_metadata_(arena),
|
|
3813
|
-
server_initial_metadata_(arena),
|
|
3814
|
-
client_to_server_messages_(arena),
|
|
3815
|
-
server_to_client_messages_(arena),
|
|
3816
|
-
server_trailing_metadata_(arena) {
|
|
3817
|
-
global_stats().IncrementServerCallsCreated();
|
|
3818
|
-
ScopedContext ctx(this);
|
|
3819
|
-
channel->channel_stack()->InitServerCallSpine(this);
|
|
3820
|
-
}
|
|
3821
|
-
|
|
3822
|
-
void ServerCallSpine::PublishInitialMetadata(
|
|
3823
|
-
ClientMetadataHandle metadata,
|
|
3824
|
-
grpc_metadata_array* publish_initial_metadata) {
|
|
3825
|
-
if (grpc_call_trace.enabled()) {
|
|
3826
|
-
gpr_log(GPR_INFO, "%s[call] PublishInitialMetadata: %s", DebugTag().c_str(),
|
|
3827
|
-
metadata->DebugString().c_str());
|
|
3828
|
-
}
|
|
3829
|
-
PublishMetadataArray(metadata.get(), publish_initial_metadata, false);
|
|
3830
|
-
client_initial_metadata_stored_ = std::move(metadata);
|
|
3831
|
-
}
|
|
3832
|
-
|
|
3833
|
-
grpc_call_error ServerCallSpine::StartBatch(const grpc_op* ops, size_t nops,
|
|
3834
|
-
void* notify_tag,
|
|
3835
|
-
bool is_notify_tag_closure) {
|
|
3836
|
-
if (nops == 0) {
|
|
3837
|
-
EndOpImmediately(cq(), notify_tag, is_notify_tag_closure);
|
|
3838
|
-
return GRPC_CALL_OK;
|
|
3839
|
-
}
|
|
3840
|
-
const grpc_call_error validation_result = ValidateServerBatch(ops, nops);
|
|
3841
|
-
if (validation_result != GRPC_CALL_OK) {
|
|
3842
|
-
return validation_result;
|
|
3843
|
-
}
|
|
3844
|
-
CommitBatch(ops, nops, notify_tag, is_notify_tag_closure);
|
|
3845
|
-
return GRPC_CALL_OK;
|
|
3846
|
-
}
|
|
3847
|
-
|
|
3848
|
-
namespace {
|
|
3849
|
-
template <typename SetupFn>
|
|
3850
|
-
class MaybeOpImpl {
|
|
3851
|
-
public:
|
|
3852
|
-
using SetupResult = decltype(std::declval<SetupFn>()(grpc_op()));
|
|
3853
|
-
using PromiseFactory = promise_detail::OncePromiseFactory<void, SetupResult>;
|
|
3854
|
-
using Promise = typename PromiseFactory::Promise;
|
|
3855
|
-
struct Dismissed {};
|
|
3856
|
-
using State = absl::variant<Dismissed, PromiseFactory, Promise>;
|
|
3857
|
-
|
|
3858
|
-
// op_ is garbage but shouldn't be uninitialized
|
|
3859
|
-
MaybeOpImpl() : state_(Dismissed{}), op_(GRPC_OP_RECV_STATUS_ON_CLIENT) {}
|
|
3860
|
-
MaybeOpImpl(SetupResult result, grpc_op_type op)
|
|
3861
|
-
: state_(PromiseFactory(std::move(result))), op_(op) {}
|
|
3862
|
-
|
|
3863
|
-
MaybeOpImpl(const MaybeOpImpl&) = delete;
|
|
3864
|
-
MaybeOpImpl& operator=(const MaybeOpImpl&) = delete;
|
|
3865
|
-
MaybeOpImpl(MaybeOpImpl&& other) noexcept
|
|
3866
|
-
: state_(MoveState(other.state_)), op_(other.op_) {}
|
|
3867
|
-
MaybeOpImpl& operator=(MaybeOpImpl&& other) noexcept {
|
|
3868
|
-
op_ = other.op_;
|
|
3869
|
-
if (absl::holds_alternative<Dismissed>(state_)) {
|
|
3870
|
-
state_.template emplace<Dismissed>();
|
|
3871
|
-
return *this;
|
|
3872
|
-
}
|
|
3873
|
-
// Can't move after first poll => Promise is not an option
|
|
3874
|
-
state_.template emplace<PromiseFactory>(
|
|
3875
|
-
std::move(absl::get<PromiseFactory>(other.state_)));
|
|
3876
|
-
return *this;
|
|
3877
|
-
}
|
|
3878
|
-
|
|
3879
|
-
Poll<StatusFlag> operator()() {
|
|
3880
|
-
if (absl::holds_alternative<Dismissed>(state_)) return Success{};
|
|
3881
|
-
if (absl::holds_alternative<PromiseFactory>(state_)) {
|
|
3882
|
-
auto& factory = absl::get<PromiseFactory>(state_);
|
|
3883
|
-
auto promise = factory.Make();
|
|
3884
|
-
state_.template emplace<Promise>(std::move(promise));
|
|
3885
|
-
}
|
|
3886
|
-
if (grpc_call_trace.enabled()) {
|
|
3887
|
-
gpr_log(GPR_INFO, "%sBeginPoll %s",
|
|
3888
|
-
Activity::current()->DebugTag().c_str(), OpName(op_).c_str());
|
|
3889
|
-
}
|
|
3890
|
-
auto& promise = absl::get<Promise>(state_);
|
|
3891
|
-
auto r = poll_cast<StatusFlag>(promise());
|
|
3892
|
-
if (grpc_call_trace.enabled()) {
|
|
3893
|
-
gpr_log(GPR_INFO, "%sEndPoll %s --> %s",
|
|
3894
|
-
Activity::current()->DebugTag().c_str(), OpName(op_).c_str(),
|
|
3895
|
-
r.pending() ? "PENDING" : (r.value().ok() ? "OK" : "FAILURE"));
|
|
3896
|
-
}
|
|
3897
|
-
return r;
|
|
3898
|
-
}
|
|
3899
|
-
|
|
3900
|
-
private:
|
|
3901
|
-
GPR_NO_UNIQUE_ADDRESS State state_;
|
|
3902
|
-
GPR_NO_UNIQUE_ADDRESS grpc_op_type op_;
|
|
3903
|
-
|
|
3904
|
-
static std::string OpName(grpc_op_type op) {
|
|
3905
|
-
switch (op) {
|
|
3906
|
-
case GRPC_OP_SEND_INITIAL_METADATA:
|
|
3907
|
-
return "SendInitialMetadata";
|
|
3908
|
-
case GRPC_OP_SEND_MESSAGE:
|
|
3909
|
-
return "SendMessage";
|
|
3910
|
-
case GRPC_OP_SEND_STATUS_FROM_SERVER:
|
|
3911
|
-
return "SendStatusFromServer";
|
|
3912
|
-
case GRPC_OP_SEND_CLOSE_FROM_CLIENT:
|
|
3913
|
-
return "SendCloseFromClient";
|
|
3914
|
-
case GRPC_OP_RECV_MESSAGE:
|
|
3915
|
-
return "RecvMessage";
|
|
3916
|
-
case GRPC_OP_RECV_CLOSE_ON_SERVER:
|
|
3917
|
-
return "RecvCloseOnServer";
|
|
3918
|
-
case GRPC_OP_RECV_INITIAL_METADATA:
|
|
3919
|
-
return "RecvInitialMetadata";
|
|
3920
|
-
case GRPC_OP_RECV_STATUS_ON_CLIENT:
|
|
3921
|
-
return "RecvStatusOnClient";
|
|
3922
|
-
}
|
|
3923
|
-
return absl::StrCat("UnknownOp(", op, ")");
|
|
3924
|
-
}
|
|
3925
|
-
|
|
3926
|
-
static State MoveState(State& state) {
|
|
3927
|
-
if (absl::holds_alternative<Dismissed>(state)) return Dismissed{};
|
|
3928
|
-
// Can't move after first poll => Promise is not an option
|
|
3929
|
-
return std::move(absl::get<PromiseFactory>(state));
|
|
3930
|
-
}
|
|
3931
|
-
};
|
|
3932
|
-
|
|
3933
|
-
// MaybeOp captures a fairly complicated dance we need to do for the batch API.
|
|
3934
|
-
// We first check if an op is included or not, and if it is, we run the setup
|
|
3935
|
-
// function in the context of the API call (NOT in the call party).
|
|
3936
|
-
// This setup function returns a promise factory which we'll then run *in* the
|
|
3937
|
-
// party to do initial setup, and have it return the promise that we'll
|
|
3938
|
-
// ultimately poll on til completion.
|
|
3939
|
-
// Once we express our surface API in terms of core internal types this whole
|
|
3940
|
-
// dance will go away.
|
|
3941
|
-
template <typename SetupFn>
|
|
3942
|
-
auto MaybeOp(const grpc_op* ops, uint8_t idx, SetupFn setup) {
|
|
3943
|
-
if (idx == 255) {
|
|
3944
|
-
return MaybeOpImpl<SetupFn>();
|
|
3945
|
-
} else {
|
|
3946
|
-
return MaybeOpImpl<SetupFn>(setup(ops[idx]), ops[idx].op);
|
|
3947
|
-
}
|
|
3948
|
-
}
|
|
3949
|
-
|
|
3950
|
-
template <typename F>
|
|
3951
|
-
class PollBatchLogger {
|
|
3952
|
-
public:
|
|
3953
|
-
PollBatchLogger(void* tag, F f) : tag_(tag), f_(std::move(f)) {}
|
|
3954
|
-
|
|
3955
|
-
auto operator()() {
|
|
3956
|
-
if (grpc_call_trace.enabled()) {
|
|
3957
|
-
gpr_log(GPR_INFO, "Poll batch %p", tag_);
|
|
3958
|
-
}
|
|
3959
|
-
auto r = f_();
|
|
3960
|
-
if (grpc_call_trace.enabled()) {
|
|
3961
|
-
gpr_log(GPR_INFO, "Poll batch %p --> %s", tag_, ResultString(r).c_str());
|
|
3962
|
-
}
|
|
3963
|
-
return r;
|
|
3964
|
-
}
|
|
3965
|
-
|
|
3966
|
-
private:
|
|
3967
|
-
template <typename T>
|
|
3968
|
-
static std::string ResultString(Poll<T> r) {
|
|
3969
|
-
if (r.pending()) return "PENDING";
|
|
3970
|
-
return ResultString(r.value());
|
|
3971
|
-
}
|
|
3972
|
-
static std::string ResultString(Empty) { return "DONE"; }
|
|
3973
|
-
|
|
3974
|
-
void* tag_;
|
|
3975
|
-
F f_;
|
|
3976
|
-
};
|
|
3977
|
-
|
|
3978
|
-
template <typename F>
|
|
3979
|
-
PollBatchLogger<F> LogPollBatch(void* tag, F f) {
|
|
3980
|
-
return PollBatchLogger<F>(tag, std::move(f));
|
|
3981
|
-
}
|
|
3982
|
-
} // namespace
|
|
3983
|
-
|
|
3984
|
-
StatusFlag ServerCallSpine::FinishRecvMessage(
|
|
3985
|
-
NextResult<MessageHandle> result) {
|
|
3986
|
-
if (result.has_value()) {
|
|
3987
|
-
MessageHandle& message = *result;
|
|
3988
|
-
NoteLastMessageFlags(message->flags());
|
|
3989
|
-
if ((message->flags() & GRPC_WRITE_INTERNAL_COMPRESS) &&
|
|
3990
|
-
(incoming_compression_algorithm() != GRPC_COMPRESS_NONE)) {
|
|
3991
|
-
*recv_message_ = grpc_raw_compressed_byte_buffer_create(
|
|
3992
|
-
nullptr, 0, incoming_compression_algorithm());
|
|
3993
|
-
} else {
|
|
3994
|
-
*recv_message_ = grpc_raw_byte_buffer_create(nullptr, 0);
|
|
3995
|
-
}
|
|
3996
|
-
grpc_slice_buffer_move_into(message->payload()->c_slice_buffer(),
|
|
3997
|
-
&(*recv_message_)->data.raw.slice_buffer);
|
|
3998
|
-
if (grpc_call_trace.enabled()) {
|
|
3999
|
-
gpr_log(GPR_INFO,
|
|
4000
|
-
"%s[call] RecvMessage: outstanding_recv "
|
|
4001
|
-
"finishes: received %" PRIdPTR " byte message",
|
|
4002
|
-
DebugTag().c_str(),
|
|
4003
|
-
(*recv_message_)->data.raw.slice_buffer.length);
|
|
4004
|
-
}
|
|
4005
|
-
recv_message_ = nullptr;
|
|
4006
|
-
return Success{};
|
|
4007
|
-
}
|
|
4008
|
-
if (result.cancelled()) {
|
|
4009
|
-
if (grpc_call_trace.enabled()) {
|
|
4010
|
-
gpr_log(GPR_INFO,
|
|
4011
|
-
"%s[call] RecvMessage: outstanding_recv "
|
|
4012
|
-
"finishes: received end-of-stream with error",
|
|
4013
|
-
DebugTag().c_str());
|
|
4014
|
-
}
|
|
4015
|
-
*recv_message_ = nullptr;
|
|
4016
|
-
recv_message_ = nullptr;
|
|
4017
|
-
return Failure{};
|
|
4018
|
-
}
|
|
4019
|
-
if (grpc_call_trace.enabled()) {
|
|
4020
|
-
gpr_log(GPR_INFO,
|
|
4021
|
-
"%s[call] RecvMessage: outstanding_recv "
|
|
4022
|
-
"finishes: received end-of-stream",
|
|
4023
|
-
DebugTag().c_str());
|
|
4024
|
-
}
|
|
4025
|
-
*recv_message_ = nullptr;
|
|
4026
|
-
recv_message_ = nullptr;
|
|
4027
|
-
return Success{};
|
|
4028
|
-
}
|
|
4029
|
-
|
|
4030
|
-
void ServerCallSpine::CommitBatch(const grpc_op* ops, size_t nops,
|
|
4031
|
-
void* notify_tag,
|
|
4032
|
-
bool is_notify_tag_closure) {
|
|
4033
|
-
std::array<uint8_t, 8> got_ops{255, 255, 255, 255, 255, 255, 255, 255};
|
|
4034
|
-
for (size_t op_idx = 0; op_idx < nops; op_idx++) {
|
|
4035
|
-
const grpc_op& op = ops[op_idx];
|
|
4036
|
-
got_ops[op.op] = op_idx;
|
|
4037
|
-
}
|
|
4038
|
-
if (!is_notify_tag_closure) grpc_cq_begin_op(cq(), notify_tag);
|
|
4039
|
-
auto send_initial_metadata = MaybeOp(
|
|
4040
|
-
ops, got_ops[GRPC_OP_SEND_INITIAL_METADATA], [this](const grpc_op& op) {
|
|
4041
|
-
auto metadata = arena()->MakePooled<ServerMetadata>();
|
|
4042
|
-
PrepareOutgoingInitialMetadata(op, *metadata);
|
|
4043
|
-
CToMetadata(op.data.send_initial_metadata.metadata,
|
|
4044
|
-
op.data.send_initial_metadata.count, metadata.get());
|
|
4045
|
-
if (grpc_call_trace.enabled()) {
|
|
4046
|
-
gpr_log(GPR_INFO, "%s[call] Send initial metadata",
|
|
4047
|
-
DebugTag().c_str());
|
|
4048
|
-
}
|
|
4049
|
-
return [this, metadata = std::move(metadata)]() mutable {
|
|
4050
|
-
return Map(server_initial_metadata_.sender.Push(std::move(metadata)),
|
|
4051
|
-
[this](bool r) {
|
|
4052
|
-
server_initial_metadata_.sender.Close();
|
|
4053
|
-
return StatusFlag(r);
|
|
4054
|
-
});
|
|
4055
|
-
};
|
|
4056
|
-
});
|
|
4057
|
-
auto send_message =
|
|
4058
|
-
MaybeOp(ops, got_ops[GRPC_OP_SEND_MESSAGE], [this](const grpc_op& op) {
|
|
4059
|
-
SliceBuffer send;
|
|
4060
|
-
grpc_slice_buffer_swap(
|
|
4061
|
-
&op.data.send_message.send_message->data.raw.slice_buffer,
|
|
4062
|
-
send.c_slice_buffer());
|
|
4063
|
-
auto msg = arena()->MakePooled<Message>(std::move(send), op.flags);
|
|
4064
|
-
return [this, msg = std::move(msg)]() mutable {
|
|
4065
|
-
return Map(server_to_client_messages_.sender.Push(std::move(msg)),
|
|
4066
|
-
[](bool r) { return StatusFlag(r); });
|
|
4067
|
-
};
|
|
4068
|
-
});
|
|
4069
|
-
auto send_trailing_metadata = MaybeOp(
|
|
4070
|
-
ops, got_ops[GRPC_OP_SEND_STATUS_FROM_SERVER], [this](const grpc_op& op) {
|
|
4071
|
-
auto metadata = arena()->MakePooled<ServerMetadata>();
|
|
4072
|
-
CToMetadata(op.data.send_status_from_server.trailing_metadata,
|
|
4073
|
-
op.data.send_status_from_server.trailing_metadata_count,
|
|
4074
|
-
metadata.get());
|
|
4075
|
-
metadata->Set(GrpcStatusMetadata(),
|
|
4076
|
-
op.data.send_status_from_server.status);
|
|
4077
|
-
if (auto* details = op.data.send_status_from_server.status_details) {
|
|
4078
|
-
// TODO(ctiller): this should not be a copy, but we have
|
|
4079
|
-
// callers that allocate and pass in a slice created with
|
|
4080
|
-
// grpc_slice_from_static_string and then delete the string
|
|
4081
|
-
// after passing it in, which shouldn't be a supported API.
|
|
4082
|
-
metadata->Set(GrpcMessageMetadata(),
|
|
4083
|
-
Slice(grpc_slice_copy(*details)));
|
|
4084
|
-
}
|
|
4085
|
-
return [this, metadata = std::move(metadata)]() mutable {
|
|
4086
|
-
server_to_client_messages_.sender.Close();
|
|
4087
|
-
return Map(server_trailing_metadata_.sender.Push(std::move(metadata)),
|
|
4088
|
-
[](bool r) { return StatusFlag(r); });
|
|
4089
|
-
};
|
|
4090
|
-
});
|
|
4091
|
-
auto recv_message =
|
|
4092
|
-
MaybeOp(ops, got_ops[GRPC_OP_RECV_MESSAGE], [this](const grpc_op& op) {
|
|
4093
|
-
GPR_ASSERT(recv_message_ == nullptr);
|
|
4094
|
-
recv_message_ = op.data.recv_message.recv_message;
|
|
4095
|
-
return [this]() mutable {
|
|
4096
|
-
return Map(client_to_server_messages_.receiver.Next(),
|
|
4097
|
-
[this](NextResult<MessageHandle> msg) {
|
|
4098
|
-
return FinishRecvMessage(std::move(msg));
|
|
4099
|
-
});
|
|
4100
|
-
};
|
|
4101
|
-
});
|
|
4102
|
-
auto primary_ops = AllOk<StatusFlag>(
|
|
4103
|
-
std::move(send_initial_metadata), std::move(send_message),
|
|
4104
|
-
std::move(send_trailing_metadata), std::move(recv_message));
|
|
4105
|
-
if (got_ops[GRPC_OP_RECV_CLOSE_ON_SERVER] != 255) {
|
|
4106
|
-
auto recv_trailing_metadata = MaybeOp(
|
|
4107
|
-
ops, got_ops[GRPC_OP_RECV_CLOSE_ON_SERVER], [this](const grpc_op& op) {
|
|
4108
|
-
return [this, cancelled = op.data.recv_close_on_server.cancelled]() {
|
|
4109
|
-
return Map(server_trailing_metadata_.receiver.AwaitClosed(),
|
|
4110
|
-
[cancelled, this](bool result) -> Success {
|
|
4111
|
-
ResetDeadline();
|
|
4112
|
-
*cancelled = result ? 1 : 0;
|
|
4113
|
-
return Success{};
|
|
4114
|
-
});
|
|
4115
|
-
};
|
|
4116
|
-
});
|
|
4117
|
-
SpawnInfallible(
|
|
4118
|
-
"final-batch",
|
|
4119
|
-
[primary_ops = std::move(primary_ops),
|
|
4120
|
-
recv_trailing_metadata = std::move(recv_trailing_metadata),
|
|
4121
|
-
is_notify_tag_closure, notify_tag, this]() mutable {
|
|
4122
|
-
return LogPollBatch(
|
|
4123
|
-
notify_tag,
|
|
4124
|
-
Seq(std::move(primary_ops), std::move(recv_trailing_metadata),
|
|
4125
|
-
[is_notify_tag_closure, notify_tag, this](StatusFlag) {
|
|
4126
|
-
return WaitForCqEndOp(is_notify_tag_closure, notify_tag,
|
|
4127
|
-
absl::OkStatus(), cq());
|
|
4128
|
-
}));
|
|
4129
|
-
});
|
|
4130
|
-
} else {
|
|
4131
|
-
SpawnInfallible("batch", [primary_ops = std::move(primary_ops),
|
|
4132
|
-
is_notify_tag_closure, notify_tag,
|
|
4133
|
-
this]() mutable {
|
|
4134
|
-
return LogPollBatch(
|
|
4135
|
-
notify_tag,
|
|
4136
|
-
Seq(std::move(primary_ops),
|
|
4137
|
-
[is_notify_tag_closure, notify_tag, this](StatusFlag r) {
|
|
4138
|
-
return WaitForCqEndOp(is_notify_tag_closure, notify_tag,
|
|
4139
|
-
StatusCast<grpc_error_handle>(r), cq());
|
|
4140
|
-
}));
|
|
4141
|
-
});
|
|
4142
|
-
}
|
|
4143
|
-
}
|
|
4144
|
-
|
|
4145
|
-
RefCountedPtr<CallSpineInterface> MakeServerCall(ServerInterface* server,
|
|
4146
|
-
Channel* channel,
|
|
4147
|
-
Arena* arena) {
|
|
4148
|
-
return RefCountedPtr<ServerCallSpine>(
|
|
4149
|
-
arena->New<ServerCallSpine>(server, channel, arena));
|
|
4150
|
-
}
|
|
4151
|
-
#else
|
|
4152
|
-
RefCountedPtr<CallSpineInterface> MakeServerCall(ServerInterface*, Channel*,
|
|
4153
|
-
Arena*) {
|
|
4154
|
-
Crash("not implemented");
|
|
4155
|
-
}
|
|
4156
|
-
#endif
|
|
4157
|
-
|
|
4158
|
-
} // namespace grpc_core
|
|
4159
|
-
|
|
4160
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
4161
|
-
// C-based API
|
|
4162
|
-
|
|
4163
|
-
void* grpc_call_arena_alloc(grpc_call* call, size_t size) {
|
|
4164
|
-
grpc_core::ExecCtx exec_ctx;
|
|
4165
|
-
return grpc_core::Call::FromC(call)->arena()->Alloc(size);
|
|
4166
|
-
}
|
|
4167
|
-
|
|
4168
|
-
size_t grpc_call_get_initial_size_estimate() {
|
|
4169
|
-
return grpc_core::FilterStackCall::InitialSizeEstimate();
|
|
4170
|
-
}
|
|
4171
|
-
|
|
4172
|
-
grpc_error_handle grpc_call_create(grpc_call_create_args* args,
|
|
4173
|
-
grpc_call** out_call) {
|
|
4174
|
-
#ifdef GRPC_EXPERIMENT_IS_INCLUDED_PROMISE_BASED_CLIENT_CALL
|
|
4175
|
-
if (grpc_core::IsPromiseBasedClientCallEnabled() &&
|
|
4176
|
-
args->server_transport_data == nullptr && args->channel->is_promising()) {
|
|
4177
|
-
return grpc_core::MakePromiseBasedCall<grpc_core::ClientPromiseBasedCall>(
|
|
4178
|
-
args, out_call);
|
|
4179
|
-
}
|
|
4180
|
-
#endif
|
|
4181
|
-
#ifdef GRPC_EXPERIMENT_IS_INCLUDED_PROMISE_BASED_SERVER_CALL
|
|
4182
|
-
if (grpc_core::IsPromiseBasedServerCallEnabled() &&
|
|
4183
|
-
args->server_transport_data != nullptr && args->channel->is_promising()) {
|
|
4184
|
-
return grpc_core::MakePromiseBasedCall<grpc_core::ServerPromiseBasedCall>(
|
|
4185
|
-
args, out_call);
|
|
4186
|
-
}
|
|
4187
|
-
#endif
|
|
4188
|
-
return grpc_core::FilterStackCall::Create(args, out_call);
|
|
4189
|
-
}
|
|
4190
|
-
|
|
4191
|
-
void grpc_call_set_completion_queue(grpc_call* call,
|
|
4192
|
-
grpc_completion_queue* cq) {
|
|
4193
|
-
grpc_core::Call::FromC(call)->SetCompletionQueue(cq);
|
|
4194
|
-
}
|
|
4195
|
-
|
|
4196
|
-
void grpc_call_ref(grpc_call* c) { grpc_core::Call::FromC(c)->ExternalRef(); }
|
|
4197
|
-
|
|
4198
|
-
void grpc_call_unref(grpc_call* c) {
|
|
4199
|
-
grpc_core::ExecCtx exec_ctx;
|
|
4200
|
-
grpc_core::Call::FromC(c)->ExternalUnref();
|
|
4201
|
-
}
|
|
4202
|
-
|
|
4203
|
-
char* grpc_call_get_peer(grpc_call* call) {
|
|
4204
|
-
return grpc_core::Call::FromC(call)->GetPeer();
|
|
4205
|
-
}
|
|
4206
|
-
|
|
4207
|
-
grpc_call* grpc_call_from_top_element(grpc_call_element* surface_element) {
|
|
4208
|
-
return grpc_core::FilterStackCall::FromTopElem(surface_element)->c_ptr();
|
|
4209
|
-
}
|
|
4210
|
-
|
|
4211
|
-
grpc_call_error grpc_call_cancel(grpc_call* call, void* reserved) {
|
|
4212
|
-
GRPC_API_TRACE("grpc_call_cancel(call=%p, reserved=%p)", 2, (call, reserved));
|
|
4213
|
-
GPR_ASSERT(reserved == nullptr);
|
|
4214
|
-
if (call == nullptr) {
|
|
4215
|
-
return GRPC_CALL_ERROR;
|
|
4216
|
-
}
|
|
4217
|
-
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
|
|
4218
|
-
grpc_core::ExecCtx exec_ctx;
|
|
4219
|
-
grpc_core::Call::FromC(call)->CancelWithError(absl::CancelledError());
|
|
4220
|
-
return GRPC_CALL_OK;
|
|
4221
|
-
}
|
|
4222
|
-
|
|
4223
|
-
grpc_call_error grpc_call_cancel_with_status(grpc_call* c,
|
|
4224
|
-
grpc_status_code status,
|
|
4225
|
-
const char* description,
|
|
4226
|
-
void* reserved) {
|
|
4227
|
-
GRPC_API_TRACE(
|
|
4228
|
-
"grpc_call_cancel_with_status("
|
|
4229
|
-
"c=%p, status=%d, description=%s, reserved=%p)",
|
|
4230
|
-
4, (c, (int)status, description, reserved));
|
|
4231
|
-
GPR_ASSERT(reserved == nullptr);
|
|
4232
|
-
if (c == nullptr) {
|
|
4233
|
-
return GRPC_CALL_ERROR;
|
|
4234
|
-
}
|
|
4235
|
-
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
|
|
4236
|
-
grpc_core::ExecCtx exec_ctx;
|
|
4237
|
-
grpc_core::Call::FromC(c)->CancelWithStatus(status, description);
|
|
4238
|
-
return GRPC_CALL_OK;
|
|
4239
|
-
}
|
|
4240
|
-
|
|
4241
|
-
void grpc_call_cancel_internal(grpc_call* call) {
|
|
4242
|
-
grpc_core::Call::FromC(call)->CancelWithError(absl::CancelledError());
|
|
4243
|
-
}
|
|
4244
|
-
|
|
4245
|
-
grpc_compression_algorithm grpc_call_test_only_get_compression_algorithm(
|
|
4246
|
-
grpc_call* call) {
|
|
4247
|
-
return grpc_core::Call::FromC(call)->test_only_compression_algorithm();
|
|
4248
|
-
}
|
|
4249
|
-
|
|
4250
|
-
uint32_t grpc_call_test_only_get_message_flags(grpc_call* call) {
|
|
4251
|
-
return grpc_core::Call::FromC(call)->test_only_message_flags();
|
|
4252
|
-
}
|
|
4253
|
-
|
|
4254
|
-
uint32_t grpc_call_test_only_get_encodings_accepted_by_peer(grpc_call* call) {
|
|
4255
|
-
return grpc_core::Call::FromC(call)
|
|
4256
|
-
->encodings_accepted_by_peer()
|
|
4257
|
-
.ToLegacyBitmask();
|
|
4258
|
-
}
|
|
4259
|
-
|
|
4260
|
-
grpc_core::Arena* grpc_call_get_arena(grpc_call* call) {
|
|
4261
|
-
return grpc_core::Call::FromC(call)->arena();
|
|
4262
|
-
}
|
|
4263
|
-
|
|
4264
|
-
grpc_call_stack* grpc_call_get_call_stack(grpc_call* call) {
|
|
4265
|
-
return grpc_core::Call::FromC(call)->call_stack();
|
|
4266
|
-
}
|
|
4267
|
-
|
|
4268
|
-
grpc_call_error grpc_call_start_batch(grpc_call* call, const grpc_op* ops,
|
|
4269
|
-
size_t nops, void* tag, void* reserved) {
|
|
4270
|
-
GRPC_API_TRACE(
|
|
4271
|
-
"grpc_call_start_batch(call=%p, ops=%p, nops=%lu, tag=%p, "
|
|
4272
|
-
"reserved=%p)",
|
|
4273
|
-
5, (call, ops, (unsigned long)nops, tag, reserved));
|
|
4274
|
-
|
|
4275
|
-
if (reserved != nullptr || call == nullptr) {
|
|
4276
|
-
return GRPC_CALL_ERROR;
|
|
4277
|
-
} else {
|
|
4278
|
-
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
|
|
4279
|
-
grpc_core::ExecCtx exec_ctx;
|
|
4280
|
-
return grpc_core::Call::FromC(call)->StartBatch(ops, nops, tag, false);
|
|
4281
|
-
}
|
|
4282
|
-
}
|
|
4283
|
-
|
|
4284
|
-
grpc_call_error grpc_call_start_batch_and_execute(grpc_call* call,
|
|
4285
|
-
const grpc_op* ops,
|
|
4286
|
-
size_t nops,
|
|
4287
|
-
grpc_closure* closure) {
|
|
4288
|
-
return grpc_core::Call::FromC(call)->StartBatch(ops, nops, closure, true);
|
|
490
|
+
void grpc_call_tracer_set(grpc_call* call,
|
|
491
|
+
grpc_core::ClientCallTracer* tracer) {
|
|
492
|
+
grpc_core::Arena* arena = grpc_call_get_arena(call);
|
|
493
|
+
return arena->SetContext<grpc_core::CallTracerAnnotationInterface>(tracer);
|
|
4289
494
|
}
|
|
4290
495
|
|
|
4291
|
-
void
|
|
4292
|
-
|
|
4293
|
-
|
|
496
|
+
void grpc_call_tracer_set_and_manage(grpc_call* call,
|
|
497
|
+
grpc_core::ClientCallTracer* tracer) {
|
|
498
|
+
grpc_core::Arena* arena = grpc_call_get_arena(call);
|
|
499
|
+
arena->ManagedNew<ClientCallTracerWrapper>(tracer);
|
|
500
|
+
return arena->SetContext<grpc_core::CallTracerAnnotationInterface>(tracer);
|
|
4294
501
|
}
|
|
4295
502
|
|
|
4296
|
-
void*
|
|
4297
|
-
|
|
503
|
+
void* grpc_call_tracer_get(grpc_call* call) {
|
|
504
|
+
grpc_core::Arena* arena = grpc_call_get_arena(call);
|
|
505
|
+
auto* call_tracer =
|
|
506
|
+
arena->GetContext<grpc_core::CallTracerAnnotationInterface>();
|
|
507
|
+
return call_tracer;
|
|
4298
508
|
}
|
|
4299
509
|
|
|
4300
510
|
uint8_t grpc_call_is_client(grpc_call* call) {
|
|
@@ -4360,5 +570,8 @@ const char* grpc_call_error_to_string(grpc_call_error error) {
|
|
|
4360
570
|
|
|
4361
571
|
void grpc_call_run_in_event_engine(const grpc_call* call,
|
|
4362
572
|
absl::AnyInvocable<void()> cb) {
|
|
4363
|
-
grpc_core::Call::FromC(call)
|
|
573
|
+
grpc_core::Call::FromC(call)
|
|
574
|
+
->arena()
|
|
575
|
+
->GetContext<grpc_event_engine::experimental::EventEngine>()
|
|
576
|
+
->Run(std::move(cb));
|
|
4364
577
|
}
|