grpc 1.50.0.pre1 → 1.52.0.pre2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Makefile +206 -49
- data/include/grpc/byte_buffer.h +76 -1
- data/include/grpc/byte_buffer_reader.h +19 -1
- data/include/grpc/compression.h +2 -2
- data/include/grpc/event_engine/event_engine.h +27 -6
- data/include/grpc/event_engine/internal/memory_allocator_impl.h +1 -1
- data/include/grpc/event_engine/internal/slice_cast.h +67 -0
- data/include/grpc/event_engine/memory_allocator.h +1 -1
- data/include/grpc/event_engine/slice.h +24 -4
- data/include/grpc/event_engine/slice_buffer.h +31 -2
- data/include/grpc/fork.h +25 -1
- data/include/grpc/grpc.h +3 -13
- data/include/grpc/grpc_posix.h +1 -1
- data/include/grpc/impl/codegen/atm.h +3 -71
- data/include/grpc/impl/codegen/atm_gcc_atomic.h +3 -58
- data/include/grpc/impl/codegen/atm_gcc_sync.h +3 -59
- data/include/grpc/impl/codegen/atm_windows.h +3 -106
- data/include/grpc/impl/codegen/byte_buffer.h +4 -78
- data/include/grpc/impl/codegen/byte_buffer_reader.h +4 -19
- data/include/grpc/impl/codegen/compression_types.h +3 -82
- data/include/grpc/impl/codegen/connectivity_state.h +3 -20
- data/include/grpc/impl/codegen/fork.h +4 -25
- data/include/grpc/impl/codegen/gpr_types.h +2 -34
- data/include/grpc/impl/codegen/grpc_types.h +3 -791
- data/include/grpc/impl/codegen/log.h +3 -86
- data/include/grpc/impl/codegen/port_platform.h +3 -758
- data/include/grpc/impl/codegen/propagation_bits.h +3 -28
- data/include/grpc/impl/codegen/slice.h +3 -106
- data/include/grpc/impl/codegen/status.h +4 -131
- data/include/grpc/impl/codegen/sync.h +3 -42
- data/include/grpc/impl/codegen/sync_abseil.h +3 -12
- data/include/grpc/impl/codegen/sync_custom.h +3 -14
- data/include/grpc/impl/codegen/sync_generic.h +3 -25
- data/include/grpc/impl/codegen/sync_posix.h +3 -28
- data/include/grpc/impl/codegen/sync_windows.h +3 -16
- data/include/grpc/impl/compression_types.h +109 -0
- data/include/grpc/impl/connectivity_state.h +47 -0
- data/include/grpc/impl/grpc_types.h +824 -0
- data/include/grpc/impl/propagation_bits.h +54 -0
- data/include/grpc/impl/slice_type.h +112 -0
- data/include/grpc/load_reporting.h +1 -1
- data/include/grpc/module.modulemap +5 -1
- data/include/grpc/slice.h +1 -1
- data/include/grpc/status.h +131 -1
- data/include/grpc/support/atm.h +70 -1
- data/include/grpc/support/atm_gcc_atomic.h +59 -1
- data/include/grpc/support/atm_gcc_sync.h +58 -1
- data/include/grpc/support/atm_windows.h +105 -1
- data/include/grpc/support/log.h +87 -1
- data/include/grpc/support/log_windows.h +1 -1
- data/include/grpc/support/port_platform.h +767 -1
- data/include/grpc/support/string_util.h +1 -1
- data/include/grpc/support/sync.h +35 -2
- data/include/grpc/support/sync_abseil.h +11 -1
- data/include/grpc/support/sync_custom.h +13 -1
- data/include/grpc/support/sync_generic.h +24 -1
- data/include/grpc/support/sync_posix.h +27 -1
- data/include/grpc/support/sync_windows.h +15 -1
- data/include/grpc/support/time.h +25 -2
- data/src/core/ext/filters/census/grpc_context.cc +17 -18
- data/src/core/ext/filters/channel_idle/channel_idle_filter.cc +28 -22
- data/src/core/ext/filters/channel_idle/channel_idle_filter.h +2 -1
- data/src/core/ext/filters/channel_idle/idle_filter_state.h +1 -1
- data/src/core/ext/filters/client_channel/backend_metric.cc +2 -0
- data/src/core/ext/filters/client_channel/backup_poller.cc +24 -24
- data/src/core/ext/filters/client_channel/backup_poller.h +21 -21
- data/src/core/ext/filters/client_channel/channel_connectivity.cc +51 -28
- data/src/core/ext/filters/client_channel/client_channel.cc +157 -168
- data/src/core/ext/filters/client_channel/client_channel.h +10 -10
- data/src/core/ext/filters/client_channel/client_channel_channelz.cc +17 -19
- data/src/core/ext/filters/client_channel/client_channel_channelz.h +19 -19
- data/src/core/ext/filters/client_channel/client_channel_factory.cc +17 -17
- data/src/core/ext/filters/client_channel/client_channel_plugin.cc +18 -18
- data/src/core/ext/filters/client_channel/client_channel_service_config.cc +153 -0
- data/src/core/ext/filters/client_channel/{resolver_result_parsing.h → client_channel_service_config.h} +26 -23
- data/src/core/ext/filters/client_channel/config_selector.h +16 -20
- data/src/core/ext/filters/client_channel/connector.h +1 -1
- data/src/core/ext/filters/client_channel/dynamic_filters.cc +28 -55
- data/src/core/ext/filters/client_channel/dynamic_filters.h +7 -8
- data/src/core/ext/filters/client_channel/global_subchannel_pool.h +18 -18
- data/src/core/ext/filters/client_channel/health/health_check_client.cc +4 -5
- data/src/core/ext/filters/client_channel/http_proxy.cc +39 -40
- data/src/core/ext/filters/client_channel/http_proxy.h +18 -18
- data/src/core/ext/filters/client_channel/lb_call_state_internal.h +39 -0
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc +3 -4
- data/src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h +17 -17
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc +7 -2
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h +1 -2
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +59 -130
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h +37 -21
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +131 -154
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +24 -25
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc +0 -1
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h +2 -4
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +18 -20
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +18 -19
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +18 -19
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +18 -19
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc +8 -9
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.cc +212 -223
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h +2 -2
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +11 -22
- data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +73 -101
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +20 -21
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +119 -106
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +12 -12
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +30 -16
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +60 -56
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +60 -64
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_attributes.cc +42 -0
- data/src/core/ext/filters/client_channel/lb_policy/xds/{xds.h → xds_attributes.h} +15 -17
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +22 -28
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +62 -94
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +70 -146
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_override_host.cc +651 -0
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_override_host.h +60 -0
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_wrr_locality.cc +364 -0
- data/src/core/ext/filters/client_channel/local_subchannel_pool.h +18 -18
- data/src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc +9 -10
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +26 -35
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +40 -41
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +22 -23
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +82 -82
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +117 -118
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +51 -52
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc +18 -18
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +18 -18
- data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h +18 -19
- data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +3 -5
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +1 -3
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +1 -1
- data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +34 -27
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.cc +44 -34
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.h +8 -10
- data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +4 -7
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +122 -119
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h +1 -1
- data/src/core/ext/filters/client_channel/retry_filter.cc +81 -103
- data/src/core/ext/filters/client_channel/retry_service_config.cc +193 -235
- data/src/core/ext/filters/client_channel/retry_service_config.h +20 -23
- data/src/core/ext/filters/client_channel/retry_throttle.cc +27 -29
- data/src/core/ext/filters/client_channel/retry_throttle.h +26 -25
- data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +3 -3
- data/src/core/ext/filters/client_channel/subchannel.cc +158 -178
- data/src/core/ext/filters/client_channel/subchannel.h +17 -40
- data/src/core/ext/filters/client_channel/subchannel_pool_interface.h +18 -18
- data/src/core/ext/filters/client_channel/subchannel_stream_client.cc +11 -12
- data/src/core/ext/filters/deadline/deadline_filter.cc +34 -17
- data/src/core/ext/filters/deadline/deadline_filter.h +1 -1
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +3 -2
- data/src/core/ext/filters/fault_injection/fault_injection_filter.h +0 -4
- data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.cc +118 -0
- data/src/core/ext/filters/fault_injection/{service_config_parser.h → fault_injection_service_config_parser.h} +20 -12
- data/src/core/ext/filters/http/client/http_client_filter.cc +36 -37
- data/src/core/ext/filters/http/client/http_client_filter.h +17 -17
- data/src/core/ext/filters/http/client_authority_filter.cc +19 -19
- data/src/core/ext/filters/http/client_authority_filter.h +18 -18
- data/src/core/ext/filters/http/http_filters_plugin.cc +35 -51
- data/src/core/ext/filters/http/message_compress/compression_filter.cc +315 -0
- data/src/core/ext/filters/http/message_compress/compression_filter.h +132 -0
- data/src/core/ext/filters/http/server/http_server_filter.cc +44 -43
- data/src/core/ext/filters/http/server/http_server_filter.h +18 -18
- data/src/core/ext/filters/message_size/message_size_filter.cc +92 -123
- data/src/core/ext/filters/message_size/message_size_filter.h +23 -16
- data/src/core/ext/filters/rbac/rbac_filter.cc +12 -12
- data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +728 -530
- data/src/core/ext/filters/rbac/rbac_service_config_parser.h +4 -3
- data/src/core/ext/filters/server_config_selector/server_config_selector.h +6 -8
- data/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc +7 -9
- data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +229 -0
- data/src/core/ext/filters/stateful_session/stateful_session_filter.h +66 -0
- data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.cc +82 -0
- data/src/core/ext/filters/stateful_session/stateful_session_service_config_parser.h +93 -0
- data/src/core/ext/transport/chttp2/alpn/alpn.cc +18 -18
- data/src/core/ext/transport/chttp2/alpn/alpn.h +22 -22
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +69 -63
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +28 -22
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +81 -97
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +18 -18
- data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +22 -22
- data/src/core/ext/transport/chttp2/transport/bin_decoder.h +30 -30
- data/src/core/ext/transport/chttp2/transport/bin_encoder.cc +29 -29
- data/src/core/ext/transport/chttp2/transport/bin_encoder.h +27 -27
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +273 -283
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +18 -19
- data/src/core/ext/transport/chttp2/transport/context_list.cc +19 -19
- data/src/core/ext/transport/chttp2/transport/context_list.h +25 -25
- data/src/core/ext/transport/chttp2/transport/decode_huff.cc +0 -36
- data/src/core/ext/transport/chttp2/transport/decode_huff.h +35 -82
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +112 -44
- data/src/core/ext/transport/chttp2/transport/flow_control.h +60 -34
- data/src/core/ext/transport/chttp2/transport/frame.h +19 -19
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +33 -32
- data/src/core/ext/transport/chttp2/transport/frame_data.h +23 -23
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +36 -36
- data/src/core/ext/transport/chttp2/transport/frame_goaway.h +18 -18
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +25 -24
- data/src/core/ext/transport/chttp2/transport/frame_ping.h +19 -19
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +28 -25
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +18 -18
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +34 -36
- data/src/core/ext/transport/chttp2/transport/frame_settings.h +20 -20
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +22 -21
- data/src/core/ext/transport/chttp2/transport/frame_window_update.h +18 -18
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +133 -181
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +40 -59
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc +2 -1
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +93 -143
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +20 -20
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +26 -26
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +18 -18
- data/src/core/ext/transport/chttp2/transport/http2_settings.cc +21 -19
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +36 -34
- data/src/core/ext/transport/chttp2/transport/http_trace.cc +19 -0
- data/src/core/ext/transport/chttp2/transport/http_trace.h +24 -0
- data/src/core/ext/transport/chttp2/transport/huffsyms.cc +20 -20
- data/src/core/ext/transport/chttp2/transport/huffsyms.h +19 -19
- data/src/core/ext/transport/chttp2/transport/internal.h +193 -170
- data/src/core/ext/transport/chttp2/transport/parsing.cc +147 -80
- data/src/core/ext/transport/chttp2/transport/stream_lists.cc +19 -19
- data/src/core/ext/transport/chttp2/transport/stream_map.cc +23 -23
- data/src/core/ext/transport/chttp2/transport/stream_map.h +31 -31
- data/src/core/ext/transport/chttp2/transport/varint.cc +19 -20
- data/src/core/ext/transport/chttp2/transport/varint.h +35 -32
- data/src/core/ext/transport/chttp2/transport/writing.cc +60 -56
- data/src/core/ext/transport/inproc/inproc_plugin.cc +17 -17
- data/src/core/ext/transport/inproc/inproc_transport.cc +122 -140
- data/src/core/ext/transport/inproc/inproc_transport.h +19 -19
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.c +62 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h +179 -0
- data/src/core/ext/upb-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.c +46 -0
- data/src/core/ext/upb-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upb.h +98 -0
- data/src/core/ext/upb-generated/xds/core/v3/cidr.upb.c +47 -0
- data/src/core/ext/upb-generated/xds/core/v3/cidr.upb.h +107 -0
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c +3 -2
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h +9 -0
- data/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.c +0 -1
- data/src/core/ext/upb-generated/xds/type/matcher/v3/cel.upb.c +46 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/cel.upb.h +98 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/domain.upb.c +62 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/domain.upb.h +174 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/http_inputs.upb.c +36 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/http_inputs.upb.h +74 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/ip.upb.c +65 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/ip.upb.h +191 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/range.upb.c +127 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/range.upb.h +474 -0
- data/src/core/ext/upb-generated/xds/type/v3/cel.upb.c +67 -0
- data/src/core/ext/upb-generated/xds/type/v3/cel.upb.h +214 -0
- data/src/core/ext/upb-generated/xds/type/v3/range.upb.c +64 -0
- data/src/core/ext/upb-generated/xds/type/v3/range.upb.h +208 -0
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c +0 -1
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.c +60 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upbdefs.c +50 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/http/stateful_session/cookie/v3/cookie.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/cidr.upbdefs.c +45 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/cidr.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/cel.upbdefs.c +43 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/cel.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/domain.upbdefs.c +51 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/domain.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/http_inputs.upbdefs.c +36 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/http_inputs.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/ip.upbdefs.c +55 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/ip.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c +9 -9
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/range.upbdefs.c +71 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/range.upbdefs.h +60 -0
- data/src/core/ext/upbdefs-generated/xds/type/v3/cel.upbdefs.c +60 -0
- data/src/core/ext/upbdefs-generated/xds/type/v3/cel.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/xds/type/v3/range.upbdefs.c +36 -0
- data/src/core/ext/upbdefs-generated/xds/type/v3/range.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c +4 -7
- data/src/core/ext/xds/certificate_provider_store.cc +4 -4
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +4 -7
- data/src/core/ext/xds/xds_api.cc +20 -95
- data/src/core/ext/xds/xds_api.h +5 -8
- data/src/core/ext/xds/xds_bootstrap.h +0 -1
- data/src/core/ext/xds/xds_bootstrap_grpc.cc +3 -12
- data/src/core/ext/xds/xds_bootstrap_grpc.h +16 -1
- data/src/core/ext/xds/xds_certificate_provider.cc +22 -25
- data/src/core/ext/xds/xds_certificate_provider.h +1 -1
- data/src/core/ext/xds/xds_channel_args.h +1 -1
- data/src/core/ext/xds/xds_channel_stack_modifier.cc +0 -1
- data/src/core/ext/xds/xds_channel_stack_modifier.h +2 -2
- data/src/core/ext/xds/xds_client.cc +134 -94
- data/src/core/ext/xds/xds_client.h +13 -5
- data/src/core/ext/xds/xds_client_grpc.cc +31 -24
- data/src/core/ext/xds/xds_client_grpc.h +1 -1
- data/src/core/ext/xds/xds_client_stats.cc +17 -17
- data/src/core/ext/xds/xds_client_stats.h +18 -18
- data/src/core/ext/xds/xds_cluster.cc +359 -203
- data/src/core/ext/xds/xds_cluster.h +52 -35
- data/src/core/ext/xds/xds_cluster_specifier_plugin.cc +54 -71
- data/src/core/ext/xds/xds_cluster_specifier_plugin.h +45 -21
- data/src/core/ext/xds/xds_common_types.cc +209 -141
- data/src/core/ext/xds/xds_common_types.h +19 -13
- data/src/core/ext/xds/xds_endpoint.cc +221 -130
- data/src/core/ext/xds/xds_endpoint.h +4 -7
- data/src/core/ext/xds/xds_health_status.cc +80 -0
- data/src/core/ext/xds/xds_health_status.h +82 -0
- data/src/core/ext/xds/xds_http_fault_filter.cc +57 -43
- data/src/core/ext/xds/xds_http_fault_filter.h +14 -22
- data/src/core/ext/xds/xds_http_filters.cc +65 -73
- data/src/core/ext/xds/xds_http_filters.h +68 -20
- data/src/core/ext/xds/xds_http_rbac_filter.cc +153 -207
- data/src/core/ext/xds/xds_http_rbac_filter.h +13 -16
- data/src/core/ext/xds/xds_http_stateful_session_filter.cc +218 -0
- data/src/core/ext/xds/xds_http_stateful_session_filter.h +58 -0
- data/src/core/ext/xds/xds_lb_policy_registry.cc +120 -171
- data/src/core/ext/xds/xds_lb_policy_registry.h +10 -11
- data/src/core/ext/xds/xds_listener.cc +447 -419
- data/src/core/ext/xds/xds_listener.h +45 -47
- data/src/core/ext/xds/xds_resource_type.h +3 -11
- data/src/core/ext/xds/xds_resource_type_impl.h +10 -13
- data/src/core/ext/xds/xds_route_config.cc +514 -528
- data/src/core/ext/xds/xds_route_config.h +39 -28
- data/src/core/ext/xds/xds_routing.cc +2 -1
- data/src/core/ext/xds/xds_routing.h +2 -0
- data/src/core/ext/xds/xds_server_config_fetcher.cc +109 -106
- data/src/core/ext/xds/xds_transport_grpc.cc +6 -7
- data/src/core/ext/xds/xds_transport_grpc.h +1 -1
- data/src/core/lib/address_utils/parse_address.cc +30 -29
- data/src/core/lib/address_utils/parse_address.h +32 -32
- data/src/core/lib/address_utils/sockaddr_utils.cc +29 -28
- data/src/core/lib/address_utils/sockaddr_utils.h +33 -33
- data/src/core/lib/avl/avl.h +4 -4
- data/src/core/lib/backoff/backoff.cc +17 -17
- data/src/core/lib/backoff/backoff.h +18 -18
- data/src/core/lib/channel/call_tracer.h +10 -1
- data/src/core/lib/channel/channel_args.cc +19 -20
- data/src/core/lib/channel/channel_args.h +59 -43
- data/src/core/lib/channel/channel_args_preconditioning.h +1 -1
- data/src/core/lib/channel/channel_stack.cc +62 -58
- data/src/core/lib/channel/channel_stack.h +144 -131
- data/src/core/lib/channel/channel_stack_builder.cc +21 -24
- data/src/core/lib/channel/channel_stack_builder.h +14 -6
- data/src/core/lib/channel/channel_stack_builder_impl.cc +43 -25
- data/src/core/lib/channel/channel_stack_builder_impl.h +2 -0
- data/src/core/lib/channel/channel_trace.cc +21 -22
- data/src/core/lib/channel/channel_trace.h +19 -19
- data/src/core/lib/channel/channelz.cc +18 -19
- data/src/core/lib/channel/channelz.h +26 -26
- data/src/core/lib/channel/channelz_registry.cc +17 -17
- data/src/core/lib/channel/channelz_registry.h +18 -18
- data/src/core/lib/channel/connected_channel.cc +732 -63
- data/src/core/lib/channel/connected_channel.h +18 -22
- data/src/core/lib/channel/context.h +18 -18
- data/src/core/lib/channel/promise_based_filter.cc +1137 -150
- data/src/core/lib/channel/promise_based_filter.h +374 -88
- data/src/core/lib/channel/status_util.cc +35 -17
- data/src/core/lib/channel/status_util.h +26 -19
- data/src/core/lib/compression/compression.cc +19 -19
- data/src/core/lib/compression/compression_internal.cc +41 -48
- data/src/core/lib/compression/compression_internal.h +22 -22
- data/src/core/lib/compression/message_compress.cc +26 -26
- data/src/core/lib/compression/message_compress.h +25 -25
- data/src/core/lib/config/core_configuration.h +1 -1
- data/src/core/lib/debug/event_log.cc +88 -0
- data/src/core/lib/debug/event_log.h +81 -0
- data/src/core/lib/debug/histogram_view.cc +69 -0
- data/src/core/lib/{slice/slice_refcount.cc → debug/histogram_view.h} +15 -13
- data/src/core/lib/debug/stats.cc +39 -136
- data/src/core/lib/debug/stats.h +46 -52
- data/src/core/lib/debug/stats_data.cc +224 -73
- data/src/core/lib/debug/stats_data.h +263 -122
- data/src/core/lib/debug/trace.cc +18 -18
- data/src/core/lib/debug/trace.h +19 -19
- data/src/core/lib/event_engine/common_closures.h +71 -0
- data/src/core/lib/event_engine/default_event_engine.cc +38 -15
- data/src/core/lib/event_engine/default_event_engine.h +15 -3
- data/src/core/lib/event_engine/default_event_engine_factory.cc +2 -4
- data/src/core/lib/event_engine/executor/executor.h +1 -1
- data/src/core/lib/event_engine/forkable.h +1 -1
- data/src/core/lib/event_engine/memory_allocator.cc +1 -1
- data/src/core/lib/event_engine/poller.h +10 -4
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +614 -0
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h +129 -0
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +900 -0
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.h +97 -0
- data/src/core/lib/event_engine/posix_engine/event_poller.h +111 -0
- data/src/core/lib/event_engine/posix_engine/event_poller_posix_default.cc +74 -0
- data/src/core/lib/event_engine/{executor/threaded_executor.cc → posix_engine/event_poller_posix_default.h} +11 -14
- data/src/core/lib/event_engine/posix_engine/internal_errqueue.cc +77 -0
- data/src/core/lib/event_engine/posix_engine/internal_errqueue.h +179 -0
- data/src/core/lib/event_engine/posix_engine/lockfree_event.cc +265 -0
- data/src/core/lib/event_engine/posix_engine/lockfree_event.h +73 -0
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +1308 -0
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +684 -0
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +456 -28
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +148 -24
- data/src/core/lib/event_engine/posix_engine/posix_engine_closure.h +80 -0
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +236 -0
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.h +228 -0
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +380 -0
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.h +91 -0
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +853 -0
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +316 -0
- data/src/core/lib/event_engine/posix_engine/timer.cc +49 -49
- data/src/core/lib/event_engine/posix_engine/timer.h +87 -86
- data/src/core/lib/event_engine/posix_engine/timer_heap.cc +27 -27
- data/src/core/lib/event_engine/posix_engine/timer_heap.h +21 -21
- data/src/core/lib/event_engine/posix_engine/timer_manager.cc +76 -214
- data/src/core/lib/event_engine/posix_engine/timer_manager.h +41 -69
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc +332 -0
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.h +185 -0
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.cc +127 -0
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.h +45 -0
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.cc +150 -0
- data/src/core/lib/event_engine/{executor/threaded_executor.h → posix_engine/wakeup_fd_pipe.h} +16 -15
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix.h +76 -0
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.cc +67 -0
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.h +37 -0
- data/src/core/lib/event_engine/slice.cc +7 -6
- data/src/core/lib/event_engine/slice_buffer.cc +2 -2
- data/src/core/lib/event_engine/socket_notifier.h +1 -1
- data/src/core/lib/event_engine/tcp_socket_utils.cc +373 -0
- data/src/core/lib/event_engine/tcp_socket_utils.h +85 -0
- data/src/core/lib/event_engine/thread_pool.cc +125 -43
- data/src/core/lib/event_engine/thread_pool.h +49 -26
- data/src/core/lib/event_engine/time_util.h +1 -1
- data/src/core/lib/event_engine/windows/iocp.cc +13 -12
- data/src/core/lib/event_engine/windows/iocp.h +1 -1
- data/src/core/lib/event_engine/windows/win_socket.cc +9 -9
- data/src/core/lib/event_engine/windows/windows_engine.cc +26 -20
- data/src/core/lib/event_engine/windows/windows_engine.h +8 -4
- data/src/core/lib/experiments/config.cc +1 -1
- data/src/core/lib/experiments/experiments.cc +13 -13
- data/src/core/lib/experiments/experiments.h +8 -6
- data/src/core/lib/gpr/alloc.cc +19 -17
- data/src/core/lib/gpr/alloc.h +18 -18
- data/src/core/lib/gpr/atm.cc +17 -17
- data/src/core/lib/gpr/cpu_iphone.cc +24 -24
- data/src/core/lib/gpr/cpu_linux.cc +28 -23
- data/src/core/lib/gpr/cpu_posix.cc +23 -22
- data/src/core/lib/gpr/cpu_windows.cc +20 -18
- data/src/core/lib/gpr/log.cc +27 -19
- data/src/core/lib/gpr/log_android.cc +22 -20
- data/src/core/lib/gpr/log_linux.cc +24 -24
- data/src/core/lib/gpr/log_posix.cc +20 -19
- data/src/core/lib/gpr/log_windows.cc +25 -24
- data/src/core/lib/gpr/spinlock.h +18 -18
- data/src/core/lib/gpr/string.cc +25 -24
- data/src/core/lib/gpr/string.h +58 -58
- data/src/core/lib/gpr/string_posix.cc +24 -24
- data/src/core/lib/gpr/string_util_windows.cc +22 -22
- data/src/core/lib/gpr/string_windows.cc +24 -24
- data/src/core/lib/gpr/sync.cc +25 -25
- data/src/core/lib/gpr/sync_abseil.cc +22 -20
- data/src/core/lib/gpr/sync_posix.cc +23 -21
- data/src/core/lib/gpr/sync_windows.cc +29 -27
- data/src/core/lib/gpr/time.cc +23 -21
- data/src/core/lib/gpr/time_posix.cc +35 -30
- data/src/core/lib/gpr/time_precise.cc +22 -22
- data/src/core/lib/gpr/time_precise.h +18 -19
- data/src/core/lib/gpr/time_windows.cc +25 -22
- data/src/core/lib/gpr/tmpfile.h +22 -22
- data/src/core/lib/gpr/tmpfile_msys.cc +21 -20
- data/src/core/lib/gpr/tmpfile_posix.cc +22 -20
- data/src/core/lib/gpr/tmpfile_windows.cc +23 -22
- data/src/core/lib/gpr/useful.h +40 -27
- data/src/core/lib/gpr/wrap_memcpy.cc +23 -23
- data/src/core/lib/gprpp/atomic_utils.h +18 -18
- data/src/core/lib/gprpp/bitset.h +24 -0
- data/src/core/{ext/xds/xds_resource_type.cc → lib/gprpp/crash.cc} +12 -12
- data/src/core/lib/gprpp/crash.h +34 -0
- data/src/core/lib/gprpp/debug_location.h +18 -18
- data/src/core/lib/gprpp/dual_ref_counted.h +1 -1
- data/src/core/lib/gprpp/env.h +20 -20
- data/src/core/lib/gprpp/env_linux.cc +21 -21
- data/src/core/lib/gprpp/env_posix.cc +18 -18
- data/src/core/lib/gprpp/env_windows.cc +18 -18
- data/src/core/lib/gprpp/examine_stack.cc +17 -17
- data/src/core/lib/gprpp/examine_stack.h +18 -18
- data/src/core/lib/gprpp/fork.cc +21 -22
- data/src/core/lib/gprpp/fork.h +22 -22
- data/src/core/lib/gprpp/global_config.h +18 -18
- data/src/core/lib/gprpp/global_config_custom.h +18 -18
- data/src/core/lib/gprpp/global_config_env.cc +17 -17
- data/src/core/lib/gprpp/global_config_env.h +23 -23
- data/src/core/lib/gprpp/global_config_generic.h +18 -18
- data/src/core/lib/gprpp/host_port.cc +26 -26
- data/src/core/lib/gprpp/host_port.h +29 -28
- data/src/core/lib/gprpp/load_file.cc +75 -0
- data/src/core/lib/gprpp/load_file.h +33 -0
- data/src/core/lib/gprpp/manual_constructor.h +18 -17
- data/src/core/lib/gprpp/memory.h +18 -18
- data/src/core/lib/gprpp/mpscq.cc +17 -17
- data/src/core/lib/gprpp/mpscq.h +18 -18
- data/src/core/lib/gprpp/no_destruct.h +1 -0
- data/src/core/lib/gprpp/orphanable.h +18 -18
- data/src/core/lib/gprpp/per_cpu.h +46 -0
- data/src/core/lib/gprpp/ref_counted.h +18 -18
- data/src/core/lib/gprpp/ref_counted_ptr.h +19 -18
- data/src/core/lib/gprpp/stat_posix.cc +5 -4
- data/src/core/lib/gprpp/stat_windows.cc +4 -2
- data/src/core/lib/gprpp/status_helper.cc +4 -3
- data/src/core/lib/gprpp/status_helper.h +1 -3
- data/src/core/lib/gprpp/strerror.cc +41 -0
- data/src/core/lib/gprpp/strerror.h +29 -0
- data/src/core/lib/gprpp/sync.h +20 -20
- data/src/core/lib/gprpp/table.h +1 -0
- data/src/core/lib/gprpp/thd.h +19 -19
- data/src/core/lib/gprpp/thd_posix.cc +30 -31
- data/src/core/lib/gprpp/thd_windows.cc +26 -26
- data/src/core/lib/gprpp/time.cc +16 -11
- data/src/core/lib/gprpp/time.h +13 -3
- data/src/core/lib/gprpp/time_averaged_stats.cc +20 -20
- data/src/core/lib/gprpp/time_averaged_stats.h +48 -48
- data/src/core/lib/gprpp/time_util.h +1 -1
- data/src/core/lib/gprpp/unique_type_name.h +18 -18
- data/src/core/lib/gprpp/validation_errors.h +18 -1
- data/src/core/lib/handshaker/proxy_mapper.h +18 -18
- data/src/core/lib/handshaker/proxy_mapper_registry.cc +17 -17
- data/src/core/lib/handshaker/proxy_mapper_registry.h +18 -18
- data/src/core/lib/http/format_request.cc +18 -18
- data/src/core/lib/http/format_request.h +18 -18
- data/src/core/lib/http/httpcli.cc +57 -61
- data/src/core/lib/http/httpcli.h +26 -26
- data/src/core/lib/http/httpcli_security_connector.cc +22 -25
- data/src/core/lib/http/parser.cc +76 -87
- data/src/core/lib/http/parser.h +32 -32
- data/src/core/lib/iomgr/block_annotate.h +21 -21
- data/src/core/lib/iomgr/buffer_list.cc +156 -136
- data/src/core/lib/iomgr/buffer_list.h +120 -98
- data/src/core/lib/iomgr/call_combiner.cc +29 -27
- data/src/core/lib/iomgr/call_combiner.h +21 -22
- data/src/core/lib/iomgr/cfstream_handle.cc +33 -36
- data/src/core/lib/iomgr/cfstream_handle.h +22 -22
- data/src/core/lib/iomgr/closure.h +90 -45
- data/src/core/lib/iomgr/combiner.cc +20 -19
- data/src/core/lib/iomgr/combiner.h +18 -18
- data/src/core/lib/iomgr/dualstack_socket_posix.cc +21 -21
- data/src/core/lib/iomgr/dynamic_annotations.h +20 -20
- data/src/core/lib/iomgr/endpoint.cc +17 -17
- data/src/core/lib/iomgr/endpoint.h +46 -46
- data/src/core/lib/iomgr/endpoint_cfstream.cc +44 -43
- data/src/core/lib/iomgr/endpoint_cfstream.h +27 -27
- data/src/core/lib/iomgr/endpoint_pair.h +18 -18
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +20 -19
- data/src/core/lib/iomgr/endpoint_pair_windows.cc +18 -17
- data/src/core/lib/iomgr/error.cc +49 -61
- data/src/core/lib/iomgr/error.h +42 -173
- data/src/core/lib/iomgr/error_cfstream.cc +18 -18
- data/src/core/lib/iomgr/error_cfstream.h +19 -19
- data/src/core/lib/iomgr/ev_apple.cc +21 -21
- data/src/core/lib/iomgr/ev_apple.h +17 -17
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +208 -195
- data/src/core/lib/iomgr/ev_epoll1_linux.h +18 -18
- data/src/core/lib/iomgr/ev_poll_posix.cc +212 -205
- data/src/core/lib/iomgr/ev_poll_posix.h +18 -18
- data/src/core/lib/iomgr/ev_posix.cc +36 -28
- data/src/core/lib/iomgr/ev_posix.h +85 -81
- data/src/core/lib/iomgr/ev_windows.cc +18 -18
- data/src/core/lib/iomgr/exec_ctx.cc +34 -34
- data/src/core/lib/iomgr/exec_ctx.h +141 -141
- data/src/core/lib/iomgr/executor.cc +21 -21
- data/src/core/lib/iomgr/executor.h +24 -24
- data/src/core/lib/iomgr/fork_posix.cc +24 -22
- data/src/core/lib/iomgr/fork_windows.cc +21 -21
- data/src/core/lib/iomgr/gethostname.h +18 -18
- data/src/core/lib/iomgr/gethostname_fallback.cc +17 -17
- data/src/core/lib/iomgr/gethostname_host_name_max.cc +17 -17
- data/src/core/lib/iomgr/gethostname_sysconf.cc +17 -17
- data/src/core/lib/iomgr/grpc_if_nametoindex.h +20 -20
- data/src/core/lib/iomgr/grpc_if_nametoindex_posix.cc +20 -19
- data/src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc +20 -19
- data/src/core/lib/iomgr/internal_errqueue.cc +4 -2
- data/src/core/lib/iomgr/internal_errqueue.h +80 -80
- data/src/core/lib/iomgr/iocp_windows.cc +22 -21
- data/src/core/lib/iomgr/iocp_windows.h +18 -18
- data/src/core/lib/iomgr/iomgr.cc +19 -18
- data/src/core/lib/iomgr/iomgr.h +32 -32
- data/src/core/lib/iomgr/iomgr_internal.cc +17 -17
- data/src/core/lib/iomgr/iomgr_internal.h +25 -25
- data/src/core/lib/iomgr/iomgr_posix.cc +20 -20
- data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +20 -19
- data/src/core/lib/iomgr/iomgr_windows.cc +24 -22
- data/src/core/lib/iomgr/load_file.cc +24 -27
- data/src/core/lib/iomgr/load_file.h +20 -20
- data/src/core/lib/iomgr/lockfree_event.cc +114 -114
- data/src/core/lib/iomgr/lockfree_event.h +19 -19
- data/src/core/lib/iomgr/nameser.h +84 -84
- data/src/core/lib/iomgr/polling_entity.cc +25 -21
- data/src/core/lib/iomgr/polling_entity.h +27 -27
- data/src/core/lib/iomgr/pollset.cc +17 -17
- data/src/core/lib/iomgr/pollset.h +51 -51
- data/src/core/lib/iomgr/pollset_set.cc +17 -17
- data/src/core/lib/iomgr/pollset_set.h +22 -22
- data/src/core/lib/iomgr/pollset_set_windows.cc +18 -18
- data/src/core/lib/iomgr/pollset_set_windows.h +18 -18
- data/src/core/lib/iomgr/pollset_windows.cc +30 -29
- data/src/core/lib/iomgr/pollset_windows.h +22 -22
- data/src/core/lib/iomgr/port.h +29 -29
- data/src/core/lib/iomgr/python_util.h +20 -20
- data/src/core/lib/iomgr/resolve_address.cc +26 -20
- data/src/core/lib/iomgr/resolve_address.h +21 -22
- data/src/core/lib/iomgr/resolve_address_impl.h +2 -2
- data/src/core/lib/iomgr/resolve_address_posix.cc +35 -45
- data/src/core/lib/iomgr/resolve_address_posix.h +1 -2
- data/src/core/lib/iomgr/resolve_address_windows.cc +18 -20
- data/src/core/lib/iomgr/resolve_address_windows.h +1 -2
- data/src/core/lib/iomgr/resolved_address.h +1 -1
- data/src/core/lib/iomgr/sockaddr.h +21 -21
- data/src/core/lib/iomgr/sockaddr_posix.h +18 -18
- data/src/core/lib/iomgr/sockaddr_utils_posix.cc +18 -17
- data/src/core/lib/iomgr/sockaddr_windows.h +18 -18
- data/src/core/lib/iomgr/socket_factory_posix.cc +18 -18
- data/src/core/lib/iomgr/socket_factory_posix.h +30 -30
- data/src/core/lib/iomgr/socket_mutator.cc +19 -18
- data/src/core/lib/iomgr/socket_mutator.h +37 -37
- data/src/core/lib/iomgr/socket_utils.h +24 -24
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +68 -66
- data/src/core/lib/iomgr/socket_utils_linux.cc +18 -17
- data/src/core/lib/iomgr/socket_utils_posix.cc +22 -20
- data/src/core/lib/iomgr/socket_utils_posix.h +78 -78
- data/src/core/lib/iomgr/socket_utils_windows.cc +20 -19
- data/src/core/lib/iomgr/socket_windows.cc +37 -36
- data/src/core/lib/iomgr/socket_windows.h +56 -56
- data/src/core/lib/iomgr/systemd_utils.cc +116 -0
- data/src/core/lib/{slice/slice_buffer_api.cc → iomgr/systemd_utils.h} +12 -14
- data/src/core/lib/iomgr/tcp_client.cc +17 -17
- data/src/core/lib/iomgr/tcp_client.h +26 -26
- data/src/core/lib/iomgr/tcp_client_cfstream.cc +25 -28
- data/src/core/lib/iomgr/tcp_client_posix.cc +70 -73
- data/src/core/lib/iomgr/tcp_client_posix.h +43 -43
- data/src/core/lib/iomgr/tcp_client_windows.cc +36 -39
- data/src/core/lib/iomgr/tcp_posix.cc +223 -237
- data/src/core/lib/iomgr/tcp_posix.h +27 -27
- data/src/core/lib/iomgr/tcp_server.cc +30 -22
- data/src/core/lib/iomgr/tcp_server.h +68 -62
- data/src/core/lib/iomgr/tcp_server_posix.cc +124 -94
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +54 -51
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +90 -55
- data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +40 -40
- data/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc +19 -19
- data/src/core/lib/iomgr/tcp_server_windows.cc +97 -104
- data/src/core/lib/iomgr/tcp_windows.cc +109 -93
- data/src/core/lib/iomgr/tcp_windows.h +29 -29
- data/src/core/lib/iomgr/timer.cc +17 -17
- data/src/core/lib/iomgr/timer.h +65 -65
- data/src/core/lib/iomgr/timer_generic.cc +115 -122
- data/src/core/lib/iomgr/timer_generic.h +19 -19
- data/src/core/lib/iomgr/timer_heap.cc +25 -25
- data/src/core/lib/iomgr/timer_heap.h +19 -19
- data/src/core/lib/iomgr/timer_manager.cc +30 -29
- data/src/core/lib/iomgr/timer_manager.h +25 -25
- data/src/core/lib/iomgr/unix_sockets_posix.cc +20 -21
- data/src/core/lib/iomgr/unix_sockets_posix.h +18 -18
- data/src/core/lib/iomgr/unix_sockets_posix_noop.cc +19 -17
- data/src/core/lib/iomgr/wakeup_fd_eventfd.cc +23 -21
- data/src/core/lib/iomgr/wakeup_fd_nospecial.cc +23 -23
- data/src/core/lib/iomgr/wakeup_fd_pipe.cc +29 -26
- data/src/core/lib/iomgr/wakeup_fd_pipe.h +18 -18
- data/src/core/lib/iomgr/wakeup_fd_posix.cc +18 -18
- data/src/core/lib/iomgr/wakeup_fd_posix.h +50 -50
- data/src/core/lib/json/json_channel_args.h +42 -0
- data/src/core/lib/json/json_object_loader.cc +17 -2
- data/src/core/lib/json/json_object_loader.h +37 -1
- data/src/core/lib/json/json_reader.cc +28 -28
- data/src/core/lib/json/json_util.cc +5 -5
- data/src/core/lib/json/json_util.h +4 -4
- data/src/core/lib/json/json_writer.cc +56 -56
- data/src/core/lib/load_balancing/lb_policy.cc +18 -18
- data/src/core/lib/load_balancing/lb_policy.h +7 -4
- data/src/core/lib/load_balancing/subchannel_interface.h +1 -8
- data/src/core/lib/matchers/matchers.cc +6 -5
- data/src/core/lib/matchers/matchers.h +1 -1
- data/src/core/lib/promise/activity.cc +16 -2
- data/src/core/lib/promise/activity.h +58 -27
- data/src/core/lib/promise/arena_promise.h +82 -52
- data/src/core/lib/promise/context.h +14 -6
- data/src/core/lib/promise/detail/basic_seq.h +9 -28
- data/src/core/lib/promise/detail/promise_factory.h +59 -10
- data/src/core/lib/promise/detail/status.h +28 -0
- data/src/core/lib/promise/detail/switch.h +1455 -0
- data/src/core/lib/promise/exec_ctx_wakeup_scheduler.h +20 -12
- data/src/core/lib/promise/for_each.h +155 -0
- data/src/core/lib/promise/latch.h +13 -19
- data/src/core/lib/promise/loop.h +7 -5
- data/src/core/lib/promise/map.h +1 -0
- data/src/core/lib/promise/map_pipe.h +88 -0
- data/src/core/lib/promise/pipe.cc +19 -0
- data/src/core/lib/promise/pipe.h +505 -0
- data/src/core/lib/promise/poll.h +19 -0
- data/src/core/lib/promise/seq.h +4 -5
- data/src/core/lib/promise/sleep.cc +5 -4
- data/src/core/lib/promise/sleep.h +1 -2
- data/src/core/lib/promise/try_concurrently.h +342 -0
- data/src/core/lib/promise/try_seq.h +11 -13
- data/src/core/lib/resolver/resolver.cc +17 -17
- data/src/core/lib/resolver/server_address.cc +18 -17
- data/src/core/lib/resolver/server_address.h +19 -21
- data/src/core/lib/resource_quota/api.cc +0 -1
- data/src/core/lib/resource_quota/api.h +1 -1
- data/src/core/lib/resource_quota/arena.cc +36 -17
- data/src/core/lib/resource_quota/arena.h +107 -18
- data/src/core/lib/resource_quota/memory_quota.cc +140 -43
- data/src/core/lib/resource_quota/memory_quota.h +85 -23
- data/src/core/lib/resource_quota/resource_quota.h +1 -1
- data/src/core/lib/security/authorization/authorization_policy_provider.h +1 -1
- data/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc +0 -1
- data/src/core/lib/security/authorization/grpc_authorization_engine.cc +1 -3
- data/src/core/lib/security/authorization/grpc_server_authz_filter.cc +4 -2
- data/src/core/lib/security/authorization/matchers.cc +25 -22
- data/src/core/lib/security/authorization/rbac_policy.cc +2 -3
- data/src/core/lib/security/authorization/rbac_policy.h +1 -1
- data/src/core/lib/security/context/security_context.cc +22 -23
- data/src/core/lib/security/context/security_context.h +40 -30
- data/src/core/lib/security/credentials/alts/alts_credentials.cc +17 -17
- data/src/core/lib/security/credentials/alts/alts_credentials.h +50 -50
- data/src/core/lib/security/credentials/alts/check_gcp_environment.cc +19 -19
- data/src/core/lib/security/credentials/alts/check_gcp_environment.h +41 -41
- data/src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc +17 -17
- data/src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc +18 -17
- data/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc +18 -17
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc +19 -19
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc +18 -18
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h +36 -37
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc +18 -18
- data/src/core/lib/security/credentials/call_creds_util.h +1 -1
- data/src/core/lib/security/credentials/channel_creds_registry_init.cc +3 -4
- data/src/core/lib/security/credentials/composite/composite_credentials.cc +22 -22
- data/src/core/lib/security/credentials/composite/composite_credentials.h +20 -21
- data/src/core/lib/security/credentials/credentials.cc +19 -18
- data/src/core/lib/security/credentials/credentials.h +34 -33
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +77 -55
- data/src/core/lib/security/credentials/external/aws_request_signer.cc +4 -3
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +40 -51
- data/src/core/lib/security/credentials/external/file_external_account_credentials.cc +17 -21
- data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +21 -25
- data/src/core/lib/security/credentials/fake/fake_credentials.cc +20 -19
- data/src/core/lib/security/credentials/fake/fake_credentials.h +34 -35
- data/src/core/lib/security/credentials/google_default/credentials_generic.cc +17 -17
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +75 -73
- data/src/core/lib/security/credentials/google_default/google_default_credentials.h +18 -19
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +18 -17
- data/src/core/lib/security/credentials/iam/iam_credentials.h +18 -18
- data/src/core/lib/security/credentials/jwt/json_token.cc +24 -25
- data/src/core/lib/security/credentials/jwt/json_token.h +32 -32
- data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +18 -18
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +18 -19
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +75 -75
- data/src/core/lib/security/credentials/jwt/jwt_verifier.h +43 -43
- data/src/core/lib/security/credentials/local/local_credentials.cc +17 -17
- data/src/core/lib/security/credentials/local/local_credentials.h +20 -20
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +52 -59
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +19 -19
- data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +24 -23
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +22 -22
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +19 -20
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +18 -18
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc +20 -28
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h +4 -11
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +30 -43
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc +1 -1
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +18 -18
- data/src/core/lib/security/credentials/tls/tls_credentials.cc +18 -19
- data/src/core/lib/security/credentials/tls/tls_credentials.h +18 -18
- data/src/core/lib/security/credentials/xds/xds_credentials.cc +1 -2
- data/src/core/lib/security/credentials/xds/xds_credentials.h +1 -1
- data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +32 -38
- data/src/core/lib/security/security_connector/alts/alts_security_connector.h +41 -42
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +32 -41
- data/src/core/lib/security/security_connector/fake/fake_security_connector.h +20 -21
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc +2 -2
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +3 -8
- data/src/core/lib/security/security_connector/load_system_roots.h +18 -18
- data/src/core/lib/security/security_connector/load_system_roots_fallback.cc +18 -18
- data/src/core/lib/security/security_connector/load_system_roots_supported.cc +19 -22
- data/src/core/lib/security/security_connector/load_system_roots_supported.h +19 -20
- data/src/core/lib/security/security_connector/local/local_security_connector.cc +30 -34
- data/src/core/lib/security/security_connector/local/local_security_connector.h +40 -41
- data/src/core/lib/security/security_connector/security_connector.cc +17 -17
- data/src/core/lib/security/security_connector/security_connector.h +32 -33
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +34 -39
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +38 -39
- data/src/core/lib/security/security_connector/ssl_utils.cc +37 -39
- data/src/core/lib/security/security_connector/ssl_utils.h +31 -31
- data/src/core/lib/security/security_connector/ssl_utils_config.cc +22 -22
- data/src/core/lib/security/security_connector/ssl_utils_config.h +18 -19
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +42 -48
- data/src/core/lib/security/security_connector/tls/tls_security_connector.h +17 -17
- data/src/core/lib/security/transport/auth_filters.h +18 -18
- data/src/core/lib/security/transport/client_auth_filter.cc +21 -21
- data/src/core/lib/security/transport/secure_endpoint.cc +54 -56
- data/src/core/lib/security/transport/secure_endpoint.h +22 -22
- data/src/core/lib/security/transport/security_handshaker.cc +70 -70
- data/src/core/lib/security/transport/security_handshaker.h +19 -19
- data/src/core/lib/security/transport/server_auth_filter.cc +43 -44
- data/src/core/lib/security/transport/tsi_error.cc +23 -20
- data/src/core/lib/security/transport/tsi_error.h +18 -18
- data/src/core/lib/security/util/json_util.cc +21 -22
- data/src/core/lib/security/util/json_util.h +18 -18
- data/src/core/lib/service_config/service_config.h +2 -2
- data/src/core/lib/service_config/service_config_call_data.h +7 -1
- data/src/core/lib/service_config/service_config_impl.cc +111 -158
- data/src/core/lib/service_config/service_config_impl.h +14 -17
- data/src/core/lib/service_config/service_config_parser.cc +14 -31
- data/src/core/lib/service_config/service_config_parser.h +14 -10
- data/src/core/lib/slice/b64.cc +26 -26
- data/src/core/lib/slice/b64.h +29 -29
- data/src/core/lib/slice/percent_encoding.cc +17 -17
- data/src/core/lib/slice/percent_encoding.h +24 -24
- data/src/core/lib/slice/slice.cc +44 -38
- data/src/core/lib/slice/slice.h +57 -11
- data/src/core/lib/slice/slice_buffer.cc +63 -59
- data/src/core/lib/slice/slice_buffer.h +27 -2
- data/src/core/lib/slice/slice_internal.h +31 -39
- data/src/core/lib/slice/slice_refcount.h +34 -19
- data/src/core/lib/slice/slice_string_helpers.cc +17 -17
- data/src/core/lib/slice/slice_string_helpers.h +19 -19
- data/src/core/lib/surface/api_trace.cc +17 -17
- data/src/core/lib/surface/api_trace.h +22 -22
- data/src/core/lib/surface/byte_buffer.cc +22 -23
- data/src/core/lib/surface/byte_buffer_reader.cc +23 -23
- data/src/core/lib/surface/call.cc +1521 -335
- data/src/core/lib/surface/call.h +86 -39
- data/src/core/lib/surface/call_details.cc +20 -21
- data/src/core/lib/surface/call_log_batch.cc +18 -18
- data/src/core/lib/surface/call_test_only.h +30 -30
- data/src/core/lib/surface/call_trace.cc +113 -0
- data/src/core/{ext/filters/http/message_compress/message_decompress_filter.h → lib/surface/call_trace.h} +10 -12
- data/src/core/lib/surface/channel.cc +62 -67
- data/src/core/lib/surface/channel.h +40 -32
- data/src/core/lib/surface/channel_init.cc +17 -17
- data/src/core/lib/surface/channel_init.h +18 -18
- data/src/core/lib/surface/channel_ping.cc +19 -19
- data/src/core/lib/surface/channel_stack_type.cc +21 -17
- data/src/core/lib/surface/channel_stack_type.h +20 -18
- data/src/core/lib/surface/completion_queue.cc +173 -191
- data/src/core/lib/surface/completion_queue.h +32 -32
- data/src/core/lib/surface/completion_queue_factory.cc +28 -28
- data/src/core/lib/surface/completion_queue_factory.h +20 -20
- data/src/core/lib/surface/event_string.cc +17 -17
- data/src/core/lib/surface/event_string.h +20 -20
- data/src/core/lib/surface/init.cc +29 -58
- data/src/core/lib/surface/init.h +18 -18
- data/src/core/lib/surface/init_internally.cc +1 -0
- data/src/core/lib/surface/init_internally.h +9 -0
- data/src/core/lib/surface/lame_client.cc +28 -26
- data/src/core/lib/surface/lame_client.h +19 -19
- data/src/core/lib/surface/metadata_array.cc +17 -18
- data/src/core/lib/surface/server.cc +61 -83
- data/src/core/lib/surface/server.h +5 -7
- data/src/core/lib/surface/validate_metadata.cc +28 -29
- data/src/core/lib/surface/validate_metadata.h +18 -18
- data/src/core/lib/surface/version.cc +21 -21
- data/src/core/lib/transport/bdp_estimator.cc +17 -17
- data/src/core/lib/transport/bdp_estimator.h +18 -19
- data/src/core/lib/transport/connectivity_state.cc +19 -19
- data/src/core/lib/transport/connectivity_state.h +19 -19
- data/src/core/lib/transport/error_utils.cc +51 -45
- data/src/core/lib/transport/error_utils.h +21 -21
- data/src/core/lib/transport/handshaker.cc +49 -46
- data/src/core/lib/transport/handshaker.h +43 -38
- data/src/core/lib/transport/handshaker_factory.h +44 -18
- data/src/core/lib/transport/handshaker_registry.cc +25 -19
- data/src/core/lib/transport/handshaker_registry.h +21 -22
- data/src/core/lib/transport/http2_errors.h +20 -20
- data/src/core/lib/transport/http_connect_handshaker.cc +40 -41
- data/src/core/lib/transport/http_connect_handshaker.h +18 -18
- data/src/core/lib/transport/metadata_batch.cc +4 -1
- data/src/core/lib/transport/metadata_batch.h +46 -20
- data/src/core/lib/transport/parsed_metadata.cc +2 -6
- data/src/core/lib/transport/parsed_metadata.h +1 -0
- data/src/core/lib/transport/pid_controller.cc +20 -20
- data/src/core/lib/transport/pid_controller.h +24 -24
- data/src/core/lib/transport/status_conversion.cc +22 -22
- data/src/core/lib/transport/status_conversion.h +20 -20
- data/src/core/lib/transport/tcp_connect_handshaker.cc +15 -20
- data/src/core/lib/transport/tcp_connect_handshaker.h +1 -1
- data/src/core/lib/transport/timeout_encoding.cc +22 -22
- data/src/core/lib/transport/timeout_encoding.h +18 -18
- data/src/core/lib/transport/transport.cc +88 -41
- data/src/core/lib/transport/transport.h +193 -195
- data/src/core/lib/transport/transport_impl.h +42 -42
- data/src/core/lib/transport/transport_op_string.cc +26 -25
- data/src/core/plugin_registry/grpc_plugin_registry.cc +25 -27
- data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +7 -14
- data/src/core/tsi/alts/crypt/aes_gcm.cc +20 -20
- data/src/core/tsi/alts/crypt/gsec.cc +26 -26
- data/src/core/tsi/alts/crypt/gsec.h +334 -334
- data/src/core/tsi/alts/frame_protector/alts_counter.cc +23 -23
- data/src/core/tsi/alts/frame_protector/alts_counter.h +66 -66
- data/src/core/tsi/alts/frame_protector/alts_crypter.cc +19 -19
- data/src/core/tsi/alts/frame_protector/alts_crypter.h +206 -206
- data/src/core/tsi/alts/frame_protector/alts_frame_protector.cc +72 -71
- data/src/core/tsi/alts/frame_protector/alts_frame_protector.h +38 -38
- data/src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.cc +18 -18
- data/src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.h +80 -81
- data/src/core/tsi/alts/frame_protector/alts_seal_privacy_integrity_crypter.cc +22 -22
- data/src/core/tsi/alts/frame_protector/alts_unseal_privacy_integrity_crypter.cc +22 -22
- data/src/core/tsi/alts/frame_protector/frame_handler.cc +26 -25
- data/src/core/tsi/alts/frame_protector/frame_handler.h +166 -166
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +78 -77
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.h +99 -99
- data/src/core/tsi/alts/handshaker/alts_shared_resource.cc +18 -17
- data/src/core/tsi/alts/handshaker/alts_shared_resource.h +41 -42
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +37 -36
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +58 -58
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h +20 -20
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.cc +21 -20
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.h +36 -36
- data/src/core/tsi/alts/handshaker/transport_security_common_api.cc +19 -19
- data/src/core/tsi/alts/handshaker/transport_security_common_api.h +102 -101
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc +45 -44
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h +38 -39
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc +38 -36
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.h +33 -34
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h +65 -66
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc +32 -31
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h +53 -54
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.cc +54 -53
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h +138 -139
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +58 -57
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h +41 -42
- data/src/core/tsi/fake_transport_security.cc +80 -79
- data/src/core/tsi/fake_transport_security.h +30 -30
- data/src/core/tsi/local_transport_security.cc +34 -33
- data/src/core/tsi/local_transport_security.h +31 -31
- data/src/core/tsi/ssl/key_logging/ssl_key_logging.cc +8 -3
- data/src/core/tsi/ssl/session_cache/ssl_session.h +18 -18
- data/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc +19 -19
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +18 -17
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +19 -19
- data/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc +25 -20
- data/src/core/tsi/ssl_transport_security.cc +139 -323
- data/src/core/tsi/ssl_transport_security.h +201 -200
- data/src/core/tsi/ssl_transport_security_utils.cc +250 -0
- data/src/core/tsi/ssl_transport_security_utils.h +147 -0
- data/src/core/tsi/ssl_types.h +25 -25
- data/src/core/tsi/transport_security.cc +26 -26
- data/src/core/tsi/transport_security.h +45 -45
- data/src/core/tsi/transport_security_grpc.cc +20 -20
- data/src/core/tsi/transport_security_grpc.h +39 -39
- data/src/core/tsi/transport_security_interface.h +330 -330
- data/src/ruby/ext/grpc/{ext-export-truffleruby.clang → ext-export-truffleruby-with-ruby-abi-version.clang} +0 -0
- data/src/ruby/ext/grpc/{ext-export-truffleruby.gcc → ext-export-truffleruby-with-ruby-abi-version.gcc} +0 -0
- data/src/ruby/ext/grpc/ext-export-with-ruby-abi-version.clang +2 -0
- data/src/ruby/ext/grpc/ext-export-with-ruby-abi-version.gcc +7 -0
- data/src/ruby/ext/grpc/ext-export.clang +0 -1
- data/src/ruby/ext/grpc/ext-export.gcc +1 -2
- data/src/ruby/ext/grpc/extconf.rb +47 -2
- data/src/ruby/ext/grpc/rb_call.c +1 -0
- data/src/ruby/ext/grpc/rb_channel.c +1 -0
- data/src/ruby/ext/grpc/rb_channel_args.c +1 -0
- data/src/ruby/ext/grpc/rb_compression_options.c +1 -1
- data/src/ruby/ext/grpc/rb_grpc.c +1 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +38 -38
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +59 -59
- data/src/ruby/lib/grpc/generic/bidi_call.rb +2 -0
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/spec/channel_spec.rb +0 -43
- data/src/ruby/spec/client_server_spec.rb +20 -8
- data/src/ruby/spec/generic/active_call_spec.rb +12 -3
- data/third_party/abseil-cpp/absl/cleanup/cleanup.h +140 -0
- data/third_party/abseil-cpp/absl/cleanup/internal/cleanup.h +100 -0
- data/third_party/re2/re2/bitstate.cc +3 -3
- data/third_party/re2/re2/dfa.cc +13 -13
- data/third_party/re2/re2/nfa.cc +4 -4
- data/third_party/re2/re2/onepass.cc +2 -2
- data/third_party/re2/re2/prefilter_tree.cc +27 -59
- data/third_party/re2/re2/prefilter_tree.h +3 -2
- data/third_party/re2/re2/prog.cc +11 -2
- data/third_party/re2/re2/prog.h +17 -5
- data/third_party/re2/re2/re2.cc +6 -11
- data/third_party/re2/re2/re2.h +1 -1
- data/third_party/re2/re2/regexp.cc +1 -2
- data/third_party/re2/re2/stringpiece.h +10 -7
- data/third_party/re2/re2/unicode_casefold.cc +25 -11
- data/third_party/re2/re2/unicode_groups.cc +319 -151
- data/third_party/re2/re2/walker-inl.h +3 -2
- data/third_party/re2/util/mutex.h +4 -4
- data/third_party/zlib/compress.c +3 -3
- data/third_party/zlib/crc32.c +21 -12
- data/third_party/zlib/deflate.c +112 -106
- data/third_party/zlib/deflate.h +2 -2
- data/third_party/zlib/gzlib.c +1 -1
- data/third_party/zlib/gzread.c +3 -5
- data/third_party/zlib/gzwrite.c +1 -1
- data/third_party/zlib/infback.c +10 -7
- data/third_party/zlib/inflate.c +5 -2
- data/third_party/zlib/inftrees.c +2 -2
- data/third_party/zlib/inftrees.h +1 -1
- data/third_party/zlib/trees.c +61 -62
- data/third_party/zlib/uncompr.c +2 -2
- data/third_party/zlib/zconf.h +16 -3
- data/third_party/zlib/zlib.h +10 -10
- data/third_party/zlib/zutil.c +9 -7
- data/third_party/zlib/zutil.h +1 -0
- metadata +146 -40
- data/include/grpc/impl/codegen/gpr_slice.h +0 -71
- data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +0 -188
- data/src/core/ext/filters/fault_injection/service_config_parser.cc +0 -187
- data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +0 -332
- data/src/core/ext/filters/http/message_compress/message_compress_filter.h +0 -52
- data/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +0 -322
- data/src/core/ext/filters/server_config_selector/server_config_selector.cc +0 -62
- data/src/core/lib/gpr/murmur_hash.cc +0 -82
- data/src/core/lib/gpr/murmur_hash.h +0 -29
- data/src/core/lib/gpr/tls.h +0 -156
- data/src/core/lib/promise/call_push_pull.h +0 -148
- data/src/core/lib/slice/slice_api.cc +0 -39
- data/src/core/lib/slice/slice_refcount_base.h +0 -60
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
#include <inttypes.h>
|
|
22
22
|
#include <limits.h>
|
|
23
23
|
#include <stdio.h>
|
|
24
|
-
#include <stdlib.h>
|
|
25
24
|
#include <string.h>
|
|
26
25
|
|
|
27
26
|
#include <algorithm>
|
|
@@ -39,13 +38,14 @@
|
|
|
39
38
|
#include "absl/types/optional.h"
|
|
40
39
|
#include "absl/types/variant.h"
|
|
41
40
|
|
|
42
|
-
#include <grpc/
|
|
43
|
-
#include <grpc/impl/
|
|
41
|
+
#include <grpc/grpc.h>
|
|
42
|
+
#include <grpc/impl/connectivity_state.h>
|
|
44
43
|
#include <grpc/slice_buffer.h>
|
|
45
44
|
#include <grpc/status.h>
|
|
46
45
|
#include <grpc/support/alloc.h>
|
|
47
46
|
#include <grpc/support/atm.h>
|
|
48
47
|
#include <grpc/support/log.h>
|
|
48
|
+
#include <grpc/support/time.h>
|
|
49
49
|
|
|
50
50
|
#include "src/core/ext/transport/chttp2/transport/context_list.h"
|
|
51
51
|
#include "src/core/ext/transport/chttp2/transport/flow_control.h"
|
|
@@ -55,14 +55,16 @@
|
|
|
55
55
|
#include "src/core/ext/transport/chttp2/transport/frame_rst_stream.h"
|
|
56
56
|
#include "src/core/ext/transport/chttp2/transport/hpack_encoder.h"
|
|
57
57
|
#include "src/core/ext/transport/chttp2/transport/http2_settings.h"
|
|
58
|
+
#include "src/core/ext/transport/chttp2/transport/http_trace.h"
|
|
58
59
|
#include "src/core/ext/transport/chttp2/transport/internal.h"
|
|
59
60
|
#include "src/core/ext/transport/chttp2/transport/stream_map.h"
|
|
60
61
|
#include "src/core/ext/transport/chttp2/transport/varint.h"
|
|
61
62
|
#include "src/core/lib/channel/channel_args.h"
|
|
62
63
|
#include "src/core/lib/debug/stats.h"
|
|
63
|
-
#include "src/core/lib/
|
|
64
|
+
#include "src/core/lib/debug/stats_data.h"
|
|
64
65
|
#include "src/core/lib/gpr/useful.h"
|
|
65
66
|
#include "src/core/lib/gprpp/bitset.h"
|
|
67
|
+
#include "src/core/lib/gprpp/crash.h"
|
|
66
68
|
#include "src/core/lib/gprpp/debug_location.h"
|
|
67
69
|
#include "src/core/lib/gprpp/ref_counted.h"
|
|
68
70
|
#include "src/core/lib/gprpp/status_helper.h"
|
|
@@ -81,7 +83,6 @@
|
|
|
81
83
|
#include "src/core/lib/slice/slice.h"
|
|
82
84
|
#include "src/core/lib/slice/slice_buffer.h"
|
|
83
85
|
#include "src/core/lib/slice/slice_internal.h"
|
|
84
|
-
#include "src/core/lib/slice/slice_refcount.h"
|
|
85
86
|
#include "src/core/lib/transport/bdp_estimator.h"
|
|
86
87
|
#include "src/core/lib/transport/connectivity_state.h"
|
|
87
88
|
#include "src/core/lib/transport/error_utils.h"
|
|
@@ -97,13 +98,13 @@
|
|
|
97
98
|
#define DEFAULT_MAX_HEADER_LIST_SIZE (8 * 1024)
|
|
98
99
|
|
|
99
100
|
#define DEFAULT_CLIENT_KEEPALIVE_TIME_MS INT_MAX
|
|
100
|
-
#define DEFAULT_CLIENT_KEEPALIVE_TIMEOUT_MS 20000
|
|
101
|
-
#define DEFAULT_SERVER_KEEPALIVE_TIME_MS 7200000
|
|
102
|
-
#define DEFAULT_SERVER_KEEPALIVE_TIMEOUT_MS 20000
|
|
101
|
+
#define DEFAULT_CLIENT_KEEPALIVE_TIMEOUT_MS 20000 // 20 seconds
|
|
102
|
+
#define DEFAULT_SERVER_KEEPALIVE_TIME_MS 7200000 // 2 hours
|
|
103
|
+
#define DEFAULT_SERVER_KEEPALIVE_TIMEOUT_MS 20000 // 20 seconds
|
|
103
104
|
#define DEFAULT_KEEPALIVE_PERMIT_WITHOUT_CALLS false
|
|
104
105
|
#define KEEPALIVE_TIME_BACKOFF_MULTIPLIER 2
|
|
105
106
|
|
|
106
|
-
#define DEFAULT_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS 300000
|
|
107
|
+
#define DEFAULT_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS 300000 // 5 minutes
|
|
107
108
|
#define DEFAULT_MAX_PINGS_BETWEEN_DATA 2
|
|
108
109
|
#define DEFAULT_MAX_PING_STRIKES 2
|
|
109
110
|
|
|
@@ -128,7 +129,6 @@ static int g_default_max_pings_without_data = DEFAULT_MAX_PINGS_BETWEEN_DATA;
|
|
|
128
129
|
static int g_default_max_ping_strikes = DEFAULT_MAX_PING_STRIKES;
|
|
129
130
|
|
|
130
131
|
#define MAX_CLIENT_STREAM_ID 0x7fffffffu
|
|
131
|
-
grpc_core::TraceFlag grpc_http_trace(false, "http");
|
|
132
132
|
grpc_core::TraceFlag grpc_keepalive_trace(false, "http_keepalive");
|
|
133
133
|
grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_refcount(false,
|
|
134
134
|
"chttp2_refcount");
|
|
@@ -231,19 +231,17 @@ grpc_chttp2_transport::~grpc_chttp2_transport() {
|
|
|
231
231
|
|
|
232
232
|
grpc_endpoint_destroy(ep);
|
|
233
233
|
|
|
234
|
-
|
|
234
|
+
grpc_slice_buffer_destroy(&qbuf);
|
|
235
235
|
|
|
236
|
-
|
|
236
|
+
grpc_slice_buffer_destroy(&outbuf);
|
|
237
237
|
|
|
238
|
-
grpc_error_handle error =
|
|
239
|
-
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Transport destroyed");
|
|
238
|
+
grpc_error_handle error = GRPC_ERROR_CREATE("Transport destroyed");
|
|
240
239
|
// ContextList::Execute follows semantics of a callback function and does not
|
|
241
240
|
// take a ref on error
|
|
242
241
|
grpc_core::ContextList::Execute(cl, nullptr, error);
|
|
243
|
-
GRPC_ERROR_UNREF(error);
|
|
244
242
|
cl = nullptr;
|
|
245
243
|
|
|
246
|
-
|
|
244
|
+
grpc_slice_buffer_destroy(&read_buffer);
|
|
247
245
|
grpc_chttp2_goaway_parser_destroy(&goaway_parser);
|
|
248
246
|
|
|
249
247
|
for (i = 0; i < STREAM_LIST_COUNT; i++) {
|
|
@@ -251,16 +249,13 @@ grpc_chttp2_transport::~grpc_chttp2_transport() {
|
|
|
251
249
|
GPR_ASSERT(lists[i].tail == nullptr);
|
|
252
250
|
}
|
|
253
251
|
|
|
254
|
-
GRPC_ERROR_UNREF(goaway_error);
|
|
255
|
-
|
|
256
252
|
GPR_ASSERT(grpc_chttp2_stream_map_size(&stream_map) == 0);
|
|
257
253
|
|
|
258
254
|
grpc_chttp2_stream_map_destroy(&stream_map);
|
|
259
255
|
|
|
260
256
|
GRPC_COMBINER_UNREF(combiner, "chttp2_transport");
|
|
261
257
|
|
|
262
|
-
cancel_pings(this,
|
|
263
|
-
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Transport destroyed"));
|
|
258
|
+
cancel_pings(this, GRPC_ERROR_CREATE("Transport destroyed"));
|
|
264
259
|
|
|
265
260
|
while (write_cb_pool) {
|
|
266
261
|
grpc_chttp2_write_cb* next = write_cb_pool->next;
|
|
@@ -268,7 +263,6 @@ grpc_chttp2_transport::~grpc_chttp2_transport() {
|
|
|
268
263
|
write_cb_pool = next;
|
|
269
264
|
}
|
|
270
265
|
|
|
271
|
-
GRPC_ERROR_UNREF(closed_with_error);
|
|
272
266
|
gpr_free(ping_acks);
|
|
273
267
|
if (grpc_core::test_only_destruct_callback != nullptr) {
|
|
274
268
|
grpc_core::test_only_destruct_callback();
|
|
@@ -329,6 +323,13 @@ static void read_channel_args(grpc_chttp2_transport* t,
|
|
|
329
323
|
t->keepalive_permit_without_calls =
|
|
330
324
|
channel_args.GetBool(GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS)
|
|
331
325
|
.value_or(false);
|
|
326
|
+
// Only send the prefered rx frame size http2 setting if we are instructed
|
|
327
|
+
// to auto size the buffers allocated at tcp level and we also can adjust
|
|
328
|
+
// sending frame size.
|
|
329
|
+
t->enable_preferred_rx_crypto_frame_advertisement =
|
|
330
|
+
channel_args
|
|
331
|
+
.GetBool(GRPC_ARG_EXPERIMENTAL_HTTP2_PREFERRED_CRYPTO_FRAME_SIZE)
|
|
332
|
+
.value_or(false);
|
|
332
333
|
|
|
333
334
|
if (channel_args.GetBool(GRPC_ARG_ENABLE_CHANNELZ)
|
|
334
335
|
.value_or(GRPC_ENABLE_CHANNELZ_DEFAULT)) {
|
|
@@ -399,6 +400,16 @@ static void read_channel_args(grpc_chttp2_transport* t,
|
|
|
399
400
|
is_client ? "clients" : "servers");
|
|
400
401
|
}
|
|
401
402
|
}
|
|
403
|
+
|
|
404
|
+
if (t->enable_preferred_rx_crypto_frame_advertisement) {
|
|
405
|
+
const grpc_chttp2_setting_parameters* sp =
|
|
406
|
+
&grpc_chttp2_settings_parameters
|
|
407
|
+
[GRPC_CHTTP2_SETTINGS_GRPC_PREFERRED_RECEIVE_CRYPTO_FRAME_SIZE];
|
|
408
|
+
queue_setting_update(
|
|
409
|
+
t, GRPC_CHTTP2_SETTINGS_GRPC_PREFERRED_RECEIVE_CRYPTO_FRAME_SIZE,
|
|
410
|
+
grpc_core::Clamp(INT_MAX, static_cast<int>(sp->min_value),
|
|
411
|
+
static_cast<int>(sp->max_value)));
|
|
412
|
+
}
|
|
402
413
|
}
|
|
403
414
|
|
|
404
415
|
static void init_transport_keepalive_settings(grpc_chttp2_transport* t) {
|
|
@@ -544,9 +555,9 @@ static void destroy_transport_locked(void* tp, grpc_error_handle /*error*/) {
|
|
|
544
555
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
|
545
556
|
t->destroying = 1;
|
|
546
557
|
close_transport_locked(
|
|
547
|
-
t, grpc_error_set_int(
|
|
548
|
-
|
|
549
|
-
|
|
558
|
+
t, grpc_error_set_int(GRPC_ERROR_CREATE("Transport destroyed"),
|
|
559
|
+
grpc_core::StatusIntProperty::kOccurredDuringWrite,
|
|
560
|
+
t->write_state));
|
|
550
561
|
t->memory_owner.Reset();
|
|
551
562
|
// Must be the last line.
|
|
552
563
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "destroy");
|
|
@@ -555,30 +566,30 @@ static void destroy_transport_locked(void* tp, grpc_error_handle /*error*/) {
|
|
|
555
566
|
static void destroy_transport(grpc_transport* gt) {
|
|
556
567
|
grpc_chttp2_transport* t = reinterpret_cast<grpc_chttp2_transport*>(gt);
|
|
557
568
|
t->combiner->Run(GRPC_CLOSURE_CREATE(destroy_transport_locked, t, nullptr),
|
|
558
|
-
|
|
569
|
+
absl::OkStatus());
|
|
559
570
|
}
|
|
560
571
|
|
|
561
572
|
static void close_transport_locked(grpc_chttp2_transport* t,
|
|
562
573
|
grpc_error_handle error) {
|
|
563
|
-
end_all_the_calls(t,
|
|
564
|
-
cancel_pings(t,
|
|
565
|
-
if (
|
|
574
|
+
end_all_the_calls(t, error);
|
|
575
|
+
cancel_pings(t, error);
|
|
576
|
+
if (t->closed_with_error.ok()) {
|
|
566
577
|
if (!grpc_error_has_clear_grpc_status(error)) {
|
|
567
|
-
error =
|
|
568
|
-
|
|
578
|
+
error =
|
|
579
|
+
grpc_error_set_int(error, grpc_core::StatusIntProperty::kRpcStatus,
|
|
580
|
+
GRPC_STATUS_UNAVAILABLE);
|
|
569
581
|
}
|
|
570
582
|
if (t->write_state != GRPC_CHTTP2_WRITE_STATE_IDLE) {
|
|
571
|
-
if (
|
|
583
|
+
if (t->close_transport_on_writes_finished.ok()) {
|
|
572
584
|
t->close_transport_on_writes_finished =
|
|
573
|
-
|
|
574
|
-
"Delayed close due to in-progress write");
|
|
585
|
+
GRPC_ERROR_CREATE("Delayed close due to in-progress write");
|
|
575
586
|
}
|
|
576
587
|
t->close_transport_on_writes_finished =
|
|
577
588
|
grpc_error_add_child(t->close_transport_on_writes_finished, error);
|
|
578
589
|
return;
|
|
579
590
|
}
|
|
580
|
-
GPR_ASSERT(!
|
|
581
|
-
t->closed_with_error =
|
|
591
|
+
GPR_ASSERT(!error.ok());
|
|
592
|
+
t->closed_with_error = error;
|
|
582
593
|
connectivity_state_set(t, GRPC_CHANNEL_SHUTDOWN, absl::Status(),
|
|
583
594
|
"close_transport");
|
|
584
595
|
if (t->ping_state.is_delayed_ping_timer_set) {
|
|
@@ -607,19 +618,17 @@ static void close_transport_locked(grpc_chttp2_transport* t,
|
|
|
607
618
|
GRPC_CHTTP2_STREAM_UNREF(s, "chttp2_writing:close");
|
|
608
619
|
}
|
|
609
620
|
GPR_ASSERT(t->write_state == GRPC_CHTTP2_WRITE_STATE_IDLE);
|
|
610
|
-
grpc_endpoint_shutdown(t->ep,
|
|
621
|
+
grpc_endpoint_shutdown(t->ep, error);
|
|
611
622
|
}
|
|
612
623
|
if (t->notify_on_receive_settings != nullptr) {
|
|
613
624
|
grpc_core::ExecCtx::Run(DEBUG_LOCATION, t->notify_on_receive_settings,
|
|
614
|
-
|
|
625
|
+
error);
|
|
615
626
|
t->notify_on_receive_settings = nullptr;
|
|
616
627
|
}
|
|
617
628
|
if (t->notify_on_close != nullptr) {
|
|
618
|
-
grpc_core::ExecCtx::Run(DEBUG_LOCATION, t->notify_on_close,
|
|
619
|
-
GRPC_ERROR_REF(error));
|
|
629
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, t->notify_on_close, error);
|
|
620
630
|
t->notify_on_close = nullptr;
|
|
621
631
|
}
|
|
622
|
-
GRPC_ERROR_UNREF(error);
|
|
623
632
|
}
|
|
624
633
|
|
|
625
634
|
#ifndef NDEBUG
|
|
@@ -684,13 +693,13 @@ grpc_chttp2_stream::~grpc_chttp2_stream() {
|
|
|
684
693
|
GPR_ASSERT(grpc_chttp2_stream_map_find(&t->stream_map, id) == nullptr);
|
|
685
694
|
}
|
|
686
695
|
|
|
687
|
-
|
|
696
|
+
grpc_slice_buffer_destroy(&frame_storage);
|
|
688
697
|
|
|
689
698
|
for (int i = 0; i < STREAM_LIST_COUNT; i++) {
|
|
690
699
|
if (GPR_UNLIKELY(included.is_set(i))) {
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
700
|
+
grpc_core::Crash(absl::StrFormat("%s stream %d still included in list %d",
|
|
701
|
+
t->is_client ? "client" : "server", id,
|
|
702
|
+
i));
|
|
694
703
|
}
|
|
695
704
|
}
|
|
696
705
|
|
|
@@ -699,11 +708,9 @@ grpc_chttp2_stream::~grpc_chttp2_stream() {
|
|
|
699
708
|
GPR_ASSERT(recv_initial_metadata_ready == nullptr);
|
|
700
709
|
GPR_ASSERT(recv_message_ready == nullptr);
|
|
701
710
|
GPR_ASSERT(recv_trailing_metadata_finished == nullptr);
|
|
702
|
-
|
|
703
|
-
GRPC_ERROR_UNREF(read_closed_error);
|
|
704
|
-
GRPC_ERROR_UNREF(write_closed_error);
|
|
711
|
+
grpc_slice_buffer_destroy(&flow_controlled_buffer);
|
|
705
712
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "stream");
|
|
706
|
-
grpc_core::ExecCtx::Run(DEBUG_LOCATION, destroy_stream_arg,
|
|
713
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, destroy_stream_arg, absl::OkStatus());
|
|
707
714
|
}
|
|
708
715
|
|
|
709
716
|
static int init_stream(grpc_transport* gt, grpc_stream* gs,
|
|
@@ -727,7 +734,7 @@ static void destroy_stream(grpc_transport* gt, grpc_stream* gs,
|
|
|
727
734
|
s->destroy_stream_arg = then_schedule_closure;
|
|
728
735
|
t->combiner->Run(
|
|
729
736
|
GRPC_CLOSURE_INIT(&s->destroy_stream, destroy_stream_locked, s, nullptr),
|
|
730
|
-
|
|
737
|
+
absl::OkStatus());
|
|
731
738
|
}
|
|
732
739
|
|
|
733
740
|
grpc_chttp2_stream* grpc_chttp2_parsing_accept_stream(grpc_chttp2_transport* t,
|
|
@@ -775,9 +782,9 @@ static void set_write_state(grpc_chttp2_transport* t,
|
|
|
775
782
|
// from peer while we had some pending writes)
|
|
776
783
|
if (st == GRPC_CHTTP2_WRITE_STATE_IDLE) {
|
|
777
784
|
grpc_core::ExecCtx::RunList(DEBUG_LOCATION, &t->run_after_write);
|
|
778
|
-
if (!
|
|
785
|
+
if (!t->close_transport_on_writes_finished.ok()) {
|
|
779
786
|
grpc_error_handle err = t->close_transport_on_writes_finished;
|
|
780
|
-
t->close_transport_on_writes_finished =
|
|
787
|
+
t->close_transport_on_writes_finished = absl::OkStatus();
|
|
781
788
|
close_transport_locked(t, err);
|
|
782
789
|
}
|
|
783
790
|
}
|
|
@@ -809,7 +816,7 @@ void grpc_chttp2_initiate_write(grpc_chttp2_transport* t,
|
|
|
809
816
|
t->combiner->FinallyRun(
|
|
810
817
|
GRPC_CLOSURE_INIT(&t->write_action_begin_locked,
|
|
811
818
|
write_action_begin_locked, t, nullptr),
|
|
812
|
-
|
|
819
|
+
absl::OkStatus());
|
|
813
820
|
break;
|
|
814
821
|
case GRPC_CHTTP2_WRITE_STATE_WRITING:
|
|
815
822
|
set_write_state(t, GRPC_CHTTP2_WRITE_STATE_WRITING_WITH_MORE,
|
|
@@ -822,8 +829,7 @@ void grpc_chttp2_initiate_write(grpc_chttp2_transport* t,
|
|
|
822
829
|
|
|
823
830
|
void grpc_chttp2_mark_stream_writable(grpc_chttp2_transport* t,
|
|
824
831
|
grpc_chttp2_stream* s) {
|
|
825
|
-
if (
|
|
826
|
-
grpc_chttp2_list_add_writable_stream(t, s)) {
|
|
832
|
+
if (t->closed_with_error.ok() && grpc_chttp2_list_add_writable_stream(t, s)) {
|
|
827
833
|
GRPC_CHTTP2_STREAM_REF(s, "chttp2_writing:become");
|
|
828
834
|
}
|
|
829
835
|
}
|
|
@@ -841,7 +847,7 @@ static void write_action_begin_locked(void* gt,
|
|
|
841
847
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(gt);
|
|
842
848
|
GPR_ASSERT(t->write_state != GRPC_CHTTP2_WRITE_STATE_IDLE);
|
|
843
849
|
grpc_chttp2_begin_write_result r;
|
|
844
|
-
if (!
|
|
850
|
+
if (!t->closed_with_error.ok()) {
|
|
845
851
|
r.writing = false;
|
|
846
852
|
} else {
|
|
847
853
|
r = grpc_chttp2_begin_write(t);
|
|
@@ -851,7 +857,7 @@ static void write_action_begin_locked(void* gt,
|
|
|
851
857
|
r.partial ? GRPC_CHTTP2_WRITE_STATE_WRITING_WITH_MORE
|
|
852
858
|
: GRPC_CHTTP2_WRITE_STATE_WRITING,
|
|
853
859
|
begin_writing_desc(r.partial));
|
|
854
|
-
write_action(t,
|
|
860
|
+
write_action(t, absl::OkStatus());
|
|
855
861
|
if (t->reading_paused_on_pending_induced_frames) {
|
|
856
862
|
GPR_ASSERT(t->num_pending_induced_frames == 0);
|
|
857
863
|
// We had paused reading, because we had many induced frames (SETTINGS
|
|
@@ -875,16 +881,17 @@ static void write_action(void* gt, grpc_error_handle /*error*/) {
|
|
|
875
881
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(gt);
|
|
876
882
|
void* cl = t->cl;
|
|
877
883
|
t->cl = nullptr;
|
|
878
|
-
//
|
|
879
|
-
//
|
|
880
|
-
// high memory pressure, then it would advertise a smaller max http2 frame
|
|
881
|
-
// size. With this logic, the sender would automatically reduce the sending
|
|
882
|
-
// frame size as well.
|
|
884
|
+
// Choose max_frame_size as the prefered rx crypto frame size indicated by the
|
|
885
|
+
// peer.
|
|
883
886
|
int max_frame_size =
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
887
|
+
t->settings
|
|
888
|
+
[GRPC_PEER_SETTINGS]
|
|
889
|
+
[GRPC_CHTTP2_SETTINGS_GRPC_PREFERRED_RECEIVE_CRYPTO_FRAME_SIZE];
|
|
890
|
+
// Note: max frame size is 0 if the remote peer does not support adjusting the
|
|
891
|
+
// sending frame size.
|
|
892
|
+
if (max_frame_size == 0) {
|
|
893
|
+
max_frame_size = INT_MAX;
|
|
894
|
+
}
|
|
888
895
|
grpc_endpoint_write(
|
|
889
896
|
t->ep, &t->outbuf,
|
|
890
897
|
GRPC_CLOSURE_INIT(&t->write_action_end_locked, write_action_end, t,
|
|
@@ -896,7 +903,7 @@ static void write_action_end(void* tp, grpc_error_handle error) {
|
|
|
896
903
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
|
897
904
|
t->combiner->Run(GRPC_CLOSURE_INIT(&t->write_action_end_locked,
|
|
898
905
|
write_action_end_locked, t, nullptr),
|
|
899
|
-
|
|
906
|
+
error);
|
|
900
907
|
}
|
|
901
908
|
|
|
902
909
|
// Callback from the grpc_endpoint after bytes have been written by calling
|
|
@@ -905,8 +912,8 @@ static void write_action_end_locked(void* tp, grpc_error_handle error) {
|
|
|
905
912
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
|
906
913
|
|
|
907
914
|
bool closed = false;
|
|
908
|
-
if (!
|
|
909
|
-
close_transport_locked(t,
|
|
915
|
+
if (!error.ok()) {
|
|
916
|
+
close_transport_locked(t, error);
|
|
910
917
|
closed = true;
|
|
911
918
|
}
|
|
912
919
|
|
|
@@ -914,8 +921,7 @@ static void write_action_end_locked(void* tp, grpc_error_handle error) {
|
|
|
914
921
|
t->sent_goaway_state = GRPC_CHTTP2_FINAL_GOAWAY_SENT;
|
|
915
922
|
closed = true;
|
|
916
923
|
if (grpc_chttp2_stream_map_size(&t->stream_map) == 0) {
|
|
917
|
-
close_transport_locked(
|
|
918
|
-
t, GRPC_ERROR_CREATE_FROM_STATIC_STRING("goaway sent"));
|
|
924
|
+
close_transport_locked(t, GRPC_ERROR_CREATE("goaway sent"));
|
|
919
925
|
}
|
|
920
926
|
}
|
|
921
927
|
|
|
@@ -939,11 +945,11 @@ static void write_action_end_locked(void* tp, grpc_error_handle error) {
|
|
|
939
945
|
t->combiner->FinallyRun(
|
|
940
946
|
GRPC_CLOSURE_INIT(&t->write_action_begin_locked,
|
|
941
947
|
write_action_begin_locked, t, nullptr),
|
|
942
|
-
|
|
948
|
+
absl::OkStatus());
|
|
943
949
|
break;
|
|
944
950
|
}
|
|
945
951
|
|
|
946
|
-
grpc_chttp2_end_write(t,
|
|
952
|
+
grpc_chttp2_end_write(t, error);
|
|
947
953
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "writing");
|
|
948
954
|
}
|
|
949
955
|
|
|
@@ -972,26 +978,27 @@ static void cancel_unstarted_streams(grpc_chttp2_transport* t,
|
|
|
972
978
|
s->trailing_metadata_buffer.Set(
|
|
973
979
|
grpc_core::GrpcStreamNetworkState(),
|
|
974
980
|
grpc_core::GrpcStreamNetworkState::kNotSentOnWire);
|
|
975
|
-
grpc_chttp2_cancel_stream(t, s,
|
|
981
|
+
grpc_chttp2_cancel_stream(t, s, error);
|
|
976
982
|
}
|
|
977
|
-
GRPC_ERROR_UNREF(error);
|
|
978
983
|
}
|
|
979
984
|
|
|
980
985
|
void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
|
|
981
986
|
uint32_t goaway_error,
|
|
982
987
|
uint32_t last_stream_id,
|
|
983
988
|
absl::string_view goaway_text) {
|
|
984
|
-
// Discard the error from a previous goaway frame (if any)
|
|
985
|
-
if (!GRPC_ERROR_IS_NONE(t->goaway_error)) {
|
|
986
|
-
GRPC_ERROR_UNREF(t->goaway_error);
|
|
987
|
-
}
|
|
988
989
|
t->goaway_error = grpc_error_set_str(
|
|
989
990
|
grpc_error_set_int(
|
|
990
991
|
grpc_error_set_int(
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
992
|
+
grpc_core::StatusCreate(
|
|
993
|
+
absl::StatusCode::kUnavailable,
|
|
994
|
+
absl::StrFormat(
|
|
995
|
+
"GOAWAY received; Error code: %u; Debug Text: %s",
|
|
996
|
+
goaway_error, goaway_text),
|
|
997
|
+
DEBUG_LOCATION, {}),
|
|
998
|
+
grpc_core::StatusIntProperty::kHttp2Error,
|
|
999
|
+
static_cast<intptr_t>(goaway_error)),
|
|
1000
|
+
grpc_core::StatusIntProperty::kRpcStatus, GRPC_STATUS_UNAVAILABLE),
|
|
1001
|
+
grpc_core::StatusStrProperty::kRawBytes, goaway_text);
|
|
995
1002
|
|
|
996
1003
|
GRPC_CHTTP2_IF_TRACING(
|
|
997
1004
|
gpr_log(GPR_INFO, "transport %p got goaway with last stream id %d", t,
|
|
@@ -1000,10 +1007,10 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
|
|
|
1000
1007
|
// received a GOAWAY with a non NO_ERROR code.
|
|
1001
1008
|
if (goaway_error != GRPC_HTTP2_NO_ERROR) {
|
|
1002
1009
|
gpr_log(GPR_INFO, "%s: Got goaway [%d] err=%s", t->peer_string.c_str(),
|
|
1003
|
-
goaway_error,
|
|
1010
|
+
goaway_error, grpc_core::StatusToString(t->goaway_error).c_str());
|
|
1004
1011
|
}
|
|
1005
1012
|
if (t->is_client) {
|
|
1006
|
-
cancel_unstarted_streams(t,
|
|
1013
|
+
cancel_unstarted_streams(t, t->goaway_error);
|
|
1007
1014
|
// Cancel all unseen streams
|
|
1008
1015
|
grpc_chttp2_stream_map_for_each(
|
|
1009
1016
|
&t->stream_map,
|
|
@@ -1014,8 +1021,7 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
|
|
|
1014
1021
|
s->trailing_metadata_buffer.Set(
|
|
1015
1022
|
grpc_core::GrpcStreamNetworkState(),
|
|
1016
1023
|
grpc_core::GrpcStreamNetworkState::kNotSeenByServer);
|
|
1017
|
-
grpc_chttp2_cancel_stream(s->t, s,
|
|
1018
|
-
GRPC_ERROR_REF(s->t->goaway_error));
|
|
1024
|
+
grpc_chttp2_cancel_stream(s->t, s, s->t->goaway_error);
|
|
1019
1025
|
}
|
|
1020
1026
|
},
|
|
1021
1027
|
&last_stream_id);
|
|
@@ -1035,7 +1041,7 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
|
|
|
1035
1041
|
t->peer_string.c_str(), t->keepalive_time.ToString().c_str());
|
|
1036
1042
|
constexpr int max_keepalive_time_millis =
|
|
1037
1043
|
INT_MAX / KEEPALIVE_TIME_BACKOFF_MULTIPLIER;
|
|
1038
|
-
|
|
1044
|
+
int64_t throttled_keepalive_time =
|
|
1039
1045
|
t->keepalive_time.millis() > max_keepalive_time_millis
|
|
1040
1046
|
? INT_MAX
|
|
1041
1047
|
: t->keepalive_time.millis() * KEEPALIVE_TIME_BACKOFF_MULTIPLIER;
|
|
@@ -1054,8 +1060,8 @@ static void maybe_start_some_streams(grpc_chttp2_transport* t) {
|
|
|
1054
1060
|
grpc_chttp2_stream* s;
|
|
1055
1061
|
// maybe cancel out streams that haven't yet started if we have received a
|
|
1056
1062
|
// GOAWAY
|
|
1057
|
-
if (!
|
|
1058
|
-
cancel_unstarted_streams(t,
|
|
1063
|
+
if (!t->goaway_error.ok()) {
|
|
1064
|
+
cancel_unstarted_streams(t, t->goaway_error);
|
|
1059
1065
|
return;
|
|
1060
1066
|
}
|
|
1061
1067
|
// start streams where we have free grpc_chttp2_stream ids and free
|
|
@@ -1095,9 +1101,9 @@ static void maybe_start_some_streams(grpc_chttp2_transport* t) {
|
|
|
1095
1101
|
grpc_core::GrpcStreamNetworkState::kNotSentOnWire);
|
|
1096
1102
|
grpc_chttp2_cancel_stream(
|
|
1097
1103
|
t, s,
|
|
1098
|
-
grpc_error_set_int(
|
|
1099
|
-
|
|
1100
|
-
|
|
1104
|
+
grpc_error_set_int(GRPC_ERROR_CREATE("Stream IDs exhausted"),
|
|
1105
|
+
grpc_core::StatusIntProperty::kRpcStatus,
|
|
1106
|
+
GRPC_STATUS_UNAVAILABLE));
|
|
1101
1107
|
}
|
|
1102
1108
|
}
|
|
1103
1109
|
}
|
|
@@ -1124,7 +1130,7 @@ static void null_then_sched_closure(grpc_closure** closure) {
|
|
|
1124
1130
|
// completion, have the application see it, and make a new operation on the
|
|
1125
1131
|
// call which recycles the batch BEFORE the call to start_batch completes,
|
|
1126
1132
|
// forcing a race.
|
|
1127
|
-
grpc_core::ExecCtx::Run(DEBUG_LOCATION, c,
|
|
1133
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, c, absl::OkStatus());
|
|
1128
1134
|
}
|
|
1129
1135
|
|
|
1130
1136
|
void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t,
|
|
@@ -1135,7 +1141,6 @@ void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t,
|
|
|
1135
1141
|
grpc_closure* closure = *pclosure;
|
|
1136
1142
|
*pclosure = nullptr;
|
|
1137
1143
|
if (closure == nullptr) {
|
|
1138
|
-
GRPC_ERROR_UNREF(error);
|
|
1139
1144
|
return;
|
|
1140
1145
|
}
|
|
1141
1146
|
closure->next_data.scratch -= CLOSURE_BARRIER_FIRST_REF_BIT;
|
|
@@ -1149,20 +1154,20 @@ void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t,
|
|
|
1149
1154
|
CLOSURE_BARRIER_FIRST_REF_BIT),
|
|
1150
1155
|
static_cast<int>(closure->next_data.scratch %
|
|
1151
1156
|
CLOSURE_BARRIER_FIRST_REF_BIT),
|
|
1152
|
-
desc,
|
|
1157
|
+
desc, grpc_core::StatusToString(error).c_str(),
|
|
1153
1158
|
write_state_name(t->write_state));
|
|
1154
1159
|
}
|
|
1155
|
-
if (!
|
|
1160
|
+
if (!error.ok()) {
|
|
1156
1161
|
grpc_error_handle cl_err =
|
|
1157
1162
|
grpc_core::internal::StatusMoveFromHeapPtr(closure->error_data.error);
|
|
1158
|
-
if (
|
|
1159
|
-
cl_err =
|
|
1163
|
+
if (cl_err.ok()) {
|
|
1164
|
+
cl_err = GRPC_ERROR_CREATE(absl::StrCat(
|
|
1160
1165
|
"Error in HTTP transport completing operation: ", desc,
|
|
1161
1166
|
" write_state=", write_state_name(t->write_state), " refs=",
|
|
1162
1167
|
closure->next_data.scratch / CLOSURE_BARRIER_FIRST_REF_BIT, " flags=",
|
|
1163
1168
|
closure->next_data.scratch % CLOSURE_BARRIER_FIRST_REF_BIT));
|
|
1164
|
-
cl_err = grpc_error_set_str(
|
|
1165
|
-
|
|
1169
|
+
cl_err = grpc_error_set_str(
|
|
1170
|
+
cl_err, grpc_core::StatusStrProperty::kTargetAddress, t->peer_string);
|
|
1166
1171
|
}
|
|
1167
1172
|
cl_err = grpc_error_add_child(cl_err, error);
|
|
1168
1173
|
closure->error_data.error = grpc_core::internal::StatusAllocHeapPtr(cl_err);
|
|
@@ -1189,6 +1194,7 @@ static bool contains_non_ok_status(grpc_metadata_batch* batch) {
|
|
|
1189
1194
|
|
|
1190
1195
|
static void log_metadata(const grpc_metadata_batch* md_batch, uint32_t id,
|
|
1191
1196
|
bool is_client, bool is_initial) {
|
|
1197
|
+
gpr_log(GPR_INFO, "--metadata--");
|
|
1192
1198
|
const std::string prefix = absl::StrCat(
|
|
1193
1199
|
"HTTP:", id, is_initial ? ":HDR" : ":TRL", is_client ? ":CLI:" : ":SVR:");
|
|
1194
1200
|
md_batch->Log([&prefix](absl::string_view key, absl::string_view value) {
|
|
@@ -1256,7 +1262,7 @@ static void perform_stream_op_locked(void* stream_op,
|
|
|
1256
1262
|
}
|
|
1257
1263
|
if (!s->write_closed) {
|
|
1258
1264
|
if (t->is_client) {
|
|
1259
|
-
if (
|
|
1265
|
+
if (t->closed_with_error.ok()) {
|
|
1260
1266
|
GPR_ASSERT(s->id == 0);
|
|
1261
1267
|
grpc_chttp2_list_add_waiting_for_concurrency(t, s);
|
|
1262
1268
|
maybe_start_some_streams(t);
|
|
@@ -1267,9 +1273,10 @@ static void perform_stream_op_locked(void* stream_op,
|
|
|
1267
1273
|
grpc_chttp2_cancel_stream(
|
|
1268
1274
|
t, s,
|
|
1269
1275
|
grpc_error_set_int(
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1276
|
+
GRPC_ERROR_CREATE_REFERENCING("Transport closed",
|
|
1277
|
+
&t->closed_with_error, 1),
|
|
1278
|
+
grpc_core::StatusIntProperty::kRpcStatus,
|
|
1279
|
+
GRPC_STATUS_UNAVAILABLE));
|
|
1273
1280
|
}
|
|
1274
1281
|
} else {
|
|
1275
1282
|
GPR_ASSERT(s->id != 0);
|
|
@@ -1284,7 +1291,7 @@ static void perform_stream_op_locked(void* stream_op,
|
|
|
1284
1291
|
s->send_initial_metadata = nullptr;
|
|
1285
1292
|
grpc_chttp2_complete_closure_step(
|
|
1286
1293
|
t, s, &s->send_initial_metadata_finished,
|
|
1287
|
-
|
|
1294
|
+
GRPC_ERROR_CREATE_REFERENCING(
|
|
1288
1295
|
"Attempt to send initial metadata after stream was closed",
|
|
1289
1296
|
&s->write_closed_error, 1),
|
|
1290
1297
|
"send_initial_metadata_finished");
|
|
@@ -1297,7 +1304,7 @@ static void perform_stream_op_locked(void* stream_op,
|
|
|
1297
1304
|
|
|
1298
1305
|
if (op->send_message) {
|
|
1299
1306
|
t->num_messages_in_next_write++;
|
|
1300
|
-
|
|
1307
|
+
grpc_core::global_stats().IncrementHttp2SendMessageSize(
|
|
1301
1308
|
op->payload->send_message.send_message->Length());
|
|
1302
1309
|
on_complete->next_data.scratch |= CLOSURE_BARRIER_MAY_COVER_WRITE;
|
|
1303
1310
|
s->send_message_finished = add_closure_barrier(op->on_complete);
|
|
@@ -1308,7 +1315,7 @@ static void perform_stream_op_locked(void* stream_op,
|
|
|
1308
1315
|
// started. The surface layer will notice that the stream has been closed
|
|
1309
1316
|
// for writes and fail the send message op.
|
|
1310
1317
|
grpc_chttp2_complete_closure_step(t, s, &s->send_message_finished,
|
|
1311
|
-
|
|
1318
|
+
absl::OkStatus(),
|
|
1312
1319
|
"fetching_send_message_finished");
|
|
1313
1320
|
} else {
|
|
1314
1321
|
uint8_t* frame_hdr = grpc_slice_buffer_tiny_add(
|
|
@@ -1337,13 +1344,13 @@ static void perform_stream_op_locked(void* stream_op,
|
|
|
1337
1344
|
slices + op_payload->send_message.send_message->Count();
|
|
1338
1345
|
for (grpc_slice* slice = slices; slice != end; slice++) {
|
|
1339
1346
|
grpc_slice_buffer_add(&s->flow_controlled_buffer,
|
|
1340
|
-
|
|
1347
|
+
grpc_core::CSliceRef(*slice));
|
|
1341
1348
|
}
|
|
1342
1349
|
|
|
1343
1350
|
int64_t notify_offset = s->next_message_end_offset;
|
|
1344
1351
|
if (notify_offset <= s->flow_controlled_bytes_written) {
|
|
1345
1352
|
grpc_chttp2_complete_closure_step(t, s, &s->send_message_finished,
|
|
1346
|
-
|
|
1353
|
+
absl::OkStatus(),
|
|
1347
1354
|
"fetching_send_message_finished");
|
|
1348
1355
|
} else {
|
|
1349
1356
|
grpc_chttp2_write_cb* cb = t->write_cb_pool;
|
|
@@ -1388,10 +1395,9 @@ static void perform_stream_op_locked(void* stream_op,
|
|
|
1388
1395
|
grpc_chttp2_complete_closure_step(
|
|
1389
1396
|
t, s, &s->send_trailing_metadata_finished,
|
|
1390
1397
|
op->payload->send_trailing_metadata.send_trailing_metadata->empty()
|
|
1391
|
-
?
|
|
1392
|
-
:
|
|
1393
|
-
|
|
1394
|
-
"stream was closed"),
|
|
1398
|
+
? absl::OkStatus()
|
|
1399
|
+
: GRPC_ERROR_CREATE("Attempt to send trailing metadata after "
|
|
1400
|
+
"stream was closed"),
|
|
1395
1401
|
"send_trailing_metadata_finished");
|
|
1396
1402
|
} else if (s->id != 0) {
|
|
1397
1403
|
// TODO(ctiller): check if there's flow control for any outstanding
|
|
@@ -1410,6 +1416,9 @@ static void perform_stream_op_locked(void* stream_op,
|
|
|
1410
1416
|
op_payload->recv_initial_metadata.recv_initial_metadata;
|
|
1411
1417
|
s->trailing_metadata_available =
|
|
1412
1418
|
op_payload->recv_initial_metadata.trailing_metadata_available;
|
|
1419
|
+
if (s->parsed_trailers_only && s->trailing_metadata_available != nullptr) {
|
|
1420
|
+
*s->trailing_metadata_available = true;
|
|
1421
|
+
}
|
|
1413
1422
|
if (op_payload->recv_initial_metadata.peer_string != nullptr) {
|
|
1414
1423
|
gpr_atm_rel_store(op_payload->recv_initial_metadata.peer_string,
|
|
1415
1424
|
(gpr_atm)t->peer_string.c_str());
|
|
@@ -1441,7 +1450,7 @@ static void perform_stream_op_locked(void* stream_op,
|
|
|
1441
1450
|
}
|
|
1442
1451
|
|
|
1443
1452
|
if (on_complete != nullptr) {
|
|
1444
|
-
grpc_chttp2_complete_closure_step(t, s, &on_complete,
|
|
1453
|
+
grpc_chttp2_complete_closure_step(t, s, &on_complete, absl::OkStatus(),
|
|
1445
1454
|
"op->on_complete");
|
|
1446
1455
|
}
|
|
1447
1456
|
|
|
@@ -1475,49 +1484,46 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
|
|
|
1475
1484
|
op->handler_private.extra_arg = gs;
|
|
1476
1485
|
t->combiner->Run(GRPC_CLOSURE_INIT(&op->handler_private.closure,
|
|
1477
1486
|
perform_stream_op_locked, op, nullptr),
|
|
1478
|
-
|
|
1487
|
+
absl::OkStatus());
|
|
1479
1488
|
}
|
|
1480
1489
|
|
|
1481
1490
|
static void cancel_pings(grpc_chttp2_transport* t, grpc_error_handle error) {
|
|
1482
1491
|
// callback remaining pings: they're not allowed to call into the transport,
|
|
1483
1492
|
// and maybe they hold resources that need to be freed
|
|
1484
1493
|
grpc_chttp2_ping_queue* pq = &t->ping_queue;
|
|
1485
|
-
GPR_ASSERT(!
|
|
1494
|
+
GPR_ASSERT(!error.ok());
|
|
1486
1495
|
for (size_t j = 0; j < GRPC_CHTTP2_PCL_COUNT; j++) {
|
|
1487
|
-
grpc_closure_list_fail_all(&pq->lists[j],
|
|
1496
|
+
grpc_closure_list_fail_all(&pq->lists[j], error);
|
|
1488
1497
|
grpc_core::ExecCtx::RunList(DEBUG_LOCATION, &pq->lists[j]);
|
|
1489
1498
|
}
|
|
1490
|
-
GRPC_ERROR_UNREF(error);
|
|
1491
1499
|
}
|
|
1492
1500
|
|
|
1493
1501
|
static void send_ping_locked(grpc_chttp2_transport* t,
|
|
1494
1502
|
grpc_closure* on_initiate, grpc_closure* on_ack) {
|
|
1495
|
-
if (!
|
|
1496
|
-
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_initiate,
|
|
1497
|
-
|
|
1498
|
-
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_ack,
|
|
1499
|
-
GRPC_ERROR_REF(t->closed_with_error));
|
|
1503
|
+
if (!t->closed_with_error.ok()) {
|
|
1504
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_initiate, t->closed_with_error);
|
|
1505
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_ack, t->closed_with_error);
|
|
1500
1506
|
return;
|
|
1501
1507
|
}
|
|
1502
1508
|
grpc_chttp2_ping_queue* pq = &t->ping_queue;
|
|
1503
1509
|
grpc_closure_list_append(&pq->lists[GRPC_CHTTP2_PCL_INITIATE], on_initiate,
|
|
1504
|
-
|
|
1510
|
+
absl::OkStatus());
|
|
1505
1511
|
grpc_closure_list_append(&pq->lists[GRPC_CHTTP2_PCL_NEXT], on_ack,
|
|
1506
|
-
|
|
1512
|
+
absl::OkStatus());
|
|
1507
1513
|
}
|
|
1508
1514
|
|
|
1509
1515
|
// Specialized form of send_ping_locked for keepalive ping. If there is already
|
|
1510
1516
|
// a ping in progress, the keepalive ping would piggyback onto that ping,
|
|
1511
1517
|
// instead of waiting for that ping to complete and then starting a new ping.
|
|
1512
1518
|
static void send_keepalive_ping_locked(grpc_chttp2_transport* t) {
|
|
1513
|
-
if (!
|
|
1519
|
+
if (!t->closed_with_error.ok()) {
|
|
1514
1520
|
t->combiner->Run(GRPC_CLOSURE_INIT(&t->start_keepalive_ping_locked,
|
|
1515
1521
|
start_keepalive_ping_locked, t, nullptr),
|
|
1516
|
-
|
|
1522
|
+
t->closed_with_error);
|
|
1517
1523
|
t->combiner->Run(
|
|
1518
1524
|
GRPC_CLOSURE_INIT(&t->finish_keepalive_ping_locked,
|
|
1519
1525
|
finish_keepalive_ping_locked, t, nullptr),
|
|
1520
|
-
|
|
1526
|
+
t->closed_with_error);
|
|
1521
1527
|
return;
|
|
1522
1528
|
}
|
|
1523
1529
|
grpc_chttp2_ping_queue* pq = &t->ping_queue;
|
|
@@ -1525,37 +1531,37 @@ static void send_keepalive_ping_locked(grpc_chttp2_transport* t) {
|
|
|
1525
1531
|
// There is a ping in flight. Add yourself to the inflight closure list.
|
|
1526
1532
|
t->combiner->Run(GRPC_CLOSURE_INIT(&t->start_keepalive_ping_locked,
|
|
1527
1533
|
start_keepalive_ping_locked, t, nullptr),
|
|
1528
|
-
|
|
1534
|
+
t->closed_with_error);
|
|
1529
1535
|
grpc_closure_list_append(
|
|
1530
1536
|
&pq->lists[GRPC_CHTTP2_PCL_INFLIGHT],
|
|
1531
1537
|
GRPC_CLOSURE_INIT(&t->finish_keepalive_ping_locked,
|
|
1532
1538
|
finish_keepalive_ping, t, grpc_schedule_on_exec_ctx),
|
|
1533
|
-
|
|
1539
|
+
absl::OkStatus());
|
|
1534
1540
|
return;
|
|
1535
1541
|
}
|
|
1536
1542
|
grpc_closure_list_append(
|
|
1537
1543
|
&pq->lists[GRPC_CHTTP2_PCL_INITIATE],
|
|
1538
1544
|
GRPC_CLOSURE_INIT(&t->start_keepalive_ping_locked, start_keepalive_ping,
|
|
1539
1545
|
t, grpc_schedule_on_exec_ctx),
|
|
1540
|
-
|
|
1546
|
+
absl::OkStatus());
|
|
1541
1547
|
grpc_closure_list_append(
|
|
1542
1548
|
&pq->lists[GRPC_CHTTP2_PCL_NEXT],
|
|
1543
1549
|
GRPC_CLOSURE_INIT(&t->finish_keepalive_ping_locked, finish_keepalive_ping,
|
|
1544
1550
|
t, grpc_schedule_on_exec_ctx),
|
|
1545
|
-
|
|
1551
|
+
absl::OkStatus());
|
|
1546
1552
|
}
|
|
1547
1553
|
|
|
1548
1554
|
void grpc_chttp2_retry_initiate_ping(void* tp, grpc_error_handle error) {
|
|
1549
1555
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
|
1550
1556
|
t->combiner->Run(GRPC_CLOSURE_INIT(&t->retry_initiate_ping_locked,
|
|
1551
1557
|
retry_initiate_ping_locked, t, nullptr),
|
|
1552
|
-
|
|
1558
|
+
error);
|
|
1553
1559
|
}
|
|
1554
1560
|
|
|
1555
1561
|
static void retry_initiate_ping_locked(void* tp, grpc_error_handle error) {
|
|
1556
1562
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
|
1557
1563
|
t->ping_state.is_delayed_ping_timer_set = false;
|
|
1558
|
-
if (
|
|
1564
|
+
if (error.ok()) {
|
|
1559
1565
|
grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_RETRY_SEND_PING);
|
|
1560
1566
|
}
|
|
1561
1567
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "retry_initiate_ping_locked");
|
|
@@ -1611,7 +1617,7 @@ class GracefulGoaway : public grpc_core::RefCounted<GracefulGoaway> {
|
|
|
1611
1617
|
// We already sent the final GOAWAY.
|
|
1612
1618
|
return;
|
|
1613
1619
|
}
|
|
1614
|
-
if (t_->destroying || !
|
|
1620
|
+
if (t_->destroying || !t_->closed_with_error.ok()) {
|
|
1615
1621
|
GRPC_CHTTP2_IF_TRACING(gpr_log(
|
|
1616
1622
|
GPR_INFO,
|
|
1617
1623
|
"transport:%p %s peer:%s Transport already shutting down. "
|
|
@@ -1636,7 +1642,7 @@ class GracefulGoaway : public grpc_core::RefCounted<GracefulGoaway> {
|
|
|
1636
1642
|
auto* self = static_cast<GracefulGoaway*>(arg);
|
|
1637
1643
|
self->t_->combiner->Run(
|
|
1638
1644
|
GRPC_CLOSURE_INIT(&self->on_ping_ack_, OnPingAckLocked, self, nullptr),
|
|
1639
|
-
|
|
1645
|
+
absl::OkStatus());
|
|
1640
1646
|
}
|
|
1641
1647
|
|
|
1642
1648
|
static void OnPingAckLocked(void* arg, grpc_error_handle /* error */) {
|
|
@@ -1648,13 +1654,13 @@ class GracefulGoaway : public grpc_core::RefCounted<GracefulGoaway> {
|
|
|
1648
1654
|
|
|
1649
1655
|
static void OnTimer(void* arg, grpc_error_handle error) {
|
|
1650
1656
|
auto* self = static_cast<GracefulGoaway*>(arg);
|
|
1651
|
-
if (!
|
|
1657
|
+
if (!error.ok()) {
|
|
1652
1658
|
self->Unref();
|
|
1653
1659
|
return;
|
|
1654
1660
|
}
|
|
1655
1661
|
self->t_->combiner->Run(
|
|
1656
1662
|
GRPC_CLOSURE_INIT(&self->on_timer_, OnTimerLocked, self, nullptr),
|
|
1657
|
-
|
|
1663
|
+
absl::OkStatus());
|
|
1658
1664
|
}
|
|
1659
1665
|
|
|
1660
1666
|
static void OnTimerLocked(void* arg, grpc_error_handle /* error */) {
|
|
@@ -1689,7 +1695,7 @@ static void send_goaway(grpc_chttp2_transport* t, grpc_error_handle error,
|
|
|
1689
1695
|
t->sent_goaway_state == GRPC_CHTTP2_GRACEFUL_GOAWAY) {
|
|
1690
1696
|
// We want to log this irrespective of whether http tracing is enabled
|
|
1691
1697
|
gpr_log(GPR_DEBUG, "%s: Sending goaway err=%s", t->peer_string.c_str(),
|
|
1692
|
-
|
|
1698
|
+
grpc_core::StatusToString(error).c_str());
|
|
1693
1699
|
t->sent_goaway_state = GRPC_CHTTP2_FINAL_GOAWAY_SEND_SCHEDULED;
|
|
1694
1700
|
grpc_chttp2_goaway_append(
|
|
1695
1701
|
t->last_new_stream_id, static_cast<uint32_t>(http_error),
|
|
@@ -1698,22 +1704,21 @@ static void send_goaway(grpc_chttp2_transport* t, grpc_error_handle error,
|
|
|
1698
1704
|
// Final GOAWAY has already been sent.
|
|
1699
1705
|
}
|
|
1700
1706
|
grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_GOAWAY_SENT);
|
|
1701
|
-
GRPC_ERROR_UNREF(error);
|
|
1702
1707
|
}
|
|
1703
1708
|
|
|
1704
1709
|
void grpc_chttp2_add_ping_strike(grpc_chttp2_transport* t) {
|
|
1705
1710
|
if (++t->ping_recv_state.ping_strikes > t->ping_policy.max_ping_strikes &&
|
|
1706
1711
|
t->ping_policy.max_ping_strikes != 0) {
|
|
1707
1712
|
send_goaway(t,
|
|
1708
|
-
grpc_error_set_int(
|
|
1709
|
-
|
|
1710
|
-
|
|
1713
|
+
grpc_error_set_int(GRPC_ERROR_CREATE("too_many_pings"),
|
|
1714
|
+
grpc_core::StatusIntProperty::kHttp2Error,
|
|
1715
|
+
GRPC_HTTP2_ENHANCE_YOUR_CALM),
|
|
1711
1716
|
/*immediate_disconnect_hint=*/true);
|
|
1712
1717
|
// The transport will be closed after the write is done
|
|
1713
1718
|
close_transport_locked(
|
|
1714
|
-
t, grpc_error_set_int(
|
|
1715
|
-
|
|
1716
|
-
|
|
1719
|
+
t, grpc_error_set_int(GRPC_ERROR_CREATE("Too many pings"),
|
|
1720
|
+
grpc_core::StatusIntProperty::kRpcStatus,
|
|
1721
|
+
GRPC_STATUS_UNAVAILABLE));
|
|
1717
1722
|
}
|
|
1718
1723
|
}
|
|
1719
1724
|
|
|
@@ -1732,7 +1737,7 @@ static void perform_transport_op_locked(void* stream_op,
|
|
|
1732
1737
|
grpc_chttp2_transport* t =
|
|
1733
1738
|
static_cast<grpc_chttp2_transport*>(op->handler_private.extra_arg);
|
|
1734
1739
|
|
|
1735
|
-
if (!
|
|
1740
|
+
if (!op->goaway_error.ok()) {
|
|
1736
1741
|
send_goaway(t, op->goaway_error, /*immediate_disconnect_hint=*/false);
|
|
1737
1742
|
}
|
|
1738
1743
|
|
|
@@ -1762,13 +1767,13 @@ static void perform_transport_op_locked(void* stream_op,
|
|
|
1762
1767
|
t->state_tracker.RemoveWatcher(op->stop_connectivity_watch);
|
|
1763
1768
|
}
|
|
1764
1769
|
|
|
1765
|
-
if (!
|
|
1766
|
-
send_goaway(t,
|
|
1770
|
+
if (!op->disconnect_with_error.ok()) {
|
|
1771
|
+
send_goaway(t, op->disconnect_with_error,
|
|
1767
1772
|
/*immediate_disconnect_hint=*/true);
|
|
1768
1773
|
close_transport_locked(t, op->disconnect_with_error);
|
|
1769
1774
|
}
|
|
1770
1775
|
|
|
1771
|
-
grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_consumed,
|
|
1776
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_consumed, absl::OkStatus());
|
|
1772
1777
|
|
|
1773
1778
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "transport_op");
|
|
1774
1779
|
}
|
|
@@ -1783,7 +1788,7 @@ static void perform_transport_op(grpc_transport* gt, grpc_transport_op* op) {
|
|
|
1783
1788
|
GRPC_CHTTP2_REF_TRANSPORT(t, "transport_op");
|
|
1784
1789
|
t->combiner->Run(GRPC_CLOSURE_INIT(&op->handler_private.closure,
|
|
1785
1790
|
perform_transport_op_locked, op, nullptr),
|
|
1786
|
-
|
|
1791
|
+
absl::OkStatus());
|
|
1787
1792
|
}
|
|
1788
1793
|
|
|
1789
1794
|
//
|
|
@@ -1795,7 +1800,7 @@ void grpc_chttp2_maybe_complete_recv_initial_metadata(grpc_chttp2_transport* t,
|
|
|
1795
1800
|
if (s->recv_initial_metadata_ready != nullptr &&
|
|
1796
1801
|
s->published_metadata[0] != GRPC_METADATA_NOT_PUBLISHED) {
|
|
1797
1802
|
if (s->seen_error) {
|
|
1798
|
-
|
|
1803
|
+
grpc_slice_buffer_reset_and_unref(&s->frame_storage);
|
|
1799
1804
|
}
|
|
1800
1805
|
*s->recv_initial_metadata = std::move(s->initial_metadata_buffer);
|
|
1801
1806
|
s->recv_initial_metadata->Set(grpc_core::PeerString(), t->peer_string);
|
|
@@ -1818,24 +1823,24 @@ void grpc_chttp2_maybe_complete_recv_message(grpc_chttp2_transport* t,
|
|
|
1818
1823
|
|
|
1819
1824
|
grpc_core::chttp2::StreamFlowControl::IncomingUpdateContext upd(
|
|
1820
1825
|
&s->flow_control);
|
|
1821
|
-
grpc_error_handle error
|
|
1826
|
+
grpc_error_handle error;
|
|
1822
1827
|
|
|
1823
1828
|
// Lambda is immediately invoked as a big scoped section that can be
|
|
1824
1829
|
// exited out of at any point by returning.
|
|
1825
1830
|
[&]() {
|
|
1826
1831
|
if (s->final_metadata_requested && s->seen_error) {
|
|
1827
|
-
|
|
1832
|
+
grpc_slice_buffer_reset_and_unref(&s->frame_storage);
|
|
1828
1833
|
s->recv_message->reset();
|
|
1829
1834
|
} else {
|
|
1830
1835
|
if (s->frame_storage.length != 0) {
|
|
1831
1836
|
while (true) {
|
|
1832
1837
|
GPR_ASSERT(s->frame_storage.length > 0);
|
|
1833
|
-
|
|
1838
|
+
int64_t min_progress_size;
|
|
1834
1839
|
auto r = grpc_deframe_unprocessed_incoming_frames(
|
|
1835
1840
|
s, &min_progress_size, &**s->recv_message, s->recv_message_flags);
|
|
1836
1841
|
if (absl::holds_alternative<grpc_core::Pending>(r)) {
|
|
1837
1842
|
if (s->read_closed) {
|
|
1838
|
-
|
|
1843
|
+
grpc_slice_buffer_reset_and_unref(&s->frame_storage);
|
|
1839
1844
|
s->recv_message->reset();
|
|
1840
1845
|
break;
|
|
1841
1846
|
} else {
|
|
@@ -1844,9 +1849,9 @@ void grpc_chttp2_maybe_complete_recv_message(grpc_chttp2_transport* t,
|
|
|
1844
1849
|
}
|
|
1845
1850
|
} else {
|
|
1846
1851
|
error = absl::get<grpc_error_handle>(r);
|
|
1847
|
-
if (!
|
|
1852
|
+
if (!error.ok()) {
|
|
1848
1853
|
s->seen_error = true;
|
|
1849
|
-
|
|
1854
|
+
grpc_slice_buffer_reset_and_unref(&s->frame_storage);
|
|
1850
1855
|
break;
|
|
1851
1856
|
} else {
|
|
1852
1857
|
if (t->channelz_socket != nullptr) {
|
|
@@ -1865,7 +1870,7 @@ void grpc_chttp2_maybe_complete_recv_message(grpc_chttp2_transport* t,
|
|
|
1865
1870
|
}
|
|
1866
1871
|
// save the length of the buffer before handing control back to application
|
|
1867
1872
|
// threads. Needed to support correct flow control bookkeeping
|
|
1868
|
-
if (
|
|
1873
|
+
if (error.ok() && s->recv_message->has_value()) {
|
|
1869
1874
|
null_then_sched_closure(&s->recv_message_ready);
|
|
1870
1875
|
} else if (s->published_metadata[1] != GRPC_METADATA_NOT_PUBLISHED) {
|
|
1871
1876
|
if (s->call_failed_before_recv_message != nullptr) {
|
|
@@ -1874,7 +1879,6 @@ void grpc_chttp2_maybe_complete_recv_message(grpc_chttp2_transport* t,
|
|
|
1874
1879
|
}
|
|
1875
1880
|
null_then_sched_closure(&s->recv_message_ready);
|
|
1876
1881
|
}
|
|
1877
|
-
GRPC_ERROR_UNREF(error);
|
|
1878
1882
|
}();
|
|
1879
1883
|
|
|
1880
1884
|
upd.SetPendingSize(s->frame_storage.length);
|
|
@@ -1887,7 +1891,7 @@ void grpc_chttp2_maybe_complete_recv_trailing_metadata(grpc_chttp2_transport* t,
|
|
|
1887
1891
|
if (s->recv_trailing_metadata_finished != nullptr && s->read_closed &&
|
|
1888
1892
|
s->write_closed) {
|
|
1889
1893
|
if (s->seen_error || !t->is_client) {
|
|
1890
|
-
|
|
1894
|
+
grpc_slice_buffer_reset_and_unref(&s->frame_storage);
|
|
1891
1895
|
}
|
|
1892
1896
|
if (s->read_closed && s->frame_storage.length == 0 &&
|
|
1893
1897
|
s->recv_trailing_metadata_finished != nullptr) {
|
|
@@ -1914,7 +1918,7 @@ static void remove_stream(grpc_chttp2_transport* t, uint32_t id,
|
|
|
1914
1918
|
post_benign_reclaimer(t);
|
|
1915
1919
|
if (t->sent_goaway_state == GRPC_CHTTP2_FINAL_GOAWAY_SENT) {
|
|
1916
1920
|
close_transport_locked(
|
|
1917
|
-
t,
|
|
1921
|
+
t, GRPC_ERROR_CREATE_REFERENCING(
|
|
1918
1922
|
"Last stream closed after sending GOAWAY", &error, 1));
|
|
1919
1923
|
}
|
|
1920
1924
|
}
|
|
@@ -1924,8 +1928,6 @@ static void remove_stream(grpc_chttp2_transport* t, uint32_t id,
|
|
|
1924
1928
|
grpc_chttp2_list_remove_stalled_by_stream(t, s);
|
|
1925
1929
|
grpc_chttp2_list_remove_stalled_by_transport(t, s);
|
|
1926
1930
|
|
|
1927
|
-
GRPC_ERROR_UNREF(error);
|
|
1928
|
-
|
|
1929
1931
|
maybe_start_some_streams(t);
|
|
1930
1932
|
}
|
|
1931
1933
|
|
|
@@ -1947,7 +1949,7 @@ void grpc_chttp2_cancel_stream(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
|
|
|
1947
1949
|
grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_RST_STREAM);
|
|
1948
1950
|
}
|
|
1949
1951
|
}
|
|
1950
|
-
if (!
|
|
1952
|
+
if (!due_to_error.ok() && !s->seen_error) {
|
|
1951
1953
|
s->seen_error = true;
|
|
1952
1954
|
}
|
|
1953
1955
|
grpc_chttp2_mark_stream_closed(t, s, 1, 1, due_to_error);
|
|
@@ -1969,7 +1971,8 @@ void grpc_chttp2_fake_status(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
|
|
|
1969
1971
|
// what we want - which is safe because we haven't told anyone
|
|
1970
1972
|
// about the metadata yet
|
|
1971
1973
|
if (s->published_metadata[1] == GRPC_METADATA_NOT_PUBLISHED ||
|
|
1972
|
-
s->recv_trailing_metadata_finished != nullptr
|
|
1974
|
+
s->recv_trailing_metadata_finished != nullptr ||
|
|
1975
|
+
!s->final_metadata_requested) {
|
|
1973
1976
|
s->trailing_metadata_buffer.Set(grpc_core::GrpcStatusMetadata(), status);
|
|
1974
1977
|
if (!message.empty()) {
|
|
1975
1978
|
s->trailing_metadata_buffer.Set(
|
|
@@ -1979,13 +1982,11 @@ void grpc_chttp2_fake_status(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
|
|
|
1979
1982
|
s->published_metadata[1] = GRPC_METADATA_SYNTHESIZED_FROM_FAKE;
|
|
1980
1983
|
grpc_chttp2_maybe_complete_recv_trailing_metadata(t, s);
|
|
1981
1984
|
}
|
|
1982
|
-
|
|
1983
|
-
GRPC_ERROR_UNREF(error);
|
|
1984
1985
|
}
|
|
1985
1986
|
|
|
1986
1987
|
static void add_error(grpc_error_handle error, grpc_error_handle* refs,
|
|
1987
1988
|
size_t* nrefs) {
|
|
1988
|
-
if (
|
|
1989
|
+
if (error.ok()) return;
|
|
1989
1990
|
for (size_t i = 0; i < *nrefs; i++) {
|
|
1990
1991
|
if (error == refs[i]) {
|
|
1991
1992
|
return;
|
|
@@ -2003,12 +2004,10 @@ static grpc_error_handle removal_error(grpc_error_handle extra_error,
|
|
|
2003
2004
|
add_error(s->read_closed_error, refs, &nrefs);
|
|
2004
2005
|
add_error(s->write_closed_error, refs, &nrefs);
|
|
2005
2006
|
add_error(extra_error, refs, &nrefs);
|
|
2006
|
-
grpc_error_handle error
|
|
2007
|
+
grpc_error_handle error;
|
|
2007
2008
|
if (nrefs > 0) {
|
|
2008
|
-
error =
|
|
2009
|
-
refs, nrefs);
|
|
2009
|
+
error = GRPC_ERROR_CREATE_REFERENCING(main_error_msg, refs, nrefs);
|
|
2010
2010
|
}
|
|
2011
|
-
GRPC_ERROR_UNREF(extra_error);
|
|
2012
2011
|
return error;
|
|
2013
2012
|
}
|
|
2014
2013
|
|
|
@@ -2018,12 +2017,11 @@ static void flush_write_list(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
|
|
|
2018
2017
|
while (*list) {
|
|
2019
2018
|
grpc_chttp2_write_cb* cb = *list;
|
|
2020
2019
|
*list = cb->next;
|
|
2021
|
-
grpc_chttp2_complete_closure_step(t, s, &cb->closure,
|
|
2020
|
+
grpc_chttp2_complete_closure_step(t, s, &cb->closure, error,
|
|
2022
2021
|
"on_write_finished_cb");
|
|
2023
2022
|
cb->next = t->write_cb_pool;
|
|
2024
2023
|
t->write_cb_pool = cb;
|
|
2025
2024
|
}
|
|
2026
|
-
GRPC_ERROR_UNREF(error);
|
|
2027
2025
|
}
|
|
2028
2026
|
|
|
2029
2027
|
void grpc_chttp2_fail_pending_writes(grpc_chttp2_transport* t,
|
|
@@ -2033,19 +2031,16 @@ void grpc_chttp2_fail_pending_writes(grpc_chttp2_transport* t,
|
|
|
2033
2031
|
removal_error(error, s, "Pending writes failed due to stream closure");
|
|
2034
2032
|
s->send_initial_metadata = nullptr;
|
|
2035
2033
|
grpc_chttp2_complete_closure_step(t, s, &s->send_initial_metadata_finished,
|
|
2036
|
-
|
|
2037
|
-
"send_initial_metadata_finished");
|
|
2034
|
+
error, "send_initial_metadata_finished");
|
|
2038
2035
|
|
|
2039
2036
|
s->send_trailing_metadata = nullptr;
|
|
2040
2037
|
s->sent_trailing_metadata_op = nullptr;
|
|
2041
2038
|
grpc_chttp2_complete_closure_step(t, s, &s->send_trailing_metadata_finished,
|
|
2042
|
-
|
|
2043
|
-
"send_trailing_metadata_finished");
|
|
2039
|
+
error, "send_trailing_metadata_finished");
|
|
2044
2040
|
|
|
2045
|
-
grpc_chttp2_complete_closure_step(t, s, &s->send_message_finished,
|
|
2046
|
-
GRPC_ERROR_REF(error),
|
|
2041
|
+
grpc_chttp2_complete_closure_step(t, s, &s->send_message_finished, error,
|
|
2047
2042
|
"fetching_send_message_finished");
|
|
2048
|
-
flush_write_list(t, s, &s->on_write_finished_cbs,
|
|
2043
|
+
flush_write_list(t, s, &s->on_write_finished_cbs, error);
|
|
2049
2044
|
flush_write_list(t, s, &s->on_flow_controlled_cbs, error);
|
|
2050
2045
|
}
|
|
2051
2046
|
|
|
@@ -2055,7 +2050,7 @@ void grpc_chttp2_mark_stream_closed(grpc_chttp2_transport* t,
|
|
|
2055
2050
|
if (s->read_closed && s->write_closed) {
|
|
2056
2051
|
// already closed, but we should still fake the status if needed.
|
|
2057
2052
|
grpc_error_handle overall_error = removal_error(error, s, "Stream removed");
|
|
2058
|
-
if (!
|
|
2053
|
+
if (!overall_error.ok()) {
|
|
2059
2054
|
grpc_chttp2_fake_status(t, s, overall_error);
|
|
2060
2055
|
}
|
|
2061
2056
|
grpc_chttp2_maybe_complete_recv_trailing_metadata(t, s);
|
|
@@ -2064,26 +2059,25 @@ void grpc_chttp2_mark_stream_closed(grpc_chttp2_transport* t,
|
|
|
2064
2059
|
bool closed_read = false;
|
|
2065
2060
|
bool became_closed = false;
|
|
2066
2061
|
if (close_reads && !s->read_closed) {
|
|
2067
|
-
s->read_closed_error =
|
|
2062
|
+
s->read_closed_error = error;
|
|
2068
2063
|
s->read_closed = true;
|
|
2069
2064
|
closed_read = true;
|
|
2070
2065
|
}
|
|
2071
2066
|
if (close_writes && !s->write_closed) {
|
|
2072
|
-
s->write_closed_error =
|
|
2067
|
+
s->write_closed_error = error;
|
|
2073
2068
|
s->write_closed = true;
|
|
2074
|
-
grpc_chttp2_fail_pending_writes(t, s,
|
|
2069
|
+
grpc_chttp2_fail_pending_writes(t, s, error);
|
|
2075
2070
|
}
|
|
2076
2071
|
if (s->read_closed && s->write_closed) {
|
|
2077
2072
|
became_closed = true;
|
|
2078
|
-
grpc_error_handle overall_error =
|
|
2079
|
-
removal_error(GRPC_ERROR_REF(error), s, "Stream removed");
|
|
2073
|
+
grpc_error_handle overall_error = removal_error(error, s, "Stream removed");
|
|
2080
2074
|
if (s->id != 0) {
|
|
2081
|
-
remove_stream(t, s->id,
|
|
2075
|
+
remove_stream(t, s->id, overall_error);
|
|
2082
2076
|
} else {
|
|
2083
2077
|
// Purge streams waiting on concurrency still waiting for id assignment
|
|
2084
2078
|
grpc_chttp2_list_remove_waiting_for_concurrency(t, s);
|
|
2085
2079
|
}
|
|
2086
|
-
if (!
|
|
2080
|
+
if (!overall_error.ok()) {
|
|
2087
2081
|
grpc_chttp2_fake_status(t, s, overall_error);
|
|
2088
2082
|
}
|
|
2089
2083
|
}
|
|
@@ -2097,10 +2091,11 @@ void grpc_chttp2_mark_stream_closed(grpc_chttp2_transport* t,
|
|
|
2097
2091
|
grpc_chttp2_maybe_complete_recv_message(t, s);
|
|
2098
2092
|
}
|
|
2099
2093
|
if (became_closed) {
|
|
2094
|
+
s->stats.latency =
|
|
2095
|
+
gpr_time_sub(gpr_now(GPR_CLOCK_MONOTONIC), s->creation_time);
|
|
2100
2096
|
grpc_chttp2_maybe_complete_recv_trailing_metadata(t, s);
|
|
2101
2097
|
GRPC_CHTTP2_STREAM_UNREF(s, "chttp2");
|
|
2102
2098
|
}
|
|
2103
|
-
GRPC_ERROR_UNREF(error);
|
|
2104
2099
|
}
|
|
2105
2100
|
|
|
2106
2101
|
static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
|
|
@@ -2183,8 +2178,8 @@ static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
|
|
|
2183
2178
|
|
|
2184
2179
|
status_hdr = GRPC_SLICE_MALLOC(15 + (grpc_status >= 10));
|
|
2185
2180
|
p = GRPC_SLICE_START_PTR(status_hdr);
|
|
2186
|
-
*p++ = 0x00;
|
|
2187
|
-
*p++ = 11;
|
|
2181
|
+
*p++ = 0x00; // literal header, not indexed
|
|
2182
|
+
*p++ = 11; // len(grpc-status)
|
|
2188
2183
|
*p++ = 'g';
|
|
2189
2184
|
*p++ = 'r';
|
|
2190
2185
|
*p++ = 'p';
|
|
@@ -2209,11 +2204,11 @@ static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
|
|
|
2209
2204
|
|
|
2210
2205
|
size_t msg_len = message.length();
|
|
2211
2206
|
GPR_ASSERT(msg_len <= UINT32_MAX);
|
|
2212
|
-
grpc_core::VarintWriter<1> msg_len_writer(msg_len);
|
|
2207
|
+
grpc_core::VarintWriter<1> msg_len_writer(static_cast<uint32_t>(msg_len));
|
|
2213
2208
|
message_pfx = GRPC_SLICE_MALLOC(14 + msg_len_writer.length());
|
|
2214
2209
|
p = GRPC_SLICE_START_PTR(message_pfx);
|
|
2215
|
-
*p++ = 0x00;
|
|
2216
|
-
*p++ = 12;
|
|
2210
|
+
*p++ = 0x00; // literal header, not indexed
|
|
2211
|
+
*p++ = 12; // len(grpc-message)
|
|
2217
2212
|
*p++ = 'g';
|
|
2218
2213
|
*p++ = 'r';
|
|
2219
2214
|
*p++ = 'p';
|
|
@@ -2270,7 +2265,7 @@ struct cancel_stream_cb_args {
|
|
|
2270
2265
|
static void cancel_stream_cb(void* user_data, uint32_t /*key*/, void* stream) {
|
|
2271
2266
|
cancel_stream_cb_args* args = static_cast<cancel_stream_cb_args*>(user_data);
|
|
2272
2267
|
grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(stream);
|
|
2273
|
-
grpc_chttp2_cancel_stream(args->t, s,
|
|
2268
|
+
grpc_chttp2_cancel_stream(args->t, s, args->error);
|
|
2274
2269
|
}
|
|
2275
2270
|
|
|
2276
2271
|
static void end_all_the_calls(grpc_chttp2_transport* t,
|
|
@@ -2278,14 +2273,14 @@ static void end_all_the_calls(grpc_chttp2_transport* t,
|
|
|
2278
2273
|
intptr_t http2_error;
|
|
2279
2274
|
// If there is no explicit grpc or HTTP/2 error, set to UNAVAILABLE on server.
|
|
2280
2275
|
if (!t->is_client && !grpc_error_has_clear_grpc_status(error) &&
|
|
2281
|
-
!grpc_error_get_int(error,
|
|
2282
|
-
|
|
2276
|
+
!grpc_error_get_int(error, grpc_core::StatusIntProperty::kHttp2Error,
|
|
2277
|
+
&http2_error)) {
|
|
2278
|
+
error = grpc_error_set_int(error, grpc_core::StatusIntProperty::kRpcStatus,
|
|
2283
2279
|
GRPC_STATUS_UNAVAILABLE);
|
|
2284
2280
|
}
|
|
2285
|
-
cancel_unstarted_streams(t,
|
|
2281
|
+
cancel_unstarted_streams(t, error);
|
|
2286
2282
|
cancel_stream_cb_args args = {error, t};
|
|
2287
2283
|
grpc_chttp2_stream_map_for_each(&t->stream_map, cancel_stream_cb, &args);
|
|
2288
|
-
GRPC_ERROR_UNREF(error);
|
|
2289
2284
|
}
|
|
2290
2285
|
|
|
2291
2286
|
//
|
|
@@ -2330,31 +2325,39 @@ void grpc_chttp2_act_on_flowctl_action(
|
|
|
2330
2325
|
queue_setting_update(t, GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE,
|
|
2331
2326
|
action.max_frame_size());
|
|
2332
2327
|
});
|
|
2328
|
+
if (t->enable_preferred_rx_crypto_frame_advertisement) {
|
|
2329
|
+
WithUrgency(
|
|
2330
|
+
t, action.preferred_rx_crypto_frame_size_update(),
|
|
2331
|
+
GRPC_CHTTP2_INITIATE_WRITE_SEND_SETTINGS, [t, &action]() {
|
|
2332
|
+
queue_setting_update(
|
|
2333
|
+
t, GRPC_CHTTP2_SETTINGS_GRPC_PREFERRED_RECEIVE_CRYPTO_FRAME_SIZE,
|
|
2334
|
+
action.preferred_rx_crypto_frame_size());
|
|
2335
|
+
});
|
|
2336
|
+
}
|
|
2333
2337
|
}
|
|
2334
2338
|
|
|
2335
2339
|
static grpc_error_handle try_http_parsing(grpc_chttp2_transport* t) {
|
|
2336
2340
|
grpc_http_parser parser;
|
|
2337
2341
|
size_t i = 0;
|
|
2338
|
-
grpc_error_handle error
|
|
2342
|
+
grpc_error_handle error;
|
|
2339
2343
|
grpc_http_response response;
|
|
2340
2344
|
|
|
2341
2345
|
grpc_http_parser_init(&parser, GRPC_HTTP_RESPONSE, &response);
|
|
2342
2346
|
|
|
2343
|
-
grpc_error_handle parse_error
|
|
2344
|
-
for (; i < t->read_buffer.count &&
|
|
2347
|
+
grpc_error_handle parse_error;
|
|
2348
|
+
for (; i < t->read_buffer.count && parse_error.ok(); i++) {
|
|
2345
2349
|
parse_error =
|
|
2346
2350
|
grpc_http_parser_parse(&parser, t->read_buffer.slices[i], nullptr);
|
|
2347
2351
|
}
|
|
2348
|
-
if (
|
|
2349
|
-
(parse_error = grpc_http_parser_eof(&parser)) ==
|
|
2352
|
+
if (parse_error.ok() &&
|
|
2353
|
+
(parse_error = grpc_http_parser_eof(&parser)) == absl::OkStatus()) {
|
|
2350
2354
|
error = grpc_error_set_int(
|
|
2351
|
-
grpc_error_set_int(
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
+
grpc_error_set_int(
|
|
2356
|
+
GRPC_ERROR_CREATE("Trying to connect an http1.x server"),
|
|
2357
|
+
grpc_core::StatusIntProperty::kHttpStatus, response.status),
|
|
2358
|
+
grpc_core::StatusIntProperty::kRpcStatus,
|
|
2355
2359
|
grpc_http2_status_to_grpc_status(response.status));
|
|
2356
2360
|
}
|
|
2357
|
-
GRPC_ERROR_UNREF(parse_error);
|
|
2358
2361
|
|
|
2359
2362
|
grpc_http_parser_destroy(&parser);
|
|
2360
2363
|
grpc_http_response_destroy(&response);
|
|
@@ -2365,38 +2368,29 @@ static void read_action(void* tp, grpc_error_handle error) {
|
|
|
2365
2368
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
|
2366
2369
|
t->combiner->Run(
|
|
2367
2370
|
GRPC_CLOSURE_INIT(&t->read_action_locked, read_action_locked, t, nullptr),
|
|
2368
|
-
|
|
2371
|
+
error);
|
|
2369
2372
|
}
|
|
2370
2373
|
|
|
2371
2374
|
static void read_action_locked(void* tp, grpc_error_handle error) {
|
|
2372
2375
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
|
2373
2376
|
|
|
2374
|
-
(void)GRPC_ERROR_REF(error);
|
|
2375
|
-
|
|
2376
2377
|
grpc_error_handle err = error;
|
|
2377
|
-
if (!
|
|
2378
|
-
err = grpc_error_set_int(
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
t->write_state);
|
|
2378
|
+
if (!err.ok()) {
|
|
2379
|
+
err = grpc_error_set_int(
|
|
2380
|
+
GRPC_ERROR_CREATE_REFERENCING("Endpoint read failed", &err, 1),
|
|
2381
|
+
grpc_core::StatusIntProperty::kOccurredDuringWrite, t->write_state);
|
|
2382
2382
|
}
|
|
2383
2383
|
std::swap(err, error);
|
|
2384
|
-
|
|
2385
|
-
if (GRPC_ERROR_IS_NONE(t->closed_with_error)) {
|
|
2384
|
+
if (t->closed_with_error.ok()) {
|
|
2386
2385
|
size_t i = 0;
|
|
2387
|
-
grpc_error_handle errors[3] = {
|
|
2388
|
-
|
|
2389
|
-
for (; i < t->read_buffer.count && errors[1] == GRPC_ERROR_NONE; i++) {
|
|
2386
|
+
grpc_error_handle errors[3] = {error, absl::OkStatus(), absl::OkStatus()};
|
|
2387
|
+
for (; i < t->read_buffer.count && errors[1] == absl::OkStatus(); i++) {
|
|
2390
2388
|
errors[1] = grpc_chttp2_perform_read(t, t->read_buffer.slices[i]);
|
|
2391
2389
|
}
|
|
2392
|
-
if (errors[1] !=
|
|
2390
|
+
if (errors[1] != absl::OkStatus()) {
|
|
2393
2391
|
errors[2] = try_http_parsing(t);
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
"Failed parsing HTTP/2", errors, GPR_ARRAY_SIZE(errors));
|
|
2397
|
-
}
|
|
2398
|
-
for (i = 0; i < GPR_ARRAY_SIZE(errors); i++) {
|
|
2399
|
-
GRPC_ERROR_UNREF(errors[i]);
|
|
2392
|
+
error = GRPC_ERROR_CREATE_REFERENCING("Failed parsing HTTP/2", errors,
|
|
2393
|
+
GPR_ARRAY_SIZE(errors));
|
|
2400
2394
|
}
|
|
2401
2395
|
|
|
2402
2396
|
if (t->initial_window_update != 0) {
|
|
@@ -2413,27 +2407,27 @@ static void read_action_locked(void* tp, grpc_error_handle error) {
|
|
|
2413
2407
|
}
|
|
2414
2408
|
|
|
2415
2409
|
bool keep_reading = false;
|
|
2416
|
-
if (
|
|
2417
|
-
error =
|
|
2418
|
-
|
|
2410
|
+
if (error.ok() && !t->closed_with_error.ok()) {
|
|
2411
|
+
error = GRPC_ERROR_CREATE_REFERENCING("Transport closed",
|
|
2412
|
+
&t->closed_with_error, 1);
|
|
2419
2413
|
}
|
|
2420
|
-
if (!
|
|
2414
|
+
if (!error.ok()) {
|
|
2421
2415
|
// If a goaway frame was received, this might be the reason why the read
|
|
2422
2416
|
// failed. Add this info to the error
|
|
2423
|
-
if (!
|
|
2424
|
-
error = grpc_error_add_child(error,
|
|
2417
|
+
if (!t->goaway_error.ok()) {
|
|
2418
|
+
error = grpc_error_add_child(error, t->goaway_error);
|
|
2425
2419
|
}
|
|
2426
2420
|
|
|
2427
|
-
close_transport_locked(t,
|
|
2421
|
+
close_transport_locked(t, error);
|
|
2428
2422
|
t->endpoint_reading = 0;
|
|
2429
|
-
} else if (
|
|
2423
|
+
} else if (t->closed_with_error.ok()) {
|
|
2430
2424
|
keep_reading = true;
|
|
2431
2425
|
// Since we have read a byte, reset the keepalive timer
|
|
2432
2426
|
if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_WAITING) {
|
|
2433
2427
|
grpc_timer_cancel(&t->keepalive_ping_timer);
|
|
2434
2428
|
}
|
|
2435
2429
|
}
|
|
2436
|
-
|
|
2430
|
+
grpc_slice_buffer_reset_and_unref(&t->read_buffer);
|
|
2437
2431
|
|
|
2438
2432
|
if (keep_reading) {
|
|
2439
2433
|
if (t->num_pending_induced_frames >= DEFAULT_MAX_PENDING_INDUCED_FRAMES) {
|
|
@@ -2449,12 +2443,10 @@ static void read_action_locked(void* tp, grpc_error_handle error) {
|
|
|
2449
2443
|
} else {
|
|
2450
2444
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "reading_action");
|
|
2451
2445
|
}
|
|
2452
|
-
|
|
2453
|
-
GRPC_ERROR_UNREF(error);
|
|
2454
2446
|
}
|
|
2455
2447
|
|
|
2456
2448
|
static void continue_read_action_locked(grpc_chttp2_transport* t) {
|
|
2457
|
-
const bool urgent = !
|
|
2449
|
+
const bool urgent = !t->goaway_error.ok();
|
|
2458
2450
|
GRPC_CLOSURE_INIT(&t->read_action_locked, read_action, t,
|
|
2459
2451
|
grpc_schedule_on_exec_ctx);
|
|
2460
2452
|
grpc_endpoint_read(t->ep, &t->read_buffer, &t->read_action_locked, urgent,
|
|
@@ -2478,16 +2470,16 @@ static void start_bdp_ping(void* tp, grpc_error_handle error) {
|
|
|
2478
2470
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
|
2479
2471
|
t->combiner->Run(GRPC_CLOSURE_INIT(&t->start_bdp_ping_locked,
|
|
2480
2472
|
start_bdp_ping_locked, t, nullptr),
|
|
2481
|
-
|
|
2473
|
+
error);
|
|
2482
2474
|
}
|
|
2483
2475
|
|
|
2484
2476
|
static void start_bdp_ping_locked(void* tp, grpc_error_handle error) {
|
|
2485
2477
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
|
2486
2478
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
|
|
2487
2479
|
gpr_log(GPR_INFO, "%s: Start BDP ping err=%s", t->peer_string.c_str(),
|
|
2488
|
-
|
|
2480
|
+
grpc_core::StatusToString(error).c_str());
|
|
2489
2481
|
}
|
|
2490
|
-
if (!
|
|
2482
|
+
if (!error.ok() || !t->closed_with_error.ok()) {
|
|
2491
2483
|
return;
|
|
2492
2484
|
}
|
|
2493
2485
|
// Reset the keepalive ping timer
|
|
@@ -2502,16 +2494,16 @@ static void finish_bdp_ping(void* tp, grpc_error_handle error) {
|
|
|
2502
2494
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
|
2503
2495
|
t->combiner->Run(GRPC_CLOSURE_INIT(&t->finish_bdp_ping_locked,
|
|
2504
2496
|
finish_bdp_ping_locked, t, nullptr),
|
|
2505
|
-
|
|
2497
|
+
error);
|
|
2506
2498
|
}
|
|
2507
2499
|
|
|
2508
2500
|
static void finish_bdp_ping_locked(void* tp, grpc_error_handle error) {
|
|
2509
2501
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
|
2510
2502
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
|
|
2511
2503
|
gpr_log(GPR_INFO, "%s: Complete BDP ping err=%s", t->peer_string.c_str(),
|
|
2512
|
-
|
|
2504
|
+
grpc_core::StatusToString(error).c_str());
|
|
2513
2505
|
}
|
|
2514
|
-
if (!
|
|
2506
|
+
if (!error.ok() || !t->closed_with_error.ok()) {
|
|
2515
2507
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "bdp_ping");
|
|
2516
2508
|
return;
|
|
2517
2509
|
}
|
|
@@ -2520,7 +2512,7 @@ static void finish_bdp_ping_locked(void* tp, grpc_error_handle error) {
|
|
|
2520
2512
|
// finish_bdp_ping_locked to be run later.
|
|
2521
2513
|
t->combiner->Run(GRPC_CLOSURE_INIT(&t->finish_bdp_ping_locked,
|
|
2522
2514
|
finish_bdp_ping_locked, t, nullptr),
|
|
2523
|
-
|
|
2515
|
+
error);
|
|
2524
2516
|
return;
|
|
2525
2517
|
}
|
|
2526
2518
|
t->bdp_ping_started = false;
|
|
@@ -2541,7 +2533,7 @@ static void next_bdp_ping_timer_expired(void* tp, grpc_error_handle error) {
|
|
|
2541
2533
|
t->combiner->Run(
|
|
2542
2534
|
GRPC_CLOSURE_INIT(&t->next_bdp_ping_timer_expired_locked,
|
|
2543
2535
|
next_bdp_ping_timer_expired_locked, t, nullptr),
|
|
2544
|
-
|
|
2536
|
+
error);
|
|
2545
2537
|
}
|
|
2546
2538
|
|
|
2547
2539
|
static void next_bdp_ping_timer_expired_locked(void* tp,
|
|
@@ -2549,7 +2541,7 @@ static void next_bdp_ping_timer_expired_locked(void* tp,
|
|
|
2549
2541
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
|
2550
2542
|
GPR_ASSERT(t->have_next_bdp_ping_timer);
|
|
2551
2543
|
t->have_next_bdp_ping_timer = false;
|
|
2552
|
-
if (!
|
|
2544
|
+
if (!error.ok()) {
|
|
2553
2545
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "bdp_ping");
|
|
2554
2546
|
return;
|
|
2555
2547
|
}
|
|
@@ -2625,15 +2617,15 @@ static void init_keepalive_ping(void* arg, grpc_error_handle error) {
|
|
|
2625
2617
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
|
|
2626
2618
|
t->combiner->Run(GRPC_CLOSURE_INIT(&t->init_keepalive_ping_locked,
|
|
2627
2619
|
init_keepalive_ping_locked, t, nullptr),
|
|
2628
|
-
|
|
2620
|
+
error);
|
|
2629
2621
|
}
|
|
2630
2622
|
|
|
2631
2623
|
static void init_keepalive_ping_locked(void* arg, grpc_error_handle error) {
|
|
2632
2624
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
|
|
2633
2625
|
GPR_ASSERT(t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_WAITING);
|
|
2634
|
-
if (t->destroying || !
|
|
2626
|
+
if (t->destroying || !t->closed_with_error.ok()) {
|
|
2635
2627
|
t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_DYING;
|
|
2636
|
-
} else if (
|
|
2628
|
+
} else if (error.ok()) {
|
|
2637
2629
|
if (t->keepalive_permit_without_calls ||
|
|
2638
2630
|
grpc_chttp2_stream_map_size(&t->stream_map) > 0) {
|
|
2639
2631
|
t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_PINGING;
|
|
@@ -2649,7 +2641,7 @@ static void init_keepalive_ping_locked(void* arg, grpc_error_handle error) {
|
|
|
2649
2641
|
grpc_core::Timestamp::Now() + t->keepalive_time,
|
|
2650
2642
|
&t->init_keepalive_ping_locked);
|
|
2651
2643
|
}
|
|
2652
|
-
} else if (error ==
|
|
2644
|
+
} else if (error == absl::CancelledError()) {
|
|
2653
2645
|
// The keepalive ping timer may be cancelled by bdp
|
|
2654
2646
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) ||
|
|
2655
2647
|
GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) {
|
|
@@ -2670,12 +2662,12 @@ static void start_keepalive_ping(void* arg, grpc_error_handle error) {
|
|
|
2670
2662
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
|
|
2671
2663
|
t->combiner->Run(GRPC_CLOSURE_INIT(&t->start_keepalive_ping_locked,
|
|
2672
2664
|
start_keepalive_ping_locked, t, nullptr),
|
|
2673
|
-
|
|
2665
|
+
error);
|
|
2674
2666
|
}
|
|
2675
2667
|
|
|
2676
2668
|
static void start_keepalive_ping_locked(void* arg, grpc_error_handle error) {
|
|
2677
2669
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
|
|
2678
|
-
if (!
|
|
2670
|
+
if (!error.ok()) {
|
|
2679
2671
|
return;
|
|
2680
2672
|
}
|
|
2681
2673
|
if (t->channelz_socket != nullptr) {
|
|
@@ -2698,13 +2690,13 @@ static void finish_keepalive_ping(void* arg, grpc_error_handle error) {
|
|
|
2698
2690
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
|
|
2699
2691
|
t->combiner->Run(GRPC_CLOSURE_INIT(&t->finish_keepalive_ping_locked,
|
|
2700
2692
|
finish_keepalive_ping_locked, t, nullptr),
|
|
2701
|
-
|
|
2693
|
+
error);
|
|
2702
2694
|
}
|
|
2703
2695
|
|
|
2704
2696
|
static void finish_keepalive_ping_locked(void* arg, grpc_error_handle error) {
|
|
2705
2697
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
|
|
2706
2698
|
if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_PINGING) {
|
|
2707
|
-
if (
|
|
2699
|
+
if (error.ok()) {
|
|
2708
2700
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) ||
|
|
2709
2701
|
GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) {
|
|
2710
2702
|
gpr_log(GPR_INFO, "%s: Finish keepalive ping", t->peer_string.c_str());
|
|
@@ -2715,7 +2707,7 @@ static void finish_keepalive_ping_locked(void* arg, grpc_error_handle error) {
|
|
|
2715
2707
|
t->combiner->Run(
|
|
2716
2708
|
GRPC_CLOSURE_INIT(&t->finish_keepalive_ping_locked,
|
|
2717
2709
|
finish_keepalive_ping_locked, t, nullptr),
|
|
2718
|
-
|
|
2710
|
+
error);
|
|
2719
2711
|
return;
|
|
2720
2712
|
}
|
|
2721
2713
|
t->keepalive_ping_started = false;
|
|
@@ -2737,27 +2729,26 @@ static void keepalive_watchdog_fired(void* arg, grpc_error_handle error) {
|
|
|
2737
2729
|
t->combiner->Run(
|
|
2738
2730
|
GRPC_CLOSURE_INIT(&t->keepalive_watchdog_fired_locked,
|
|
2739
2731
|
keepalive_watchdog_fired_locked, t, nullptr),
|
|
2740
|
-
|
|
2732
|
+
error);
|
|
2741
2733
|
}
|
|
2742
2734
|
|
|
2743
2735
|
static void keepalive_watchdog_fired_locked(void* arg,
|
|
2744
2736
|
grpc_error_handle error) {
|
|
2745
2737
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
|
|
2746
2738
|
if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_PINGING) {
|
|
2747
|
-
if (
|
|
2739
|
+
if (error.ok()) {
|
|
2748
2740
|
gpr_log(GPR_INFO, "%s: Keepalive watchdog fired. Closing transport.",
|
|
2749
2741
|
t->peer_string.c_str());
|
|
2750
2742
|
t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_DYING;
|
|
2751
2743
|
close_transport_locked(
|
|
2752
|
-
t, grpc_error_set_int(
|
|
2753
|
-
|
|
2754
|
-
GRPC_ERROR_INT_GRPC_STATUS,
|
|
2744
|
+
t, grpc_error_set_int(GRPC_ERROR_CREATE("keepalive watchdog timeout"),
|
|
2745
|
+
grpc_core::StatusIntProperty::kRpcStatus,
|
|
2755
2746
|
GRPC_STATUS_UNAVAILABLE));
|
|
2756
2747
|
}
|
|
2757
2748
|
} else {
|
|
2758
2749
|
// The watchdog timer should have been cancelled by
|
|
2759
2750
|
// finish_keepalive_ping_locked.
|
|
2760
|
-
if (GPR_UNLIKELY(error !=
|
|
2751
|
+
if (GPR_UNLIKELY(error != absl::CancelledError())) {
|
|
2761
2752
|
gpr_log(GPR_ERROR, "keepalive_ping_end state error: %d (expect: %d)",
|
|
2762
2753
|
t->keepalive_state, GRPC_CHTTP2_KEEPALIVE_STATE_PINGING);
|
|
2763
2754
|
}
|
|
@@ -2810,7 +2801,7 @@ static void post_benign_reclaimer(grpc_chttp2_transport* t) {
|
|
|
2810
2801
|
benign_reclaimer_locked, t,
|
|
2811
2802
|
grpc_schedule_on_exec_ctx);
|
|
2812
2803
|
t->active_reclamation = std::move(*sweep);
|
|
2813
|
-
t->combiner->Run(&t->benign_reclaimer_locked,
|
|
2804
|
+
t->combiner->Run(&t->benign_reclaimer_locked, absl::OkStatus());
|
|
2814
2805
|
} else {
|
|
2815
2806
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "benign_reclaimer");
|
|
2816
2807
|
}
|
|
@@ -2830,7 +2821,8 @@ static void post_destructive_reclaimer(grpc_chttp2_transport* t) {
|
|
|
2830
2821
|
destructive_reclaimer_locked, t,
|
|
2831
2822
|
grpc_schedule_on_exec_ctx);
|
|
2832
2823
|
t->active_reclamation = std::move(*sweep);
|
|
2833
|
-
t->combiner->Run(&t->destructive_reclaimer_locked,
|
|
2824
|
+
t->combiner->Run(&t->destructive_reclaimer_locked,
|
|
2825
|
+
absl::OkStatus());
|
|
2834
2826
|
} else {
|
|
2835
2827
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "benign_reclaimer");
|
|
2836
2828
|
}
|
|
@@ -2840,8 +2832,7 @@ static void post_destructive_reclaimer(grpc_chttp2_transport* t) {
|
|
|
2840
2832
|
|
|
2841
2833
|
static void benign_reclaimer_locked(void* arg, grpc_error_handle error) {
|
|
2842
2834
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
|
|
2843
|
-
if (
|
|
2844
|
-
grpc_chttp2_stream_map_size(&t->stream_map) == 0) {
|
|
2835
|
+
if (error.ok() && grpc_chttp2_stream_map_size(&t->stream_map) == 0) {
|
|
2845
2836
|
// Channel with no active streams: send a goaway to try and make it
|
|
2846
2837
|
// disconnect cleanly
|
|
2847
2838
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
|
|
@@ -2849,12 +2840,11 @@ static void benign_reclaimer_locked(void* arg, grpc_error_handle error) {
|
|
|
2849
2840
|
t->peer_string.c_str());
|
|
2850
2841
|
}
|
|
2851
2842
|
send_goaway(t,
|
|
2852
|
-
grpc_error_set_int(
|
|
2853
|
-
|
|
2854
|
-
|
|
2843
|
+
grpc_error_set_int(GRPC_ERROR_CREATE("Buffers full"),
|
|
2844
|
+
grpc_core::StatusIntProperty::kHttp2Error,
|
|
2845
|
+
GRPC_HTTP2_ENHANCE_YOUR_CALM),
|
|
2855
2846
|
/*immediate_disconnect_hint=*/true);
|
|
2856
|
-
} else if (
|
|
2857
|
-
GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
|
|
2847
|
+
} else if (error.ok() && GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
|
|
2858
2848
|
gpr_log(GPR_INFO,
|
|
2859
2849
|
"HTTP2: %s - skip benign reclamation, there are still %" PRIdPTR
|
|
2860
2850
|
" streams",
|
|
@@ -2862,7 +2852,7 @@ static void benign_reclaimer_locked(void* arg, grpc_error_handle error) {
|
|
|
2862
2852
|
grpc_chttp2_stream_map_size(&t->stream_map));
|
|
2863
2853
|
}
|
|
2864
2854
|
t->benign_reclaimer_registered = false;
|
|
2865
|
-
if (error !=
|
|
2855
|
+
if (error != absl::CancelledError()) {
|
|
2866
2856
|
t->active_reclamation.Finish();
|
|
2867
2857
|
}
|
|
2868
2858
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "benign_reclaimer");
|
|
@@ -2872,7 +2862,7 @@ static void destructive_reclaimer_locked(void* arg, grpc_error_handle error) {
|
|
|
2872
2862
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
|
|
2873
2863
|
size_t n = grpc_chttp2_stream_map_size(&t->stream_map);
|
|
2874
2864
|
t->destructive_reclaimer_registered = false;
|
|
2875
|
-
if (
|
|
2865
|
+
if (error.ok() && n > 0) {
|
|
2876
2866
|
grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(
|
|
2877
2867
|
grpc_chttp2_stream_map_rand(&t->stream_map));
|
|
2878
2868
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
|
|
@@ -2881,8 +2871,8 @@ static void destructive_reclaimer_locked(void* arg, grpc_error_handle error) {
|
|
|
2881
2871
|
}
|
|
2882
2872
|
grpc_chttp2_cancel_stream(
|
|
2883
2873
|
t, s,
|
|
2884
|
-
grpc_error_set_int(
|
|
2885
|
-
|
|
2874
|
+
grpc_error_set_int(GRPC_ERROR_CREATE("Buffers full"),
|
|
2875
|
+
grpc_core::StatusIntProperty::kHttp2Error,
|
|
2886
2876
|
GRPC_HTTP2_ENHANCE_YOUR_CALM));
|
|
2887
2877
|
if (n > 1) {
|
|
2888
2878
|
// Since we cancel one stream per destructive reclamation, if
|
|
@@ -2892,7 +2882,7 @@ static void destructive_reclaimer_locked(void* arg, grpc_error_handle error) {
|
|
|
2892
2882
|
post_destructive_reclaimer(t);
|
|
2893
2883
|
}
|
|
2894
2884
|
}
|
|
2895
|
-
if (error !=
|
|
2885
|
+
if (error != absl::CancelledError()) {
|
|
2896
2886
|
t->active_reclamation.Finish();
|
|
2897
2887
|
}
|
|
2898
2888
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "destructive_reclaimer");
|
|
@@ -2991,7 +2981,7 @@ void grpc_chttp2_transport_start_reading(
|
|
|
2991
2981
|
grpc_chttp2_transport* t =
|
|
2992
2982
|
reinterpret_cast<grpc_chttp2_transport*>(transport);
|
|
2993
2983
|
GRPC_CHTTP2_REF_TRANSPORT(
|
|
2994
|
-
t, "reading_action");
|
|
2984
|
+
t, "reading_action"); // matches unref inside reading_action
|
|
2995
2985
|
if (read_buffer != nullptr) {
|
|
2996
2986
|
grpc_slice_buffer_move_into(read_buffer, &t->read_buffer);
|
|
2997
2987
|
gpr_free(read_buffer);
|
|
@@ -3000,5 +2990,5 @@ void grpc_chttp2_transport_start_reading(
|
|
|
3000
2990
|
t->notify_on_close = notify_on_close;
|
|
3001
2991
|
t->combiner->Run(
|
|
3002
2992
|
GRPC_CLOSURE_INIT(&t->read_action_locked, read_action_locked, t, nullptr),
|
|
3003
|
-
|
|
2993
|
+
absl::OkStatus());
|
|
3004
2994
|
}
|