grpc 1.52.0.pre2 → 1.53.0.pre2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Makefile +50 -5
- data/include/grpc/event_engine/event_engine.h +24 -2
- data/include/grpc/event_engine/slice_buffer.h +13 -1
- data/include/grpc/impl/grpc_types.h +3 -0
- data/include/grpc/support/time.h +6 -4
- data/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +148 -0
- data/src/core/ext/filters/backend_metrics/backend_metric_filter.h +52 -0
- data/src/core/ext/filters/backend_metrics/backend_metric_provider.h +29 -0
- data/src/core/ext/filters/channel_idle/channel_idle_filter.h +3 -3
- data/src/core/ext/filters/channel_idle/idle_filter_state.h +3 -3
- data/src/core/ext/filters/client_channel/backend_metric.h +3 -3
- data/src/core/ext/filters/client_channel/backup_poller.h +3 -3
- data/src/core/ext/filters/client_channel/channel_connectivity.cc +1 -1
- data/src/core/ext/filters/client_channel/client_channel.cc +29 -33
- data/src/core/ext/filters/client_channel/client_channel.h +3 -3
- data/src/core/ext/filters/client_channel/client_channel_channelz.h +3 -3
- data/src/core/ext/filters/client_channel/client_channel_factory.h +3 -3
- data/src/core/ext/filters/client_channel/client_channel_service_config.h +3 -3
- data/src/core/ext/filters/client_channel/config_selector.h +3 -3
- data/src/core/ext/filters/client_channel/connector.h +8 -4
- data/src/core/ext/filters/client_channel/dynamic_filters.h +3 -3
- data/src/core/ext/filters/client_channel/global_subchannel_pool.h +3 -3
- data/src/core/ext/filters/client_channel/health/health_check_client.h +3 -3
- data/src/core/ext/filters/client_channel/http_proxy.h +3 -3
- data/src/core/ext/filters/client_channel/lb_call_state_internal.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +14 -7
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +1 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc +1 -78
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric_internal.h +117 -0
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +1 -0
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/static_stride_scheduler.cc +128 -0
- data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/static_stride_scheduler.h +71 -0
- data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/weighted_round_robin.cc +972 -0
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +3 -6
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_attributes.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h +3 -3
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +12 -7
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_override_host.cc +275 -107
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_override_host.h +10 -3
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_wrr_locality.cc +5 -0
- data/src/core/ext/filters/client_channel/local_subchannel_pool.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +6 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +1 -2
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +1 -0
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.h +3 -3
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +3 -7
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h +3 -3
- data/src/core/ext/filters/client_channel/retry_filter.cc +10 -13
- data/src/core/ext/filters/client_channel/retry_filter.h +3 -3
- data/src/core/ext/filters/client_channel/retry_service_config.h +3 -3
- data/src/core/ext/filters/client_channel/retry_throttle.h +3 -3
- data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +4 -4
- data/src/core/ext/filters/client_channel/subchannel.cc +5 -1
- data/src/core/ext/filters/client_channel/subchannel.h +3 -3
- data/src/core/ext/filters/client_channel/subchannel_interface_internal.h +3 -3
- data/src/core/ext/filters/client_channel/subchannel_pool_interface.h +3 -3
- data/src/core/ext/filters/client_channel/subchannel_stream_client.h +3 -3
- data/src/core/ext/filters/deadline/deadline_filter.cc +40 -48
- data/src/core/ext/filters/deadline/deadline_filter.h +6 -10
- data/src/core/ext/filters/fault_injection/fault_injection_filter.h +3 -3
- data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.h +3 -3
- data/src/core/ext/filters/http/client/http_client_filter.cc +26 -21
- data/src/core/ext/filters/http/client/http_client_filter.h +3 -3
- data/src/core/ext/filters/http/client_authority_filter.h +3 -3
- data/src/core/ext/filters/http/message_compress/compression_filter.cc +109 -117
- data/src/core/ext/filters/http/message_compress/compression_filter.h +17 -10
- data/src/core/ext/filters/http/server/http_server_filter.cc +25 -24
- data/src/core/ext/filters/http/server/http_server_filter.h +3 -3
- data/src/core/ext/filters/message_size/message_size_filter.cc +2 -1
- data/src/core/ext/filters/message_size/message_size_filter.h +3 -3
- data/src/core/ext/filters/rbac/rbac_filter.cc +4 -3
- data/src/core/ext/filters/rbac/rbac_filter.h +3 -3
- data/src/core/ext/filters/rbac/rbac_service_config_parser.h +3 -3
- data/src/core/ext/filters/server_config_selector/server_config_selector.h +3 -3
- data/src/core/ext/filters/server_config_selector/server_config_selector_filter.h +3 -3
- data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +27 -37
- data/src/core/ext/filters/stateful_session/stateful_session_filter.h +5 -5
- data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h +3 -3
- data/src/core/ext/transport/chttp2/alpn/alpn.h +3 -3
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +2 -7
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +3 -3
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +1 -0
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +3 -3
- data/src/core/ext/transport/chttp2/transport/bin_decoder.h +3 -3
- data/src/core/ext/transport/chttp2/transport/bin_encoder.h +3 -3
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +195 -111
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +3 -3
- data/src/core/ext/transport/chttp2/transport/context_list.h +3 -3
- data/src/core/ext/transport/chttp2/transport/decode_huff.h +3 -3
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/flow_control.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_data.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_goaway.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/frame_ping.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/frame_settings.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_window_update.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_constants.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +18 -407
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +1 -0
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +3 -3
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +3 -3
- data/src/core/ext/transport/chttp2/transport/http_trace.h +3 -3
- data/src/core/ext/transport/chttp2/transport/huffsyms.h +3 -3
- data/src/core/ext/transport/chttp2/transport/internal.h +28 -23
- data/src/core/ext/transport/chttp2/transport/parsing.cc +111 -31
- data/src/core/ext/transport/chttp2/transport/stream_map.h +3 -3
- data/src/core/ext/transport/chttp2/transport/varint.h +3 -3
- data/src/core/ext/transport/chttp2/transport/writing.cc +9 -8
- data/src/core/ext/transport/inproc/inproc_transport.h +3 -3
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c +3 -2
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h +9 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.c +38 -2
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.h +185 -0
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +7 -3
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +44 -0
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +16 -25
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +48 -74
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +30 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +137 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +15 -12
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +83 -51
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +3 -2
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +15 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +17 -2
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +61 -0
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +11 -5
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +37 -6
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +5 -3
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +24 -0
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +5 -3
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +22 -0
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +6 -3
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +24 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +24 -5
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +50 -0
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +57 -16
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +254 -17
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c +3 -2
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h +9 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.c +3 -2
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.h +9 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c +7 -6
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h +21 -12
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +6 -3
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +23 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +10 -7
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +42 -12
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.c +54 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3/client_side_weighted_round_robin.upb.h +188 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.c +111 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +444 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.c +7 -3
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h +24 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +8 -6
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +31 -9
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +5 -3
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +24 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.c +47 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/filter_state.upb.h +113 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.c +43 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/status_code_input.upb.h +114 -0
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h +3 -1
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c +54 -53
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.c +34 -13
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +195 -187
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +232 -224
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +0 -5
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c +95 -75
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +94 -93
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +81 -75
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +189 -187
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c +7 -3
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +71 -66
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +137 -133
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c +16 -12
- data/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c +140 -133
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +81 -70
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +771 -741
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c +16 -14
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opentelemetry.upbdefs.c +14 -13
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c +20 -18
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c +53 -42
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +363 -356
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +149 -145
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c +16 -13
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/filter_state.upbdefs.c +48 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/filter_state.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +14 -14
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/status_code_input.upbdefs.c +40 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/status_code_input.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c +10 -9
- data/src/core/ext/xds/certificate_provider_store.h +3 -3
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +1 -0
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +3 -3
- data/src/core/ext/xds/upb_utils.h +3 -3
- data/src/core/ext/xds/xds_api.h +3 -3
- data/src/core/ext/xds/xds_bootstrap.h +3 -3
- data/src/core/ext/xds/xds_bootstrap_grpc.cc +1 -0
- data/src/core/ext/xds/xds_bootstrap_grpc.h +3 -3
- data/src/core/ext/xds/xds_certificate_provider.h +3 -3
- data/src/core/ext/xds/xds_channel_args.h +3 -3
- data/src/core/ext/xds/xds_channel_stack_modifier.h +3 -3
- data/src/core/ext/xds/xds_client.cc +8 -3
- data/src/core/ext/xds/xds_client.h +3 -3
- data/src/core/ext/xds/xds_client_grpc.cc +0 -1
- data/src/core/ext/xds/xds_client_grpc.h +3 -3
- data/src/core/ext/xds/xds_client_stats.h +4 -3
- data/src/core/ext/xds/xds_cluster.cc +11 -7
- data/src/core/ext/xds/xds_cluster.h +6 -6
- data/src/core/ext/xds/xds_cluster_specifier_plugin.h +3 -3
- data/src/core/ext/xds/xds_common_types.cc +1 -0
- data/src/core/ext/xds/xds_common_types.h +3 -3
- data/src/core/ext/xds/xds_endpoint.cc +1 -1
- data/src/core/ext/xds/xds_endpoint.h +3 -3
- data/src/core/ext/xds/xds_health_status.h +30 -3
- data/src/core/ext/xds/xds_http_fault_filter.h +3 -3
- data/src/core/ext/xds/xds_http_filters.cc +1 -1
- data/src/core/ext/xds/xds_http_filters.h +3 -3
- data/src/core/ext/xds/xds_http_rbac_filter.h +3 -3
- data/src/core/ext/xds/xds_http_stateful_session_filter.h +3 -3
- data/src/core/ext/xds/xds_lb_policy_registry.cc +95 -0
- data/src/core/ext/xds/xds_lb_policy_registry.h +3 -3
- data/src/core/ext/xds/xds_listener.cc +1 -0
- data/src/core/ext/xds/xds_listener.h +3 -3
- data/src/core/ext/xds/xds_resource_type.h +3 -3
- data/src/core/ext/xds/xds_resource_type_impl.h +3 -3
- data/src/core/ext/xds/xds_route_config.cc +6 -0
- data/src/core/ext/xds/xds_route_config.h +3 -3
- data/src/core/ext/xds/xds_routing.h +3 -3
- data/src/core/ext/xds/xds_transport.h +3 -3
- data/src/core/ext/xds/xds_transport_grpc.h +3 -3
- data/src/core/lib/address_utils/parse_address.h +3 -3
- data/src/core/lib/address_utils/sockaddr_utils.cc +1 -0
- data/src/core/lib/address_utils/sockaddr_utils.h +3 -3
- data/src/core/lib/avl/avl.h +3 -3
- data/src/core/lib/backoff/backoff.h +3 -3
- data/src/core/lib/channel/call_finalization.h +3 -3
- data/src/core/lib/channel/call_tracer.h +3 -3
- data/src/core/lib/channel/channel_args.cc +1 -0
- data/src/core/lib/channel/channel_args.h +11 -5
- data/src/core/lib/channel/channel_args_preconditioning.h +3 -3
- data/src/core/lib/channel/channel_fwd.h +3 -3
- data/src/core/lib/channel/channel_stack.cc +1 -2
- data/src/core/lib/channel/channel_stack.h +4 -4
- data/src/core/lib/channel/channel_stack_builder.h +3 -3
- data/src/core/lib/channel/channel_stack_builder_impl.cc +14 -1
- data/src/core/lib/channel/channel_stack_builder_impl.h +3 -3
- data/src/core/lib/channel/channel_trace.h +3 -3
- data/src/core/lib/channel/channelz.h +3 -3
- data/src/core/lib/channel/channelz_registry.h +3 -3
- data/src/core/lib/channel/connected_channel.cc +883 -354
- data/src/core/lib/channel/connected_channel.h +3 -3
- data/src/core/lib/channel/context.h +7 -3
- data/src/core/lib/channel/promise_based_filter.cc +532 -260
- data/src/core/lib/channel/promise_based_filter.h +124 -44
- data/src/core/lib/channel/status_util.h +3 -3
- data/src/core/lib/compression/compression_internal.h +3 -3
- data/src/core/lib/compression/message_compress.h +3 -3
- data/src/core/lib/config/core_configuration.h +3 -3
- data/src/core/lib/debug/event_log.h +3 -3
- data/src/core/lib/debug/histogram_view.h +3 -3
- data/src/core/lib/debug/stats.h +3 -3
- data/src/core/lib/debug/stats_data.cc +66 -65
- data/src/core/lib/debug/stats_data.h +42 -33
- data/src/core/lib/debug/trace.h +4 -26
- data/src/core/lib/event_engine/channel_args_endpoint_config.cc +5 -0
- data/src/core/lib/event_engine/channel_args_endpoint_config.h +3 -3
- data/src/core/lib/event_engine/common_closures.h +3 -3
- data/src/core/lib/event_engine/default_event_engine.cc +9 -4
- data/src/core/lib/event_engine/default_event_engine.h +30 -6
- data/src/core/lib/event_engine/default_event_engine_factory.h +3 -3
- data/src/core/lib/event_engine/event_engine.cc +25 -0
- data/src/core/lib/event_engine/executor/executor.h +3 -3
- data/src/core/lib/event_engine/forkable.cc +11 -6
- data/src/core/lib/event_engine/forkable.h +3 -3
- data/src/core/lib/event_engine/handle_containers.h +10 -3
- data/src/core/lib/event_engine/poller.h +3 -3
- data/src/core/lib/event_engine/posix.h +158 -0
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +44 -16
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h +14 -4
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +6 -7
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.h +3 -3
- data/src/core/lib/event_engine/posix_engine/event_poller.h +3 -3
- data/src/core/lib/event_engine/posix_engine/event_poller_posix_default.h +3 -3
- data/src/core/lib/event_engine/posix_engine/internal_errqueue.h +3 -3
- data/src/core/lib/event_engine/posix_engine/lockfree_event.h +3 -3
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +52 -55
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +46 -13
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +82 -12
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +23 -9
- data/src/core/lib/event_engine/posix_engine/posix_engine_closure.h +3 -3
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +60 -7
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.h +65 -14
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +0 -1
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.h +6 -6
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +3 -3
- data/src/core/lib/event_engine/posix_engine/timer.h +3 -3
- data/src/core/lib/event_engine/posix_engine/timer_heap.h +3 -3
- data/src/core/lib/event_engine/posix_engine/timer_manager.h +3 -3
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.h +3 -3
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.h +3 -3
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.h +3 -3
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix.h +3 -3
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.h +3 -3
- data/src/core/lib/event_engine/resolved_address.cc +19 -0
- data/src/core/lib/event_engine/resolved_address_internal.h +34 -0
- data/src/core/lib/event_engine/shim.cc +56 -0
- data/src/core/lib/event_engine/shim.h +33 -0
- data/src/core/lib/event_engine/slice.cc +1 -1
- data/src/core/lib/event_engine/tcp_socket_utils.cc +18 -2
- data/src/core/lib/event_engine/tcp_socket_utils.h +8 -3
- data/src/core/lib/event_engine/thread_local.cc +29 -0
- data/src/core/lib/event_engine/thread_local.h +32 -0
- data/src/core/lib/event_engine/thread_pool.cc +41 -65
- data/src/core/lib/event_engine/thread_pool.h +21 -17
- data/src/core/lib/event_engine/time_util.h +3 -3
- data/src/core/lib/event_engine/trace.cc +6 -0
- data/src/core/lib/event_engine/trace.h +16 -3
- data/src/core/lib/event_engine/utils.cc +2 -2
- data/src/core/lib/event_engine/utils.h +12 -4
- data/src/core/lib/event_engine/windows/iocp.cc +24 -40
- data/src/core/lib/event_engine/windows/iocp.h +3 -3
- data/src/core/lib/event_engine/windows/win_socket.cc +56 -33
- data/src/core/lib/event_engine/windows/win_socket.h +34 -25
- data/src/core/lib/event_engine/windows/windows_endpoint.cc +331 -0
- data/src/core/lib/event_engine/windows/windows_endpoint.h +103 -0
- data/src/core/lib/event_engine/windows/windows_engine.cc +243 -20
- data/src/core/lib/event_engine/windows/windows_engine.h +62 -23
- data/src/core/lib/experiments/config.cc +16 -1
- data/src/core/lib/experiments/config.h +13 -3
- data/src/core/lib/experiments/experiments.cc +14 -8
- data/src/core/lib/experiments/experiments.h +80 -21
- data/src/core/lib/gpr/alloc.h +3 -3
- data/src/core/lib/gpr/spinlock.h +3 -3
- data/src/core/lib/gpr/string.h +3 -3
- data/src/core/lib/gpr/sync_abseil.cc +15 -7
- data/src/core/lib/gpr/time_precise.h +3 -3
- data/src/core/lib/gpr/tmpfile.h +3 -3
- data/src/core/lib/gpr/useful.h +3 -3
- data/src/core/lib/gprpp/atomic_utils.h +3 -3
- data/src/core/lib/gprpp/bitset.h +3 -3
- data/src/core/lib/gprpp/chunked_vector.h +3 -3
- data/src/core/lib/gprpp/construct_destruct.h +3 -3
- data/src/core/lib/gprpp/cpp_impl_of.h +3 -3
- data/src/core/lib/gprpp/crash.h +3 -3
- data/src/core/lib/gprpp/debug_location.h +3 -6
- data/src/core/lib/gprpp/dual_ref_counted.h +3 -3
- data/src/core/lib/gprpp/env.h +3 -3
- data/src/core/lib/gprpp/examine_stack.h +3 -3
- data/src/core/lib/gprpp/fork.cc +21 -4
- data/src/core/lib/gprpp/fork.h +7 -5
- data/src/core/lib/gprpp/global_config.h +3 -3
- data/src/core/lib/gprpp/global_config_custom.h +3 -3
- data/src/core/lib/gprpp/global_config_env.cc +1 -0
- data/src/core/lib/gprpp/global_config_env.h +3 -3
- data/src/core/lib/gprpp/global_config_generic.h +3 -3
- data/src/core/lib/gprpp/host_port.cc +2 -0
- data/src/core/lib/gprpp/host_port.h +3 -3
- data/src/core/lib/gprpp/load_file.h +3 -3
- data/src/core/lib/gprpp/manual_constructor.h +3 -3
- data/src/core/lib/gprpp/match.h +3 -3
- data/src/core/lib/gprpp/memory.h +3 -3
- data/src/core/lib/gprpp/mpscq.h +3 -3
- data/src/core/lib/gprpp/no_destruct.h +3 -3
- data/src/core/lib/gprpp/notification.h +3 -3
- data/src/core/lib/gprpp/orphanable.h +3 -3
- data/src/core/lib/gprpp/overload.h +3 -3
- data/src/core/lib/gprpp/packed_table.h +3 -3
- data/src/core/lib/gprpp/per_cpu.h +3 -3
- data/src/core/lib/gprpp/ref_counted.h +3 -3
- data/src/core/lib/gprpp/ref_counted_ptr.h +3 -3
- data/src/core/lib/gprpp/single_set_ptr.h +3 -3
- data/src/core/lib/gprpp/sorted_pack.h +3 -3
- data/src/core/lib/gprpp/stat.h +3 -3
- data/src/core/lib/gprpp/status_helper.h +3 -3
- data/src/core/lib/gprpp/strerror.cc +2 -0
- data/src/core/lib/gprpp/strerror.h +3 -3
- data/src/core/lib/gprpp/sync.h +3 -3
- data/src/core/lib/gprpp/table.h +3 -3
- data/src/core/lib/gprpp/tchar.h +3 -3
- data/src/core/lib/gprpp/thd.h +3 -3
- data/src/core/lib/gprpp/time.cc +1 -0
- data/src/core/lib/gprpp/time.h +3 -3
- data/src/core/lib/gprpp/time_averaged_stats.h +3 -3
- data/src/core/lib/gprpp/time_util.h +3 -3
- data/src/core/lib/gprpp/unique_type_name.h +3 -3
- data/src/core/lib/gprpp/validation_errors.h +3 -3
- data/src/core/lib/gprpp/work_serializer.h +3 -3
- data/src/core/lib/handshaker/proxy_mapper.h +3 -3
- data/src/core/lib/handshaker/proxy_mapper_registry.h +3 -3
- data/src/core/lib/http/format_request.cc +1 -0
- data/src/core/lib/http/format_request.h +3 -3
- data/src/core/lib/http/httpcli.cc +1 -0
- data/src/core/lib/http/httpcli.h +3 -3
- data/src/core/lib/http/httpcli_ssl_credentials.h +3 -3
- data/src/core/lib/http/parser.h +3 -3
- data/src/core/lib/iomgr/block_annotate.h +3 -3
- data/src/core/lib/iomgr/buffer_list.h +3 -3
- data/src/core/lib/iomgr/call_combiner.cc +4 -4
- data/src/core/lib/iomgr/call_combiner.h +3 -3
- data/src/core/lib/iomgr/cfstream_handle.h +3 -3
- data/src/core/lib/iomgr/closure.cc +27 -0
- data/src/core/lib/iomgr/closure.h +5 -3
- data/src/core/lib/iomgr/combiner.h +3 -3
- data/src/core/lib/iomgr/dynamic_annotations.h +3 -3
- data/src/core/lib/iomgr/endpoint.h +3 -3
- data/src/core/lib/iomgr/endpoint_cfstream.h +3 -3
- data/src/core/lib/iomgr/endpoint_pair.h +3 -3
- data/src/core/lib/iomgr/endpoint_pair_windows.cc +10 -2
- data/src/core/lib/iomgr/error.h +3 -3
- data/src/core/lib/iomgr/error_cfstream.h +3 -3
- data/src/core/lib/iomgr/ev_apple.h +3 -3
- data/src/core/lib/iomgr/ev_epoll1_linux.h +3 -3
- data/src/core/lib/iomgr/ev_poll_posix.h +3 -3
- data/src/core/lib/iomgr/ev_posix.h +3 -3
- data/src/core/lib/iomgr/event_engine_shims/closure.cc +62 -0
- data/src/core/lib/iomgr/event_engine_shims/closure.h +39 -0
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +430 -0
- data/src/core/lib/iomgr/event_engine_shims/endpoint.h +43 -0
- data/src/core/lib/iomgr/event_engine_shims/tcp_client.cc +91 -0
- data/src/core/lib/iomgr/event_engine_shims/tcp_client.h +44 -0
- data/src/core/lib/iomgr/exec_ctx.h +3 -3
- data/src/core/lib/iomgr/executor.h +3 -3
- data/src/core/lib/iomgr/fork_posix.cc +5 -4
- data/src/core/lib/iomgr/gethostname.h +3 -3
- data/src/core/lib/iomgr/grpc_if_nametoindex.h +3 -3
- data/src/core/lib/iomgr/internal_errqueue.h +3 -3
- data/src/core/lib/iomgr/iocp_windows.h +3 -3
- data/src/core/lib/iomgr/iomgr.h +3 -3
- data/src/core/lib/iomgr/iomgr_fwd.h +3 -3
- data/src/core/lib/iomgr/iomgr_internal.h +3 -3
- data/src/core/lib/iomgr/load_file.h +3 -3
- data/src/core/lib/iomgr/lockfree_event.h +3 -3
- data/src/core/lib/iomgr/nameser.h +3 -3
- data/src/core/lib/iomgr/polling_entity.h +3 -3
- data/src/core/lib/iomgr/pollset.h +3 -3
- data/src/core/lib/iomgr/pollset_set.h +3 -3
- data/src/core/lib/iomgr/pollset_set_windows.h +3 -3
- data/src/core/lib/iomgr/pollset_windows.cc +2 -2
- data/src/core/lib/iomgr/pollset_windows.h +3 -3
- data/src/core/lib/iomgr/port.h +3 -3
- data/src/core/lib/iomgr/python_util.h +3 -3
- data/src/core/lib/iomgr/resolve_address.h +3 -3
- data/src/core/lib/iomgr/resolve_address_impl.h +3 -3
- data/src/core/lib/iomgr/resolve_address_posix.h +3 -3
- data/src/core/lib/iomgr/resolve_address_windows.h +3 -3
- data/src/core/lib/iomgr/resolved_address.h +3 -3
- data/src/core/lib/iomgr/sockaddr.h +3 -3
- data/src/core/lib/iomgr/sockaddr_posix.h +3 -3
- data/src/core/lib/iomgr/sockaddr_windows.h +3 -3
- data/src/core/lib/iomgr/socket_factory_posix.h +3 -3
- data/src/core/lib/iomgr/socket_mutator.h +3 -3
- data/src/core/lib/iomgr/socket_utils.h +3 -3
- data/src/core/lib/iomgr/socket_utils_posix.h +3 -3
- data/src/core/lib/iomgr/socket_windows.h +3 -3
- data/src/core/lib/iomgr/systemd_utils.cc +19 -19
- data/src/core/lib/iomgr/systemd_utils.h +24 -24
- data/src/core/lib/iomgr/tcp_client.h +3 -3
- data/src/core/lib/iomgr/tcp_client_posix.cc +12 -0
- data/src/core/lib/iomgr/tcp_client_posix.h +3 -3
- data/src/core/lib/iomgr/tcp_client_windows.cc +13 -1
- data/src/core/lib/iomgr/tcp_posix.cc +49 -65
- data/src/core/lib/iomgr/tcp_posix.h +3 -3
- data/src/core/lib/iomgr/tcp_server.h +3 -3
- data/src/core/lib/iomgr/tcp_server_posix.cc +219 -4
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +13 -3
- data/src/core/lib/iomgr/tcp_server_windows.cc +4 -6
- data/src/core/lib/iomgr/tcp_windows.h +3 -3
- data/src/core/lib/iomgr/timer.h +3 -3
- data/src/core/lib/iomgr/timer_generic.h +3 -3
- data/src/core/lib/iomgr/timer_heap.h +3 -3
- data/src/core/lib/iomgr/timer_manager.h +3 -3
- data/src/core/lib/iomgr/unix_sockets_posix.h +3 -3
- data/src/core/lib/iomgr/wakeup_fd_pipe.h +3 -3
- data/src/core/lib/iomgr/wakeup_fd_posix.h +3 -3
- data/src/core/lib/json/json.h +3 -3
- data/src/core/lib/json/json_args.h +3 -3
- data/src/core/lib/json/json_channel_args.h +3 -3
- data/src/core/lib/json/json_object_loader.h +3 -3
- data/src/core/lib/json/json_reader.cc +1 -0
- data/src/core/lib/json/json_util.h +3 -3
- data/src/core/lib/load_balancing/lb_policy.cc +9 -0
- data/src/core/lib/load_balancing/lb_policy.h +9 -5
- data/src/core/lib/load_balancing/lb_policy_factory.h +3 -3
- data/src/core/lib/load_balancing/lb_policy_registry.cc +1 -0
- data/src/core/lib/load_balancing/lb_policy_registry.h +3 -3
- data/src/core/lib/load_balancing/subchannel_interface.h +8 -6
- data/src/core/lib/matchers/matchers.cc +1 -0
- data/src/core/lib/matchers/matchers.h +3 -3
- data/src/core/lib/promise/activity.cc +8 -6
- data/src/core/lib/promise/activity.h +52 -66
- data/src/core/lib/promise/arena_promise.h +3 -3
- data/src/core/lib/promise/context.h +3 -3
- data/src/core/lib/promise/detail/basic_join.h +197 -0
- data/src/core/lib/promise/detail/basic_seq.h +10 -16
- data/src/core/lib/promise/detail/promise_factory.h +3 -3
- data/src/core/lib/promise/detail/promise_like.h +3 -3
- data/src/core/lib/promise/detail/status.h +3 -3
- data/src/core/lib/promise/detail/switch.h +3 -3
- data/src/core/lib/promise/exec_ctx_wakeup_scheduler.h +3 -3
- data/src/core/lib/promise/if.h +195 -0
- data/src/core/lib/promise/interceptor_list.h +308 -0
- data/src/core/lib/promise/intra_activity_waiter.h +9 -3
- data/src/core/lib/promise/latch.h +99 -5
- data/src/core/lib/promise/loop.h +4 -4
- data/src/core/lib/promise/map.h +4 -6
- data/src/core/lib/promise/pipe.h +296 -193
- data/src/core/lib/promise/poll.h +113 -14
- data/src/core/lib/promise/promise.h +4 -5
- data/src/core/lib/promise/race.h +6 -9
- data/src/core/lib/promise/seq.h +3 -3
- data/src/core/lib/promise/sleep.h +3 -3
- data/src/core/lib/promise/{pipe.cc → trace.cc} +3 -2
- data/src/core/lib/promise/trace.h +24 -0
- data/src/core/lib/promise/try_join.h +82 -0
- data/src/core/lib/promise/try_seq.h +3 -3
- data/src/core/lib/resolver/resolver.h +3 -3
- data/src/core/lib/resolver/resolver_factory.h +4 -4
- data/src/core/lib/resolver/resolver_registry.cc +15 -0
- data/src/core/lib/resolver/resolver_registry.h +3 -3
- data/src/core/lib/resolver/server_address.cc +1 -0
- data/src/core/lib/resolver/server_address.h +3 -3
- data/src/core/lib/resource_quota/api.h +3 -3
- data/src/core/lib/resource_quota/arena.cc +36 -9
- data/src/core/lib/resource_quota/arena.h +84 -22
- data/src/core/lib/resource_quota/memory_quota.h +3 -3
- data/src/core/lib/resource_quota/periodic_update.h +3 -3
- data/src/core/lib/resource_quota/resource_quota.h +3 -3
- data/src/core/lib/resource_quota/thread_quota.h +3 -3
- data/src/core/lib/resource_quota/trace.h +3 -3
- data/src/core/lib/security/authorization/authorization_engine.h +3 -3
- data/src/core/lib/security/authorization/authorization_policy_provider.h +3 -3
- data/src/core/lib/security/authorization/evaluate_args.h +3 -3
- data/src/core/lib/security/authorization/grpc_authorization_engine.h +3 -3
- data/src/core/lib/security/authorization/grpc_server_authz_filter.h +3 -3
- data/src/core/lib/security/authorization/matchers.h +3 -3
- data/src/core/lib/security/authorization/rbac_policy.cc +1 -0
- data/src/core/lib/security/authorization/rbac_policy.h +3 -3
- data/src/core/lib/security/certificate_provider/certificate_provider_factory.h +3 -3
- data/src/core/lib/security/certificate_provider/certificate_provider_registry.h +3 -3
- data/src/core/lib/security/context/security_context.h +3 -3
- data/src/core/lib/security/credentials/alts/alts_credentials.h +3 -3
- data/src/core/lib/security/credentials/alts/check_gcp_environment.h +3 -3
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h +3 -3
- data/src/core/lib/security/credentials/call_creds_util.h +3 -3
- data/src/core/lib/security/credentials/channel_creds_registry.h +3 -3
- data/src/core/lib/security/credentials/composite/composite_credentials.h +3 -3
- data/src/core/lib/security/credentials/credentials.h +3 -3
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +1 -0
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.h +3 -3
- data/src/core/lib/security/credentials/external/aws_request_signer.cc +1 -0
- data/src/core/lib/security/credentials/external/aws_request_signer.h +3 -3
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +1 -0
- data/src/core/lib/security/credentials/external/external_account_credentials.h +3 -3
- data/src/core/lib/security/credentials/external/file_external_account_credentials.h +3 -3
- data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +1 -0
- data/src/core/lib/security/credentials/external/url_external_account_credentials.h +3 -3
- data/src/core/lib/security/credentials/fake/fake_credentials.h +3 -3
- data/src/core/lib/security/credentials/google_default/google_default_credentials.h +3 -3
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +1 -0
- data/src/core/lib/security/credentials/iam/iam_credentials.h +3 -3
- data/src/core/lib/security/credentials/insecure/insecure_credentials.h +3 -3
- data/src/core/lib/security/credentials/jwt/json_token.h +3 -3
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +4 -3
- data/src/core/lib/security/credentials/jwt/jwt_verifier.h +3 -3
- data/src/core/lib/security/credentials/local/local_credentials.h +3 -3
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +4 -3
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +3 -3
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +3 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h +3 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +1 -1
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +3 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h +3 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +3 -3
- data/src/core/lib/security/credentials/tls/tls_credentials.h +3 -3
- data/src/core/lib/security/credentials/tls/tls_utils.h +3 -3
- data/src/core/lib/security/credentials/xds/xds_credentials.h +3 -3
- 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 +1 -0
- 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.h +3 -3
- data/src/core/lib/security/security_connector/load_system_roots.h +3 -3
- data/src/core/lib/security/security_connector/load_system_roots_supported.h +3 -3
- data/src/core/lib/security/security_connector/local/local_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/security_connector.h +3 -3
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +1 -0
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +3 -3
- data/src/core/lib/security/security_connector/ssl_utils.h +3 -3
- data/src/core/lib/security/security_connector/ssl_utils_config.h +3 -3
- data/src/core/lib/security/security_connector/tls/tls_security_connector.h +3 -3
- data/src/core/lib/security/transport/auth_filters.h +27 -5
- data/src/core/lib/security/transport/secure_endpoint.h +3 -3
- data/src/core/lib/security/transport/security_handshaker.cc +9 -0
- data/src/core/lib/security/transport/security_handshaker.h +3 -3
- data/src/core/lib/security/transport/server_auth_filter.cc +120 -251
- data/src/core/lib/security/transport/tsi_error.h +3 -3
- data/src/core/lib/security/util/json_util.h +3 -3
- data/src/core/lib/service_config/service_config.h +3 -3
- data/src/core/lib/service_config/service_config_call_data.h +3 -3
- data/src/core/lib/service_config/service_config_impl.h +3 -3
- data/src/core/lib/service_config/service_config_parser.h +3 -3
- data/src/core/lib/slice/b64.h +3 -3
- data/src/core/lib/slice/percent_encoding.h +3 -3
- data/src/core/lib/slice/slice.cc +3 -3
- data/src/core/lib/slice/slice.h +14 -21
- data/src/core/lib/slice/slice_buffer.h +10 -4
- data/src/core/lib/slice/slice_internal.h +3 -3
- data/src/core/lib/slice/slice_refcount.cc +20 -0
- data/src/core/lib/slice/slice_refcount.h +26 -6
- data/src/core/lib/slice/slice_string_helpers.h +3 -3
- data/src/core/lib/surface/api_trace.h +3 -3
- data/src/core/lib/surface/builtins.h +3 -3
- data/src/core/lib/surface/call.cc +866 -252
- data/src/core/lib/surface/call.h +31 -3
- data/src/core/lib/surface/call_log_batch.cc +1 -0
- data/src/core/lib/surface/call_test_only.h +3 -3
- data/src/core/lib/surface/call_trace.cc +21 -11
- data/src/core/lib/surface/call_trace.h +3 -3
- data/src/core/lib/surface/channel.h +3 -3
- data/src/core/lib/surface/channel_init.h +3 -3
- data/src/core/lib/surface/channel_stack_type.h +3 -3
- data/src/core/lib/surface/completion_queue.cc +1 -0
- data/src/core/lib/surface/completion_queue.h +3 -3
- data/src/core/lib/surface/completion_queue_factory.h +3 -3
- data/src/core/lib/surface/event_string.cc +1 -0
- data/src/core/lib/surface/event_string.h +3 -3
- data/src/core/lib/surface/init.cc +1 -1
- data/src/core/lib/surface/init.h +3 -3
- data/src/core/lib/surface/init_internally.h +3 -3
- data/src/core/lib/surface/lame_client.cc +3 -1
- data/src/core/lib/surface/lame_client.h +3 -3
- data/src/core/lib/surface/server.cc +273 -27
- data/src/core/lib/surface/server.h +6 -3
- data/src/core/lib/surface/validate_metadata.h +3 -3
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/bdp_estimator.h +3 -3
- data/src/core/lib/transport/connectivity_state.h +3 -3
- data/src/core/lib/transport/error_utils.h +3 -3
- data/src/core/lib/transport/handshaker.cc +11 -0
- data/src/core/lib/transport/handshaker.h +4 -4
- data/src/core/lib/transport/handshaker_factory.h +3 -3
- data/src/core/lib/transport/handshaker_registry.h +3 -3
- data/src/core/lib/transport/http2_errors.h +3 -3
- data/src/core/lib/transport/http_connect_handshaker.h +3 -3
- data/src/core/lib/transport/metadata_batch.cc +11 -0
- data/src/core/lib/transport/metadata_batch.h +24 -3
- data/src/core/lib/transport/parsed_metadata.h +3 -3
- data/src/core/lib/transport/pid_controller.h +3 -3
- data/src/core/lib/transport/status_conversion.h +3 -3
- data/src/core/lib/transport/tcp_connect_handshaker.cc +0 -1
- data/src/core/lib/transport/tcp_connect_handshaker.h +3 -3
- data/src/core/lib/transport/timeout_encoding.h +3 -3
- data/src/core/lib/transport/transport.cc +3 -8
- data/src/core/lib/transport/transport.h +16 -8
- data/src/core/lib/transport/transport_fwd.h +3 -3
- data/src/core/lib/transport/transport_impl.h +3 -3
- data/src/core/lib/transport/transport_op_string.cc +1 -0
- data/src/core/lib/uri/uri_parser.cc +1 -1
- data/src/core/lib/uri/uri_parser.h +3 -3
- data/src/core/plugin_registry/grpc_plugin_registry.cc +5 -0
- data/src/core/tsi/alts/crypt/gsec.h +3 -3
- data/src/core/tsi/alts/frame_protector/alts_counter.h +3 -3
- data/src/core/tsi/alts/frame_protector/alts_crypter.h +3 -3
- data/src/core/tsi/alts/frame_protector/alts_frame_protector.h +3 -3
- data/src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.h +3 -3
- data/src/core/tsi/alts/frame_protector/frame_handler.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_shared_resource.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h +3 -3
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.h +3 -3
- data/src/core/tsi/alts/handshaker/transport_security_common_api.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h +3 -3
- data/src/core/tsi/fake_transport_security.h +3 -3
- data/src/core/tsi/local_transport_security.h +3 -3
- data/src/core/tsi/ssl/key_logging/ssl_key_logging.cc +1 -1
- data/src/core/tsi/ssl/key_logging/ssl_key_logging.h +3 -3
- data/src/core/tsi/ssl/session_cache/ssl_session.h +3 -3
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +3 -3
- data/src/core/tsi/ssl_transport_security.cc +113 -24
- data/src/core/tsi/ssl_transport_security.h +5 -3
- data/src/core/tsi/ssl_transport_security_utils.h +3 -3
- data/src/core/tsi/ssl_types.h +3 -3
- data/src/core/tsi/transport_security.h +3 -3
- data/src/core/tsi/transport_security_grpc.h +3 -3
- data/src/core/tsi/transport_security_interface.h +3 -3
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/generate_proto_ruby.sh +0 -6
- data/third_party/abseil-cpp/absl/algorithm/container.h +56 -57
- data/third_party/abseil-cpp/absl/base/attributes.h +39 -19
- data/third_party/abseil-cpp/absl/base/config.h +44 -3
- data/third_party/abseil-cpp/absl/base/internal/cycleclock.h +3 -18
- data/third_party/abseil-cpp/absl/base/internal/cycleclock_config.h +55 -0
- data/third_party/abseil-cpp/absl/base/internal/direct_mmap.h +2 -1
- data/third_party/abseil-cpp/absl/base/internal/inline_variable.h +3 -3
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc +2 -2
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.h +1 -1
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +10 -6
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +23 -24
- data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +3 -3
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +2 -6
- data/third_party/abseil-cpp/absl/base/internal/spinlock_win32.inc +4 -1
- data/third_party/abseil-cpp/absl/base/internal/strerror.cc +4 -4
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +14 -10
- data/third_party/abseil-cpp/absl/base/internal/thread_annotations.h +9 -0
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +4 -0
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +3 -40
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock_config.h +62 -0
- data/third_party/abseil-cpp/absl/base/macros.h +4 -21
- data/third_party/abseil-cpp/absl/base/optimization.h +58 -6
- data/third_party/abseil-cpp/absl/base/options.h +1 -7
- data/third_party/abseil-cpp/absl/base/policy_checks.h +15 -13
- data/third_party/abseil-cpp/absl/container/fixed_array.h +7 -5
- data/third_party/abseil-cpp/absl/container/flat_hash_set.h +0 -7
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +66 -18
- data/third_party/abseil-cpp/absl/container/internal/common.h +3 -3
- data/third_party/abseil-cpp/absl/container/internal/common_policy_traits.h +132 -0
- data/third_party/abseil-cpp/absl/container/internal/container_memory.h +13 -1
- data/third_party/abseil-cpp/absl/container/internal/hash_policy_traits.h +4 -55
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +50 -5
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +14 -46
- data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +110 -32
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +155 -4
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +661 -341
- data/third_party/abseil-cpp/absl/crc/crc32c.cc +99 -0
- data/third_party/abseil-cpp/absl/crc/crc32c.h +183 -0
- data/third_party/abseil-cpp/absl/crc/internal/cpu_detect.cc +256 -0
- data/third_party/abseil-cpp/absl/crc/internal/cpu_detect.h +57 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc.cc +468 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc.h +91 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc32_x86_arm_combined_simd.h +269 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc32c.h +39 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc32c_inline.h +72 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_cord_state.cc +130 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_cord_state.h +159 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_internal.h +179 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_memcpy.h +119 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_fallback.cc +75 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_x86_64.cc +434 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_non_temporal_memcpy.cc +93 -0
- data/third_party/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc +725 -0
- data/third_party/abseil-cpp/absl/crc/internal/non_temporal_arm_intrinsics.h +79 -0
- data/third_party/abseil-cpp/absl/crc/internal/non_temporal_memcpy.h +180 -0
- data/third_party/abseil-cpp/absl/debugging/internal/address_is_readable.cc +1 -1
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +67 -38
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.h +1 -1
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc +12 -13
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +11 -9
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_generic-inl.inc +1 -1
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +40 -85
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_win32-inl.inc +5 -4
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +33 -8
- data/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc +3 -2
- data/third_party/abseil-cpp/absl/debugging/symbolize_darwin.inc +3 -2
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +118 -94
- data/third_party/abseil-cpp/absl/debugging/symbolize_win32.inc +7 -6
- data/third_party/abseil-cpp/absl/functional/any_invocable.h +5 -2
- data/third_party/abseil-cpp/absl/functional/internal/any_invocable.h +47 -26
- data/third_party/abseil-cpp/absl/hash/internal/city.cc +10 -10
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +18 -4
- data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc +3 -14
- data/third_party/abseil-cpp/absl/memory/memory.h +26 -447
- data/third_party/abseil-cpp/absl/meta/type_traits.h +104 -12
- data/third_party/abseil-cpp/absl/numeric/bits.h +2 -3
- data/third_party/abseil-cpp/absl/numeric/int128.cc +10 -8
- data/third_party/abseil-cpp/absl/profiling/internal/sample_recorder.h +14 -6
- data/third_party/abseil-cpp/absl/random/internal/fast_uniform_bits.h +2 -1
- data/third_party/abseil-cpp/absl/random/internal/nonsecure_base.h +1 -1
- data/third_party/abseil-cpp/absl/random/internal/pcg_engine.h +2 -23
- data/third_party/abseil-cpp/absl/random/internal/pool_urbg.cc +9 -9
- data/third_party/abseil-cpp/absl/random/internal/seed_material.cc +2 -2
- data/third_party/abseil-cpp/absl/random/random.h +6 -6
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +1 -0
- data/third_party/abseil-cpp/absl/status/status.cc +19 -12
- data/third_party/abseil-cpp/absl/status/status.h +2 -2
- data/third_party/abseil-cpp/absl/strings/ascii.cc +5 -5
- data/third_party/abseil-cpp/absl/strings/charconv.cc +534 -96
- data/third_party/abseil-cpp/absl/strings/cord.cc +92 -40
- data/third_party/abseil-cpp/absl/strings/cord.h +71 -80
- data/third_party/abseil-cpp/absl/strings/cord_buffer.h +8 -5
- data/third_party/abseil-cpp/absl/strings/escaping.cc +73 -62
- data/third_party/abseil-cpp/absl/strings/escaping.h +24 -19
- data/third_party/abseil-cpp/absl/strings/internal/char_map.h +14 -12
- data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc +4 -4
- data/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc +2 -2
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +326 -70
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +8 -4
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h +26 -14
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc +5 -5
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_crc.cc +9 -7
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_crc.h +5 -4
- data/third_party/abseil-cpp/absl/strings/internal/cordz_functions.h +7 -15
- data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.h +3 -3
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +8 -5
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.h +7 -7
- data/third_party/abseil-cpp/absl/strings/internal/cordz_statistics.h +4 -4
- data/third_party/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance.cc +93 -0
- data/third_party/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance.h +34 -0
- data/third_party/abseil-cpp/absl/strings/internal/escaping.cc +12 -10
- data/third_party/abseil-cpp/absl/strings/internal/escaping.h +7 -9
- data/third_party/abseil-cpp/absl/strings/internal/has_absl_stringify.h +55 -0
- data/third_party/abseil-cpp/absl/strings/internal/memutil.cc +9 -6
- data/third_party/abseil-cpp/absl/strings/internal/ostringstream.cc +14 -7
- data/third_party/abseil-cpp/absl/strings/internal/ostringstream.h +35 -10
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +113 -46
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +126 -29
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc +3 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +4 -3
- data/third_party/abseil-cpp/absl/strings/internal/str_format/checker.h +49 -287
- data/third_party/abseil-cpp/absl/strings/internal/str_format/constexpr_parser.h +351 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +2 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +4 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +215 -181
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc +10 -209
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +10 -101
- data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +2 -1
- data/third_party/abseil-cpp/absl/strings/internal/stringify_sink.cc +28 -0
- data/third_party/abseil-cpp/absl/strings/internal/stringify_sink.h +57 -0
- data/third_party/abseil-cpp/absl/strings/numbers.cc +34 -31
- data/third_party/abseil-cpp/absl/strings/str_cat.cc +9 -6
- data/third_party/abseil-cpp/absl/strings/str_cat.h +50 -3
- data/third_party/abseil-cpp/absl/strings/str_format.h +71 -9
- data/third_party/abseil-cpp/absl/strings/string_view.cc +6 -6
- data/third_party/abseil-cpp/absl/strings/string_view.h +3 -10
- data/third_party/abseil-cpp/absl/strings/substitute.cc +8 -6
- data/third_party/abseil-cpp/absl/strings/substitute.h +46 -20
- data/third_party/abseil-cpp/absl/synchronization/internal/futex.h +20 -17
- data/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc +37 -31
- data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h +22 -8
- data/third_party/abseil-cpp/absl/synchronization/mutex.cc +104 -55
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +85 -46
- data/third_party/abseil-cpp/absl/synchronization/notification.cc +0 -1
- data/third_party/abseil-cpp/absl/synchronization/notification.h +0 -1
- data/third_party/abseil-cpp/absl/time/civil_time.cc +26 -0
- data/third_party/abseil-cpp/absl/time/civil_time.h +25 -0
- data/third_party/abseil-cpp/absl/time/clock.cc +17 -11
- data/third_party/abseil-cpp/absl/time/duration.cc +7 -7
- data/third_party/abseil-cpp/absl/time/format.cc +2 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc +26 -5
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +7 -6
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc +36 -35
- data/third_party/abseil-cpp/absl/time/time.cc +2 -2
- data/third_party/abseil-cpp/absl/time/time.h +253 -158
- data/third_party/abseil-cpp/absl/types/internal/span.h +30 -19
- data/third_party/abseil-cpp/absl/types/internal/variant.h +28 -40
- data/third_party/abseil-cpp/absl/types/span.h +29 -7
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_genn.c +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +1 -2
- metadata +73 -8
- data/src/core/lib/event_engine/socket_notifier.h +0 -55
- data/src/core/lib/promise/for_each.h +0 -155
- data/src/core/lib/promise/map_pipe.h +0 -88
- data/src/core/lib/promise/try_concurrently.h +0 -342
@@ -17,16 +17,18 @@
|
|
17
17
|
#include "src/core/lib/channel/promise_based_filter.h"
|
18
18
|
|
19
19
|
#include <algorithm>
|
20
|
+
#include <initializer_list>
|
20
21
|
#include <memory>
|
21
22
|
#include <string>
|
23
|
+
#include <utility>
|
22
24
|
#include <vector>
|
23
25
|
|
24
26
|
#include "absl/base/attributes.h"
|
25
27
|
#include "absl/functional/function_ref.h"
|
28
|
+
#include "absl/status/status.h"
|
26
29
|
#include "absl/strings/str_cat.h"
|
27
30
|
#include "absl/strings/str_format.h"
|
28
31
|
#include "absl/strings/str_join.h"
|
29
|
-
#include "absl/types/variant.h"
|
30
32
|
|
31
33
|
#include <grpc/status.h>
|
32
34
|
|
@@ -36,6 +38,7 @@
|
|
36
38
|
#include "src/core/lib/gprpp/manual_constructor.h"
|
37
39
|
#include "src/core/lib/gprpp/status_helper.h"
|
38
40
|
#include "src/core/lib/iomgr/error.h"
|
41
|
+
#include "src/core/lib/promise/detail/basic_seq.h"
|
39
42
|
#include "src/core/lib/slice/slice.h"
|
40
43
|
|
41
44
|
extern grpc_core::TraceFlag grpc_trace_channel;
|
@@ -46,14 +49,21 @@ namespace promise_filter_detail {
|
|
46
49
|
namespace {
|
47
50
|
class FakeActivity final : public Activity {
|
48
51
|
public:
|
52
|
+
explicit FakeActivity(Activity* wake_activity)
|
53
|
+
: wake_activity_(wake_activity) {}
|
49
54
|
void Orphan() override {}
|
50
55
|
void ForceImmediateRepoll() override {}
|
51
|
-
Waker MakeOwningWaker() override {
|
52
|
-
Waker MakeNonOwningWaker() override {
|
56
|
+
Waker MakeOwningWaker() override { return wake_activity_->MakeOwningWaker(); }
|
57
|
+
Waker MakeNonOwningWaker() override {
|
58
|
+
return wake_activity_->MakeNonOwningWaker();
|
59
|
+
}
|
53
60
|
void Run(absl::FunctionRef<void()> f) {
|
54
61
|
ScopedActivity activity(this);
|
55
62
|
f();
|
56
63
|
}
|
64
|
+
|
65
|
+
private:
|
66
|
+
Activity* const wake_activity_;
|
57
67
|
};
|
58
68
|
|
59
69
|
absl::Status StatusFromMetadata(const ServerMetadata& md) {
|
@@ -72,39 +82,43 @@ absl::Status StatusFromMetadata(const ServerMetadata& md) {
|
|
72
82
|
///////////////////////////////////////////////////////////////////////////////
|
73
83
|
// BaseCallData
|
74
84
|
|
75
|
-
BaseCallData::BaseCallData(
|
76
|
-
|
85
|
+
BaseCallData::BaseCallData(
|
86
|
+
grpc_call_element* elem, const grpc_call_element_args* args, uint8_t flags,
|
87
|
+
absl::FunctionRef<Interceptor*()> make_send_interceptor,
|
88
|
+
absl::FunctionRef<Interceptor*()> make_recv_interceptor)
|
77
89
|
: call_stack_(args->call_stack),
|
78
90
|
elem_(elem),
|
79
91
|
arena_(args->arena),
|
80
92
|
call_combiner_(args->call_combiner),
|
81
93
|
deadline_(args->deadline),
|
82
94
|
context_(args->context),
|
83
|
-
|
95
|
+
server_initial_metadata_pipe_(
|
84
96
|
flags & kFilterExaminesServerInitialMetadata
|
85
|
-
? arena_->New<
|
97
|
+
? arena_->New<Pipe<ServerMetadataHandle>>(arena_)
|
98
|
+
: nullptr),
|
99
|
+
send_message_(
|
100
|
+
flags & kFilterExaminesOutboundMessages
|
101
|
+
? arena_->New<SendMessage>(this, make_send_interceptor())
|
102
|
+
: nullptr),
|
103
|
+
receive_message_(
|
104
|
+
flags & kFilterExaminesInboundMessages
|
105
|
+
? arena_->New<ReceiveMessage>(this, make_recv_interceptor())
|
86
106
|
: nullptr),
|
87
|
-
send_message_(flags & kFilterExaminesOutboundMessages
|
88
|
-
? arena_->New<SendMessage>(this)
|
89
|
-
: nullptr),
|
90
|
-
receive_message_(flags & kFilterExaminesInboundMessages
|
91
|
-
? arena_->New<ReceiveMessage>(this)
|
92
|
-
: nullptr),
|
93
107
|
event_engine_(
|
94
108
|
static_cast<ChannelFilter*>(elem->channel_data)
|
95
109
|
->hack_until_per_channel_stack_event_engines_land_get_event_engine()) {
|
96
110
|
}
|
97
111
|
|
98
112
|
BaseCallData::~BaseCallData() {
|
99
|
-
FakeActivity().Run([this] {
|
113
|
+
FakeActivity(this).Run([this] {
|
100
114
|
if (send_message_ != nullptr) {
|
101
115
|
send_message_->~SendMessage();
|
102
116
|
}
|
103
117
|
if (receive_message_ != nullptr) {
|
104
118
|
receive_message_->~ReceiveMessage();
|
105
119
|
}
|
106
|
-
if (
|
107
|
-
|
120
|
+
if (server_initial_metadata_pipe_ != nullptr) {
|
121
|
+
server_initial_metadata_pipe_->~Pipe();
|
108
122
|
}
|
109
123
|
});
|
110
124
|
}
|
@@ -119,20 +133,20 @@ Waker BaseCallData::MakeNonOwningWaker() { return MakeOwningWaker(); }
|
|
119
133
|
|
120
134
|
Waker BaseCallData::MakeOwningWaker() {
|
121
135
|
GRPC_CALL_STACK_REF(call_stack_, "waker");
|
122
|
-
return Waker(this);
|
136
|
+
return Waker(this, nullptr);
|
123
137
|
}
|
124
138
|
|
125
|
-
void BaseCallData::Wakeup() {
|
139
|
+
void BaseCallData::Wakeup(void*) {
|
126
140
|
auto wakeup = [](void* p, grpc_error_handle) {
|
127
141
|
auto* self = static_cast<BaseCallData*>(p);
|
128
142
|
self->OnWakeup();
|
129
|
-
self->Drop();
|
143
|
+
self->Drop(nullptr);
|
130
144
|
};
|
131
145
|
auto* closure = GRPC_CLOSURE_CREATE(wakeup, this, nullptr);
|
132
146
|
GRPC_CALL_COMBINER_START(call_combiner_, closure, absl::OkStatus(), "wakeup");
|
133
147
|
}
|
134
148
|
|
135
|
-
void BaseCallData::Drop() { GRPC_CALL_STACK_UNREF(call_stack_, "waker"); }
|
149
|
+
void BaseCallData::Drop(void*) { GRPC_CALL_STACK_UNREF(call_stack_, "waker"); }
|
136
150
|
|
137
151
|
std::string BaseCallData::LogTag() const {
|
138
152
|
return absl::StrCat(
|
@@ -196,7 +210,14 @@ void BaseCallData::CapturedBatch::ResumeWith(Flusher* releaser) {
|
|
196
210
|
auto* batch = std::exchange(batch_, nullptr);
|
197
211
|
GPR_ASSERT(batch != nullptr);
|
198
212
|
uintptr_t& refcnt = *RefCountField(batch);
|
199
|
-
if (refcnt == 0)
|
213
|
+
if (refcnt == 0) {
|
214
|
+
// refcnt==0 ==> cancelled
|
215
|
+
if (grpc_trace_channel.enabled()) {
|
216
|
+
gpr_log(GPR_INFO, "%sRESUME BATCH REQUEST CANCELLED",
|
217
|
+
Activity::current()->DebugTag().c_str());
|
218
|
+
}
|
219
|
+
return;
|
220
|
+
}
|
200
221
|
if (--refcnt == 0) {
|
201
222
|
releaser->Resume(batch);
|
202
223
|
}
|
@@ -219,6 +240,10 @@ void BaseCallData::CapturedBatch::CancelWith(grpc_error_handle error,
|
|
219
240
|
uintptr_t& refcnt = *RefCountField(batch);
|
220
241
|
if (refcnt == 0) {
|
221
242
|
// refcnt==0 ==> cancelled
|
243
|
+
if (grpc_trace_channel.enabled()) {
|
244
|
+
gpr_log(GPR_INFO, "%sCANCEL BATCH REQUEST ALREADY CANCELLED",
|
245
|
+
Activity::current()->DebugTag().c_str());
|
246
|
+
}
|
222
247
|
return;
|
223
248
|
}
|
224
249
|
refcnt = 0;
|
@@ -329,12 +354,13 @@ void BaseCallData::SendMessage::StartOp(CapturedBatch batch) {
|
|
329
354
|
intercepted_on_complete_ = std::exchange(batch_->on_complete, &on_complete_);
|
330
355
|
}
|
331
356
|
|
332
|
-
|
357
|
+
template <typename T>
|
358
|
+
void BaseCallData::SendMessage::GotPipe(T* pipe_end) {
|
333
359
|
if (grpc_trace_channel.enabled()) {
|
334
360
|
gpr_log(GPR_INFO, "%s SendMessage.GotPipe st=%s", base_->LogTag().c_str(),
|
335
361
|
StateString(state_));
|
336
362
|
}
|
337
|
-
GPR_ASSERT(
|
363
|
+
GPR_ASSERT(pipe_end != nullptr);
|
338
364
|
switch (state_) {
|
339
365
|
case State::kInitial:
|
340
366
|
state_ = State::kIdle;
|
@@ -354,7 +380,7 @@ void BaseCallData::SendMessage::GotPipe(PipeReceiver<MessageHandle>* receiver) {
|
|
354
380
|
case State::kCancelledButNotYetPolled:
|
355
381
|
return;
|
356
382
|
}
|
357
|
-
|
383
|
+
interceptor_->GotPipe(pipe_end);
|
358
384
|
}
|
359
385
|
|
360
386
|
bool BaseCallData::SendMessage::IsIdle() const {
|
@@ -398,12 +424,14 @@ void BaseCallData::SendMessage::OnComplete(absl::Status status) {
|
|
398
424
|
case State::kForwardedBatch:
|
399
425
|
completed_status_ = status;
|
400
426
|
state_ = State::kBatchCompleted;
|
427
|
+
ScopedContext ctx(base_);
|
401
428
|
base_->WakeInsideCombiner(&flusher);
|
402
429
|
break;
|
403
430
|
}
|
404
431
|
}
|
405
432
|
|
406
|
-
void BaseCallData::SendMessage::Done(const ServerMetadata& metadata
|
433
|
+
void BaseCallData::SendMessage::Done(const ServerMetadata& metadata,
|
434
|
+
Flusher* flusher) {
|
407
435
|
if (grpc_trace_channel.enabled()) {
|
408
436
|
gpr_log(GPR_INFO, "%s SendMessage.Done st=%s md=%s",
|
409
437
|
base_->LogTag().c_str(), StateString(state_),
|
@@ -419,7 +447,16 @@ void BaseCallData::SendMessage::Done(const ServerMetadata& metadata) {
|
|
419
447
|
state_ = State::kCancelledButNotYetPolled;
|
420
448
|
break;
|
421
449
|
case State::kGotBatchNoPipe:
|
422
|
-
case State::kGotBatch:
|
450
|
+
case State::kGotBatch: {
|
451
|
+
std::string temp;
|
452
|
+
batch_.CancelWith(
|
453
|
+
absl::Status(
|
454
|
+
static_cast<absl::StatusCode>(metadata.get(GrpcStatusMetadata())
|
455
|
+
.value_or(GRPC_STATUS_UNKNOWN)),
|
456
|
+
metadata.GetStringValue("grpc-message", &temp).value_or("")),
|
457
|
+
flusher);
|
458
|
+
state_ = State::kCancelledButNotYetPolled;
|
459
|
+
} break;
|
423
460
|
case State::kBatchCompleted:
|
424
461
|
Crash(absl::StrFormat("ILLEGAL STATE: %s", StateString(state_)));
|
425
462
|
break;
|
@@ -431,7 +468,8 @@ void BaseCallData::SendMessage::Done(const ServerMetadata& metadata) {
|
|
431
468
|
}
|
432
469
|
}
|
433
470
|
|
434
|
-
void BaseCallData::SendMessage::WakeInsideCombiner(Flusher* flusher
|
471
|
+
void BaseCallData::SendMessage::WakeInsideCombiner(Flusher* flusher,
|
472
|
+
bool allow_push_to_pipe) {
|
435
473
|
if (grpc_trace_channel.enabled()) {
|
436
474
|
gpr_log(GPR_INFO, "%s SendMessage.WakeInsideCombiner st=%s%s",
|
437
475
|
base_->LogTag().c_str(), StateString(state_),
|
@@ -443,26 +481,28 @@ void BaseCallData::SendMessage::WakeInsideCombiner(Flusher* flusher) {
|
|
443
481
|
case State::kInitial:
|
444
482
|
case State::kIdle:
|
445
483
|
case State::kGotBatchNoPipe:
|
446
|
-
case State::kForwardedBatch:
|
447
484
|
case State::kCancelled:
|
448
485
|
break;
|
449
486
|
case State::kCancelledButNotYetPolled:
|
450
|
-
|
487
|
+
interceptor()->Push()->Close();
|
451
488
|
state_ = State::kCancelled;
|
452
489
|
break;
|
453
|
-
case State::kGotBatch:
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
490
|
+
case State::kGotBatch:
|
491
|
+
if (allow_push_to_pipe) {
|
492
|
+
state_ = State::kPushedToPipe;
|
493
|
+
auto message = GetContext<Arena>()->MakePooled<Message>();
|
494
|
+
message->payload()->Swap(batch_->payload->send_message.send_message);
|
495
|
+
message->mutable_flags() = batch_->payload->send_message.flags;
|
496
|
+
push_ = interceptor()->Push()->Push(std::move(message));
|
497
|
+
next_.emplace(interceptor()->Pull()->Next());
|
498
|
+
} else {
|
499
|
+
break;
|
500
|
+
}
|
461
501
|
ABSL_FALLTHROUGH_INTENDED;
|
462
502
|
case State::kPushedToPipe: {
|
463
503
|
GPR_ASSERT(push_.has_value());
|
464
504
|
auto r_push = (*push_)();
|
465
|
-
if (auto* p =
|
505
|
+
if (auto* p = r_push.value_if_ready()) {
|
466
506
|
if (grpc_trace_channel.enabled()) {
|
467
507
|
gpr_log(GPR_INFO,
|
468
508
|
"%s SendMessage.WakeInsideCombiner push complete, result=%s",
|
@@ -476,7 +516,7 @@ void BaseCallData::SendMessage::WakeInsideCombiner(Flusher* flusher) {
|
|
476
516
|
}
|
477
517
|
GPR_ASSERT(next_.has_value());
|
478
518
|
auto r_next = (*next_)();
|
479
|
-
if (auto* p =
|
519
|
+
if (auto* p = r_next.value_if_ready()) {
|
480
520
|
if (grpc_trace_channel.enabled()) {
|
481
521
|
gpr_log(GPR_INFO,
|
482
522
|
"%s SendMessage.WakeInsideCombiner next complete, "
|
@@ -488,25 +528,25 @@ void BaseCallData::SendMessage::WakeInsideCombiner(Flusher* flusher) {
|
|
488
528
|
batch_->payload->send_message.flags = (**p)->flags();
|
489
529
|
state_ = State::kForwardedBatch;
|
490
530
|
batch_.ResumeWith(flusher);
|
491
|
-
next_result_ = std::move(*p);
|
492
531
|
next_.reset();
|
532
|
+
if ((*push_)().ready()) push_.reset();
|
493
533
|
}
|
494
534
|
} break;
|
535
|
+
case State::kForwardedBatch:
|
536
|
+
if (push_.has_value() && (*push_)().ready()) {
|
537
|
+
push_.reset();
|
538
|
+
}
|
539
|
+
break;
|
495
540
|
case State::kBatchCompleted:
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
// intercept the sent messages). The push promise here is pushing into the
|
500
|
-
// latter pipe, and so we need to keep polling it until it's done, which
|
501
|
-
// depending on what happens inside the promise may take some time.
|
502
|
-
if (absl::holds_alternative<Pending>((*push_)())) break;
|
541
|
+
if (push_.has_value() && (*push_)().pending()) {
|
542
|
+
break;
|
543
|
+
}
|
503
544
|
if (completed_status_.ok()) {
|
504
545
|
state_ = State::kIdle;
|
505
546
|
Activity::current()->ForceImmediateRepoll();
|
506
547
|
} else {
|
507
548
|
state_ = State::kCancelled;
|
508
549
|
}
|
509
|
-
push_.reset();
|
510
550
|
flusher->AddClosure(intercepted_on_complete_, completed_status_,
|
511
551
|
"batch_completed");
|
512
552
|
break;
|
@@ -538,14 +578,20 @@ const char* BaseCallData::ReceiveMessage::StateString(State state) {
|
|
538
578
|
return "CANCELLED";
|
539
579
|
case State::kCancelledWhilstForwarding:
|
540
580
|
return "CANCELLED_WHILST_FORWARDING";
|
581
|
+
case State::kCancelledWhilstForwardingNoPipe:
|
582
|
+
return "CANCELLED_WHILST_FORWARDING_NO_PIPE";
|
541
583
|
case State::kBatchCompletedButCancelled:
|
542
584
|
return "BATCH_COMPLETED_BUT_CANCELLED";
|
585
|
+
case State::kBatchCompletedButCancelledNoPipe:
|
586
|
+
return "BATCH_COMPLETED_BUT_CANCELLED_NO_PIPE";
|
543
587
|
case State::kCancelledWhilstIdle:
|
544
588
|
return "CANCELLED_WHILST_IDLE";
|
545
589
|
case State::kCompletedWhilePulledFromPipe:
|
546
590
|
return "COMPLETED_WHILE_PULLED_FROM_PIPE";
|
547
591
|
case State::kCompletedWhilePushedToPipe:
|
548
592
|
return "COMPLETED_WHILE_PUSHED_TO_PIPE";
|
593
|
+
case State::kCompletedWhileBatchCompleted:
|
594
|
+
return "COMPLETED_WHILE_BATCH_COMPLETED";
|
549
595
|
}
|
550
596
|
return "UNKNOWN";
|
551
597
|
}
|
@@ -563,11 +609,14 @@ void BaseCallData::ReceiveMessage::StartOp(CapturedBatch& batch) {
|
|
563
609
|
state_ = State::kForwardedBatch;
|
564
610
|
break;
|
565
611
|
case State::kCancelledWhilstForwarding:
|
612
|
+
case State::kCancelledWhilstForwardingNoPipe:
|
566
613
|
case State::kBatchCompletedButCancelled:
|
614
|
+
case State::kBatchCompletedButCancelledNoPipe:
|
567
615
|
case State::kForwardedBatch:
|
568
616
|
case State::kForwardedBatchNoPipe:
|
569
617
|
case State::kBatchCompleted:
|
570
618
|
case State::kBatchCompletedNoPipe:
|
619
|
+
case State::kCompletedWhileBatchCompleted:
|
571
620
|
case State::kPushedToPipe:
|
572
621
|
case State::kPulledFromPipe:
|
573
622
|
case State::kCompletedWhilePulledFromPipe:
|
@@ -587,7 +636,8 @@ void BaseCallData::ReceiveMessage::StartOp(CapturedBatch& batch) {
|
|
587
636
|
batch->payload->recv_message.recv_message_ready, &on_complete_);
|
588
637
|
}
|
589
638
|
|
590
|
-
|
639
|
+
template <typename T>
|
640
|
+
void BaseCallData::ReceiveMessage::GotPipe(T* pipe_end) {
|
591
641
|
if (grpc_trace_channel.enabled()) {
|
592
642
|
gpr_log(GPR_INFO, "%s ReceiveMessage.GotPipe st=%s",
|
593
643
|
base_->LogTag().c_str(), StateString(state_));
|
@@ -610,14 +660,17 @@ void BaseCallData::ReceiveMessage::GotPipe(PipeSender<MessageHandle>* sender) {
|
|
610
660
|
case State::kPulledFromPipe:
|
611
661
|
case State::kCompletedWhilePulledFromPipe:
|
612
662
|
case State::kCompletedWhilePushedToPipe:
|
663
|
+
case State::kCompletedWhileBatchCompleted:
|
613
664
|
case State::kCancelledWhilstForwarding:
|
665
|
+
case State::kCancelledWhilstForwardingNoPipe:
|
614
666
|
case State::kCancelledWhilstIdle:
|
615
667
|
case State::kBatchCompletedButCancelled:
|
668
|
+
case State::kBatchCompletedButCancelledNoPipe:
|
616
669
|
Crash(absl::StrFormat("ILLEGAL STATE: %s", StateString(state_)));
|
617
670
|
case State::kCancelled:
|
618
671
|
return;
|
619
672
|
}
|
620
|
-
|
673
|
+
interceptor()->GotPipe(pipe_end);
|
621
674
|
}
|
622
675
|
|
623
676
|
void BaseCallData::ReceiveMessage::OnComplete(absl::Status status) {
|
@@ -632,9 +685,11 @@ void BaseCallData::ReceiveMessage::OnComplete(absl::Status status) {
|
|
632
685
|
case State::kPushedToPipe:
|
633
686
|
case State::kPulledFromPipe:
|
634
687
|
case State::kBatchCompleted:
|
688
|
+
case State::kCompletedWhileBatchCompleted:
|
635
689
|
case State::kBatchCompletedNoPipe:
|
636
690
|
case State::kCancelled:
|
637
691
|
case State::kBatchCompletedButCancelled:
|
692
|
+
case State::kBatchCompletedButCancelledNoPipe:
|
638
693
|
case State::kCancelledWhilstIdle:
|
639
694
|
case State::kCompletedWhilePulledFromPipe:
|
640
695
|
case State::kCompletedWhilePushedToPipe:
|
@@ -648,6 +703,9 @@ void BaseCallData::ReceiveMessage::OnComplete(absl::Status status) {
|
|
648
703
|
case State::kCancelledWhilstForwarding:
|
649
704
|
state_ = State::kBatchCompletedButCancelled;
|
650
705
|
break;
|
706
|
+
case State::kCancelledWhilstForwardingNoPipe:
|
707
|
+
state_ = State::kBatchCompletedButCancelledNoPipe;
|
708
|
+
break;
|
651
709
|
}
|
652
710
|
completed_status_ = status;
|
653
711
|
Flusher flusher(base_);
|
@@ -670,9 +728,15 @@ void BaseCallData::ReceiveMessage::Done(const ServerMetadata& metadata,
|
|
670
728
|
state_ = State::kCancelledWhilstIdle;
|
671
729
|
break;
|
672
730
|
case State::kForwardedBatch:
|
673
|
-
case State::kForwardedBatchNoPipe:
|
674
731
|
state_ = State::kCancelledWhilstForwarding;
|
675
732
|
break;
|
733
|
+
case State::kForwardedBatchNoPipe:
|
734
|
+
state_ = State::kCancelledWhilstForwardingNoPipe;
|
735
|
+
break;
|
736
|
+
case State::kCompletedWhileBatchCompleted:
|
737
|
+
case State::kBatchCompleted:
|
738
|
+
state_ = State::kCompletedWhileBatchCompleted;
|
739
|
+
break;
|
676
740
|
case State::kCompletedWhilePulledFromPipe:
|
677
741
|
case State::kCompletedWhilePushedToPipe:
|
678
742
|
case State::kPulledFromPipe:
|
@@ -694,23 +758,27 @@ void BaseCallData::ReceiveMessage::Done(const ServerMetadata& metadata,
|
|
694
758
|
state_ = State::kCancelled;
|
695
759
|
}
|
696
760
|
} break;
|
697
|
-
case State::kBatchCompleted:
|
698
761
|
case State::kBatchCompletedNoPipe:
|
699
762
|
case State::kBatchCompletedButCancelled:
|
763
|
+
case State::kBatchCompletedButCancelledNoPipe:
|
700
764
|
Crash(absl::StrFormat("ILLEGAL STATE: %s", StateString(state_)));
|
701
765
|
case State::kCancelledWhilstIdle:
|
702
766
|
case State::kCancelledWhilstForwarding:
|
767
|
+
case State::kCancelledWhilstForwardingNoPipe:
|
703
768
|
case State::kCancelled:
|
704
769
|
break;
|
705
770
|
}
|
706
771
|
}
|
707
772
|
|
708
|
-
void BaseCallData::ReceiveMessage::WakeInsideCombiner(Flusher* flusher
|
773
|
+
void BaseCallData::ReceiveMessage::WakeInsideCombiner(Flusher* flusher,
|
774
|
+
bool allow_push_to_pipe) {
|
709
775
|
if (grpc_trace_channel.enabled()) {
|
710
776
|
gpr_log(GPR_INFO,
|
711
|
-
"%s ReceiveMessage.WakeInsideCombiner st=%s push?=%s next?=%s"
|
777
|
+
"%s ReceiveMessage.WakeInsideCombiner st=%s push?=%s next?=%s "
|
778
|
+
"allow_push_to_pipe=%s",
|
712
779
|
base_->LogTag().c_str(), StateString(state_),
|
713
|
-
push_.has_value() ? "yes" : "no", next_.has_value() ? "yes" : "no"
|
780
|
+
push_.has_value() ? "yes" : "no", next_.has_value() ? "yes" : "no",
|
781
|
+
allow_push_to_pipe ? "yes" : "no");
|
714
782
|
}
|
715
783
|
switch (state_) {
|
716
784
|
case State::kInitial:
|
@@ -719,40 +787,53 @@ void BaseCallData::ReceiveMessage::WakeInsideCombiner(Flusher* flusher) {
|
|
719
787
|
case State::kForwardedBatch:
|
720
788
|
case State::kCancelled:
|
721
789
|
case State::kCancelledWhilstForwarding:
|
790
|
+
case State::kCancelledWhilstForwardingNoPipe:
|
722
791
|
case State::kBatchCompletedNoPipe:
|
723
792
|
break;
|
724
793
|
case State::kCancelledWhilstIdle:
|
725
|
-
|
794
|
+
interceptor()->Push()->Close();
|
726
795
|
state_ = State::kCancelled;
|
727
796
|
break;
|
728
797
|
case State::kBatchCompletedButCancelled:
|
729
|
-
|
798
|
+
case State::kCompletedWhileBatchCompleted:
|
799
|
+
interceptor()->Push()->Close();
|
800
|
+
state_ = State::kCancelled;
|
801
|
+
flusher->AddClosure(std::exchange(intercepted_on_complete_, nullptr),
|
802
|
+
completed_status_, "recv_message");
|
803
|
+
break;
|
804
|
+
case State::kBatchCompletedButCancelledNoPipe:
|
730
805
|
state_ = State::kCancelled;
|
731
806
|
flusher->AddClosure(std::exchange(intercepted_on_complete_, nullptr),
|
732
807
|
completed_status_, "recv_message");
|
733
808
|
break;
|
734
809
|
case State::kBatchCompleted:
|
735
810
|
if (completed_status_.ok() && intercepted_slice_buffer_->has_value()) {
|
736
|
-
|
811
|
+
if (!allow_push_to_pipe) break;
|
812
|
+
if (state_ == State::kBatchCompleted) {
|
813
|
+
state_ = State::kPushedToPipe;
|
814
|
+
} else {
|
815
|
+
state_ = State::kCompletedWhilePushedToPipe;
|
816
|
+
}
|
737
817
|
auto message = GetContext<Arena>()->MakePooled<Message>();
|
738
818
|
message->payload()->Swap(&**intercepted_slice_buffer_);
|
739
819
|
message->mutable_flags() = *intercepted_flags_;
|
740
|
-
push_ =
|
741
|
-
next_
|
820
|
+
push_ = interceptor()->Push()->Push(std::move(message));
|
821
|
+
next_.emplace(interceptor()->Pull()->Next());
|
742
822
|
} else {
|
743
|
-
|
823
|
+
interceptor()->Push()->Close();
|
744
824
|
state_ = State::kCancelled;
|
745
825
|
flusher->AddClosure(std::exchange(intercepted_on_complete_, nullptr),
|
746
826
|
completed_status_, "recv_message");
|
747
827
|
break;
|
748
828
|
}
|
749
|
-
GPR_ASSERT(state_ == State::kPushedToPipe
|
829
|
+
GPR_ASSERT(state_ == State::kPushedToPipe ||
|
830
|
+
state_ == State::kCompletedWhilePushedToPipe);
|
750
831
|
ABSL_FALLTHROUGH_INTENDED;
|
751
832
|
case State::kCompletedWhilePushedToPipe:
|
752
833
|
case State::kPushedToPipe: {
|
753
834
|
GPR_ASSERT(push_.has_value());
|
754
835
|
auto r_push = (*push_)();
|
755
|
-
if (auto* p =
|
836
|
+
if (auto* p = r_push.value_if_ready()) {
|
756
837
|
if (grpc_trace_channel.enabled()) {
|
757
838
|
gpr_log(GPR_INFO,
|
758
839
|
"%s ReceiveMessage.WakeInsideCombiner push complete: %s",
|
@@ -765,13 +846,7 @@ void BaseCallData::ReceiveMessage::WakeInsideCombiner(Flusher* flusher) {
|
|
765
846
|
}
|
766
847
|
GPR_ASSERT(next_.has_value());
|
767
848
|
auto r_next = (*next_)();
|
768
|
-
if (auto* p =
|
769
|
-
if (grpc_trace_channel.enabled()) {
|
770
|
-
gpr_log(GPR_INFO,
|
771
|
-
"%s ReceiveMessage.WakeInsideCombiner next complete: %s",
|
772
|
-
base_->LogTag().c_str(),
|
773
|
-
p->has_value() ? "got message" : "end of stream");
|
774
|
-
}
|
849
|
+
if (auto* p = r_next.value_if_ready()) {
|
775
850
|
next_.reset();
|
776
851
|
if (p->has_value()) {
|
777
852
|
*intercepted_slice_buffer_ = std::move(*(**p)->payload());
|
@@ -785,25 +860,37 @@ void BaseCallData::ReceiveMessage::WakeInsideCombiner(Flusher* flusher) {
|
|
785
860
|
*intercepted_slice_buffer_ = absl::nullopt;
|
786
861
|
*intercepted_flags_ = 0;
|
787
862
|
state_ = State::kCancelled;
|
863
|
+
flusher->AddClosure(
|
864
|
+
std::exchange(intercepted_on_complete_, nullptr),
|
865
|
+
p->cancelled() ? absl::CancelledError() : absl::OkStatus(),
|
866
|
+
"recv_message");
|
867
|
+
}
|
868
|
+
if (grpc_trace_channel.enabled()) {
|
869
|
+
gpr_log(GPR_INFO,
|
870
|
+
"%s ReceiveMessage.WakeInsideCombiner next complete: %s "
|
871
|
+
"new_state=%s",
|
872
|
+
base_->LogTag().c_str(),
|
873
|
+
p->has_value() ? "got message" : "end of stream",
|
874
|
+
StateString(state_));
|
788
875
|
}
|
789
876
|
}
|
790
|
-
}
|
791
877
|
if (state_ != State::kPulledFromPipe &&
|
792
878
|
state_ != State::kCompletedWhilePulledFromPipe) {
|
793
879
|
break;
|
794
880
|
}
|
881
|
+
}
|
795
882
|
ABSL_FALLTHROUGH_INTENDED;
|
796
883
|
case State::kCompletedWhilePulledFromPipe:
|
797
884
|
case State::kPulledFromPipe: {
|
798
885
|
GPR_ASSERT(push_.has_value());
|
799
|
-
if (
|
886
|
+
if ((*push_)().ready()) {
|
800
887
|
if (grpc_trace_channel.enabled()) {
|
801
888
|
gpr_log(GPR_INFO,
|
802
889
|
"%s ReceiveMessage.WakeInsideCombiner push complete",
|
803
890
|
base_->LogTag().c_str());
|
804
891
|
}
|
805
892
|
if (state_ == State::kCompletedWhilePulledFromPipe) {
|
806
|
-
|
893
|
+
interceptor()->Push()->Close();
|
807
894
|
state_ = State::kCancelled;
|
808
895
|
} else {
|
809
896
|
state_ = State::kIdle;
|
@@ -825,56 +912,76 @@ struct ClientCallData::RecvInitialMetadata final {
|
|
825
912
|
// Initial state; no op seen
|
826
913
|
kInitial,
|
827
914
|
// No op seen, but we have a latch that would like to modify it when we do
|
828
|
-
|
915
|
+
kGotPipe,
|
829
916
|
// Responded to trailing metadata prior to getting a recv_initial_metadata
|
830
917
|
kRespondedToTrailingMetadataPriorToHook,
|
831
918
|
// Hooked, no latch yet
|
832
|
-
|
919
|
+
kHookedWaitingForPipe,
|
833
920
|
// Hooked, latch seen
|
834
|
-
|
921
|
+
kHookedAndGotPipe,
|
835
922
|
// Got the callback, haven't set latch yet
|
836
|
-
|
923
|
+
kCompleteWaitingForPipe,
|
837
924
|
// Got the callback and got the latch
|
838
|
-
|
925
|
+
kCompleteAndGotPipe,
|
839
926
|
// Got the callback and set the latch
|
840
|
-
|
927
|
+
kCompleteAndPushedToPipe,
|
841
928
|
// Called the original callback
|
842
929
|
kResponded,
|
843
930
|
// Called the original callback with an error: still need to set the latch
|
844
|
-
|
931
|
+
kRespondedButNeedToClosePipe,
|
845
932
|
};
|
846
933
|
|
847
934
|
State state = kInitial;
|
848
935
|
grpc_closure* original_on_ready = nullptr;
|
849
936
|
grpc_closure on_ready;
|
850
937
|
grpc_metadata_batch* metadata = nullptr;
|
851
|
-
|
938
|
+
PipeSender<ServerMetadataHandle>* server_initial_metadata_publisher = nullptr;
|
939
|
+
absl::optional<PipeSender<ServerMetadataHandle>::PushType> metadata_push_;
|
940
|
+
absl::optional<PipeReceiverNextType<ServerMetadataHandle>> metadata_next_;
|
852
941
|
|
853
942
|
static const char* StateString(State state) {
|
854
943
|
switch (state) {
|
855
944
|
case kInitial:
|
856
945
|
return "INITIAL";
|
857
|
-
case
|
858
|
-
return "
|
946
|
+
case kGotPipe:
|
947
|
+
return "GOT_PIPE";
|
859
948
|
case kRespondedToTrailingMetadataPriorToHook:
|
860
949
|
return "RESPONDED_TO_TRAILING_METADATA_PRIOR_TO_HOOK";
|
861
|
-
case
|
862
|
-
return "
|
863
|
-
case
|
864
|
-
return "
|
865
|
-
case
|
866
|
-
return "
|
867
|
-
case
|
868
|
-
return "
|
869
|
-
case
|
870
|
-
return "
|
950
|
+
case kHookedWaitingForPipe:
|
951
|
+
return "HOOKED_WAITING_FOR_PIPE";
|
952
|
+
case kHookedAndGotPipe:
|
953
|
+
return "HOOKED_AND_GOT_PIPE";
|
954
|
+
case kCompleteWaitingForPipe:
|
955
|
+
return "COMPLETE_WAITING_FOR_PIPE";
|
956
|
+
case kCompleteAndGotPipe:
|
957
|
+
return "COMPLETE_AND_GOT_PIPE";
|
958
|
+
case kCompleteAndPushedToPipe:
|
959
|
+
return "COMPLETE_AND_PUSHED_TO_PIPE";
|
871
960
|
case kResponded:
|
872
961
|
return "RESPONDED";
|
873
|
-
case
|
874
|
-
return "
|
962
|
+
case kRespondedButNeedToClosePipe:
|
963
|
+
return "RESPONDED_BUT_NEED_TO_CLOSE_PIPE";
|
875
964
|
}
|
876
965
|
return "UNKNOWN";
|
877
966
|
}
|
967
|
+
|
968
|
+
bool AllowRecvMessage() const {
|
969
|
+
switch (state) {
|
970
|
+
case kInitial:
|
971
|
+
case kGotPipe:
|
972
|
+
case kHookedWaitingForPipe:
|
973
|
+
case kHookedAndGotPipe:
|
974
|
+
case kCompleteWaitingForPipe:
|
975
|
+
case kCompleteAndGotPipe:
|
976
|
+
case kCompleteAndPushedToPipe:
|
977
|
+
case kRespondedToTrailingMetadataPriorToHook:
|
978
|
+
return false;
|
979
|
+
case kResponded:
|
980
|
+
case kRespondedButNeedToClosePipe:
|
981
|
+
return true;
|
982
|
+
}
|
983
|
+
GPR_UNREACHABLE_CODE(return false);
|
984
|
+
}
|
878
985
|
};
|
879
986
|
|
880
987
|
class ClientCallData::PollContext {
|
@@ -892,6 +999,7 @@ class ClientCallData::PollContext {
|
|
892
999
|
PollContext& operator=(const PollContext&) = delete;
|
893
1000
|
|
894
1001
|
void Run() {
|
1002
|
+
GPR_DEBUG_ASSERT(HasContext<Arena>());
|
895
1003
|
if (grpc_trace_channel.enabled()) {
|
896
1004
|
gpr_log(GPR_INFO, "%s ClientCallData.PollContext.Run %s",
|
897
1005
|
self_->LogTag().c_str(), self_->DebugString().c_str());
|
@@ -899,43 +1007,67 @@ class ClientCallData::PollContext {
|
|
899
1007
|
GPR_ASSERT(have_scoped_activity_);
|
900
1008
|
repoll_ = false;
|
901
1009
|
if (self_->send_message() != nullptr) {
|
902
|
-
self_->send_message()->WakeInsideCombiner(flusher_);
|
1010
|
+
self_->send_message()->WakeInsideCombiner(flusher_, true);
|
903
1011
|
}
|
904
1012
|
if (self_->receive_message() != nullptr) {
|
905
|
-
self_->receive_message()->WakeInsideCombiner(
|
1013
|
+
self_->receive_message()->WakeInsideCombiner(
|
1014
|
+
flusher_, self_->recv_initial_metadata_ == nullptr
|
1015
|
+
? true
|
1016
|
+
: self_->recv_initial_metadata_->AllowRecvMessage());
|
906
1017
|
}
|
907
|
-
if (self_->
|
1018
|
+
if (self_->server_initial_metadata_pipe() != nullptr) {
|
1019
|
+
if (self_->recv_initial_metadata_->metadata_push_.has_value()) {
|
1020
|
+
if ((*self_->recv_initial_metadata_->metadata_push_)().ready()) {
|
1021
|
+
self_->recv_initial_metadata_->metadata_push_.reset();
|
1022
|
+
}
|
1023
|
+
}
|
908
1024
|
switch (self_->recv_initial_metadata_->state) {
|
909
1025
|
case RecvInitialMetadata::kInitial:
|
910
|
-
case RecvInitialMetadata::
|
911
|
-
case RecvInitialMetadata::
|
912
|
-
case RecvInitialMetadata::
|
913
|
-
case RecvInitialMetadata::
|
1026
|
+
case RecvInitialMetadata::kGotPipe:
|
1027
|
+
case RecvInitialMetadata::kHookedWaitingForPipe:
|
1028
|
+
case RecvInitialMetadata::kHookedAndGotPipe:
|
1029
|
+
case RecvInitialMetadata::kCompleteWaitingForPipe:
|
914
1030
|
case RecvInitialMetadata::kResponded:
|
915
1031
|
case RecvInitialMetadata::kRespondedToTrailingMetadataPriorToHook:
|
916
1032
|
break;
|
917
|
-
case RecvInitialMetadata::
|
918
|
-
self_->recv_initial_metadata_->server_initial_metadata_publisher
|
919
|
-
|
1033
|
+
case RecvInitialMetadata::kRespondedButNeedToClosePipe:
|
1034
|
+
self_->recv_initial_metadata_->server_initial_metadata_publisher
|
1035
|
+
->Close();
|
920
1036
|
self_->recv_initial_metadata_->state =
|
921
1037
|
RecvInitialMetadata::kResponded;
|
922
1038
|
break;
|
923
|
-
case RecvInitialMetadata::
|
1039
|
+
case RecvInitialMetadata::kCompleteAndGotPipe:
|
924
1040
|
self_->recv_initial_metadata_->state =
|
925
|
-
RecvInitialMetadata::
|
926
|
-
|
927
|
-
self_->recv_initial_metadata_->
|
1041
|
+
RecvInitialMetadata::kCompleteAndPushedToPipe;
|
1042
|
+
GPR_ASSERT(
|
1043
|
+
!self_->recv_initial_metadata_->metadata_push_.has_value());
|
1044
|
+
GPR_ASSERT(
|
1045
|
+
!self_->recv_initial_metadata_->metadata_next_.has_value());
|
1046
|
+
self_->recv_initial_metadata_->metadata_push_.emplace(
|
1047
|
+
self_->recv_initial_metadata_->server_initial_metadata_publisher
|
1048
|
+
->Push(ServerMetadataHandle(
|
1049
|
+
self_->recv_initial_metadata_->metadata,
|
1050
|
+
Arena::PooledDeleter(nullptr))));
|
1051
|
+
repoll_ = true; // ensure Push() gets polled.
|
1052
|
+
self_->recv_initial_metadata_->metadata_next_.emplace(
|
1053
|
+
self_->server_initial_metadata_pipe()->receiver.Next());
|
928
1054
|
ABSL_FALLTHROUGH_INTENDED;
|
929
|
-
case RecvInitialMetadata::
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
if (
|
935
|
-
|
1055
|
+
case RecvInitialMetadata::kCompleteAndPushedToPipe: {
|
1056
|
+
GPR_ASSERT(self_->recv_initial_metadata_->metadata_next_.has_value());
|
1057
|
+
Poll<NextResult<ServerMetadataHandle>> p =
|
1058
|
+
(*self_->recv_initial_metadata_->metadata_next_)();
|
1059
|
+
if (NextResult<ServerMetadataHandle>* nr = p.value_if_ready()) {
|
1060
|
+
if (nr->has_value()) {
|
1061
|
+
ServerMetadataHandle md = std::move(nr->value());
|
1062
|
+
if (self_->recv_initial_metadata_->metadata != md.get()) {
|
1063
|
+
*self_->recv_initial_metadata_->metadata = std::move(*md);
|
1064
|
+
}
|
1065
|
+
} else {
|
1066
|
+
self_->recv_initial_metadata_->metadata->Clear();
|
936
1067
|
}
|
937
1068
|
self_->recv_initial_metadata_->state =
|
938
1069
|
RecvInitialMetadata::kResponded;
|
1070
|
+
repoll_ = true;
|
939
1071
|
flusher_->AddClosure(
|
940
1072
|
std::exchange(self_->recv_initial_metadata_->original_on_ready,
|
941
1073
|
nullptr),
|
@@ -961,10 +1093,10 @@ class ClientCallData::PollContext {
|
|
961
1093
|
return h->DebugString();
|
962
1094
|
}).c_str());
|
963
1095
|
}
|
964
|
-
if (auto* r =
|
1096
|
+
if (auto* r = poll.value_if_ready()) {
|
965
1097
|
auto md = std::move(*r);
|
966
1098
|
if (self_->send_message() != nullptr) {
|
967
|
-
self_->send_message()->Done(*md);
|
1099
|
+
self_->send_message()->Done(*md, flusher_);
|
968
1100
|
}
|
969
1101
|
if (self_->receive_message() != nullptr) {
|
970
1102
|
self_->receive_message()->Done(*md, flusher_);
|
@@ -981,25 +1113,25 @@ class ClientCallData::PollContext {
|
|
981
1113
|
if (self_->recv_initial_metadata_ != nullptr) {
|
982
1114
|
switch (self_->recv_initial_metadata_->state) {
|
983
1115
|
case RecvInitialMetadata::kInitial:
|
984
|
-
case RecvInitialMetadata::
|
1116
|
+
case RecvInitialMetadata::kGotPipe:
|
985
1117
|
self_->recv_initial_metadata_->state = RecvInitialMetadata::
|
986
1118
|
kRespondedToTrailingMetadataPriorToHook;
|
987
1119
|
break;
|
988
1120
|
case RecvInitialMetadata::
|
989
1121
|
kRespondedToTrailingMetadataPriorToHook:
|
990
|
-
case RecvInitialMetadata::
|
1122
|
+
case RecvInitialMetadata::kRespondedButNeedToClosePipe:
|
991
1123
|
Crash(absl::StrFormat("ILLEGAL STATE: %s",
|
992
1124
|
RecvInitialMetadata::StateString(
|
993
1125
|
self_->recv_initial_metadata_
|
994
1126
|
->state))); // not reachable
|
995
1127
|
break;
|
996
|
-
case RecvInitialMetadata::
|
997
|
-
case RecvInitialMetadata::
|
1128
|
+
case RecvInitialMetadata::kHookedWaitingForPipe:
|
1129
|
+
case RecvInitialMetadata::kHookedAndGotPipe:
|
998
1130
|
case RecvInitialMetadata::kResponded:
|
999
|
-
case RecvInitialMetadata::
|
1000
|
-
case RecvInitialMetadata::
|
1131
|
+
case RecvInitialMetadata::kCompleteAndGotPipe:
|
1132
|
+
case RecvInitialMetadata::kCompleteAndPushedToPipe:
|
1001
1133
|
break;
|
1002
|
-
case RecvInitialMetadata::
|
1134
|
+
case RecvInitialMetadata::kCompleteWaitingForPipe:
|
1003
1135
|
self_->recv_initial_metadata_->state =
|
1004
1136
|
RecvInitialMetadata::kResponded;
|
1005
1137
|
flusher_->AddClosure(
|
@@ -1016,25 +1148,25 @@ class ClientCallData::PollContext {
|
|
1016
1148
|
if (self_->recv_initial_metadata_ != nullptr) {
|
1017
1149
|
switch (self_->recv_initial_metadata_->state) {
|
1018
1150
|
case RecvInitialMetadata::kInitial:
|
1019
|
-
case RecvInitialMetadata::
|
1151
|
+
case RecvInitialMetadata::kGotPipe:
|
1020
1152
|
self_->recv_initial_metadata_->state = RecvInitialMetadata::
|
1021
1153
|
kRespondedToTrailingMetadataPriorToHook;
|
1022
1154
|
break;
|
1023
|
-
case RecvInitialMetadata::
|
1024
|
-
case RecvInitialMetadata::
|
1155
|
+
case RecvInitialMetadata::kHookedWaitingForPipe:
|
1156
|
+
case RecvInitialMetadata::kHookedAndGotPipe:
|
1025
1157
|
case RecvInitialMetadata::kResponded:
|
1026
1158
|
break;
|
1027
1159
|
case RecvInitialMetadata::
|
1028
1160
|
kRespondedToTrailingMetadataPriorToHook:
|
1029
|
-
case RecvInitialMetadata::
|
1161
|
+
case RecvInitialMetadata::kRespondedButNeedToClosePipe:
|
1030
1162
|
Crash(absl::StrFormat("ILLEGAL STATE: %s",
|
1031
1163
|
RecvInitialMetadata::StateString(
|
1032
1164
|
self_->recv_initial_metadata_
|
1033
1165
|
->state))); // not reachable
|
1034
1166
|
break;
|
1035
|
-
case RecvInitialMetadata::
|
1036
|
-
case RecvInitialMetadata::
|
1037
|
-
case RecvInitialMetadata::
|
1167
|
+
case RecvInitialMetadata::kCompleteWaitingForPipe:
|
1168
|
+
case RecvInitialMetadata::kCompleteAndGotPipe:
|
1169
|
+
case RecvInitialMetadata::kCompleteAndPushedToPipe:
|
1038
1170
|
self_->recv_initial_metadata_->state =
|
1039
1171
|
RecvInitialMetadata::kResponded;
|
1040
1172
|
flusher_->AddClosure(
|
@@ -1099,6 +1231,7 @@ class ClientCallData::PollContext {
|
|
1099
1231
|
auto run = [](void* p, grpc_error_handle) {
|
1100
1232
|
auto* next_poll = static_cast<NextPoll*>(p);
|
1101
1233
|
{
|
1234
|
+
ScopedContext ctx(next_poll->call_data);
|
1102
1235
|
Flusher flusher(next_poll->call_data);
|
1103
1236
|
next_poll->call_data->WakeInsideCombiner(&flusher);
|
1104
1237
|
}
|
@@ -1133,11 +1266,16 @@ class ClientCallData::PollContext {
|
|
1133
1266
|
ClientCallData::ClientCallData(grpc_call_element* elem,
|
1134
1267
|
const grpc_call_element_args* args,
|
1135
1268
|
uint8_t flags)
|
1136
|
-
: BaseCallData(
|
1269
|
+
: BaseCallData(
|
1270
|
+
elem, args, flags,
|
1271
|
+
[args]() {
|
1272
|
+
return args->arena->New<ReceiveInterceptor>(args->arena);
|
1273
|
+
},
|
1274
|
+
[args]() { return args->arena->New<SendInterceptor>(args->arena); }) {
|
1137
1275
|
GRPC_CLOSURE_INIT(&recv_trailing_metadata_ready_,
|
1138
1276
|
RecvTrailingMetadataReadyCallback, this,
|
1139
1277
|
grpc_schedule_on_exec_ctx);
|
1140
|
-
if (
|
1278
|
+
if (server_initial_metadata_pipe() != nullptr) {
|
1141
1279
|
recv_initial_metadata_ = arena()->New<RecvInitialMetadata>();
|
1142
1280
|
}
|
1143
1281
|
}
|
@@ -1200,7 +1338,7 @@ std::string ClientCallData::DebugString() const {
|
|
1200
1338
|
" sent_initial_state=", StateString(send_initial_state_),
|
1201
1339
|
" recv_trailing_state=", StateString(recv_trailing_state_), " captured={",
|
1202
1340
|
absl::StrJoin(captured, ","), "}",
|
1203
|
-
|
1341
|
+
server_initial_metadata_pipe() == nullptr
|
1204
1342
|
? ""
|
1205
1343
|
: absl::StrCat(" recv_initial_metadata=",
|
1206
1344
|
RecvInitialMetadata::StateString(
|
@@ -1242,21 +1380,21 @@ void ClientCallData::StartBatch(grpc_transport_stream_op_batch* b) {
|
|
1242
1380
|
switch (recv_initial_metadata_->state) {
|
1243
1381
|
case RecvInitialMetadata::kInitial:
|
1244
1382
|
recv_initial_metadata_->state =
|
1245
|
-
RecvInitialMetadata::
|
1383
|
+
RecvInitialMetadata::kHookedWaitingForPipe;
|
1246
1384
|
break;
|
1247
|
-
case RecvInitialMetadata::
|
1248
|
-
recv_initial_metadata_->state = RecvInitialMetadata::
|
1385
|
+
case RecvInitialMetadata::kGotPipe:
|
1386
|
+
recv_initial_metadata_->state = RecvInitialMetadata::kHookedAndGotPipe;
|
1249
1387
|
break;
|
1250
1388
|
case RecvInitialMetadata::kRespondedToTrailingMetadataPriorToHook:
|
1251
1389
|
hook = false;
|
1252
1390
|
break;
|
1253
|
-
case RecvInitialMetadata::
|
1254
|
-
case RecvInitialMetadata::
|
1255
|
-
case RecvInitialMetadata::
|
1256
|
-
case RecvInitialMetadata::
|
1257
|
-
case RecvInitialMetadata::
|
1391
|
+
case RecvInitialMetadata::kHookedWaitingForPipe:
|
1392
|
+
case RecvInitialMetadata::kHookedAndGotPipe:
|
1393
|
+
case RecvInitialMetadata::kCompleteWaitingForPipe:
|
1394
|
+
case RecvInitialMetadata::kCompleteAndGotPipe:
|
1395
|
+
case RecvInitialMetadata::kCompleteAndPushedToPipe:
|
1258
1396
|
case RecvInitialMetadata::kResponded:
|
1259
|
-
case RecvInitialMetadata::
|
1397
|
+
case RecvInitialMetadata::kRespondedButNeedToClosePipe:
|
1260
1398
|
Crash(absl::StrFormat(
|
1261
1399
|
"ILLEGAL STATE: %s",
|
1262
1400
|
RecvInitialMetadata::StateString(
|
@@ -1360,9 +1498,9 @@ void ClientCallData::Cancel(grpc_error_handle error, Flusher* flusher) {
|
|
1360
1498
|
}
|
1361
1499
|
if (recv_initial_metadata_ != nullptr) {
|
1362
1500
|
switch (recv_initial_metadata_->state) {
|
1363
|
-
case RecvInitialMetadata::
|
1364
|
-
case RecvInitialMetadata::
|
1365
|
-
case RecvInitialMetadata::
|
1501
|
+
case RecvInitialMetadata::kCompleteWaitingForPipe:
|
1502
|
+
case RecvInitialMetadata::kCompleteAndGotPipe:
|
1503
|
+
case RecvInitialMetadata::kCompleteAndPushedToPipe:
|
1366
1504
|
recv_initial_metadata_->state = RecvInitialMetadata::kResponded;
|
1367
1505
|
GRPC_CALL_COMBINER_START(
|
1368
1506
|
call_combiner(),
|
@@ -1370,13 +1508,13 @@ void ClientCallData::Cancel(grpc_error_handle error, Flusher* flusher) {
|
|
1370
1508
|
error, "propagate cancellation");
|
1371
1509
|
break;
|
1372
1510
|
case RecvInitialMetadata::kInitial:
|
1373
|
-
case RecvInitialMetadata::
|
1511
|
+
case RecvInitialMetadata::kGotPipe:
|
1374
1512
|
case RecvInitialMetadata::kRespondedToTrailingMetadataPriorToHook:
|
1375
|
-
case RecvInitialMetadata::
|
1376
|
-
case RecvInitialMetadata::
|
1513
|
+
case RecvInitialMetadata::kHookedWaitingForPipe:
|
1514
|
+
case RecvInitialMetadata::kHookedAndGotPipe:
|
1377
1515
|
case RecvInitialMetadata::kResponded:
|
1378
1516
|
break;
|
1379
|
-
case RecvInitialMetadata::
|
1517
|
+
case RecvInitialMetadata::kRespondedButNeedToClosePipe:
|
1380
1518
|
Crash(absl::StrFormat(
|
1381
1519
|
"ILLEGAL STATE: %s",
|
1382
1520
|
RecvInitialMetadata::StateString(recv_initial_metadata_->state)));
|
@@ -1384,7 +1522,7 @@ void ClientCallData::Cancel(grpc_error_handle error, Flusher* flusher) {
|
|
1384
1522
|
}
|
1385
1523
|
}
|
1386
1524
|
if (send_message() != nullptr) {
|
1387
|
-
send_message()->Done(*ServerMetadataFromStatus(error));
|
1525
|
+
send_message()->Done(*ServerMetadataFromStatus(error), flusher);
|
1388
1526
|
}
|
1389
1527
|
if (receive_message() != nullptr) {
|
1390
1528
|
receive_message()->Done(*ServerMetadataFromStatus(error), flusher);
|
@@ -1402,8 +1540,15 @@ void ClientCallData::StartPromise(Flusher* flusher) {
|
|
1402
1540
|
promise_ = filter->MakeCallPromise(
|
1403
1541
|
CallArgs{WrapMetadata(send_initial_metadata_batch_->payload
|
1404
1542
|
->send_initial_metadata.send_initial_metadata),
|
1405
|
-
|
1406
|
-
|
1543
|
+
server_initial_metadata_pipe() == nullptr
|
1544
|
+
? nullptr
|
1545
|
+
: &server_initial_metadata_pipe()->sender,
|
1546
|
+
send_message() == nullptr
|
1547
|
+
? nullptr
|
1548
|
+
: send_message()->interceptor()->original_receiver(),
|
1549
|
+
receive_message() == nullptr
|
1550
|
+
? nullptr
|
1551
|
+
: receive_message()->interceptor()->original_sender()},
|
1407
1552
|
[this](CallArgs call_args) {
|
1408
1553
|
return MakeNextPromise(std::move(call_args));
|
1409
1554
|
});
|
@@ -1412,28 +1557,30 @@ void ClientCallData::StartPromise(Flusher* flusher) {
|
|
1412
1557
|
|
1413
1558
|
void ClientCallData::RecvInitialMetadataReady(grpc_error_handle error) {
|
1414
1559
|
if (grpc_trace_channel.enabled()) {
|
1415
|
-
gpr_log(GPR_INFO,
|
1416
|
-
|
1560
|
+
gpr_log(GPR_INFO,
|
1561
|
+
"%s ClientCallData.RecvInitialMetadataReady %s error:%s md:%s",
|
1562
|
+
LogTag().c_str(), DebugString().c_str(), error.ToString().c_str(),
|
1563
|
+
recv_initial_metadata_->metadata->DebugString().c_str());
|
1417
1564
|
}
|
1418
1565
|
ScopedContext context(this);
|
1419
1566
|
Flusher flusher(this);
|
1420
1567
|
if (!error.ok()) {
|
1421
1568
|
switch (recv_initial_metadata_->state) {
|
1422
|
-
case RecvInitialMetadata::
|
1569
|
+
case RecvInitialMetadata::kHookedWaitingForPipe:
|
1423
1570
|
recv_initial_metadata_->state = RecvInitialMetadata::kResponded;
|
1424
1571
|
break;
|
1425
|
-
case RecvInitialMetadata::
|
1572
|
+
case RecvInitialMetadata::kHookedAndGotPipe:
|
1426
1573
|
recv_initial_metadata_->state =
|
1427
|
-
RecvInitialMetadata::
|
1574
|
+
RecvInitialMetadata::kRespondedButNeedToClosePipe;
|
1428
1575
|
break;
|
1429
1576
|
case RecvInitialMetadata::kInitial:
|
1430
|
-
case RecvInitialMetadata::
|
1431
|
-
case RecvInitialMetadata::
|
1432
|
-
case RecvInitialMetadata::
|
1433
|
-
case RecvInitialMetadata::
|
1577
|
+
case RecvInitialMetadata::kGotPipe:
|
1578
|
+
case RecvInitialMetadata::kCompleteWaitingForPipe:
|
1579
|
+
case RecvInitialMetadata::kCompleteAndGotPipe:
|
1580
|
+
case RecvInitialMetadata::kCompleteAndPushedToPipe:
|
1434
1581
|
case RecvInitialMetadata::kResponded:
|
1435
1582
|
case RecvInitialMetadata::kRespondedToTrailingMetadataPriorToHook:
|
1436
|
-
case RecvInitialMetadata::
|
1583
|
+
case RecvInitialMetadata::kRespondedButNeedToClosePipe:
|
1437
1584
|
Crash(absl::StrFormat(
|
1438
1585
|
"ILLEGAL STATE: %s",
|
1439
1586
|
RecvInitialMetadata::StateString(
|
@@ -1450,22 +1597,22 @@ void ClientCallData::RecvInitialMetadataReady(grpc_error_handle error) {
|
|
1450
1597
|
cancelled_error_, "propagate cancellation");
|
1451
1598
|
} else {
|
1452
1599
|
switch (recv_initial_metadata_->state) {
|
1453
|
-
case RecvInitialMetadata::
|
1600
|
+
case RecvInitialMetadata::kHookedWaitingForPipe:
|
1454
1601
|
recv_initial_metadata_->state =
|
1455
|
-
RecvInitialMetadata::
|
1602
|
+
RecvInitialMetadata::kCompleteWaitingForPipe;
|
1456
1603
|
break;
|
1457
|
-
case RecvInitialMetadata::
|
1604
|
+
case RecvInitialMetadata::kHookedAndGotPipe:
|
1458
1605
|
recv_initial_metadata_->state =
|
1459
|
-
RecvInitialMetadata::
|
1606
|
+
RecvInitialMetadata::kCompleteAndGotPipe;
|
1460
1607
|
break;
|
1461
1608
|
case RecvInitialMetadata::kInitial:
|
1462
|
-
case RecvInitialMetadata::
|
1463
|
-
case RecvInitialMetadata::
|
1464
|
-
case RecvInitialMetadata::
|
1465
|
-
case RecvInitialMetadata::
|
1609
|
+
case RecvInitialMetadata::kGotPipe:
|
1610
|
+
case RecvInitialMetadata::kCompleteWaitingForPipe:
|
1611
|
+
case RecvInitialMetadata::kCompleteAndGotPipe:
|
1612
|
+
case RecvInitialMetadata::kCompleteAndPushedToPipe:
|
1466
1613
|
case RecvInitialMetadata::kResponded:
|
1467
1614
|
case RecvInitialMetadata::kRespondedToTrailingMetadataPriorToHook:
|
1468
|
-
case RecvInitialMetadata::
|
1615
|
+
case RecvInitialMetadata::kRespondedButNeedToClosePipe:
|
1469
1616
|
Crash(absl::StrFormat(
|
1470
1617
|
"ILLEGAL STATE: %s",
|
1471
1618
|
RecvInitialMetadata::StateString(
|
@@ -1512,24 +1659,24 @@ ArenaPromise<ServerMetadataHandle> ClientCallData::MakeNextPromise(
|
|
1512
1659
|
call_args.server_initial_metadata;
|
1513
1660
|
switch (recv_initial_metadata_->state) {
|
1514
1661
|
case RecvInitialMetadata::kInitial:
|
1515
|
-
recv_initial_metadata_->state = RecvInitialMetadata::
|
1662
|
+
recv_initial_metadata_->state = RecvInitialMetadata::kGotPipe;
|
1516
1663
|
break;
|
1517
|
-
case RecvInitialMetadata::
|
1518
|
-
recv_initial_metadata_->state = RecvInitialMetadata::
|
1664
|
+
case RecvInitialMetadata::kHookedWaitingForPipe:
|
1665
|
+
recv_initial_metadata_->state = RecvInitialMetadata::kHookedAndGotPipe;
|
1519
1666
|
poll_ctx_->Repoll();
|
1520
1667
|
break;
|
1521
|
-
case RecvInitialMetadata::
|
1668
|
+
case RecvInitialMetadata::kCompleteWaitingForPipe:
|
1522
1669
|
recv_initial_metadata_->state =
|
1523
|
-
RecvInitialMetadata::
|
1670
|
+
RecvInitialMetadata::kCompleteAndGotPipe;
|
1524
1671
|
poll_ctx_->Repoll();
|
1525
1672
|
break;
|
1526
|
-
case RecvInitialMetadata::
|
1527
|
-
case RecvInitialMetadata::
|
1528
|
-
case RecvInitialMetadata::
|
1529
|
-
case RecvInitialMetadata::
|
1673
|
+
case RecvInitialMetadata::kGotPipe:
|
1674
|
+
case RecvInitialMetadata::kHookedAndGotPipe:
|
1675
|
+
case RecvInitialMetadata::kCompleteAndGotPipe:
|
1676
|
+
case RecvInitialMetadata::kCompleteAndPushedToPipe:
|
1530
1677
|
case RecvInitialMetadata::kResponded:
|
1531
1678
|
case RecvInitialMetadata::kRespondedToTrailingMetadataPriorToHook:
|
1532
|
-
case RecvInitialMetadata::
|
1679
|
+
case RecvInitialMetadata::kRespondedButNeedToClosePipe:
|
1533
1680
|
Crash(absl::StrFormat(
|
1534
1681
|
"ILLEGAL STATE: %s",
|
1535
1682
|
RecvInitialMetadata::StateString(
|
@@ -1539,14 +1686,14 @@ ArenaPromise<ServerMetadataHandle> ClientCallData::MakeNextPromise(
|
|
1539
1686
|
GPR_ASSERT(call_args.server_initial_metadata == nullptr);
|
1540
1687
|
}
|
1541
1688
|
if (send_message() != nullptr) {
|
1542
|
-
send_message()->GotPipe(call_args.
|
1689
|
+
send_message()->GotPipe(call_args.client_to_server_messages);
|
1543
1690
|
} else {
|
1544
|
-
GPR_ASSERT(call_args.
|
1691
|
+
GPR_ASSERT(call_args.client_to_server_messages == nullptr);
|
1545
1692
|
}
|
1546
1693
|
if (receive_message() != nullptr) {
|
1547
|
-
receive_message()->GotPipe(call_args.
|
1694
|
+
receive_message()->GotPipe(call_args.server_to_client_messages);
|
1548
1695
|
} else {
|
1549
|
-
GPR_ASSERT(call_args.
|
1696
|
+
GPR_ASSERT(call_args.server_to_client_messages == nullptr);
|
1550
1697
|
}
|
1551
1698
|
return ArenaPromise<ServerMetadataHandle>(
|
1552
1699
|
[this]() { return PollTrailingMetadata(); });
|
@@ -1640,7 +1787,7 @@ void ClientCallData::RecvTrailingMetadataReady(grpc_error_handle error) {
|
|
1640
1787
|
receive_message()->Done(*recv_trailing_metadata_, &flusher);
|
1641
1788
|
}
|
1642
1789
|
if (send_message() != nullptr) {
|
1643
|
-
send_message()->Done(*recv_trailing_metadata_);
|
1790
|
+
send_message()->Done(*recv_trailing_metadata_, &flusher);
|
1644
1791
|
}
|
1645
1792
|
// Repoll the promise.
|
1646
1793
|
ScopedContext context(this);
|
@@ -1677,29 +1824,31 @@ void ClientCallData::OnWakeup() {
|
|
1677
1824
|
struct ServerCallData::SendInitialMetadata {
|
1678
1825
|
enum State {
|
1679
1826
|
kInitial,
|
1680
|
-
|
1681
|
-
|
1682
|
-
|
1683
|
-
|
1827
|
+
kGotPipe,
|
1828
|
+
kQueuedWaitingForPipe,
|
1829
|
+
kQueuedAndGotPipe,
|
1830
|
+
kQueuedAndPushedToPipe,
|
1684
1831
|
kForwarded,
|
1685
1832
|
kCancelled,
|
1686
1833
|
};
|
1687
1834
|
State state = kInitial;
|
1688
1835
|
CapturedBatch batch;
|
1689
|
-
|
1836
|
+
PipeSender<ServerMetadataHandle>* server_initial_metadata_publisher = nullptr;
|
1837
|
+
absl::optional<PipeSender<ServerMetadataHandle>::PushType> metadata_push_;
|
1838
|
+
absl::optional<PipeReceiverNextType<ServerMetadataHandle>> metadata_next_;
|
1690
1839
|
|
1691
1840
|
static const char* StateString(State state) {
|
1692
1841
|
switch (state) {
|
1693
1842
|
case kInitial:
|
1694
1843
|
return "INITIAL";
|
1695
|
-
case
|
1696
|
-
return "
|
1697
|
-
case
|
1698
|
-
return "
|
1699
|
-
case
|
1700
|
-
return "
|
1701
|
-
case
|
1702
|
-
return "
|
1844
|
+
case kGotPipe:
|
1845
|
+
return "GOT_PIPE";
|
1846
|
+
case kQueuedWaitingForPipe:
|
1847
|
+
return "QUEUED_WAITING_FOR_PIPE";
|
1848
|
+
case kQueuedAndGotPipe:
|
1849
|
+
return "QUEUED_AND_GOT_PIPE";
|
1850
|
+
case kQueuedAndPushedToPipe:
|
1851
|
+
return "QUEUED_AND_PUSHED_TO_PIPE";
|
1703
1852
|
case kForwarded:
|
1704
1853
|
return "FORWARDED";
|
1705
1854
|
case kCancelled:
|
@@ -1734,6 +1883,7 @@ class ServerCallData::PollContext {
|
|
1734
1883
|
auto* next_poll = static_cast<NextPoll*>(p);
|
1735
1884
|
{
|
1736
1885
|
Flusher flusher(next_poll->call_data);
|
1886
|
+
ScopedContext context(next_poll->call_data);
|
1737
1887
|
next_poll->call_data->WakeInsideCombiner(&flusher);
|
1738
1888
|
}
|
1739
1889
|
GRPC_CALL_STACK_UNREF(next_poll->call_stack, "re-poll");
|
@@ -1781,6 +1931,8 @@ const char* ServerCallData::StateString(SendTrailingState state) {
|
|
1781
1931
|
return "FORWARDED";
|
1782
1932
|
case SendTrailingState::kQueuedBehindSendMessage:
|
1783
1933
|
return "QUEUED_BEHIND_SEND_MESSAGE";
|
1934
|
+
case SendTrailingState::kQueuedButHaventClosedSends:
|
1935
|
+
return "QUEUED_BUT_HAVENT_CLOSED_SENDS";
|
1784
1936
|
case SendTrailingState::kQueued:
|
1785
1937
|
return "QUEUED";
|
1786
1938
|
case SendTrailingState::kCancelled:
|
@@ -1792,8 +1944,13 @@ const char* ServerCallData::StateString(SendTrailingState state) {
|
|
1792
1944
|
ServerCallData::ServerCallData(grpc_call_element* elem,
|
1793
1945
|
const grpc_call_element_args* args,
|
1794
1946
|
uint8_t flags)
|
1795
|
-
: BaseCallData(
|
1796
|
-
|
1947
|
+
: BaseCallData(
|
1948
|
+
elem, args, flags,
|
1949
|
+
[args]() { return args->arena->New<SendInterceptor>(args->arena); },
|
1950
|
+
[args]() {
|
1951
|
+
return args->arena->New<ReceiveInterceptor>(args->arena);
|
1952
|
+
}) {
|
1953
|
+
if (server_initial_metadata_pipe() != nullptr) {
|
1797
1954
|
send_initial_metadata_ = arena()->New<SendInitialMetadata>();
|
1798
1955
|
}
|
1799
1956
|
GRPC_CLOSURE_INIT(&recv_initial_metadata_ready_,
|
@@ -1881,19 +2038,19 @@ void ServerCallData::StartBatch(grpc_transport_stream_op_batch* b) {
|
|
1881
2038
|
switch (send_initial_metadata_->state) {
|
1882
2039
|
case SendInitialMetadata::kInitial:
|
1883
2040
|
send_initial_metadata_->state =
|
1884
|
-
SendInitialMetadata::
|
2041
|
+
SendInitialMetadata::kQueuedWaitingForPipe;
|
1885
2042
|
break;
|
1886
|
-
case SendInitialMetadata::
|
1887
|
-
send_initial_metadata_->state = SendInitialMetadata::
|
2043
|
+
case SendInitialMetadata::kGotPipe:
|
2044
|
+
send_initial_metadata_->state = SendInitialMetadata::kQueuedAndGotPipe;
|
1888
2045
|
break;
|
1889
2046
|
case SendInitialMetadata::kCancelled:
|
1890
2047
|
batch.CancelWith(
|
1891
2048
|
cancelled_error_.ok() ? absl::CancelledError() : cancelled_error_,
|
1892
2049
|
&flusher);
|
1893
2050
|
break;
|
1894
|
-
case SendInitialMetadata::
|
1895
|
-
case SendInitialMetadata::
|
1896
|
-
case SendInitialMetadata::
|
2051
|
+
case SendInitialMetadata::kQueuedAndGotPipe:
|
2052
|
+
case SendInitialMetadata::kQueuedWaitingForPipe:
|
2053
|
+
case SendInitialMetadata::kQueuedAndPushedToPipe:
|
1897
2054
|
case SendInitialMetadata::kForwarded:
|
1898
2055
|
Crash(absl::StrFormat(
|
1899
2056
|
"ILLEGAL STATE: %s",
|
@@ -1926,6 +2083,9 @@ void ServerCallData::StartBatch(grpc_transport_stream_op_batch* b) {
|
|
1926
2083
|
}
|
1927
2084
|
if (send_message() != nullptr && !send_message()->IsIdle()) {
|
1928
2085
|
send_trailing_state_ = SendTrailingState::kQueuedBehindSendMessage;
|
2086
|
+
} else if (send_message() != nullptr) {
|
2087
|
+
send_trailing_state_ = SendTrailingState::kQueuedButHaventClosedSends;
|
2088
|
+
wake = true;
|
1929
2089
|
} else {
|
1930
2090
|
send_trailing_state_ = SendTrailingState::kQueued;
|
1931
2091
|
wake = true;
|
@@ -1933,6 +2093,7 @@ void ServerCallData::StartBatch(grpc_transport_stream_op_batch* b) {
|
|
1933
2093
|
break;
|
1934
2094
|
case SendTrailingState::kQueued:
|
1935
2095
|
case SendTrailingState::kQueuedBehindSendMessage:
|
2096
|
+
case SendTrailingState::kQueuedButHaventClosedSends:
|
1936
2097
|
case SendTrailingState::kForwarded:
|
1937
2098
|
Crash(
|
1938
2099
|
absl::StrFormat("ILLEGAL STATE: %s",
|
@@ -1952,26 +2113,55 @@ void ServerCallData::StartBatch(grpc_transport_stream_op_batch* b) {
|
|
1952
2113
|
|
1953
2114
|
// Handle cancellation.
|
1954
2115
|
void ServerCallData::Completed(grpc_error_handle error, Flusher* flusher) {
|
2116
|
+
if (grpc_trace_channel.enabled()) {
|
2117
|
+
gpr_log(
|
2118
|
+
GPR_DEBUG,
|
2119
|
+
"%sServerCallData::Completed: send_trailing_state=%s "
|
2120
|
+
"send_initial_state=%s error=%s",
|
2121
|
+
LogTag().c_str(), StateString(send_trailing_state_),
|
2122
|
+
send_initial_metadata_ == nullptr
|
2123
|
+
? "null"
|
2124
|
+
: SendInitialMetadata::StateString(send_initial_metadata_->state),
|
2125
|
+
error.ToString().c_str());
|
2126
|
+
}
|
1955
2127
|
// Track the latest reason for cancellation.
|
1956
2128
|
cancelled_error_ = error;
|
1957
2129
|
// Stop running the promise.
|
1958
2130
|
promise_ = ArenaPromise<ServerMetadataHandle>();
|
1959
|
-
|
1960
|
-
|
1961
|
-
|
1962
|
-
|
1963
|
-
|
2131
|
+
switch (send_trailing_state_) {
|
2132
|
+
case SendTrailingState::kInitial:
|
2133
|
+
case SendTrailingState::kForwarded:
|
2134
|
+
send_trailing_state_ = SendTrailingState::kCancelled;
|
2135
|
+
if (!error.ok()) {
|
2136
|
+
auto* batch = grpc_make_transport_stream_op(
|
2137
|
+
NewClosure([call_combiner = call_combiner()](absl::Status) {
|
2138
|
+
GRPC_CALL_COMBINER_STOP(call_combiner, "done-cancel");
|
2139
|
+
}));
|
2140
|
+
batch->cancel_stream = true;
|
2141
|
+
batch->payload->cancel_stream.cancel_error = error;
|
2142
|
+
flusher->Resume(batch);
|
2143
|
+
}
|
2144
|
+
break;
|
2145
|
+
case SendTrailingState::kQueued:
|
2146
|
+
send_trailing_state_ = SendTrailingState::kCancelled;
|
2147
|
+
send_trailing_metadata_batch_.CancelWith(error, flusher);
|
2148
|
+
break;
|
2149
|
+
case SendTrailingState::kQueuedBehindSendMessage:
|
2150
|
+
case SendTrailingState::kQueuedButHaventClosedSends:
|
2151
|
+
case SendTrailingState::kCancelled:
|
2152
|
+
send_trailing_state_ = SendTrailingState::kCancelled;
|
2153
|
+
break;
|
1964
2154
|
}
|
1965
2155
|
if (send_initial_metadata_ != nullptr) {
|
1966
2156
|
switch (send_initial_metadata_->state) {
|
1967
2157
|
case SendInitialMetadata::kInitial:
|
1968
|
-
case SendInitialMetadata::
|
2158
|
+
case SendInitialMetadata::kGotPipe:
|
1969
2159
|
case SendInitialMetadata::kForwarded:
|
1970
2160
|
case SendInitialMetadata::kCancelled:
|
1971
2161
|
break;
|
1972
|
-
case SendInitialMetadata::
|
1973
|
-
case SendInitialMetadata::
|
1974
|
-
case SendInitialMetadata::
|
2162
|
+
case SendInitialMetadata::kQueuedWaitingForPipe:
|
2163
|
+
case SendInitialMetadata::kQueuedAndGotPipe:
|
2164
|
+
case SendInitialMetadata::kQueuedAndPushedToPipe:
|
1975
2165
|
send_initial_metadata_->batch.CancelWith(error, flusher);
|
1976
2166
|
break;
|
1977
2167
|
}
|
@@ -1983,7 +2173,7 @@ void ServerCallData::Completed(grpc_error_handle error, Flusher* flusher) {
|
|
1983
2173
|
}
|
1984
2174
|
ScopedContext ctx(this);
|
1985
2175
|
if (send_message() != nullptr) {
|
1986
|
-
send_message()->Done(*ServerMetadataFromStatus(error));
|
2176
|
+
send_message()->Done(*ServerMetadataFromStatus(error), flusher);
|
1987
2177
|
}
|
1988
2178
|
if (receive_message() != nullptr) {
|
1989
2179
|
receive_message()->Done(*ServerMetadataFromStatus(error), flusher);
|
@@ -2008,19 +2198,19 @@ ArenaPromise<ServerMetadataHandle> ServerCallData::MakeNextPromise(
|
|
2008
2198
|
call_args.server_initial_metadata;
|
2009
2199
|
switch (send_initial_metadata_->state) {
|
2010
2200
|
case SendInitialMetadata::kInitial:
|
2011
|
-
send_initial_metadata_->state = SendInitialMetadata::
|
2201
|
+
send_initial_metadata_->state = SendInitialMetadata::kGotPipe;
|
2012
2202
|
break;
|
2013
|
-
case SendInitialMetadata::
|
2014
|
-
case SendInitialMetadata::
|
2015
|
-
case SendInitialMetadata::
|
2203
|
+
case SendInitialMetadata::kGotPipe:
|
2204
|
+
case SendInitialMetadata::kQueuedAndGotPipe:
|
2205
|
+
case SendInitialMetadata::kQueuedAndPushedToPipe:
|
2016
2206
|
case SendInitialMetadata::kForwarded:
|
2017
2207
|
Crash(absl::StrFormat(
|
2018
2208
|
"ILLEGAL STATE: %s",
|
2019
2209
|
SendInitialMetadata::StateString(
|
2020
2210
|
send_initial_metadata_->state))); // not reachable
|
2021
2211
|
break;
|
2022
|
-
case SendInitialMetadata::
|
2023
|
-
send_initial_metadata_->state = SendInitialMetadata::
|
2212
|
+
case SendInitialMetadata::kQueuedWaitingForPipe:
|
2213
|
+
send_initial_metadata_->state = SendInitialMetadata::kQueuedAndGotPipe;
|
2024
2214
|
break;
|
2025
2215
|
case SendInitialMetadata::kCancelled:
|
2026
2216
|
break;
|
@@ -2029,14 +2219,14 @@ ArenaPromise<ServerMetadataHandle> ServerCallData::MakeNextPromise(
|
|
2029
2219
|
GPR_ASSERT(call_args.server_initial_metadata == nullptr);
|
2030
2220
|
}
|
2031
2221
|
if (send_message() != nullptr) {
|
2032
|
-
send_message()->GotPipe(call_args.
|
2222
|
+
send_message()->GotPipe(call_args.server_to_client_messages);
|
2033
2223
|
} else {
|
2034
|
-
GPR_ASSERT(call_args.
|
2224
|
+
GPR_ASSERT(call_args.server_to_client_messages == nullptr);
|
2035
2225
|
}
|
2036
2226
|
if (receive_message() != nullptr) {
|
2037
|
-
receive_message()->GotPipe(call_args.
|
2227
|
+
receive_message()->GotPipe(call_args.client_to_server_messages);
|
2038
2228
|
} else {
|
2039
|
-
GPR_ASSERT(call_args.
|
2229
|
+
GPR_ASSERT(call_args.client_to_server_messages == nullptr);
|
2040
2230
|
}
|
2041
2231
|
return ArenaPromise<ServerMetadataHandle>(
|
2042
2232
|
[this]() { return PollTrailingMetadata(); });
|
@@ -2046,9 +2236,14 @@ ArenaPromise<ServerMetadataHandle> ServerCallData::MakeNextPromise(
|
|
2046
2236
|
// All polls: await sending the trailing metadata, then foward it down the
|
2047
2237
|
// stack.
|
2048
2238
|
Poll<ServerMetadataHandle> ServerCallData::PollTrailingMetadata() {
|
2239
|
+
if (grpc_trace_channel.enabled()) {
|
2240
|
+
gpr_log(GPR_INFO, "%s PollTrailingMetadata: %s", LogTag().c_str(),
|
2241
|
+
StateString(send_trailing_state_));
|
2242
|
+
}
|
2049
2243
|
switch (send_trailing_state_) {
|
2050
2244
|
case SendTrailingState::kInitial:
|
2051
2245
|
case SendTrailingState::kQueuedBehindSendMessage:
|
2246
|
+
case SendTrailingState::kQueuedButHaventClosedSends:
|
2052
2247
|
return Pending{};
|
2053
2248
|
case SendTrailingState::kQueued:
|
2054
2249
|
return WrapMetadata(send_trailing_metadata_batch_->payload
|
@@ -2111,22 +2306,24 @@ void ServerCallData::RecvInitialMetadataReady(grpc_error_handle error) {
|
|
2111
2306
|
ScopedContext context(this);
|
2112
2307
|
// Construct the promise.
|
2113
2308
|
ChannelFilter* filter = static_cast<ChannelFilter*>(elem()->channel_data);
|
2114
|
-
FakeActivity().Run([this, filter] {
|
2309
|
+
FakeActivity(this).Run([this, filter] {
|
2115
2310
|
promise_ = filter->MakeCallPromise(
|
2116
2311
|
CallArgs{WrapMetadata(recv_initial_metadata_),
|
2117
|
-
|
2118
|
-
|
2312
|
+
server_initial_metadata_pipe() == nullptr
|
2313
|
+
? nullptr
|
2314
|
+
: &server_initial_metadata_pipe()->sender,
|
2315
|
+
receive_message() == nullptr
|
2316
|
+
? nullptr
|
2317
|
+
: receive_message()->interceptor()->original_receiver(),
|
2318
|
+
send_message() == nullptr
|
2319
|
+
? nullptr
|
2320
|
+
: send_message()->interceptor()->original_sender()},
|
2119
2321
|
[this](CallArgs call_args) {
|
2120
2322
|
return MakeNextPromise(std::move(call_args));
|
2121
2323
|
});
|
2122
2324
|
});
|
2123
2325
|
// Poll once.
|
2124
2326
|
WakeInsideCombiner(&flusher);
|
2125
|
-
if (auto* closure =
|
2126
|
-
std::exchange(original_recv_initial_metadata_ready_, nullptr)) {
|
2127
|
-
flusher.AddClosure(closure, absl::OkStatus(),
|
2128
|
-
"original_recv_initial_metadata");
|
2129
|
-
}
|
2130
2327
|
}
|
2131
2328
|
|
2132
2329
|
std::string ServerCallData::DebugString() const {
|
@@ -2157,61 +2354,125 @@ void ServerCallData::WakeInsideCombiner(Flusher* flusher) {
|
|
2157
2354
|
gpr_log(GPR_INFO, "%s: WakeInsideCombiner %s", LogTag().c_str(),
|
2158
2355
|
DebugString().c_str());
|
2159
2356
|
}
|
2160
|
-
if (send_initial_metadata_ != nullptr &&
|
2161
|
-
send_initial_metadata_->state ==
|
2162
|
-
SendInitialMetadata::kQueuedAndGotLatch) {
|
2163
|
-
send_initial_metadata_->state = SendInitialMetadata::kQueuedAndSetLatch;
|
2164
|
-
send_initial_metadata_->server_initial_metadata_publisher->Set(
|
2165
|
-
send_initial_metadata_->batch->payload->send_initial_metadata
|
2166
|
-
.send_initial_metadata);
|
2167
|
-
}
|
2168
2357
|
poll_ctx.ClearRepoll();
|
2358
|
+
if (send_initial_metadata_ != nullptr) {
|
2359
|
+
if (send_initial_metadata_->state ==
|
2360
|
+
SendInitialMetadata::kQueuedAndGotPipe) {
|
2361
|
+
send_initial_metadata_->state =
|
2362
|
+
SendInitialMetadata::kQueuedAndPushedToPipe;
|
2363
|
+
GPR_ASSERT(!send_initial_metadata_->metadata_push_.has_value());
|
2364
|
+
GPR_ASSERT(!send_initial_metadata_->metadata_next_.has_value());
|
2365
|
+
send_initial_metadata_->metadata_push_.emplace(
|
2366
|
+
send_initial_metadata_->server_initial_metadata_publisher->Push(
|
2367
|
+
ServerMetadataHandle(
|
2368
|
+
send_initial_metadata_->batch->payload->send_initial_metadata
|
2369
|
+
.send_initial_metadata,
|
2370
|
+
Arena::PooledDeleter(nullptr))));
|
2371
|
+
send_initial_metadata_->metadata_next_.emplace(
|
2372
|
+
server_initial_metadata_pipe()->receiver.Next());
|
2373
|
+
}
|
2374
|
+
if (send_initial_metadata_->metadata_push_.has_value()) {
|
2375
|
+
if ((*send_initial_metadata_->metadata_push_)().ready()) {
|
2376
|
+
if (grpc_trace_channel.enabled()) {
|
2377
|
+
gpr_log(GPR_INFO, "%s: WakeInsideCombiner: metadata_push done",
|
2378
|
+
LogTag().c_str());
|
2379
|
+
}
|
2380
|
+
send_initial_metadata_->metadata_push_.reset();
|
2381
|
+
} else if (grpc_trace_channel.enabled()) {
|
2382
|
+
gpr_log(GPR_INFO, "%s: WakeInsideCombiner: metadata_push pending",
|
2383
|
+
LogTag().c_str());
|
2384
|
+
}
|
2385
|
+
}
|
2386
|
+
}
|
2169
2387
|
if (send_message() != nullptr) {
|
2170
|
-
|
2388
|
+
if (send_trailing_state_ ==
|
2389
|
+
SendTrailingState::kQueuedButHaventClosedSends) {
|
2390
|
+
send_trailing_state_ = SendTrailingState::kQueued;
|
2391
|
+
send_message()->Done(*send_trailing_metadata_batch_->payload
|
2392
|
+
->send_trailing_metadata.send_trailing_metadata,
|
2393
|
+
flusher);
|
2394
|
+
}
|
2395
|
+
send_message()->WakeInsideCombiner(
|
2396
|
+
flusher,
|
2397
|
+
send_initial_metadata_ == nullptr ||
|
2398
|
+
send_initial_metadata_->state == SendInitialMetadata::kForwarded);
|
2399
|
+
if (grpc_trace_channel.enabled()) {
|
2400
|
+
gpr_log(GPR_DEBUG,
|
2401
|
+
"%s: After send_message WakeInsideCombiner %s is_idle=%s "
|
2402
|
+
"is_forwarded=%s",
|
2403
|
+
LogTag().c_str(), DebugString().c_str(),
|
2404
|
+
send_message()->IsIdle() ? "true" : "false",
|
2405
|
+
send_message()->IsForwarded() ? "true" : "false");
|
2406
|
+
}
|
2171
2407
|
if (send_trailing_state_ == SendTrailingState::kQueuedBehindSendMessage &&
|
2172
|
-
send_message()->IsIdle()
|
2408
|
+
(send_message()->IsIdle() ||
|
2409
|
+
(send_trailing_metadata_batch_->send_message &&
|
2410
|
+
send_message()->IsForwarded()))) {
|
2173
2411
|
send_trailing_state_ = SendTrailingState::kQueued;
|
2412
|
+
send_message()->Done(*send_trailing_metadata_batch_->payload
|
2413
|
+
->send_trailing_metadata.send_trailing_metadata,
|
2414
|
+
flusher);
|
2174
2415
|
}
|
2175
2416
|
}
|
2176
2417
|
if (receive_message() != nullptr) {
|
2177
|
-
receive_message()->WakeInsideCombiner(flusher);
|
2418
|
+
receive_message()->WakeInsideCombiner(flusher, true);
|
2178
2419
|
}
|
2179
2420
|
if (promise_.has_value()) {
|
2180
2421
|
Poll<ServerMetadataHandle> poll;
|
2181
2422
|
poll = promise_();
|
2182
2423
|
if (grpc_trace_channel.enabled()) {
|
2183
|
-
gpr_log(
|
2184
|
-
|
2185
|
-
|
2186
|
-
|
2424
|
+
gpr_log(
|
2425
|
+
GPR_INFO,
|
2426
|
+
"%s: WakeInsideCombiner poll=%s; send_initial_metadata=%s "
|
2427
|
+
"send_trailing_metadata=%s",
|
2428
|
+
LogTag().c_str(),
|
2429
|
+
PollToString(
|
2430
|
+
poll,
|
2431
|
+
[](const ServerMetadataHandle& h) { return h->DebugString(); })
|
2432
|
+
.c_str(),
|
2433
|
+
send_initial_metadata_ == nullptr
|
2434
|
+
? "null"
|
2435
|
+
: SendInitialMetadata::StateString(send_initial_metadata_->state),
|
2436
|
+
StateString(send_trailing_state_));
|
2187
2437
|
}
|
2188
2438
|
if (send_initial_metadata_ != nullptr &&
|
2189
2439
|
send_initial_metadata_->state ==
|
2190
|
-
SendInitialMetadata::
|
2191
|
-
|
2192
|
-
|
2193
|
-
|
2440
|
+
SendInitialMetadata::kQueuedAndPushedToPipe) {
|
2441
|
+
GPR_ASSERT(send_initial_metadata_->metadata_next_.has_value());
|
2442
|
+
auto p = (*send_initial_metadata_->metadata_next_)();
|
2443
|
+
if (grpc_trace_channel.enabled()) {
|
2444
|
+
gpr_log(GPR_INFO,
|
2445
|
+
"%s: WakeInsideCombiner send_initial_metadata poll=%s",
|
2446
|
+
LogTag().c_str(),
|
2447
|
+
PollToString(p, [](const NextResult<ServerMetadataHandle>& h) {
|
2448
|
+
return (*h)->DebugString();
|
2449
|
+
}).c_str());
|
2450
|
+
}
|
2451
|
+
if (auto* nr = p.value_if_ready()) {
|
2452
|
+
ServerMetadataHandle md = std::move(nr->value());
|
2194
2453
|
if (send_initial_metadata_->batch->payload->send_initial_metadata
|
2195
|
-
.send_initial_metadata != md) {
|
2454
|
+
.send_initial_metadata != md.get()) {
|
2196
2455
|
*send_initial_metadata_->batch->payload->send_initial_metadata
|
2197
2456
|
.send_initial_metadata = std::move(*md);
|
2198
2457
|
}
|
2199
2458
|
send_initial_metadata_->state = SendInitialMetadata::kForwarded;
|
2459
|
+
poll_ctx.Repoll();
|
2200
2460
|
send_initial_metadata_->batch.ResumeWith(flusher);
|
2201
2461
|
}
|
2202
2462
|
}
|
2203
|
-
if (auto* r =
|
2463
|
+
if (auto* r = poll.value_if_ready()) {
|
2204
2464
|
promise_ = ArenaPromise<ServerMetadataHandle>();
|
2205
2465
|
auto* md = UnwrapMetadata(std::move(*r));
|
2206
2466
|
bool destroy_md = true;
|
2207
2467
|
if (send_message() != nullptr) {
|
2208
|
-
send_message()->Done(*md);
|
2468
|
+
send_message()->Done(*md, flusher);
|
2209
2469
|
}
|
2210
2470
|
if (receive_message() != nullptr) {
|
2211
2471
|
receive_message()->Done(*md, flusher);
|
2212
2472
|
}
|
2213
2473
|
switch (send_trailing_state_) {
|
2214
2474
|
case SendTrailingState::kQueuedBehindSendMessage:
|
2475
|
+
case SendTrailingState::kQueuedButHaventClosedSends:
|
2215
2476
|
case SendTrailingState::kQueued: {
|
2216
2477
|
if (send_trailing_metadata_batch_->payload->send_trailing_metadata
|
2217
2478
|
.send_trailing_metadata != md) {
|
@@ -2241,9 +2502,20 @@ void ServerCallData::WakeInsideCombiner(Flusher* flusher) {
|
|
2241
2502
|
}
|
2242
2503
|
}
|
2243
2504
|
}
|
2505
|
+
if (std::exchange(forward_recv_initial_metadata_callback_, false)) {
|
2506
|
+
if (auto* closure =
|
2507
|
+
std::exchange(original_recv_initial_metadata_ready_, nullptr)) {
|
2508
|
+
flusher->AddClosure(closure, absl::OkStatus(),
|
2509
|
+
"original_recv_initial_metadata");
|
2510
|
+
}
|
2511
|
+
}
|
2244
2512
|
}
|
2245
2513
|
|
2246
|
-
void ServerCallData::OnWakeup() {
|
2514
|
+
void ServerCallData::OnWakeup() {
|
2515
|
+
Flusher flusher(this);
|
2516
|
+
ScopedContext context(this);
|
2517
|
+
WakeInsideCombiner(&flusher);
|
2518
|
+
}
|
2247
2519
|
|
2248
2520
|
} // namespace promise_filter_detail
|
2249
2521
|
} // namespace grpc_core
|