grpc 1.42.0 → 1.51.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Makefile +705 -451
- data/include/grpc/compression.h +1 -1
- data/include/grpc/event_engine/endpoint_config.h +11 -5
- data/include/grpc/event_engine/event_engine.h +122 -44
- data/include/grpc/event_engine/internal/memory_allocator_impl.h +1 -31
- data/include/grpc/event_engine/memory_allocator.h +27 -26
- data/include/grpc/event_engine/memory_request.h +57 -0
- data/include/grpc/event_engine/port.h +1 -1
- data/include/grpc/event_engine/slice.h +286 -0
- data/include/grpc/event_engine/slice_buffer.h +135 -0
- data/include/grpc/grpc.h +43 -27
- data/include/grpc/grpc_posix.h +20 -19
- data/include/grpc/grpc_security.h +323 -195
- data/include/grpc/grpc_security_constants.h +1 -14
- data/include/grpc/impl/codegen/atm_gcc_atomic.h +19 -28
- data/include/grpc/impl/codegen/atm_gcc_sync.h +0 -2
- data/include/grpc/impl/codegen/atm_windows.h +0 -2
- data/include/grpc/impl/codegen/compression_types.h +2 -3
- data/include/grpc/impl/codegen/connectivity_state.h +2 -1
- data/include/grpc/impl/codegen/gpr_types.h +2 -1
- data/include/grpc/impl/codegen/grpc_types.h +31 -30
- data/include/grpc/impl/codegen/port_platform.h +107 -47
- data/include/grpc/impl/codegen/slice.h +5 -2
- data/include/grpc/slice.h +0 -11
- data/src/core/ext/filters/census/grpc_context.cc +3 -0
- data/src/core/ext/filters/channel_idle/channel_idle_filter.cc +315 -0
- data/src/core/ext/filters/channel_idle/channel_idle_filter.h +142 -0
- data/src/core/ext/filters/channel_idle/idle_filter_state.cc +96 -0
- data/src/core/ext/filters/channel_idle/idle_filter_state.h +68 -0
- data/src/core/ext/filters/client_channel/backend_metric.cc +20 -16
- data/src/core/ext/filters/client_channel/backend_metric.h +19 -8
- data/src/core/ext/filters/client_channel/backup_poller.cc +23 -19
- data/src/core/ext/filters/client_channel/backup_poller.h +2 -4
- data/src/core/ext/filters/client_channel/channel_connectivity.cc +54 -30
- data/src/core/ext/filters/client_channel/client_channel.cc +684 -615
- data/src/core/ext/filters/client_channel/client_channel.h +103 -58
- data/src/core/ext/filters/client_channel/client_channel_channelz.cc +2 -6
- data/src/core/ext/filters/client_channel/client_channel_channelz.h +12 -2
- data/src/core/ext/filters/client_channel/client_channel_factory.cc +2 -26
- data/src/core/ext/filters/client_channel/client_channel_factory.h +8 -8
- data/src/core/ext/filters/client_channel/client_channel_plugin.cc +9 -41
- data/src/core/ext/filters/client_channel/client_channel_service_config.cc +153 -0
- data/src/core/ext/filters/client_channel/client_channel_service_config.h +111 -0
- data/src/core/ext/filters/client_channel/config_selector.cc +1 -0
- data/src/core/ext/filters/client_channel/config_selector.h +21 -11
- data/src/core/ext/filters/client_channel/connector.h +13 -8
- data/src/core/ext/filters/client_channel/dynamic_filters.cc +36 -51
- data/src/core/ext/filters/client_channel/dynamic_filters.h +19 -10
- data/src/core/ext/filters/client_channel/global_subchannel_pool.cc +4 -22
- data/src/core/ext/filters/client_channel/global_subchannel_pool.h +6 -15
- data/src/core/ext/filters/client_channel/health/health_check_client.cc +139 -583
- data/src/core/ext/filters/client_channel/health/health_check_client.h +26 -160
- data/src/core/ext/filters/client_channel/http_proxy.cc +96 -130
- data/src/core/ext/filters/client_channel/http_proxy.h +25 -1
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc +12 -8
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.h +7 -5
- data/src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h +49 -0
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc +36 -15
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h +15 -9
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +21 -19
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h +1 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +380 -313
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +0 -7
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc +15 -3
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h +6 -2
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +2 -5
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +8 -2
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +26 -16
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +10 -8
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc +415 -0
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.h +57 -0
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.cc +1152 -0
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h +94 -0
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +228 -207
- data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +491 -452
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +523 -391
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h +16 -6
- data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +636 -626
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +280 -254
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +147 -134
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +275 -223
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +266 -249
- 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_attributes.h +64 -0
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +288 -277
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +213 -182
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +589 -737
- 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.cc +4 -0
- data/src/core/ext/filters/client_channel/local_subchannel_pool.h +1 -0
- data/src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc +43 -33
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +676 -334
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +30 -13
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +29 -24
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +51 -71
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +358 -357
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +55 -40
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +3 -2
- data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc +2 -0
- data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h +2 -1
- data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +124 -255
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +37 -49
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +18 -3
- data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +190 -102
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.cc +258 -0
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.h +123 -0
- data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +56 -61
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +648 -503
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h +3 -1
- data/src/core/ext/filters/client_channel/retry_filter.cc +382 -294
- data/src/core/ext/filters/client_channel/retry_filter.h +1 -0
- data/src/core/ext/filters/client_channel/retry_service_config.cc +198 -232
- data/src/core/ext/filters/client_channel/retry_service_config.h +41 -32
- data/src/core/ext/filters/client_channel/retry_throttle.cc +18 -39
- data/src/core/ext/filters/client_channel/retry_throttle.h +26 -13
- data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +37 -19
- data/src/core/ext/filters/client_channel/subchannel.cc +272 -319
- data/src/core/ext/filters/client_channel/subchannel.h +100 -47
- data/src/core/ext/filters/client_channel/subchannel_interface_internal.h +38 -0
- data/src/core/ext/filters/client_channel/subchannel_pool_interface.cc +17 -77
- data/src/core/ext/filters/client_channel/subchannel_pool_interface.h +20 -26
- data/src/core/ext/filters/client_channel/subchannel_stream_client.cc +470 -0
- data/src/core/ext/filters/client_channel/subchannel_stream_client.h +222 -0
- data/src/core/ext/filters/deadline/deadline_filter.cc +48 -39
- data/src/core/ext/filters/deadline/deadline_filter.h +11 -4
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +179 -403
- data/src/core/ext/filters/fault_injection/fault_injection_filter.h +38 -6
- data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.cc +118 -0
- data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.h +112 -0
- data/src/core/ext/filters/http/client/http_client_filter.cc +106 -551
- data/src/core/ext/filters/http/client/http_client_filter.h +35 -5
- data/src/core/ext/filters/http/client_authority_filter.cc +43 -112
- data/src/core/ext/filters/http/client_authority_filter.h +28 -6
- data/src/core/ext/filters/http/http_filters_plugin.cc +35 -28
- data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +112 -333
- data/src/core/ext/filters/http/message_compress/message_compress_filter.h +1 -2
- data/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +85 -161
- data/src/core/ext/filters/http/message_compress/message_decompress_filter.h +1 -0
- data/src/core/ext/filters/http/server/http_server_filter.cc +100 -476
- data/src/core/ext/filters/http/server/http_server_filter.h +37 -3
- data/src/core/ext/filters/message_size/message_size_filter.cc +130 -159
- data/src/core/ext/filters/message_size/message_size_filter.h +41 -17
- data/src/core/ext/filters/rbac/rbac_filter.cc +174 -0
- data/src/core/ext/filters/rbac/rbac_filter.h +84 -0
- data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +819 -0
- data/src/core/ext/filters/rbac/rbac_service_config_parser.h +86 -0
- data/src/core/ext/filters/server_config_selector/server_config_selector.cc +62 -0
- data/src/core/ext/filters/server_config_selector/server_config_selector.h +85 -0
- data/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc +160 -0
- data/src/core/ext/filters/server_config_selector/server_config_selector_filter.h +33 -0
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +268 -110
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +9 -9
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +387 -216
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +5 -5
- data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +7 -7
- data/src/core/ext/transport/chttp2/transport/bin_decoder.h +2 -1
- data/src/core/ext/transport/chttp2/transport/bin_encoder.cc +2 -1
- data/src/core/ext/transport/chttp2/transport/bin_encoder.h +1 -1
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +791 -1179
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +16 -5
- data/src/core/ext/transport/chttp2/transport/context_list.cc +6 -3
- data/src/core/ext/transport/chttp2/transport/context_list.h +6 -4
- data/src/core/ext/transport/chttp2/transport/decode_huff.cc +287 -0
- data/src/core/ext/transport/chttp2/transport/decode_huff.h +1018 -0
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +297 -285
- data/src/core/ext/transport/chttp2/transport/flow_control.h +191 -293
- data/src/core/ext/transport/chttp2/transport/frame.h +0 -4
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +66 -218
- data/src/core/ext/transport/chttp2/transport/frame_data.h +13 -36
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +16 -13
- data/src/core/ext/transport/chttp2/transport/frame_goaway.h +3 -1
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +12 -7
- data/src/core/ext/transport/chttp2/transport/frame_ping.h +3 -0
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +21 -9
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +3 -0
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +27 -59
- data/src/core/ext/transport/chttp2/transport/frame_settings.h +4 -0
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +15 -16
- data/src/core/ext/transport/chttp2/transport/frame_window_update.h +3 -0
- data/src/core/ext/transport/chttp2/transport/hpack_constants.h +7 -1
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +381 -260
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +106 -147
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc +5 -2
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h +12 -1
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +157 -229
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +8 -2
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +143 -42
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +50 -50
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +0 -1
- data/src/core/ext/transport/chttp2/transport/internal.h +74 -163
- data/src/core/ext/transport/chttp2/transport/parsing.cc +170 -91
- data/src/core/ext/transport/chttp2/transport/stream_lists.cc +11 -11
- data/src/core/ext/transport/chttp2/transport/stream_map.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/stream_map.h +1 -0
- data/src/core/ext/transport/chttp2/transport/varint.cc +2 -3
- data/src/core/ext/transport/chttp2/transport/varint.h +13 -8
- data/src/core/ext/transport/chttp2/transport/writing.cc +150 -183
- data/src/core/ext/transport/inproc/inproc_plugin.cc +0 -5
- data/src/core/ext/transport/inproc/inproc_transport.cc +237 -323
- data/src/core/ext/transport/inproc/inproc_transport.h +4 -5
- data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c +117 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h +502 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c +121 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h +569 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c +60 -341
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h +280 -1355
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.c +352 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump_shared.upb.h +1768 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c +56 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h +159 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c +64 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h +189 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c +46 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h +128 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c +43 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h +106 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c +43 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h +101 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c +106 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h +613 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c +48 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h +107 -0
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c +43 -0
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +51 -0
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +30 -4
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +54 -17
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +143 -116
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +730 -385
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +241 -199
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +1360 -663
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c +49 -28
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h +213 -90
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +321 -271
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +1776 -826
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c +20 -7
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h +47 -23
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +60 -27
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +277 -98
- data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c +299 -0
- data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h +1437 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +74 -53
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +383 -189
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c +21 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h +50 -24
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +215 -176
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +1179 -583
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +105 -45
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +554 -166
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c +19 -6
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h +43 -23
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c +16 -22
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h +46 -100
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c +58 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h +159 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +145 -117
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +821 -409
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +141 -92
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +773 -348
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c +21 -8
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h +62 -30
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +204 -125
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +1068 -398
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +17 -4
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h +33 -16
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c +27 -13
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h +92 -48
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +22 -9
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +80 -33
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +26 -13
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +98 -48
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c +21 -8
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h +51 -25
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +51 -35
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h +207 -108
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +74 -55
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +374 -189
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c +70 -53
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h +378 -187
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c +19 -6
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h +39 -20
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +122 -71
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +660 -259
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +104 -79
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +589 -300
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +31 -16
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +109 -48
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +27 -10
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +98 -39
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c +53 -0
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h +140 -0
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c +82 -61
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h +446 -234
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c +86 -65
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h +443 -236
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +139 -103
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +649 -293
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +45 -41
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +255 -165
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +706 -570
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +4125 -1898
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c +38 -19
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h +161 -71
- data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c +241 -0
- data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h +1191 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c +44 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h +92 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c +49 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h +107 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +27 -13
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h +86 -45
- data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c +52 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h +138 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c +63 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h +254 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.c +46 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opentelemetry.upb.h +98 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c +47 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h +98 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c +69 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h +221 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.c +33 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/trace.upb.h +43 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c +71 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h +226 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c +54 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h +150 -0
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +17 -4
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +39 -23
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c +45 -28
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h +208 -111
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +51 -36
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +273 -131
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c +71 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +237 -0
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +26 -13
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +91 -42
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +292 -224
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +1679 -733
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.c +52 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h +168 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.c +46 -0
- data/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.h +98 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c +9 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h +6 -3
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +107 -60
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +607 -234
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +41 -26
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +169 -86
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +126 -83
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +651 -262
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c +62 -0
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h +168 -0
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c +15 -2
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h +26 -14
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +206 -72
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +1095 -255
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +31 -17
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h +116 -61
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c +74 -57
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h +368 -185
- data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c +48 -0
- data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h +116 -0
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c +34 -18
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h +140 -80
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c +74 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h +230 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c +28 -14
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h +108 -56
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c +21 -8
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h +55 -30
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c +20 -7
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h +53 -26
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c +19 -6
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h +43 -23
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +35 -20
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h +130 -68
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +31 -17
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h +132 -64
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c +26 -12
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h +94 -52
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c +37 -22
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h +163 -82
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c +50 -31
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h +258 -144
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c +53 -36
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h +256 -130
- data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c +66 -0
- data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h +213 -0
- data/src/core/ext/upb-generated/envoy/type/v3/http.upb.c +9 -0
- data/src/core/ext/upb-generated/envoy/type/v3/http.upb.h +3 -0
- data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c +42 -0
- data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h +143 -0
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c +23 -9
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h +71 -35
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.c +30 -15
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.h +111 -51
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_strategy.upb.c +63 -0
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_strategy.upb.h +202 -0
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.c +26 -0
- data/src/core/ext/upb-generated/envoy/type/v3/ratelimit_unit.upb.h +41 -0
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c +19 -6
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h +45 -18
- data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c +51 -0
- data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h +131 -0
- data/src/core/ext/upb-generated/google/api/annotations.upb.c +22 -0
- data/src/core/ext/upb-generated/google/api/annotations.upb.h +23 -0
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c +154 -125
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h +765 -381
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +158 -126
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +844 -401
- data/src/core/ext/upb-generated/google/api/http.upb.c +43 -28
- data/src/core/ext/upb-generated/google/api/http.upb.h +229 -114
- data/src/core/ext/upb-generated/google/api/httpbody.upb.c +46 -0
- data/src/core/ext/upb-generated/google/api/httpbody.upb.h +115 -0
- data/src/core/ext/upb-generated/google/protobuf/any.upb.c +18 -5
- data/src/core/ext/upb-generated/google/protobuf/any.upb.h +43 -21
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +374 -282
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +2199 -1029
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.c +18 -5
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +41 -19
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.c +15 -2
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.h +26 -14
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +47 -31
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +190 -92
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +18 -5
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +41 -19
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +57 -36
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +277 -148
- data/src/core/ext/upb-generated/google/rpc/status.upb.c +21 -8
- data/src/core/ext/upb-generated/google/rpc/status.upb.h +57 -29
- data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c +84 -0
- data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h +335 -0
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +32 -18
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +108 -47
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +135 -107
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +726 -358
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +27 -12
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +85 -40
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +22 -8
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +65 -34
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +81 -61
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +435 -237
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c +34 -19
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h +124 -62
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c +175 -0
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h +792 -0
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +75 -13
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +206 -56
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.c +31 -5
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.h +59 -17
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c +21 -0
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +16 -0
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.c +31 -5
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +61 -19
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +30 -4
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +54 -17
- data/src/core/ext/upb-generated/validate/validate.upb.c +406 -310
- data/src/core/ext/upb-generated/validate/validate.upb.h +2822 -1164
- data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c +110 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h +290 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.c +55 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.h +112 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c +38 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h +46 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c +64 -17
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h +191 -67
- data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c +53 -0
- data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h +103 -0
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.c +17 -4
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +35 -18
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +30 -16
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +107 -54
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +25 -11
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +58 -29
- data/src/core/ext/upb-generated/xds/core/v3/extension.upb.c +46 -0
- data/src/core/ext/upb-generated/xds/core/v3/extension.upb.h +107 -0
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.c +22 -9
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +60 -29
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +33 -19
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +139 -69
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +22 -9
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +63 -29
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c +36 -21
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h +106 -45
- data/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.c +47 -0
- data/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.h +113 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c +207 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h +914 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c +52 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h +151 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c +65 -0
- data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h +226 -0
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c +20 -7
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h +47 -23
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.c +84 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/certs.upbdefs.h +55 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.c +127 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/clusters.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c +75 -327
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h +16 -101
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.c +256 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump_shared.upbdefs.h +115 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.c +43 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/init_dump.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.c +56 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/listeners.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.c +49 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/memory.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.c +46 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/metrics.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.c +46 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/mutex_stats.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.c +142 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/server_info.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.c +51 -0
- data/src/core/ext/upbdefs-generated/envoy/admin/v3/tap.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c +10 -8
- data/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h +1 -1
- data/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c +10 -13
- data/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c +120 -150
- data/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h +46 -46
- data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c +253 -280
- data/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h +55 -55
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c +60 -62
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +387 -424
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h +76 -76
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c +16 -18
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c +25 -23
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.c +206 -0
- data/src/core/ext/upbdefs-generated/envoy/config/common/matcher/v3/matcher.upbdefs.h +105 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c +17 -32
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h +22 -22
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c +17 -19
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c +203 -246
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h +73 -73
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +140 -116
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h +26 -16
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c +16 -19
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c +24 -43
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h +4 -9
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.c +53 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_method_list.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c +23 -51
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h +43 -43
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +179 -187
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h +30 -25
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c +16 -19
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c +254 -254
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h +53 -43
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c +14 -16
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c +16 -20
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c +16 -18
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c +26 -28
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c +15 -18
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c +20 -28
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h +13 -13
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c +21 -33
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h +19 -19
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c +20 -30
- data/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h +16 -16
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c +16 -18
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c +180 -165
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h +24 -19
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c +155 -166
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h +22 -22
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c +21 -23
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c +46 -42
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.c +69 -0
- data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/metrics_service.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c +19 -35
- data/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h +25 -25
- data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c +19 -37
- data/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h +28 -28
- data/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.c +194 -0
- data/src/core/ext/upbdefs-generated/envoy/config/rbac/v3/rbac.upbdefs.h +75 -0
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +82 -85
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h +7 -12
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +874 -917
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h +170 -160
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c +54 -48
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.c +199 -0
- data/src/core/ext/upbdefs-generated/envoy/config/tap/v3/common.upbdefs.h +90 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.c +54 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/datadog.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.c +57 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/dynamic_ot.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c +17 -21
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.c +72 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/lightstep.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.c +99 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opencensus.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opentelemetry.upbdefs.c +47 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/opentelemetry.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.c +52 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/service.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.c +71 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/skywalking.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.c +61 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/trace.upbdefs.h +30 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.c +75 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/xray.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.c +77 -0
- data/src/core/ext/upbdefs-generated/envoy/config/trace/v3/zipkin.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c +17 -18
- data/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c +19 -29
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h +16 -16
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c +20 -26
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c +80 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c +19 -20
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +405 -410
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +63 -58
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c +17 -13
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h +1 -1
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c +174 -157
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h +24 -19
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c +21 -27
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +219 -216
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h +24 -19
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.c +58 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c +16 -18
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c +162 -107
- data/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h +57 -22
- data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c +18 -22
- data/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c +125 -135
- data/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h +16 -16
- data/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.c +46 -0
- data/src/core/ext/upbdefs-generated/envoy/type/http/v3/cookie.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c +15 -23
- data/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h +13 -13
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.c +52 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/http_inputs.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c +17 -21
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c +17 -19
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c +17 -19
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c +17 -19
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c +38 -43
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c +17 -21
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c +16 -21
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c +18 -24
- data/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c +15 -29
- data/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h +22 -22
- data/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c +16 -26
- data/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h +16 -16
- data/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.c +53 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/hash_policy.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c +12 -10
- data/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h +1 -1
- data/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.c +94 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/http_status.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c +14 -19
- data/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c +13 -19
- data/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_strategy.upbdefs.c +69 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_strategy.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.c +38 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/ratelimit_unit.upbdefs.h +30 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c +13 -16
- data/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.c +57 -0
- data/src/core/ext/upbdefs-generated/envoy/type/v3/token_bucket.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c +7 -7
- data/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h +1 -1
- data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.c +154 -0
- data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/checked.upbdefs.h +95 -0
- data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.c +153 -0
- data/src/core/ext/upbdefs-generated/google/api/expr/v1alpha1/syntax.upbdefs.h +100 -0
- data/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c +5 -14
- data/src/core/ext/upbdefs-generated/google/api/http.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.c +39 -0
- data/src/core/ext/upbdefs-generated/google/api/httpbody.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c +5 -10
- data/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c +96 -151
- data/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h +82 -82
- data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c +5 -10
- data/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c +5 -10
- data/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c +5 -16
- data/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h +13 -13
- data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c +5 -10
- data/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c +5 -26
- data/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h +28 -28
- data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c +6 -11
- data/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.c +67 -0
- data/src/core/ext/upbdefs-generated/opencensus/proto/trace/v1/trace_config.upbdefs.h +50 -0
- data/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c +99 -0
- data/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h +75 -0
- data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c +6 -15
- data/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h +10 -10
- data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c +7 -12
- data/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c +6 -6
- data/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h +1 -1
- data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c +6 -11
- data/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c +6 -11
- data/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c +8 -57
- data/src/core/ext/upbdefs-generated/validate/validate.upbdefs.h +70 -70
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.c +63 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/migrate.upbdefs.h +45 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.c +47 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/security.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.c +35 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/sensitive.upbdefs.h +30 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c +6 -17
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h +13 -13
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.c +40 -0
- data/src/core/ext/upbdefs-generated/xds/annotations/v3/versioning.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c +7 -12
- data/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c +9 -16
- data/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c +6 -13
- data/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.c +41 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/extension.upbdefs.h +35 -0
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c +8 -13
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c +8 -15
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h +7 -7
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c +8 -13
- data/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h +4 -4
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.c +126 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/matcher.upbdefs.h +80 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.c +40 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/regex.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.c +52 -0
- data/src/core/ext/upbdefs-generated/xds/type/matcher/v3/string.upbdefs.h +40 -0
- data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c +7 -12
- data/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h +4 -4
- data/src/core/ext/xds/certificate_provider_store.cc +75 -3
- data/src/core/ext/xds/certificate_provider_store.h +28 -2
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +20 -14
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +11 -3
- data/src/core/ext/xds/upb_utils.h +45 -0
- data/src/core/ext/xds/xds_api.cc +329 -3648
- data/src/core/ext/xds/xds_api.h +78 -630
- data/src/core/ext/xds/xds_bootstrap.cc +10 -443
- data/src/core/ext/xds/xds_bootstrap.h +44 -81
- data/src/core/ext/xds/xds_bootstrap_grpc.cc +361 -0
- data/src/core/ext/xds/xds_bootstrap_grpc.h +184 -0
- data/src/core/ext/xds/xds_certificate_provider.cc +36 -25
- data/src/core/ext/xds/xds_certificate_provider.h +35 -3
- data/src/core/ext/xds/xds_channel_stack_modifier.cc +27 -21
- data/src/core/ext/xds/xds_channel_stack_modifier.h +17 -4
- data/src/core/ext/xds/xds_client.cc +1278 -2037
- data/src/core/ext/xds/xds_client.h +158 -197
- data/src/core/ext/xds/xds_client_grpc.cc +210 -0
- data/src/core/ext/xds/xds_client_grpc.h +79 -0
- data/src/core/ext/xds/xds_client_stats.cc +18 -19
- data/src/core/ext/xds/xds_client_stats.h +9 -7
- data/src/core/ext/xds/xds_cluster.cc +659 -0
- data/src/core/ext/xds/xds_cluster.h +116 -0
- data/src/core/ext/xds/xds_cluster_specifier_plugin.cc +152 -0
- data/src/core/ext/xds/xds_cluster_specifier_plugin.h +92 -0
- data/src/core/ext/xds/xds_common_types.cc +501 -0
- data/src/core/ext/xds/xds_common_types.h +108 -0
- data/src/core/ext/xds/xds_endpoint.cc +468 -0
- data/src/core/ext/xds/xds_endpoint.h +139 -0
- data/src/core/ext/xds/xds_http_fault_filter.cc +67 -59
- data/src/core/ext/xds/xds_http_fault_filter.h +18 -24
- data/src/core/ext/xds/xds_http_filters.cc +66 -66
- data/src/core/ext/xds/xds_http_filters.h +72 -24
- data/src/core/ext/xds/xds_http_rbac_filter.cc +505 -0
- data/src/core/ext/xds/xds_http_rbac_filter.h +58 -0
- data/src/core/ext/xds/xds_lb_policy_registry.cc +243 -0
- data/src/core/ext/xds/xds_lb_policy_registry.h +71 -0
- data/src/core/ext/xds/xds_listener.cc +1144 -0
- data/src/core/ext/xds/xds_listener.h +224 -0
- data/src/core/ext/xds/xds_resource_type.h +104 -0
- data/src/core/ext/xds/xds_resource_type_impl.h +86 -0
- data/src/core/ext/xds/xds_route_config.cc +1166 -0
- data/src/core/ext/xds/xds_route_config.h +241 -0
- data/src/core/ext/xds/xds_routing.cc +264 -0
- data/src/core/ext/xds/xds_routing.h +106 -0
- data/src/core/ext/xds/xds_server_config_fetcher.cc +1155 -324
- data/src/core/ext/xds/xds_transport.h +86 -0
- data/src/core/ext/xds/xds_transport_grpc.cc +356 -0
- data/src/core/ext/xds/xds_transport_grpc.h +135 -0
- data/src/core/lib/address_utils/parse_address.cc +36 -16
- data/src/core/lib/address_utils/parse_address.h +11 -2
- data/src/core/lib/address_utils/sockaddr_utils.cc +82 -51
- data/src/core/lib/address_utils/sockaddr_utils.h +9 -19
- data/src/core/lib/avl/avl.h +476 -88
- data/src/core/lib/backoff/backoff.cc +9 -40
- data/src/core/lib/backoff/backoff.h +12 -12
- data/src/core/lib/channel/call_finalization.h +88 -0
- data/src/core/lib/channel/call_tracer.h +16 -7
- data/src/core/lib/channel/channel_args.cc +274 -48
- data/src/core/lib/channel/channel_args.h +413 -12
- data/src/core/lib/channel/channel_args_preconditioning.cc +43 -0
- data/src/core/lib/channel/channel_args_preconditioning.h +62 -0
- data/src/core/lib/channel/channel_fwd.h +26 -0
- data/src/core/lib/channel/channel_stack.cc +64 -17
- data/src/core/lib/channel/channel_stack.h +96 -14
- data/src/core/lib/channel/channel_stack_builder.cc +18 -280
- data/src/core/lib/channel/channel_stack_builder.h +112 -150
- data/src/core/lib/channel/channel_stack_builder_impl.cc +113 -0
- data/src/core/lib/channel/channel_stack_builder_impl.h +48 -0
- data/src/core/lib/channel/channel_trace.cc +12 -22
- data/src/core/lib/channel/channel_trace.h +6 -3
- data/src/core/lib/channel/channelz.cc +36 -49
- data/src/core/lib/channel/channelz.h +24 -7
- data/src/core/lib/channel/channelz_registry.cc +11 -19
- data/src/core/lib/channel/channelz_registry.h +10 -9
- data/src/core/lib/channel/connected_channel.cc +704 -48
- data/src/core/lib/channel/connected_channel.h +3 -4
- data/src/core/lib/channel/context.h +11 -0
- data/src/core/lib/channel/promise_based_filter.cc +2126 -0
- data/src/core/lib/channel/promise_based_filter.h +848 -0
- data/src/core/lib/channel/status_util.cc +29 -0
- data/src/core/lib/channel/status_util.h +9 -2
- data/src/core/lib/compression/compression.cc +26 -113
- data/src/core/lib/compression/compression_internal.cc +170 -204
- data/src/core/lib/compression/compression_internal.h +68 -72
- data/src/core/lib/compression/message_compress.cc +18 -16
- data/src/core/lib/compression/message_compress.h +4 -5
- data/src/core/lib/config/core_configuration.cc +18 -3
- data/src/core/lib/config/core_configuration.h +133 -36
- 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/debug/histogram_view.h +37 -0
- data/src/core/lib/debug/stats.cc +31 -135
- data/src/core/lib/debug/stats.h +30 -37
- data/src/core/lib/debug/stats_data.cc +290 -638
- data/src/core/lib/debug/stats_data.h +263 -527
- data/src/core/lib/debug/trace.cc +0 -2
- data/src/core/lib/debug/trace.h +15 -14
- data/src/core/lib/event_engine/channel_args_endpoint_config.cc +40 -0
- data/src/core/lib/event_engine/channel_args_endpoint_config.h +49 -0
- data/src/core/lib/event_engine/common_closures.h +71 -0
- data/src/core/lib/event_engine/default_event_engine.cc +94 -0
- data/src/core/lib/event_engine/default_event_engine.h +49 -0
- data/src/core/lib/event_engine/default_event_engine_factory.cc +48 -0
- data/src/core/lib/event_engine/default_event_engine_factory.h +33 -0
- data/src/core/lib/event_engine/executor/executor.h +38 -0
- data/src/core/lib/event_engine/forkable.cc +101 -0
- data/src/core/lib/event_engine/forkable.h +61 -0
- data/src/core/lib/event_engine/handle_containers.h +67 -0
- data/src/core/lib/event_engine/memory_allocator.cc +74 -0
- data/src/core/lib/event_engine/poller.h +62 -0
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +618 -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 +901 -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/posix_engine/event_poller_posix_default.h +33 -0
- 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 +267 -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 +1270 -0
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +682 -0
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +577 -0
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +245 -0
- data/src/core/lib/event_engine/posix_engine/posix_engine_closure.h +80 -0
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +1081 -0
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +361 -0
- data/src/core/lib/event_engine/posix_engine/timer.cc +311 -0
- data/src/core/lib/event_engine/posix_engine/timer.h +194 -0
- data/src/core/lib/event_engine/posix_engine/timer_heap.cc +107 -0
- data/src/core/lib/event_engine/posix_engine/timer_heap.h +56 -0
- data/src/core/lib/event_engine/posix_engine/timer_manager.cc +174 -0
- data/src/core/lib/event_engine/posix_engine/timer_manager.h +114 -0
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc +301 -0
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.h +179 -0
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.cc +126 -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 +151 -0
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.h +45 -0
- 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/resolved_address.cc +41 -0
- data/src/core/lib/event_engine/slice.cc +103 -0
- data/src/core/lib/event_engine/slice_buffer.cc +50 -0
- data/src/core/lib/event_engine/socket_notifier.h +55 -0
- data/src/core/lib/event_engine/thread_pool.cc +276 -0
- data/src/core/lib/event_engine/thread_pool.h +137 -0
- data/src/core/lib/event_engine/time_util.cc +30 -0
- data/src/core/lib/event_engine/time_util.h +32 -0
- data/src/core/lib/event_engine/trace.cc +18 -0
- data/src/core/lib/event_engine/trace.h +30 -0
- data/src/core/lib/event_engine/utils.cc +44 -0
- data/src/core/lib/event_engine/utils.h +36 -0
- data/src/core/lib/event_engine/windows/iocp.cc +155 -0
- data/src/core/lib/event_engine/windows/iocp.h +69 -0
- data/src/core/lib/event_engine/windows/win_socket.cc +196 -0
- data/src/core/lib/event_engine/windows/win_socket.h +120 -0
- data/src/core/lib/event_engine/windows/windows_engine.cc +165 -0
- data/src/core/lib/event_engine/windows/windows_engine.h +124 -0
- data/src/core/lib/experiments/config.cc +146 -0
- data/src/core/lib/experiments/config.h +43 -0
- data/src/core/lib/experiments/experiments.cc +86 -0
- data/src/core/lib/experiments/experiments.h +63 -0
- data/src/core/lib/gpr/alloc.cc +1 -9
- data/src/core/lib/gpr/cpu_linux.cc +6 -2
- data/src/core/lib/gpr/log.cc +5 -0
- data/src/core/lib/gpr/log_linux.cc +3 -4
- data/src/core/lib/gpr/log_windows.cc +0 -1
- data/src/core/lib/gpr/string.h +1 -1
- data/src/core/lib/gpr/string_util_windows.cc +3 -30
- data/src/core/lib/gpr/sync_abseil.cc +0 -14
- data/src/core/lib/gpr/sync_posix.cc +1 -14
- data/src/core/lib/gpr/time.cc +13 -10
- data/src/core/lib/gpr/time_posix.cc +6 -15
- data/src/core/lib/gpr/time_precise.h +1 -1
- data/src/core/lib/gpr/time_windows.cc +10 -7
- data/src/core/lib/gpr/tmpfile_posix.cc +3 -2
- data/src/core/lib/gpr/tmpfile_windows.cc +5 -7
- data/src/core/lib/gpr/useful.h +58 -0
- data/src/core/lib/gprpp/bitset.h +27 -14
- data/src/core/lib/gprpp/chunked_vector.h +49 -3
- data/src/core/lib/gprpp/construct_destruct.h +1 -0
- data/src/core/lib/gprpp/cpp_impl_of.h +49 -0
- data/src/core/lib/gprpp/debug_location.h +41 -7
- data/src/core/lib/gprpp/dual_ref_counted.h +1 -4
- data/src/core/lib/gprpp/env.h +53 -0
- data/src/core/lib/gprpp/env_linux.cc +80 -0
- data/src/core/lib/gprpp/env_posix.cc +47 -0
- data/src/core/lib/gprpp/env_windows.cc +56 -0
- data/src/core/lib/gprpp/examine_stack.h +0 -1
- data/src/core/lib/gprpp/fork.cc +17 -28
- data/src/core/lib/gprpp/fork.h +0 -8
- data/src/core/lib/gprpp/global_config.h +2 -4
- data/src/core/lib/gprpp/global_config_env.cc +16 -14
- data/src/core/lib/gprpp/global_config_env.h +5 -3
- data/src/core/lib/gprpp/global_config_generic.h +0 -4
- data/src/core/lib/gprpp/host_port.cc +2 -0
- 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 +0 -70
- data/src/core/lib/gprpp/match.h +2 -0
- data/src/core/lib/gprpp/memory.h +1 -5
- data/src/core/lib/gprpp/no_destruct.h +94 -0
- data/src/core/lib/gprpp/notification.h +67 -0
- data/src/core/lib/gprpp/orphanable.h +2 -5
- data/src/core/lib/gprpp/packed_table.h +40 -0
- data/src/core/lib/gprpp/per_cpu.h +46 -0
- data/src/core/lib/gprpp/ref_counted.h +4 -4
- data/src/core/lib/gprpp/ref_counted_ptr.h +23 -39
- data/src/core/lib/gprpp/single_set_ptr.h +87 -0
- data/src/core/lib/gprpp/sorted_pack.h +98 -0
- data/src/core/lib/gprpp/stat.h +0 -2
- data/src/core/lib/gprpp/stat_posix.cc +10 -4
- data/src/core/lib/gprpp/stat_windows.cc +3 -2
- data/src/core/lib/gprpp/status_helper.cc +75 -48
- data/src/core/lib/gprpp/status_helper.h +16 -21
- 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 +3 -1
- data/src/core/lib/gprpp/table.h +42 -2
- data/src/core/lib/gprpp/tchar.cc +49 -0
- data/src/core/lib/gprpp/tchar.h +33 -0
- data/src/core/lib/gprpp/thd.h +2 -5
- data/src/core/lib/gprpp/thd_posix.cc +4 -2
- data/src/core/lib/gprpp/thd_windows.cc +3 -2
- data/src/core/lib/gprpp/time.cc +234 -0
- data/src/core/lib/gprpp/time.h +367 -0
- data/src/core/lib/gprpp/time_averaged_stats.cc +60 -0
- data/src/core/lib/gprpp/time_averaged_stats.h +79 -0
- data/src/core/lib/gprpp/time_util.cc +4 -0
- data/src/core/lib/gprpp/time_util.h +1 -1
- data/src/core/lib/gprpp/unique_type_name.h +104 -0
- data/src/core/lib/gprpp/validation_errors.cc +61 -0
- data/src/core/lib/gprpp/validation_errors.h +127 -0
- data/src/core/lib/gprpp/work_serializer.cc +247 -0
- data/src/core/lib/gprpp/work_serializer.h +86 -0
- data/src/core/lib/handshaker/proxy_mapper.h +53 -0
- data/src/core/lib/handshaker/proxy_mapper_registry.cc +71 -0
- data/src/core/lib/handshaker/proxy_mapper_registry.h +75 -0
- data/src/core/lib/http/format_request.cc +62 -29
- data/src/core/lib/http/format_request.h +10 -7
- data/src/core/lib/http/httpcli.cc +313 -244
- data/src/core/lib/http/httpcli.h +234 -90
- data/src/core/lib/http/httpcli_security_connector.cc +84 -86
- data/src/core/lib/http/httpcli_ssl_credentials.h +39 -0
- data/src/core/lib/http/parser.cc +124 -65
- data/src/core/lib/http/parser.h +18 -2
- data/src/core/lib/iomgr/buffer_list.cc +110 -121
- data/src/core/lib/iomgr/buffer_list.h +68 -52
- data/src/core/lib/iomgr/call_combiner.cc +17 -40
- data/src/core/lib/iomgr/call_combiner.h +3 -4
- data/src/core/lib/iomgr/cfstream_handle.cc +13 -16
- data/src/core/lib/iomgr/closure.h +68 -14
- data/src/core/lib/iomgr/combiner.cc +11 -9
- data/src/core/lib/iomgr/endpoint.cc +4 -4
- data/src/core/lib/iomgr/endpoint.h +7 -6
- data/src/core/lib/iomgr/endpoint_cfstream.cc +40 -53
- data/src/core/lib/iomgr/endpoint_cfstream.h +4 -4
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +15 -11
- data/src/core/lib/iomgr/endpoint_pair_windows.cc +5 -14
- data/src/core/lib/iomgr/error.cc +30 -813
- data/src/core/lib/iomgr/error.h +22 -295
- data/src/core/lib/iomgr/error_cfstream.cc +0 -5
- data/src/core/lib/iomgr/ev_apple.cc +10 -9
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +88 -84
- data/src/core/lib/iomgr/ev_epoll1_linux.h +1 -1
- data/src/core/lib/iomgr/ev_poll_posix.cc +123 -109
- data/src/core/lib/iomgr/ev_poll_posix.h +2 -2
- data/src/core/lib/iomgr/ev_posix.cc +58 -100
- data/src/core/lib/iomgr/ev_posix.h +6 -4
- data/src/core/lib/iomgr/exec_ctx.cc +14 -109
- data/src/core/lib/iomgr/exec_ctx.h +24 -66
- data/src/core/lib/iomgr/executor.cc +16 -21
- data/src/core/lib/iomgr/executor.h +1 -4
- data/src/core/lib/iomgr/fork_posix.cc +1 -0
- data/src/core/lib/iomgr/internal_errqueue.cc +40 -47
- data/src/core/lib/iomgr/internal_errqueue.h +1 -6
- data/src/core/lib/iomgr/iocp_windows.cc +10 -10
- data/src/core/lib/iomgr/iocp_windows.h +1 -1
- data/src/core/lib/iomgr/iomgr.cc +6 -2
- data/src/core/lib/iomgr/iomgr_fwd.h +26 -0
- data/src/core/lib/iomgr/iomgr_posix.cc +4 -3
- data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +4 -2
- data/src/core/lib/iomgr/iomgr_windows.cc +3 -2
- data/src/core/lib/iomgr/load_file.cc +5 -9
- data/src/core/lib/iomgr/lockfree_event.cc +10 -27
- data/src/core/lib/iomgr/polling_entity.h +6 -0
- data/src/core/lib/iomgr/pollset.cc +1 -1
- data/src/core/lib/iomgr/pollset.h +5 -5
- data/src/core/lib/iomgr/pollset_set.h +1 -3
- data/src/core/lib/iomgr/pollset_windows.cc +6 -6
- data/src/core/lib/iomgr/port.h +29 -12
- data/src/core/lib/iomgr/python_util.h +2 -2
- data/src/core/lib/iomgr/resolve_address.cc +16 -22
- data/src/core/lib/iomgr/resolve_address.h +79 -46
- data/src/core/lib/iomgr/resolve_address_impl.h +59 -0
- data/src/core/lib/iomgr/resolve_address_posix.cc +112 -78
- data/src/core/lib/iomgr/resolve_address_posix.h +63 -0
- data/src/core/lib/iomgr/resolve_address_windows.cc +125 -81
- data/src/core/lib/iomgr/resolve_address_windows.h +63 -0
- data/src/core/lib/iomgr/resolved_address.h +39 -0
- data/src/core/lib/iomgr/sockaddr.h +2 -3
- data/src/core/lib/iomgr/sockaddr_posix.h +2 -0
- data/src/core/lib/iomgr/sockaddr_utils_posix.cc +63 -0
- data/src/core/lib/iomgr/sockaddr_windows.h +2 -0
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +44 -81
- data/src/core/lib/iomgr/socket_utils_posix.cc +84 -1
- data/src/core/lib/iomgr/socket_utils_posix.h +98 -6
- data/src/core/lib/iomgr/socket_windows.cc +2 -2
- data/src/core/lib/iomgr/socket_windows.h +0 -2
- data/src/core/lib/iomgr/tcp_client.cc +11 -9
- data/src/core/lib/iomgr/tcp_client.h +25 -15
- data/src/core/lib/iomgr/tcp_client_cfstream.cc +28 -26
- data/src/core/lib/iomgr/tcp_client_posix.cc +194 -85
- data/src/core/lib/iomgr/tcp_client_posix.h +14 -12
- data/src/core/lib/iomgr/tcp_client_windows.cc +33 -35
- data/src/core/lib/iomgr/tcp_posix.cc +465 -254
- data/src/core/lib/iomgr/tcp_posix.h +4 -4
- data/src/core/lib/iomgr/tcp_server.cc +3 -4
- data/src/core/lib/iomgr/tcp_server.h +5 -4
- data/src/core/lib/iomgr/tcp_server_posix.cc +109 -101
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +21 -20
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +50 -49
- data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +19 -16
- data/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc +1 -1
- data/src/core/lib/iomgr/tcp_server_windows.cc +45 -48
- data/src/core/lib/iomgr/tcp_windows.cc +43 -46
- data/src/core/lib/iomgr/tcp_windows.h +1 -3
- data/src/core/lib/iomgr/timer.cc +2 -2
- data/src/core/lib/iomgr/timer.h +18 -13
- data/src/core/lib/iomgr/timer_generic.cc +108 -97
- data/src/core/lib/iomgr/timer_manager.cc +14 -14
- data/src/core/lib/iomgr/unix_sockets_posix.cc +20 -34
- data/src/core/lib/iomgr/unix_sockets_posix.h +4 -7
- data/src/core/lib/iomgr/unix_sockets_posix_noop.cc +6 -15
- data/src/core/lib/iomgr/wakeup_fd_eventfd.cc +4 -5
- data/src/core/lib/iomgr/wakeup_fd_pipe.cc +10 -8
- data/src/core/lib/iomgr/wakeup_fd_posix.cc +15 -12
- data/src/core/lib/iomgr/wakeup_fd_posix.h +0 -2
- data/src/core/lib/json/json.h +20 -24
- data/src/core/lib/json/json_args.h +34 -0
- data/src/core/lib/json/json_channel_args.h +42 -0
- data/src/core/lib/json/json_object_loader.cc +207 -0
- data/src/core/lib/json/json_object_loader.h +620 -0
- data/src/core/lib/json/json_reader.cc +155 -75
- data/src/core/lib/json/json_util.cc +17 -37
- data/src/core/lib/json/json_util.h +18 -9
- data/src/core/lib/json/json_writer.cc +6 -1
- data/src/core/lib/load_balancing/lb_policy.cc +93 -0
- data/src/core/lib/load_balancing/lb_policy.h +439 -0
- data/src/core/lib/load_balancing/lb_policy_factory.h +49 -0
- data/src/core/lib/load_balancing/lb_policy_registry.cc +141 -0
- data/src/core/lib/load_balancing/lb_policy_registry.h +82 -0
- data/src/core/lib/load_balancing/subchannel_interface.h +133 -0
- data/src/core/lib/matchers/matchers.cc +10 -8
- data/src/core/lib/matchers/matchers.h +2 -0
- data/src/core/lib/promise/activity.cc +134 -0
- data/src/core/lib/promise/activity.h +604 -0
- data/src/core/lib/promise/arena_promise.h +230 -0
- data/src/core/lib/promise/context.h +92 -0
- data/src/core/lib/promise/detail/basic_seq.h +497 -0
- data/src/core/lib/promise/detail/promise_factory.h +235 -0
- data/src/core/lib/promise/detail/promise_like.h +85 -0
- data/src/core/lib/promise/detail/status.h +78 -0
- data/src/core/lib/promise/detail/switch.h +1455 -0
- data/src/core/lib/promise/exec_ctx_wakeup_scheduler.h +50 -0
- data/src/core/lib/promise/for_each.h +129 -0
- data/src/core/lib/promise/intra_activity_waiter.h +49 -0
- data/src/core/lib/promise/latch.h +103 -0
- data/src/core/lib/promise/loop.h +138 -0
- data/src/core/lib/promise/map.h +87 -0
- data/src/core/lib/promise/map_pipe.h +87 -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 +79 -0
- data/src/core/lib/promise/promise.h +96 -0
- data/src/core/lib/promise/race.h +83 -0
- data/src/core/lib/promise/seq.h +106 -0
- data/src/core/lib/promise/sleep.cc +90 -0
- data/src/core/lib/promise/sleep.h +84 -0
- data/src/core/lib/promise/try_concurrently.h +341 -0
- data/src/core/lib/promise/try_seq.h +174 -0
- data/src/core/lib/resolver/resolver.cc +37 -0
- data/src/core/lib/resolver/resolver.h +138 -0
- data/src/core/lib/resolver/resolver_factory.h +77 -0
- data/src/core/lib/resolver/resolver_registry.cc +149 -0
- data/src/core/lib/resolver/resolver_registry.h +123 -0
- data/src/core/lib/resolver/server_address.cc +181 -0
- data/src/core/lib/resolver/server_address.h +145 -0
- data/src/core/lib/resource_quota/api.cc +104 -0
- data/src/core/lib/resource_quota/api.h +49 -0
- data/src/core/lib/resource_quota/arena.cc +138 -0
- data/src/core/lib/resource_quota/arena.h +252 -0
- data/src/core/lib/resource_quota/memory_quota.cc +603 -0
- data/src/core/lib/resource_quota/memory_quota.h +530 -0
- data/src/core/lib/resource_quota/periodic_update.cc +78 -0
- data/src/core/lib/resource_quota/periodic_update.h +71 -0
- data/src/core/lib/resource_quota/resource_quota.cc +33 -0
- data/src/core/lib/resource_quota/resource_quota.h +74 -0
- data/src/core/lib/resource_quota/thread_quota.cc +45 -0
- data/src/core/lib/resource_quota/thread_quota.h +61 -0
- data/src/core/lib/resource_quota/trace.cc +19 -0
- data/src/core/lib/resource_quota/trace.h +24 -0
- data/src/core/lib/security/authorization/authorization_policy_provider.h +14 -0
- data/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc +4 -0
- data/src/core/lib/security/authorization/evaluate_args.cc +53 -45
- data/src/core/lib/security/authorization/evaluate_args.h +9 -5
- data/src/core/lib/security/authorization/grpc_authorization_engine.cc +64 -0
- data/src/core/lib/security/authorization/grpc_authorization_engine.h +69 -0
- data/src/core/lib/security/authorization/grpc_server_authz_filter.cc +122 -0
- data/src/core/lib/security/authorization/grpc_server_authz_filter.h +61 -0
- data/src/core/lib/security/authorization/matchers.cc +241 -0
- data/src/core/lib/security/authorization/matchers.h +218 -0
- data/src/core/lib/security/authorization/rbac_policy.cc +445 -0
- data/src/core/lib/security/authorization/rbac_policy.h +178 -0
- data/src/core/lib/security/certificate_provider/certificate_provider_factory.h +66 -0
- data/src/core/lib/security/certificate_provider/certificate_provider_registry.cc +60 -0
- data/src/core/lib/security/certificate_provider/certificate_provider_registry.h +70 -0
- data/src/core/lib/security/context/security_context.cc +9 -4
- data/src/core/lib/security/context/security_context.h +33 -4
- data/src/core/lib/security/credentials/alts/alts_credentials.cc +18 -10
- data/src/core/lib/security/credentials/alts/alts_credentials.h +18 -4
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc +1 -3
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc +1 -4
- data/src/core/lib/security/credentials/call_creds_util.cc +97 -0
- data/src/core/lib/security/credentials/call_creds_util.h +43 -0
- data/src/core/lib/security/credentials/channel_creds_registry.h +103 -0
- data/src/core/lib/security/credentials/channel_creds_registry_init.cc +80 -0
- data/src/core/lib/security/credentials/composite/composite_credentials.cc +32 -91
- data/src/core/lib/security/credentials/composite/composite_credentials.h +42 -16
- data/src/core/lib/security/credentials/credentials.cc +6 -11
- data/src/core/lib/security/credentials/credentials.h +106 -99
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +249 -107
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.h +19 -0
- data/src/core/lib/security/credentials/external/aws_request_signer.cc +13 -3
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +137 -103
- data/src/core/lib/security/credentials/external/external_account_credentials.h +16 -9
- data/src/core/lib/security/credentials/external/file_external_account_credentials.cc +29 -27
- data/src/core/lib/security/credentials/external/file_external_account_credentials.h +6 -0
- data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +76 -45
- data/src/core/lib/security/credentials/external/url_external_account_credentials.h +11 -0
- data/src/core/lib/security/credentials/fake/fake_credentials.cc +43 -43
- data/src/core/lib/security/credentials/fake/fake_credentials.h +35 -26
- data/src/core/lib/security/credentials/google_default/credentials_generic.cc +6 -8
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +118 -80
- data/src/core/lib/security/credentials/google_default/google_default_credentials.h +20 -7
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +32 -30
- data/src/core/lib/security/credentials/iam/iam_credentials.h +25 -9
- data/src/core/lib/security/credentials/insecure/insecure_credentials.cc +35 -26
- data/src/core/lib/security/credentials/insecure/insecure_credentials.h +61 -0
- data/src/core/lib/security/credentials/jwt/json_token.cc +21 -12
- data/src/core/lib/security/credentials/jwt/json_token.h +2 -2
- data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +46 -55
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +30 -12
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +96 -61
- data/src/core/lib/security/credentials/jwt/jwt_verifier.h +6 -4
- data/src/core/lib/security/credentials/local/local_credentials.cc +19 -13
- data/src/core/lib/security/credentials/local/local_credentials.h +19 -3
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +214 -222
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +81 -34
- data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +104 -156
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +80 -27
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +31 -35
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +29 -6
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc +21 -29
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h +13 -14
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +75 -58
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +73 -14
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc +241 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h +168 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +37 -92
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +73 -149
- data/src/core/lib/security/credentials/tls/tls_credentials.cc +59 -42
- data/src/core/lib/security/credentials/tls/tls_credentials.h +13 -4
- data/src/core/lib/security/credentials/tls/tls_utils.cc +5 -1
- data/src/core/lib/security/credentials/tls/tls_utils.h +1 -1
- data/src/core/lib/security/credentials/xds/xds_credentials.cc +81 -89
- data/src/core/lib/security/credentials/xds/xds_credentials.h +53 -8
- data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +46 -45
- data/src/core/lib/security/security_connector/alts/alts_security_connector.h +9 -6
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +58 -70
- data/src/core/lib/security/security_connector/fake/fake_security_connector.h +3 -5
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc +23 -24
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +34 -27
- data/src/core/lib/security/security_connector/load_system_roots_fallback.cc +5 -3
- data/src/core/lib/security/security_connector/load_system_roots_supported.cc +175 -0
- data/src/core/lib/security/security_connector/load_system_roots_supported.h +46 -0
- data/src/core/lib/security/security_connector/local/local_security_connector.cc +52 -40
- data/src/core/lib/security/security_connector/local/local_security_connector.h +7 -3
- data/src/core/lib/security/security_connector/security_connector.cc +22 -32
- data/src/core/lib/security/security_connector/security_connector.h +49 -31
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +39 -34
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +4 -2
- data/src/core/lib/security/security_connector/ssl_utils.cc +54 -40
- data/src/core/lib/security/security_connector/ssl_utils.h +23 -24
- data/src/core/lib/security/security_connector/ssl_utils_config.h +1 -1
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +391 -230
- data/src/core/lib/security/security_connector/tls/tls_security_connector.h +97 -54
- data/src/core/lib/security/transport/auth_filters.h +45 -5
- data/src/core/lib/security/transport/client_auth_filter.cc +122 -368
- data/src/core/lib/security/transport/secure_endpoint.cc +282 -158
- data/src/core/lib/security/transport/secure_endpoint.h +5 -4
- data/src/core/lib/security/transport/security_handshaker.cc +123 -92
- data/src/core/lib/security/transport/security_handshaker.h +7 -2
- data/src/core/lib/security/transport/server_auth_filter.cc +87 -58
- data/src/core/lib/security/transport/tsi_error.cc +6 -3
- data/src/core/lib/security/util/json_util.cc +7 -7
- data/src/core/lib/security/util/json_util.h +0 -2
- data/src/core/lib/service_config/service_config.h +89 -0
- data/src/core/lib/service_config/service_config_call_data.h +76 -0
- data/src/core/lib/service_config/service_config_impl.cc +191 -0
- data/src/core/lib/service_config/service_config_impl.h +125 -0
- data/src/core/lib/service_config/service_config_parser.cc +81 -0
- data/src/core/lib/service_config/service_config_parser.h +105 -0
- data/src/core/lib/slice/b64.cc +2 -2
- data/src/core/lib/slice/b64.h +2 -0
- data/src/core/lib/slice/percent_encoding.cc +35 -97
- data/src/core/lib/slice/percent_encoding.h +4 -16
- data/src/core/lib/slice/slice.cc +94 -184
- data/src/core/lib/slice/slice.h +402 -0
- data/src/core/lib/slice/slice_buffer.cc +92 -33
- data/src/core/lib/slice/slice_buffer.h +137 -0
- data/src/core/lib/slice/slice_internal.h +22 -48
- data/src/core/lib/slice/slice_refcount.h +32 -93
- data/src/core/lib/slice/slice_string_helpers.cc +0 -16
- data/src/core/lib/slice/slice_string_helpers.h +1 -8
- data/src/core/lib/surface/builtins.cc +11 -6
- data/src/core/lib/surface/byte_buffer.cc +9 -4
- data/src/core/lib/surface/byte_buffer_reader.cc +7 -7
- data/src/core/lib/surface/call.cc +2324 -1337
- data/src/core/lib/surface/call.h +69 -21
- data/src/core/lib/surface/call_details.cc +6 -6
- data/src/core/lib/surface/call_log_batch.cc +7 -1
- data/src/core/lib/surface/call_test_only.h +4 -1
- data/src/core/lib/surface/call_trace.cc +113 -0
- data/src/core/lib/surface/call_trace.h +30 -0
- data/src/core/lib/surface/channel.cc +230 -328
- data/src/core/lib/surface/channel.h +110 -74
- data/src/core/lib/surface/channel_init.cc +2 -3
- data/src/core/lib/surface/channel_init.h +4 -6
- data/src/core/lib/surface/channel_ping.cc +9 -3
- data/src/core/lib/surface/channel_stack_type.cc +4 -2
- data/src/core/lib/surface/channel_stack_type.h +2 -2
- data/src/core/lib/surface/completion_queue.cc +76 -94
- data/src/core/lib/surface/completion_queue.h +8 -6
- data/src/core/lib/surface/completion_queue_factory.cc +6 -0
- data/src/core/lib/surface/completion_queue_factory.h +1 -3
- data/src/core/lib/surface/event_string.cc +1 -7
- data/src/core/lib/surface/event_string.h +1 -1
- data/src/core/lib/surface/init.cc +87 -78
- data/src/core/lib/surface/init.h +0 -10
- data/src/core/lib/surface/init_internally.cc +24 -0
- data/src/core/lib/surface/init_internally.h +36 -0
- data/src/core/lib/surface/lame_client.cc +69 -107
- data/src/core/lib/surface/lame_client.h +41 -3
- data/src/core/lib/surface/metadata_array.cc +2 -0
- data/src/core/lib/surface/server.cc +153 -206
- data/src/core/lib/surface/server.h +64 -36
- data/src/core/lib/surface/validate_metadata.cc +17 -31
- data/src/core/lib/surface/validate_metadata.h +3 -0
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/bdp_estimator.cc +11 -12
- data/src/core/lib/transport/bdp_estimator.h +4 -5
- data/src/core/lib/transport/connectivity_state.cc +7 -6
- data/src/core/lib/transport/connectivity_state.h +3 -4
- data/src/core/lib/transport/error_utils.cc +45 -65
- data/src/core/lib/transport/error_utils.h +10 -5
- data/src/core/lib/transport/handshaker.cc +225 -0
- data/src/core/lib/transport/handshaker.h +167 -0
- data/src/core/lib/transport/handshaker_factory.h +74 -0
- data/src/core/lib/transport/handshaker_registry.cc +61 -0
- data/src/core/lib/transport/handshaker_registry.h +69 -0
- data/src/core/lib/transport/http_connect_handshaker.cc +400 -0
- data/src/core/lib/transport/http_connect_handshaker.h +42 -0
- data/src/core/lib/transport/metadata_batch.cc +266 -69
- data/src/core/lib/transport/metadata_batch.h +1108 -837
- data/src/core/lib/transport/parsed_metadata.cc +35 -0
- data/src/core/lib/transport/parsed_metadata.h +239 -93
- data/src/core/lib/transport/pid_controller.cc +4 -4
- data/src/core/lib/transport/status_conversion.cc +3 -3
- data/src/core/lib/transport/status_conversion.h +3 -3
- data/src/core/lib/transport/tcp_connect_handshaker.cc +246 -0
- data/src/core/lib/transport/tcp_connect_handshaker.h +39 -0
- data/src/core/lib/transport/timeout_encoding.cc +203 -70
- data/src/core/lib/transport/timeout_encoding.h +44 -10
- data/src/core/lib/transport/transport.cc +82 -58
- data/src/core/lib/transport/transport.h +154 -35
- data/src/core/lib/transport/transport_fwd.h +20 -0
- data/src/core/lib/transport/transport_impl.h +24 -0
- data/src/core/lib/transport/transport_op_string.cc +24 -66
- data/src/core/lib/uri/uri_parser.cc +248 -66
- data/src/core/lib/uri/uri_parser.h +39 -25
- data/src/core/plugin_registry/grpc_plugin_registry.cc +56 -140
- data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +61 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +76 -52
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.h +1 -1
- data/src/core/tsi/alts/handshaker/alts_shared_resource.cc +9 -1
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +43 -28
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h +1 -1
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.cc +4 -3
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.h +1 -1
- data/src/core/tsi/alts/handshaker/transport_security_common_api.cc +2 -2
- data/src/core/tsi/alts/handshaker/transport_security_common_api.h +2 -2
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc +7 -7
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc +7 -6
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc +1 -1
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +14 -6
- data/src/core/tsi/fake_transport_security.cc +69 -34
- data/src/core/tsi/fake_transport_security.h +6 -0
- data/src/core/tsi/local_transport_security.cc +24 -28
- data/src/core/tsi/local_transport_security.h +1 -4
- data/src/core/tsi/ssl/key_logging/ssl_key_logging.cc +145 -0
- data/src/core/tsi/ssl/key_logging/ssl_key_logging.h +81 -0
- data/src/core/tsi/ssl/session_cache/ssl_session.h +3 -3
- data/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc +3 -1
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +13 -6
- data/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc +8 -2
- data/src/core/tsi/ssl_transport_security.cc +249 -68
- data/src/core/tsi/ssl_transport_security.h +47 -8
- data/src/core/tsi/transport_security.cc +18 -6
- data/src/core/tsi/transport_security.h +2 -1
- data/src/core/tsi/transport_security_grpc.cc +3 -2
- data/src/core/tsi/transport_security_grpc.h +5 -2
- data/src/core/tsi/transport_security_interface.h +19 -5
- data/src/ruby/ext/grpc/ext-export-truffleruby.clang +2 -0
- data/src/ruby/ext/grpc/ext-export-truffleruby.gcc +7 -0
- data/src/ruby/ext/grpc/ext-export.clang +1 -0
- data/src/ruby/ext/grpc/ext-export.gcc +1 -0
- data/src/ruby/ext/grpc/extconf.rb +61 -21
- data/src/ruby/ext/grpc/rb_channel.c +5 -2
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +26 -36
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +40 -55
- data/src/ruby/ext/grpc/rb_loader.c +6 -2
- data/src/ruby/ext/grpc/rb_server.c +7 -4
- data/src/ruby/lib/grpc/errors.rb +1 -1
- data/src/ruby/lib/grpc/generic/active_call.rb +7 -1
- data/src/ruby/lib/grpc/grpc.rb +1 -1
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/generate_proto_ruby.sh +1 -0
- data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +4 -0
- data/src/ruby/pb/src/proto/grpc/testing/test_pb.rb +2 -1
- data/src/ruby/pb/test/client.rb +769 -0
- data/src/ruby/pb/test/server.rb +252 -0
- data/src/ruby/pb/test/xds_client.rb +415 -0
- data/src/ruby/spec/channel_spec.rb +5 -43
- data/src/ruby/spec/generic/active_call_spec.rb +12 -3
- data/src/ruby/spec/generic/client_stub_spec.rb +23 -23
- data/src/ruby/spec/generic/server_interceptors_spec.rb +1 -1
- data/src/ruby/spec/user_agent_spec.rb +1 -1
- data/third_party/abseil-cpp/absl/algorithm/container.h +102 -92
- data/third_party/abseil-cpp/absl/base/attributes.h +112 -52
- data/third_party/abseil-cpp/absl/base/casts.h +61 -68
- data/third_party/abseil-cpp/absl/base/config.h +245 -74
- data/third_party/abseil-cpp/absl/base/dynamic_annotations.h +1 -26
- data/third_party/abseil-cpp/absl/base/internal/cycleclock.cc +12 -42
- data/third_party/abseil-cpp/absl/base/internal/cycleclock.h +67 -2
- data/third_party/abseil-cpp/absl/base/internal/direct_mmap.h +3 -3
- data/third_party/abseil-cpp/absl/base/internal/endian.h +17 -62
- data/third_party/abseil-cpp/absl/base/internal/fast_type_id.h +50 -0
- data/third_party/abseil-cpp/absl/base/internal/invoke.h +54 -0
- data/third_party/abseil-cpp/absl/base/internal/prefetch.h +138 -0
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +29 -22
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +13 -12
- data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +3 -0
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +11 -1
- data/third_party/abseil-cpp/absl/base/internal/spinlock_linux.inc +2 -5
- data/third_party/abseil-cpp/absl/base/internal/spinlock_wait.h +2 -0
- data/third_party/abseil-cpp/absl/base/internal/strerror.cc +88 -0
- data/third_party/abseil-cpp/absl/base/internal/strerror.h +39 -0
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +68 -0
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.cc +2 -1
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +4 -4
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +22 -7
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +15 -6
- data/third_party/abseil-cpp/absl/base/log_severity.cc +28 -0
- data/third_party/abseil-cpp/absl/base/log_severity.h +51 -0
- data/third_party/abseil-cpp/absl/base/optimization.h +19 -11
- data/third_party/abseil-cpp/absl/base/options.h +1 -1
- data/third_party/abseil-cpp/absl/base/thread_annotations.h +2 -2
- 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/abseil-cpp/absl/container/fixed_array.h +2 -5
- data/third_party/abseil-cpp/absl/container/flat_hash_map.h +11 -4
- data/third_party/abseil-cpp/absl/container/flat_hash_set.h +510 -0
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +118 -99
- data/third_party/abseil-cpp/absl/container/internal/common.h +6 -5
- data/third_party/abseil-cpp/absl/container/internal/container_memory.h +10 -28
- data/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +17 -15
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +77 -113
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +62 -85
- data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +417 -431
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +3 -2
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +18 -8
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +724 -262
- data/third_party/abseil-cpp/absl/debugging/internal/address_is_readable.cc +45 -88
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +11 -1
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc +16 -11
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h +7 -2
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +8 -3
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc +8 -3
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h +13 -5
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc +110 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +8 -3
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +236 -0
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +33 -10
- data/third_party/abseil-cpp/absl/debugging/internal/symbolize.h +8 -2
- data/third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc +35 -4
- data/third_party/abseil-cpp/absl/debugging/stacktrace.cc +2 -0
- data/third_party/abseil-cpp/absl/debugging/symbolize.cc +7 -0
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +60 -7
- data/third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc +72 -0
- data/third_party/abseil-cpp/absl/functional/any_invocable.h +313 -0
- data/third_party/abseil-cpp/absl/functional/bind_front.h +10 -1
- data/third_party/abseil-cpp/absl/functional/function_ref.h +6 -2
- data/third_party/abseil-cpp/absl/functional/internal/any_invocable.h +857 -0
- data/third_party/abseil-cpp/absl/hash/hash.h +104 -8
- data/third_party/abseil-cpp/absl/hash/internal/hash.cc +15 -16
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +297 -51
- data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc +123 -0
- data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.h +50 -0
- data/third_party/abseil-cpp/absl/memory/memory.h +1 -1
- data/third_party/abseil-cpp/absl/meta/type_traits.h +32 -2
- data/third_party/abseil-cpp/absl/numeric/bits.h +2 -1
- data/third_party/abseil-cpp/absl/numeric/int128.cc +7 -12
- data/third_party/abseil-cpp/absl/numeric/int128.h +148 -75
- data/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc +19 -25
- data/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc +73 -70
- data/third_party/abseil-cpp/absl/profiling/internal/exponential_biased.cc +93 -0
- data/third_party/abseil-cpp/absl/profiling/internal/exponential_biased.h +130 -0
- data/third_party/abseil-cpp/absl/profiling/internal/sample_recorder.h +245 -0
- data/third_party/abseil-cpp/absl/random/bernoulli_distribution.h +200 -0
- data/third_party/abseil-cpp/absl/random/beta_distribution.h +427 -0
- data/third_party/abseil-cpp/absl/random/discrete_distribution.cc +98 -0
- data/third_party/abseil-cpp/absl/random/discrete_distribution.h +247 -0
- data/third_party/abseil-cpp/absl/random/distributions.h +452 -0
- data/third_party/abseil-cpp/absl/random/exponential_distribution.h +165 -0
- data/third_party/abseil-cpp/absl/random/gaussian_distribution.cc +104 -0
- data/third_party/abseil-cpp/absl/random/gaussian_distribution.h +275 -0
- data/third_party/abseil-cpp/absl/random/internal/distribution_caller.h +95 -0
- data/third_party/abseil-cpp/absl/random/internal/fast_uniform_bits.h +269 -0
- data/third_party/abseil-cpp/absl/random/internal/fastmath.h +57 -0
- data/third_party/abseil-cpp/absl/random/internal/generate_real.h +144 -0
- data/third_party/abseil-cpp/absl/random/internal/iostream_state_saver.h +245 -0
- data/third_party/abseil-cpp/absl/random/internal/nonsecure_base.h +161 -0
- data/third_party/abseil-cpp/absl/random/internal/pcg_engine.h +308 -0
- data/third_party/abseil-cpp/absl/random/internal/platform.h +171 -0
- data/third_party/abseil-cpp/absl/random/internal/pool_urbg.cc +253 -0
- data/third_party/abseil-cpp/absl/random/internal/pool_urbg.h +131 -0
- data/third_party/abseil-cpp/absl/random/internal/randen.cc +91 -0
- data/third_party/abseil-cpp/absl/random/internal/randen.h +96 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_detect.cc +225 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_detect.h +33 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_engine.h +264 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_hwaes.cc +526 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_hwaes.h +50 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_round_keys.cc +462 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_slow.cc +471 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_slow.h +40 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_traits.h +88 -0
- data/third_party/abseil-cpp/absl/random/internal/salted_seed_seq.h +165 -0
- data/third_party/abseil-cpp/absl/random/internal/seed_material.cc +267 -0
- data/third_party/abseil-cpp/absl/random/internal/seed_material.h +104 -0
- data/third_party/abseil-cpp/absl/random/internal/traits.h +149 -0
- data/third_party/abseil-cpp/absl/random/internal/uniform_helper.h +244 -0
- data/third_party/abseil-cpp/absl/random/internal/wide_multiply.h +96 -0
- data/third_party/abseil-cpp/absl/random/log_uniform_int_distribution.h +256 -0
- data/third_party/abseil-cpp/absl/random/poisson_distribution.h +261 -0
- data/third_party/abseil-cpp/absl/random/random.h +189 -0
- data/third_party/abseil-cpp/absl/random/seed_gen_exception.cc +46 -0
- data/third_party/abseil-cpp/absl/random/seed_gen_exception.h +55 -0
- data/third_party/abseil-cpp/absl/random/seed_sequences.cc +29 -0
- data/third_party/abseil-cpp/absl/random/seed_sequences.h +111 -0
- data/third_party/abseil-cpp/absl/random/uniform_int_distribution.h +275 -0
- data/third_party/abseil-cpp/absl/random/uniform_real_distribution.h +202 -0
- data/third_party/abseil-cpp/absl/random/zipf_distribution.h +272 -0
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +22 -5
- data/third_party/abseil-cpp/absl/status/status.cc +183 -19
- data/third_party/abseil-cpp/absl/status/status.h +41 -27
- data/third_party/abseil-cpp/absl/status/statusor.cc +34 -2
- data/third_party/abseil-cpp/absl/status/statusor.h +40 -24
- data/third_party/abseil-cpp/absl/strings/ascii.h +4 -4
- data/third_party/abseil-cpp/absl/strings/charconv.cc +3 -3
- data/third_party/abseil-cpp/absl/strings/charconv.h +3 -2
- data/third_party/abseil-cpp/absl/strings/cord.cc +469 -1094
- data/third_party/abseil-cpp/absl/strings/cord.h +392 -144
- data/third_party/abseil-cpp/absl/strings/cord_analysis.cc +188 -0
- data/third_party/abseil-cpp/absl/strings/cord_analysis.h +44 -0
- data/third_party/abseil-cpp/absl/strings/cord_buffer.cc +30 -0
- data/third_party/abseil-cpp/absl/strings/cord_buffer.h +572 -0
- data/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/cord_data_edge.h +63 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.cc +23 -29
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +208 -96
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +1228 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h +924 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.cc +187 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_navigator.h +267 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.cc +69 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree_reader.h +212 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.cc +62 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.h +50 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_crc.cc +54 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_crc.h +102 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h +60 -19
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.cc +48 -172
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.h +42 -24
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring_reader.h +4 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_functions.cc +96 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_functions.h +85 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.cc +139 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.h +131 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +418 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.h +298 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_statistics.h +88 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_update_scope.h +71 -0
- data/third_party/abseil-cpp/absl/strings/internal/cordz_update_tracker.h +123 -0
- data/third_party/abseil-cpp/absl/strings/internal/escaping.cc +6 -5
- data/third_party/abseil-cpp/absl/strings/internal/ostringstream.cc +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/resize_uninitialized.h +48 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +9 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc +3 -4
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +39 -8
- data/third_party/abseil-cpp/absl/strings/internal/str_format/checker.h +7 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +10 -11
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +41 -20
- data/third_party/abseil-cpp/absl/strings/internal/str_format/output.h +2 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc +62 -73
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +28 -18
- data/third_party/abseil-cpp/absl/strings/internal/str_join_internal.h +9 -6
- data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +35 -35
- data/third_party/abseil-cpp/absl/strings/internal/string_constant.h +10 -2
- data/third_party/abseil-cpp/absl/strings/internal/utf8.cc +9 -9
- data/third_party/abseil-cpp/absl/strings/numbers.cc +9 -9
- data/third_party/abseil-cpp/absl/strings/numbers.h +60 -23
- data/third_party/abseil-cpp/absl/strings/str_cat.cc +4 -4
- data/third_party/abseil-cpp/absl/strings/str_cat.h +20 -13
- data/third_party/abseil-cpp/absl/strings/str_format.h +1 -2
- data/third_party/abseil-cpp/absl/strings/str_join.h +9 -15
- data/third_party/abseil-cpp/absl/strings/str_split.h +1 -2
- data/third_party/abseil-cpp/absl/strings/string_view.cc +18 -34
- data/third_party/abseil-cpp/absl/strings/string_view.h +123 -41
- data/third_party/abseil-cpp/absl/strings/strip.h +8 -6
- data/third_party/abseil-cpp/absl/strings/substitute.cc +2 -1
- data/third_party/abseil-cpp/absl/strings/substitute.h +109 -76
- data/third_party/abseil-cpp/absl/synchronization/blocking_counter.cc +25 -15
- data/third_party/abseil-cpp/absl/synchronization/blocking_counter.h +5 -3
- data/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.cc +9 -6
- data/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.h +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.h +1 -6
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc +1 -26
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.h +10 -4
- data/third_party/abseil-cpp/absl/synchronization/mutex.cc +75 -40
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +20 -12
- data/third_party/abseil-cpp/absl/synchronization/notification.h +3 -2
- data/third_party/abseil-cpp/absl/time/civil_time.cc +1 -3
- data/third_party/abseil-cpp/absl/time/duration.cc +5 -4
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/civil_time_detail.h +11 -7
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h +93 -20
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.h +2 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc +83 -21
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +49 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc +2 -3
- data/third_party/abseil-cpp/absl/time/time.h +82 -47
- data/third_party/abseil-cpp/absl/types/bad_optional_access.h +1 -1
- data/third_party/abseil-cpp/absl/types/bad_variant_access.h +2 -2
- data/third_party/abseil-cpp/absl/types/internal/optional.h +8 -0
- data/third_party/abseil-cpp/absl/types/internal/variant.h +3 -3
- data/third_party/abseil-cpp/absl/types/optional.h +17 -14
- data/third_party/abseil-cpp/absl/types/span.h +5 -4
- data/third_party/boringssl-with-bazel/err_data.c +681 -677
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_bitstr.c +19 -11
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_object.c +41 -30
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_time.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn1_lib.c +59 -47
- data/third_party/boringssl-with-bazel/src/crypto/asn1/asn_pack.c +24 -28
- data/third_party/boringssl-with-bazel/src/crypto/asn1/f_int.c +5 -0
- data/third_party/boringssl-with-bazel/src/crypto/asn1/internal.h +28 -0
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_dec.c +48 -272
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_typ.c +8 -6
- data/third_party/boringssl-with-bazel/src/crypto/base64/base64.c +13 -0
- data/third_party/boringssl-with-bazel/src/crypto/bytestring/ber.c +3 -1
- data/third_party/boringssl-with-bazel/src/crypto/dsa/dsa.c +21 -0
- data/third_party/boringssl-with-bazel/src/crypto/evp/evp_asn1.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/cipher/cipher.c +12 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/ecdsa.c +1 -2
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +7 -7
- data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/mem.c +18 -0
- data/third_party/boringssl-with-bazel/src/crypto/pkcs7/pkcs7.c +29 -0
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/internal.h +0 -1
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/pkcs8/pkcs8_x509.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/pool/internal.h +5 -1
- data/third_party/boringssl-with-bazel/src/crypto/pool/pool.c +59 -23
- data/third_party/boringssl-with-bazel/src/crypto/x509/asn1_gen.c +2 -18
- data/third_party/boringssl-with-bazel/src/crypto/x509/internal.h +8 -2
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/internal.h +216 -11
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_cache.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_data.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_lib.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_map.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_node.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_tree.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_alt.c +1 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_cpols.c +0 -1
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_lib.c +21 -4
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1.h +971 -253
- data/third_party/boringssl-with-bazel/src/include/openssl/asn1t.h +3 -3
- data/third_party/boringssl-with-bazel/src/include/openssl/base.h +0 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/base64.h +8 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/cipher.h +13 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/dh.h +4 -12
- data/third_party/boringssl-with-bazel/src/include/openssl/dsa.h +27 -41
- data/third_party/boringssl-with-bazel/src/include/openssl/ec_key.h +12 -27
- data/third_party/boringssl-with-bazel/src/include/openssl/ecdsa.h +8 -10
- data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +29 -55
- data/third_party/boringssl-with-bazel/src/include/openssl/hpke.h +1 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/pkcs7.h +12 -13
- data/third_party/boringssl-with-bazel/src/include/openssl/pkcs8.h +6 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/pool.h +7 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/rsa.h +24 -28
- data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +29 -11
- data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +12 -43
- data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +4 -3
- data/third_party/boringssl-with-bazel/src/ssl/internal.h +3 -3
- data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +4 -0
- data/third_party/boringssl-with-bazel/src/ssl/ssl_versions.cc +4 -0
- data/third_party/cares/cares/include/ares.h +742 -0
- data/third_party/cares/cares/include/ares_dns.h +112 -0
- data/third_party/cares/cares/{ares_rules.h → include/ares_rules.h} +0 -0
- data/third_party/cares/cares/include/ares_version.h +24 -0
- data/third_party/cares/cares/src/lib/ares__close_sockets.c +61 -0
- data/third_party/cares/cares/src/lib/ares__get_hostent.c +260 -0
- data/third_party/cares/cares/src/lib/ares__parse_into_addrinfo.c +260 -0
- data/third_party/cares/cares/{ares__read_line.c → src/lib/ares__read_line.c} +0 -0
- data/third_party/cares/cares/src/lib/ares__readaddrinfo.c +264 -0
- data/third_party/cares/cares/src/lib/ares__sortaddrinfo.c +499 -0
- data/third_party/cares/cares/{ares__timeval.c → src/lib/ares__timeval.c} +0 -0
- data/third_party/cares/cares/src/lib/ares_android.c +444 -0
- data/third_party/cares/cares/src/lib/ares_android.h +27 -0
- data/third_party/cares/cares/{ares_cancel.c → src/lib/ares_cancel.c} +0 -0
- data/third_party/cares/cares/src/lib/ares_create_query.c +197 -0
- data/third_party/cares/cares/src/lib/ares_data.c +240 -0
- data/third_party/cares/cares/src/lib/ares_data.h +74 -0
- data/third_party/cares/cares/{ares_destroy.c → src/lib/ares_destroy.c} +0 -0
- data/third_party/cares/cares/src/lib/ares_expand_name.c +300 -0
- data/third_party/cares/cares/src/lib/ares_expand_string.c +67 -0
- data/third_party/cares/cares/{ares_fds.c → src/lib/ares_fds.c} +0 -0
- data/third_party/cares/cares/src/lib/ares_free_hostent.c +43 -0
- data/third_party/cares/cares/{ares_free_string.c → src/lib/ares_free_string.c} +0 -0
- data/third_party/cares/cares/src/lib/ares_freeaddrinfo.c +59 -0
- data/third_party/cares/cares/src/lib/ares_getaddrinfo.c +772 -0
- data/third_party/cares/cares/src/lib/ares_getenv.c +28 -0
- data/third_party/cares/cares/{ares_getenv.h → src/lib/ares_getenv.h} +0 -0
- data/third_party/cares/cares/src/lib/ares_gethostbyaddr.c +287 -0
- data/third_party/cares/cares/src/lib/ares_gethostbyname.c +534 -0
- data/third_party/cares/cares/src/lib/ares_getnameinfo.c +447 -0
- data/third_party/cares/cares/{ares_getsock.c → src/lib/ares_getsock.c} +0 -0
- data/third_party/cares/cares/{ares_inet_net_pton.h → src/lib/ares_inet_net_pton.h} +0 -0
- data/third_party/cares/cares/src/lib/ares_init.c +2654 -0
- data/third_party/cares/cares/{ares_iphlpapi.h → src/lib/ares_iphlpapi.h} +0 -0
- data/third_party/cares/cares/src/lib/ares_ipv6.h +85 -0
- data/third_party/cares/cares/src/lib/ares_library_init.c +200 -0
- data/third_party/cares/cares/src/lib/ares_library_init.h +43 -0
- data/third_party/cares/cares/{ares_llist.c → src/lib/ares_llist.c} +0 -0
- data/third_party/cares/cares/{ares_llist.h → src/lib/ares_llist.h} +0 -0
- data/third_party/cares/cares/{ares_mkquery.c → src/lib/ares_mkquery.c} +0 -0
- data/third_party/cares/cares/src/lib/ares_nameser.h +482 -0
- data/third_party/cares/cares/{ares_nowarn.c → src/lib/ares_nowarn.c} +0 -0
- data/third_party/cares/cares/{ares_nowarn.h → src/lib/ares_nowarn.h} +0 -0
- data/third_party/cares/cares/{ares_options.c → src/lib/ares_options.c} +0 -0
- data/third_party/cares/cares/src/lib/ares_parse_a_reply.c +209 -0
- data/third_party/cares/cares/src/lib/ares_parse_aaaa_reply.c +212 -0
- data/third_party/cares/cares/src/lib/ares_parse_caa_reply.c +199 -0
- data/third_party/cares/cares/src/lib/ares_parse_mx_reply.c +164 -0
- data/third_party/cares/cares/src/lib/ares_parse_naptr_reply.c +183 -0
- data/third_party/cares/cares/src/lib/ares_parse_ns_reply.c +177 -0
- data/third_party/cares/cares/src/lib/ares_parse_ptr_reply.c +228 -0
- data/third_party/cares/cares/src/lib/ares_parse_soa_reply.c +179 -0
- data/third_party/cares/cares/src/lib/ares_parse_srv_reply.c +168 -0
- data/third_party/cares/cares/src/lib/ares_parse_txt_reply.c +214 -0
- data/third_party/cares/cares/{ares_platform.c → src/lib/ares_platform.c} +0 -0
- data/third_party/cares/cares/{ares_platform.h → src/lib/ares_platform.h} +0 -0
- data/third_party/cares/cares/src/lib/ares_private.h +423 -0
- data/third_party/cares/cares/src/lib/ares_process.c +1548 -0
- data/third_party/cares/cares/src/lib/ares_query.c +180 -0
- data/third_party/cares/cares/src/lib/ares_search.c +321 -0
- data/third_party/cares/cares/src/lib/ares_send.c +131 -0
- data/third_party/cares/cares/src/lib/ares_setup.h +220 -0
- data/third_party/cares/cares/{ares_strcasecmp.c → src/lib/ares_strcasecmp.c} +0 -0
- data/third_party/cares/cares/{ares_strcasecmp.h → src/lib/ares_strcasecmp.h} +0 -0
- data/third_party/cares/cares/{ares_strdup.c → src/lib/ares_strdup.c} +0 -0
- data/third_party/cares/cares/{ares_strdup.h → src/lib/ares_strdup.h} +0 -0
- data/third_party/cares/cares/{ares_strerror.c → src/lib/ares_strerror.c} +0 -0
- data/third_party/cares/cares/src/lib/ares_strsplit.c +178 -0
- data/third_party/cares/cares/{ares_strsplit.h → src/lib/ares_strsplit.h} +0 -0
- data/third_party/cares/cares/{ares_timeout.c → src/lib/ares_timeout.c} +0 -0
- data/third_party/cares/cares/{ares_version.c → src/lib/ares_version.c} +0 -0
- data/third_party/cares/cares/{ares_writev.c → src/lib/ares_writev.c} +0 -0
- data/third_party/cares/cares/src/lib/ares_writev.h +36 -0
- data/third_party/cares/cares/{bitncmp.c → src/lib/bitncmp.c} +0 -0
- data/third_party/cares/cares/{bitncmp.h → src/lib/bitncmp.h} +0 -0
- data/third_party/cares/cares/src/lib/config-dos.h +115 -0
- data/third_party/cares/cares/{config-win32.h → src/lib/config-win32.h} +0 -0
- data/third_party/cares/cares/src/lib/inet_net_pton.c +444 -0
- data/third_party/cares/cares/src/lib/inet_ntop.c +201 -0
- data/third_party/cares/cares/{setup_once.h → src/lib/setup_once.h} +0 -0
- data/third_party/cares/cares/{windows_port.c → src/lib/windows_port.c} +0 -0
- data/third_party/upb/third_party/utf8_range/naive.c +92 -0
- data/third_party/upb/third_party/utf8_range/range2-neon.c +157 -0
- data/third_party/upb/third_party/utf8_range/range2-sse.c +170 -0
- data/third_party/upb/third_party/utf8_range/utf8_range.h +9 -0
- data/third_party/upb/upb/arena.c +277 -0
- data/third_party/upb/upb/arena.h +225 -0
- data/third_party/upb/upb/array.c +114 -0
- data/third_party/upb/upb/array.h +83 -0
- data/third_party/upb/upb/collections.h +36 -0
- data/third_party/upb/upb/decode.c +832 -382
- data/third_party/upb/upb/decode.h +44 -17
- data/third_party/upb/upb/decode_fast.c +304 -302
- data/third_party/upb/upb/decode_fast.h +18 -18
- data/third_party/upb/upb/def.c +2083 -982
- data/third_party/upb/upb/def.h +339 -260
- data/third_party/upb/upb/def.hpp +144 -171
- data/third_party/upb/upb/encode.c +287 -185
- data/third_party/upb/upb/encode.h +24 -16
- data/third_party/upb/upb/extension_registry.c +93 -0
- data/third_party/upb/upb/extension_registry.h +84 -0
- data/third_party/upb/upb/internal/decode.h +211 -0
- data/third_party/upb/upb/internal/table.h +385 -0
- data/third_party/upb/upb/internal/upb.h +68 -0
- data/third_party/upb/upb/internal/vsnprintf_compat.h +52 -0
- data/third_party/upb/upb/json_decode.c +1512 -0
- data/third_party/upb/upb/json_decode.h +47 -0
- data/third_party/upb/upb/json_encode.c +780 -0
- data/third_party/upb/upb/json_encode.h +65 -0
- data/third_party/upb/upb/map.c +108 -0
- data/third_party/upb/upb/map.h +117 -0
- data/third_party/upb/upb/message_value.h +66 -0
- data/third_party/upb/upb/mini_table.c +1147 -0
- data/third_party/upb/upb/mini_table.h +189 -0
- data/third_party/upb/upb/mini_table.hpp +112 -0
- data/third_party/upb/upb/msg.c +132 -161
- data/third_party/upb/upb/msg.h +18 -55
- data/third_party/upb/upb/msg_internal.h +404 -254
- data/third_party/upb/upb/port_def.inc +10 -1
- data/third_party/upb/upb/port_undef.inc +2 -0
- data/third_party/upb/upb/reflection.c +203 -280
- data/third_party/upb/upb/reflection.h +40 -126
- data/third_party/upb/upb/reflection.hpp +6 -6
- data/third_party/upb/upb/status.c +86 -0
- data/third_party/upb/upb/status.h +66 -0
- data/third_party/upb/upb/table.c +233 -149
- data/third_party/upb/upb/table_internal.h +9 -324
- data/third_party/upb/upb/text_encode.c +116 -92
- data/third_party/upb/upb/text_encode.h +10 -10
- data/third_party/upb/upb/upb.c +34 -273
- data/third_party/upb/upb/upb.h +79 -262
- data/third_party/upb/upb/upb.hpp +31 -28
- data/third_party/xxhash/xxhash.h +607 -352
- data/third_party/zlib/compress.c +3 -3
- data/third_party/zlib/crc32.c +975 -292
- data/third_party/zlib/crc32.h +9441 -436
- data/third_party/zlib/deflate.c +183 -129
- data/third_party/zlib/deflate.h +12 -15
- data/third_party/zlib/gzguts.h +3 -2
- data/third_party/zlib/gzlib.c +6 -4
- data/third_party/zlib/gzread.c +8 -12
- data/third_party/zlib/gzwrite.c +26 -14
- data/third_party/zlib/infback.c +12 -8
- data/third_party/zlib/inffast.c +14 -14
- data/third_party/zlib/inflate.c +44 -10
- data/third_party/zlib/inflate.h +3 -2
- data/third_party/zlib/inftrees.c +3 -3
- data/third_party/zlib/inftrees.h +1 -1
- data/third_party/zlib/trees.c +85 -107
- data/third_party/zlib/uncompr.c +2 -2
- data/third_party/zlib/zconf.h +16 -3
- data/third_party/zlib/zlib.h +129 -106
- data/third_party/zlib/zutil.c +11 -9
- data/third_party/zlib/zutil.h +13 -9
- metadata +713 -295
- data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +0 -392
- data/src/core/ext/filters/client_channel/http_connect_handshaker.h +0 -42
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h +0 -44
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +0 -83
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds.h +0 -60
- data/src/core/ext/filters/client_channel/lb_policy.cc +0 -131
- data/src/core/ext/filters/client_channel/lb_policy.h +0 -425
- data/src/core/ext/filters/client_channel/lb_policy_factory.h +0 -48
- data/src/core/ext/filters/client_channel/lb_policy_registry.cc +0 -185
- data/src/core/ext/filters/client_channel/lb_policy_registry.h +0 -65
- data/src/core/ext/filters/client_channel/proxy_mapper.h +0 -54
- data/src/core/ext/filters/client_channel/proxy_mapper_registry.cc +0 -89
- data/src/core/ext/filters/client_channel/proxy_mapper_registry.h +0 -50
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc +0 -31
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc +0 -28
- data/src/core/ext/filters/client_channel/resolver.cc +0 -87
- data/src/core/ext/filters/client_channel/resolver.h +0 -136
- data/src/core/ext/filters/client_channel/resolver_factory.h +0 -75
- data/src/core/ext/filters/client_channel/resolver_registry.cc +0 -195
- data/src/core/ext/filters/client_channel/resolver_registry.h +0 -89
- data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +0 -189
- data/src/core/ext/filters/client_channel/resolver_result_parsing.h +0 -99
- data/src/core/ext/filters/client_channel/server_address.cc +0 -170
- data/src/core/ext/filters/client_channel/server_address.h +0 -144
- data/src/core/ext/filters/client_channel/subchannel_interface.h +0 -130
- data/src/core/ext/filters/client_idle/client_idle_filter.cc +0 -264
- data/src/core/ext/filters/client_idle/idle_filter_state.cc +0 -96
- data/src/core/ext/filters/client_idle/idle_filter_state.h +0 -66
- data/src/core/ext/filters/fault_injection/service_config_parser.cc +0 -181
- data/src/core/ext/filters/fault_injection/service_config_parser.h +0 -85
- data/src/core/ext/filters/max_age/max_age_filter.cc +0 -560
- data/src/core/ext/filters/max_age/max_age_filter.h +0 -26
- data/src/core/ext/service_config/service_config.cc +0 -227
- data/src/core/ext/service_config/service_config.h +0 -127
- data/src/core/ext/service_config/service_config_call_data.h +0 -72
- data/src/core/ext/service_config/service_config_parser.cc +0 -89
- data/src/core/ext/service_config/service_config_parser.h +0 -97
- data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +0 -119
- data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc +0 -95
- data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +0 -189
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +0 -53
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +0 -83
- data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +0 -125
- data/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc +0 -37
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_index.h +0 -107
- data/src/core/ext/transport/chttp2/transport/hpack_utils.cc +0 -46
- data/src/core/ext/transport/chttp2/transport/hpack_utils.h +0 -30
- data/src/core/ext/transport/chttp2/transport/popularity_count.h +0 -60
- data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c +0 -27
- data/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h +0 -62
- data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c +0 -27
- data/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h +0 -62
- data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c +0 -27
- data/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h +0 -62
- data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c +0 -27
- data/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h +0 -62
- data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c +0 -27
- data/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h +0 -62
- data/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c +0 -72
- data/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.h +0 -35
- data/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c +0 -73
- data/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.h +0 -35
- data/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c +0 -72
- data/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.h +0 -35
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c +0 -80
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.h +0 -35
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c +0 -74
- data/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h +0 -35
- data/src/core/ext/xds/certificate_provider_factory.h +0 -61
- data/src/core/ext/xds/certificate_provider_registry.cc +0 -103
- data/src/core/ext/xds/certificate_provider_registry.h +0 -57
- data/src/core/lib/avl/avl.cc +0 -306
- data/src/core/lib/channel/handshaker.cc +0 -222
- data/src/core/lib/channel/handshaker.h +0 -161
- data/src/core/lib/channel/handshaker_factory.h +0 -50
- data/src/core/lib/channel/handshaker_registry.cc +0 -50
- data/src/core/lib/channel/handshaker_registry.h +0 -71
- data/src/core/lib/compression/algorithm_metadata.h +0 -62
- data/src/core/lib/compression/compression_args.cc +0 -138
- data/src/core/lib/compression/compression_args.h +0 -56
- data/src/core/lib/compression/stream_compression.cc +0 -81
- data/src/core/lib/compression/stream_compression.h +0 -117
- data/src/core/lib/compression/stream_compression_gzip.cc +0 -231
- data/src/core/lib/compression/stream_compression_gzip.h +0 -28
- data/src/core/lib/compression/stream_compression_identity.cc +0 -91
- data/src/core/lib/compression/stream_compression_identity.h +0 -29
- data/src/core/lib/event_engine/endpoint_config.cc +0 -45
- data/src/core/lib/event_engine/endpoint_config_internal.h +0 -42
- data/src/core/lib/event_engine/event_engine.cc +0 -50
- data/src/core/lib/event_engine/sockaddr.cc +0 -40
- data/src/core/lib/event_engine/sockaddr.h +0 -44
- data/src/core/lib/gpr/env.h +0 -40
- data/src/core/lib/gpr/env_linux.cc +0 -75
- data/src/core/lib/gpr/env_posix.cc +0 -46
- data/src/core/lib/gpr/env_windows.cc +0 -74
- 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/string_windows.h +0 -32
- data/src/core/lib/gpr/tls.h +0 -151
- data/src/core/lib/gprpp/arena.cc +0 -104
- data/src/core/lib/gprpp/arena.h +0 -131
- data/src/core/lib/iomgr/endpoint_pair_event_engine.cc +0 -32
- data/src/core/lib/iomgr/error_internal.h +0 -66
- data/src/core/lib/iomgr/ev_epollex_linux.cc +0 -1654
- data/src/core/lib/iomgr/ev_epollex_linux.h +0 -30
- data/src/core/lib/iomgr/event_engine/closure.cc +0 -77
- data/src/core/lib/iomgr/event_engine/closure.h +0 -42
- data/src/core/lib/iomgr/event_engine/endpoint.cc +0 -173
- data/src/core/lib/iomgr/event_engine/endpoint.h +0 -52
- data/src/core/lib/iomgr/event_engine/iomgr.cc +0 -104
- data/src/core/lib/iomgr/event_engine/iomgr.h +0 -42
- data/src/core/lib/iomgr/event_engine/pollset.cc +0 -88
- data/src/core/lib/iomgr/event_engine/pollset.h +0 -25
- data/src/core/lib/iomgr/event_engine/promise.h +0 -51
- data/src/core/lib/iomgr/event_engine/resolved_address_internal.cc +0 -41
- data/src/core/lib/iomgr/event_engine/resolved_address_internal.h +0 -35
- data/src/core/lib/iomgr/event_engine/resolver.cc +0 -114
- data/src/core/lib/iomgr/event_engine/tcp.cc +0 -293
- data/src/core/lib/iomgr/event_engine/timer.cc +0 -62
- data/src/core/lib/iomgr/executor/mpmcqueue.cc +0 -182
- data/src/core/lib/iomgr/executor/mpmcqueue.h +0 -171
- data/src/core/lib/iomgr/executor/threadpool.cc +0 -136
- data/src/core/lib/iomgr/executor/threadpool.h +0 -150
- data/src/core/lib/iomgr/iomgr_custom.cc +0 -79
- data/src/core/lib/iomgr/iomgr_custom.h +0 -49
- data/src/core/lib/iomgr/is_epollexclusive_available.cc +0 -119
- data/src/core/lib/iomgr/is_epollexclusive_available.h +0 -36
- data/src/core/lib/iomgr/pollset_custom.cc +0 -105
- data/src/core/lib/iomgr/pollset_custom.h +0 -37
- data/src/core/lib/iomgr/pollset_set_custom.cc +0 -47
- data/src/core/lib/iomgr/pollset_set_custom.h +0 -26
- data/src/core/lib/iomgr/resolve_address_custom.cc +0 -169
- data/src/core/lib/iomgr/resolve_address_custom.h +0 -44
- data/src/core/lib/iomgr/resource_quota.cc +0 -1106
- data/src/core/lib/iomgr/resource_quota.h +0 -226
- data/src/core/lib/iomgr/sys_epoll_wrapper.h +0 -30
- data/src/core/lib/iomgr/tcp_client_custom.cc +0 -152
- data/src/core/lib/iomgr/tcp_custom.cc +0 -377
- data/src/core/lib/iomgr/tcp_custom.h +0 -86
- data/src/core/lib/iomgr/tcp_server_custom.cc +0 -467
- data/src/core/lib/iomgr/time_averaged_stats.cc +0 -64
- data/src/core/lib/iomgr/time_averaged_stats.h +0 -72
- data/src/core/lib/iomgr/timer_custom.cc +0 -96
- data/src/core/lib/iomgr/timer_custom.h +0 -43
- data/src/core/lib/iomgr/work_serializer.cc +0 -155
- data/src/core/lib/iomgr/work_serializer.h +0 -81
- data/src/core/lib/profiling/basic_timers.cc +0 -295
- data/src/core/lib/profiling/stap_timers.cc +0 -50
- data/src/core/lib/profiling/timers.h +0 -94
- data/src/core/lib/security/authorization/sdk_server_authz_filter.cc +0 -171
- data/src/core/lib/security/authorization/sdk_server_authz_filter.h +0 -67
- data/src/core/lib/security/credentials/credentials_metadata.cc +0 -61
- data/src/core/lib/security/security_connector/load_system_roots_linux.cc +0 -171
- data/src/core/lib/security/security_connector/load_system_roots_linux.h +0 -46
- data/src/core/lib/slice/slice_api.cc +0 -39
- data/src/core/lib/slice/slice_intern.cc +0 -367
- data/src/core/lib/slice/slice_refcount.cc +0 -17
- data/src/core/lib/slice/slice_refcount_base.h +0 -173
- data/src/core/lib/slice/slice_split.cc +0 -100
- data/src/core/lib/slice/slice_split.h +0 -40
- data/src/core/lib/slice/slice_utils.h +0 -200
- data/src/core/lib/slice/static_slice.cc +0 -529
- data/src/core/lib/slice/static_slice.h +0 -331
- data/src/core/lib/surface/init_secure.cc +0 -103
- data/src/core/lib/transport/byte_stream.cc +0 -158
- data/src/core/lib/transport/byte_stream.h +0 -166
- data/src/core/lib/transport/metadata.cc +0 -714
- data/src/core/lib/transport/metadata.h +0 -449
- data/src/core/lib/transport/static_metadata.cc +0 -1117
- data/src/core/lib/transport/static_metadata.h +0 -340
- data/src/core/lib/transport/status_metadata.cc +0 -63
- data/src/core/lib/transport/status_metadata.h +0 -48
- data/third_party/abseil-cpp/absl/base/internal/exponential_biased.cc +0 -93
- data/third_party/abseil-cpp/absl/base/internal/exponential_biased.h +0 -130
- data/third_party/abseil-cpp/absl/container/internal/have_sse.h +0 -50
- data/third_party/abseil-cpp/absl/hash/internal/wyhash.cc +0 -111
- data/third_party/abseil-cpp/absl/hash/internal/wyhash.h +0 -48
- data/third_party/boringssl-with-bazel/src/crypto/asn1/f_enum.c +0 -93
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/pcy_int.h +0 -217
- data/third_party/cares/cares/ares.h +0 -670
- data/third_party/cares/cares/ares__close_sockets.c +0 -61
- data/third_party/cares/cares/ares__get_hostent.c +0 -261
- data/third_party/cares/cares/ares_create_query.c +0 -206
- data/third_party/cares/cares/ares_data.c +0 -222
- data/third_party/cares/cares/ares_data.h +0 -72
- data/third_party/cares/cares/ares_dns.h +0 -103
- data/third_party/cares/cares/ares_expand_name.c +0 -209
- data/third_party/cares/cares/ares_expand_string.c +0 -70
- data/third_party/cares/cares/ares_free_hostent.c +0 -41
- data/third_party/cares/cares/ares_getenv.c +0 -30
- data/third_party/cares/cares/ares_gethostbyaddr.c +0 -294
- data/third_party/cares/cares/ares_gethostbyname.c +0 -529
- data/third_party/cares/cares/ares_getnameinfo.c +0 -453
- data/third_party/cares/cares/ares_getopt.c +0 -122
- data/third_party/cares/cares/ares_getopt.h +0 -53
- data/third_party/cares/cares/ares_init.c +0 -2615
- data/third_party/cares/cares/ares_ipv6.h +0 -78
- data/third_party/cares/cares/ares_library_init.c +0 -195
- data/third_party/cares/cares/ares_library_init.h +0 -43
- data/third_party/cares/cares/ares_parse_a_reply.c +0 -264
- data/third_party/cares/cares/ares_parse_aaaa_reply.c +0 -264
- data/third_party/cares/cares/ares_parse_mx_reply.c +0 -170
- data/third_party/cares/cares/ares_parse_naptr_reply.c +0 -194
- data/third_party/cares/cares/ares_parse_ns_reply.c +0 -183
- data/third_party/cares/cares/ares_parse_ptr_reply.c +0 -221
- data/third_party/cares/cares/ares_parse_soa_reply.c +0 -133
- data/third_party/cares/cares/ares_parse_srv_reply.c +0 -179
- data/third_party/cares/cares/ares_parse_txt_reply.c +0 -220
- data/third_party/cares/cares/ares_private.h +0 -382
- data/third_party/cares/cares/ares_process.c +0 -1473
- data/third_party/cares/cares/ares_query.c +0 -186
- data/third_party/cares/cares/ares_search.c +0 -323
- data/third_party/cares/cares/ares_send.c +0 -137
- data/third_party/cares/cares/ares_setup.h +0 -217
- data/third_party/cares/cares/ares_strsplit.c +0 -174
- data/third_party/cares/cares/ares_version.h +0 -24
- data/third_party/cares/cares/inet_net_pton.c +0 -450
- data/third_party/cares/cares/inet_ntop.c +0 -207
- data/third_party/upb/upb/decode_internal.h +0 -193
- data/third_party/upb/upb/upb_internal.h +0 -58
@@ -20,42 +20,76 @@
|
|
20
20
|
|
21
21
|
#include <inttypes.h>
|
22
22
|
#include <limits.h>
|
23
|
-
#include <math.h>
|
24
23
|
#include <stdio.h>
|
24
|
+
#include <stdlib.h>
|
25
25
|
#include <string.h>
|
26
26
|
|
27
|
+
#include <algorithm>
|
28
|
+
#include <memory>
|
29
|
+
#include <new>
|
30
|
+
#include <string>
|
31
|
+
#include <utility>
|
32
|
+
|
33
|
+
#include "absl/base/attributes.h"
|
34
|
+
#include "absl/status/status.h"
|
35
|
+
#include "absl/strings/cord.h"
|
36
|
+
#include "absl/strings/str_cat.h"
|
27
37
|
#include "absl/strings/str_format.h"
|
38
|
+
#include "absl/strings/string_view.h"
|
39
|
+
#include "absl/types/optional.h"
|
40
|
+
#include "absl/types/variant.h"
|
28
41
|
|
42
|
+
#include <grpc/impl/codegen/connectivity_state.h>
|
43
|
+
#include <grpc/impl/codegen/grpc_types.h>
|
29
44
|
#include <grpc/slice_buffer.h>
|
45
|
+
#include <grpc/status.h>
|
30
46
|
#include <grpc/support/alloc.h>
|
47
|
+
#include <grpc/support/atm.h>
|
31
48
|
#include <grpc/support/log.h>
|
32
|
-
#include <grpc/support/string_util.h>
|
33
49
|
|
34
50
|
#include "src/core/ext/transport/chttp2/transport/context_list.h"
|
51
|
+
#include "src/core/ext/transport/chttp2/transport/flow_control.h"
|
52
|
+
#include "src/core/ext/transport/chttp2/transport/frame.h"
|
35
53
|
#include "src/core/ext/transport/chttp2/transport/frame_data.h"
|
54
|
+
#include "src/core/ext/transport/chttp2/transport/frame_goaway.h"
|
55
|
+
#include "src/core/ext/transport/chttp2/transport/frame_rst_stream.h"
|
56
|
+
#include "src/core/ext/transport/chttp2/transport/hpack_encoder.h"
|
57
|
+
#include "src/core/ext/transport/chttp2/transport/http2_settings.h"
|
36
58
|
#include "src/core/ext/transport/chttp2/transport/internal.h"
|
59
|
+
#include "src/core/ext/transport/chttp2/transport/stream_map.h"
|
37
60
|
#include "src/core/ext/transport/chttp2/transport/varint.h"
|
38
61
|
#include "src/core/lib/channel/channel_args.h"
|
39
|
-
#include "src/core/lib/compression/stream_compression.h"
|
40
62
|
#include "src/core/lib/debug/stats.h"
|
41
|
-
#include "src/core/lib/
|
42
|
-
#include "src/core/lib/
|
43
|
-
#include "src/core/lib/
|
63
|
+
#include "src/core/lib/debug/stats_data.h"
|
64
|
+
#include "src/core/lib/experiments/experiments.h"
|
65
|
+
#include "src/core/lib/gpr/useful.h"
|
66
|
+
#include "src/core/lib/gprpp/bitset.h"
|
67
|
+
#include "src/core/lib/gprpp/debug_location.h"
|
68
|
+
#include "src/core/lib/gprpp/ref_counted.h"
|
69
|
+
#include "src/core/lib/gprpp/status_helper.h"
|
70
|
+
#include "src/core/lib/gprpp/time.h"
|
44
71
|
#include "src/core/lib/http/parser.h"
|
45
|
-
#include "src/core/lib/iomgr/
|
46
|
-
#include "src/core/lib/iomgr/
|
72
|
+
#include "src/core/lib/iomgr/combiner.h"
|
73
|
+
#include "src/core/lib/iomgr/error.h"
|
74
|
+
#include "src/core/lib/iomgr/exec_ctx.h"
|
75
|
+
#include "src/core/lib/iomgr/iomgr_fwd.h"
|
47
76
|
#include "src/core/lib/iomgr/timer.h"
|
48
|
-
#include "src/core/lib/
|
77
|
+
#include "src/core/lib/promise/poll.h"
|
78
|
+
#include "src/core/lib/resource_quota/arena.h"
|
79
|
+
#include "src/core/lib/resource_quota/memory_quota.h"
|
80
|
+
#include "src/core/lib/resource_quota/resource_quota.h"
|
81
|
+
#include "src/core/lib/resource_quota/trace.h"
|
82
|
+
#include "src/core/lib/slice/slice.h"
|
83
|
+
#include "src/core/lib/slice/slice_buffer.h"
|
49
84
|
#include "src/core/lib/slice/slice_internal.h"
|
50
|
-
#include "src/core/lib/
|
85
|
+
#include "src/core/lib/transport/bdp_estimator.h"
|
86
|
+
#include "src/core/lib/transport/connectivity_state.h"
|
51
87
|
#include "src/core/lib/transport/error_utils.h"
|
52
88
|
#include "src/core/lib/transport/http2_errors.h"
|
53
|
-
#include "src/core/lib/transport/
|
89
|
+
#include "src/core/lib/transport/metadata_batch.h"
|
54
90
|
#include "src/core/lib/transport/status_conversion.h"
|
55
|
-
#include "src/core/lib/transport/timeout_encoding.h"
|
56
91
|
#include "src/core/lib/transport/transport.h"
|
57
92
|
#include "src/core/lib/transport/transport_impl.h"
|
58
|
-
#include "src/core/lib/uri/uri_parser.h"
|
59
93
|
|
60
94
|
#define DEFAULT_CONNECTION_WINDOW_TARGET (1024 * 1024)
|
61
95
|
#define MAX_WINDOW 0x7fffffffu
|
@@ -109,8 +143,6 @@ static void read_action(void* t, grpc_error_handle error);
|
|
109
143
|
static void read_action_locked(void* t, grpc_error_handle error);
|
110
144
|
static void continue_read_action_locked(grpc_chttp2_transport* t);
|
111
145
|
|
112
|
-
static void complete_fetch(void* gs, grpc_error_handle error);
|
113
|
-
static void complete_fetch_locked(void* gs, grpc_error_handle error);
|
114
146
|
// Set a transport level setting, and push it to our peer
|
115
147
|
static void queue_setting_update(grpc_chttp2_transport* t,
|
116
148
|
grpc_chttp2_setting_id id, uint32_t value);
|
@@ -126,8 +158,6 @@ static void connectivity_state_set(grpc_chttp2_transport* t,
|
|
126
158
|
const absl::Status& status,
|
127
159
|
const char* reason);
|
128
160
|
|
129
|
-
static void benign_reclaimer(void* arg, grpc_error_handle error);
|
130
|
-
static void destructive_reclaimer(void* arg, grpc_error_handle error);
|
131
161
|
static void benign_reclaimer_locked(void* arg, grpc_error_handle error);
|
132
162
|
static void destructive_reclaimer_locked(void* arg, grpc_error_handle error);
|
133
163
|
|
@@ -162,18 +192,13 @@ static void finish_keepalive_ping_locked(void* arg, grpc_error_handle error);
|
|
162
192
|
static void keepalive_watchdog_fired(void* arg, grpc_error_handle error);
|
163
193
|
static void keepalive_watchdog_fired_locked(void* arg, grpc_error_handle error);
|
164
194
|
|
165
|
-
static void reset_byte_stream(void* arg, grpc_error_handle error);
|
166
|
-
|
167
|
-
// Flow control default enabled. Can be disabled by setting
|
168
|
-
// GRPC_EXPERIMENTAL_DISABLE_FLOW_CONTROL
|
169
|
-
bool g_flow_control_enabled = true;
|
170
|
-
|
171
195
|
namespace grpc_core {
|
172
196
|
|
173
197
|
namespace {
|
174
198
|
TestOnlyGlobalHttp2TransportInitCallback test_only_init_callback = nullptr;
|
175
199
|
TestOnlyGlobalHttp2TransportDestructCallback test_only_destruct_callback =
|
176
200
|
nullptr;
|
201
|
+
bool test_only_disable_transient_failure_state_notification = false;
|
177
202
|
} // namespace
|
178
203
|
|
179
204
|
void TestOnlySetGlobalHttp2TransportInitCallback(
|
@@ -186,6 +211,11 @@ void TestOnlySetGlobalHttp2TransportDestructCallback(
|
|
186
211
|
test_only_destruct_callback = callback;
|
187
212
|
}
|
188
213
|
|
214
|
+
void TestOnlyGlobalHttp2TransportDisableTransientFailureStateNotification(
|
215
|
+
bool disable) {
|
216
|
+
test_only_disable_transient_failure_state_notification = disable;
|
217
|
+
}
|
218
|
+
|
189
219
|
} // namespace grpc_core
|
190
220
|
|
191
221
|
//
|
@@ -201,19 +231,17 @@ grpc_chttp2_transport::~grpc_chttp2_transport() {
|
|
201
231
|
|
202
232
|
grpc_endpoint_destroy(ep);
|
203
233
|
|
204
|
-
|
234
|
+
grpc_slice_buffer_destroy(&qbuf);
|
205
235
|
|
206
|
-
|
236
|
+
grpc_slice_buffer_destroy(&outbuf);
|
207
237
|
|
208
|
-
grpc_error_handle error =
|
209
|
-
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Transport destroyed");
|
238
|
+
grpc_error_handle error = GRPC_ERROR_CREATE("Transport destroyed");
|
210
239
|
// ContextList::Execute follows semantics of a callback function and does not
|
211
240
|
// take a ref on error
|
212
241
|
grpc_core::ContextList::Execute(cl, nullptr, error);
|
213
|
-
GRPC_ERROR_UNREF(error);
|
214
242
|
cl = nullptr;
|
215
243
|
|
216
|
-
|
244
|
+
grpc_slice_buffer_destroy(&read_buffer);
|
217
245
|
grpc_chttp2_goaway_parser_destroy(&goaway_parser);
|
218
246
|
|
219
247
|
for (i = 0; i < STREAM_LIST_COUNT; i++) {
|
@@ -221,16 +249,13 @@ grpc_chttp2_transport::~grpc_chttp2_transport() {
|
|
221
249
|
GPR_ASSERT(lists[i].tail == nullptr);
|
222
250
|
}
|
223
251
|
|
224
|
-
GRPC_ERROR_UNREF(goaway_error);
|
225
|
-
|
226
252
|
GPR_ASSERT(grpc_chttp2_stream_map_size(&stream_map) == 0);
|
227
253
|
|
228
254
|
grpc_chttp2_stream_map_destroy(&stream_map);
|
229
255
|
|
230
256
|
GRPC_COMBINER_UNREF(combiner, "chttp2_transport");
|
231
257
|
|
232
|
-
cancel_pings(this,
|
233
|
-
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Transport destroyed"));
|
258
|
+
cancel_pings(this, GRPC_ERROR_CREATE("Transport destroyed"));
|
234
259
|
|
235
260
|
while (write_cb_pool) {
|
236
261
|
grpc_chttp2_write_cb* next = write_cb_pool->next;
|
@@ -238,9 +263,6 @@ grpc_chttp2_transport::~grpc_chttp2_transport() {
|
|
238
263
|
write_cb_pool = next;
|
239
264
|
}
|
240
265
|
|
241
|
-
flow_control.Destroy();
|
242
|
-
|
243
|
-
GRPC_ERROR_UNREF(closed_with_error);
|
244
266
|
gpr_free(ping_acks);
|
245
267
|
if (grpc_core::test_only_destruct_callback != nullptr) {
|
246
268
|
grpc_core::test_only_destruct_callback();
|
@@ -249,170 +271,151 @@ grpc_chttp2_transport::~grpc_chttp2_transport() {
|
|
249
271
|
|
250
272
|
static const grpc_transport_vtable* get_vtable(void);
|
251
273
|
|
252
|
-
|
253
|
-
|
254
|
-
const grpc_channel_args* channel_args,
|
274
|
+
static void read_channel_args(grpc_chttp2_transport* t,
|
275
|
+
const grpc_core::ChannelArgs& channel_args,
|
255
276
|
bool is_client) {
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER)) {
|
264
|
-
const grpc_integer_options options = {-1, 0, INT_MAX};
|
265
|
-
const int value =
|
266
|
-
grpc_channel_arg_get_integer(&channel_args->args[i], options);
|
267
|
-
if (value >= 0) {
|
268
|
-
if ((t->next_stream_id & 1) != (value & 1)) {
|
269
|
-
gpr_log(GPR_ERROR, "%s: low bit must be %d on %s",
|
270
|
-
GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER, t->next_stream_id & 1,
|
271
|
-
is_client ? "client" : "server");
|
272
|
-
} else {
|
273
|
-
t->next_stream_id = static_cast<uint32_t>(value);
|
274
|
-
}
|
275
|
-
}
|
276
|
-
} else if (0 == strcmp(channel_args->args[i].key,
|
277
|
-
GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_ENCODER)) {
|
278
|
-
const grpc_integer_options options = {-1, 0, INT_MAX};
|
279
|
-
const int value =
|
280
|
-
grpc_channel_arg_get_integer(&channel_args->args[i], options);
|
281
|
-
if (value >= 0) {
|
282
|
-
t->hpack_compressor.SetMaxUsableSize(value);
|
283
|
-
}
|
284
|
-
} else if (0 == strcmp(channel_args->args[i].key,
|
285
|
-
GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA)) {
|
286
|
-
t->ping_policy.max_pings_without_data = grpc_channel_arg_get_integer(
|
287
|
-
&channel_args->args[i],
|
288
|
-
{g_default_max_pings_without_data, 0, INT_MAX});
|
289
|
-
} else if (0 == strcmp(channel_args->args[i].key,
|
290
|
-
GRPC_ARG_HTTP2_MAX_PING_STRIKES)) {
|
291
|
-
t->ping_policy.max_ping_strikes = grpc_channel_arg_get_integer(
|
292
|
-
&channel_args->args[i], {g_default_max_ping_strikes, 0, INT_MAX});
|
293
|
-
} else if (0 ==
|
294
|
-
strcmp(channel_args->args[i].key,
|
295
|
-
GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS)) {
|
296
|
-
t->ping_policy.min_recv_ping_interval_without_data =
|
297
|
-
grpc_channel_arg_get_integer(
|
298
|
-
&channel_args->args[i],
|
299
|
-
grpc_integer_options{
|
300
|
-
g_default_min_recv_ping_interval_without_data_ms, 0,
|
301
|
-
INT_MAX});
|
302
|
-
} else if (0 == strcmp(channel_args->args[i].key,
|
303
|
-
GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE)) {
|
304
|
-
t->write_buffer_size = static_cast<uint32_t>(grpc_channel_arg_get_integer(
|
305
|
-
&channel_args->args[i], {0, 0, MAX_WRITE_BUFFER_SIZE}));
|
306
|
-
} else if (0 ==
|
307
|
-
strcmp(channel_args->args[i].key, GRPC_ARG_HTTP2_BDP_PROBE)) {
|
308
|
-
enable_bdp = grpc_channel_arg_get_bool(&channel_args->args[i], true);
|
309
|
-
} else if (0 ==
|
310
|
-
strcmp(channel_args->args[i].key, GRPC_ARG_KEEPALIVE_TIME_MS)) {
|
311
|
-
const int value = grpc_channel_arg_get_integer(
|
312
|
-
&channel_args->args[i],
|
313
|
-
grpc_integer_options{t->is_client
|
314
|
-
? g_default_client_keepalive_time_ms
|
315
|
-
: g_default_server_keepalive_time_ms,
|
316
|
-
1, INT_MAX});
|
317
|
-
t->keepalive_time = value == INT_MAX ? GRPC_MILLIS_INF_FUTURE : value;
|
318
|
-
} else if (0 == strcmp(channel_args->args[i].key,
|
319
|
-
GRPC_ARG_KEEPALIVE_TIMEOUT_MS)) {
|
320
|
-
const int value = grpc_channel_arg_get_integer(
|
321
|
-
&channel_args->args[i],
|
322
|
-
grpc_integer_options{t->is_client
|
323
|
-
? g_default_client_keepalive_timeout_ms
|
324
|
-
: g_default_server_keepalive_timeout_ms,
|
325
|
-
0, INT_MAX});
|
326
|
-
t->keepalive_timeout = value == INT_MAX ? GRPC_MILLIS_INF_FUTURE : value;
|
327
|
-
} else if (0 == strcmp(channel_args->args[i].key,
|
328
|
-
GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS)) {
|
329
|
-
t->keepalive_permit_without_calls = static_cast<uint32_t>(
|
330
|
-
grpc_channel_arg_get_integer(&channel_args->args[i], {0, 0, 1}));
|
331
|
-
} else if (0 == strcmp(channel_args->args[i].key,
|
332
|
-
GRPC_ARG_OPTIMIZATION_TARGET)) {
|
333
|
-
gpr_log(GPR_INFO, "GRPC_ARG_OPTIMIZATION_TARGET is deprecated");
|
334
|
-
} else if (0 ==
|
335
|
-
strcmp(channel_args->args[i].key, GRPC_ARG_ENABLE_CHANNELZ)) {
|
336
|
-
channelz_enabled = grpc_channel_arg_get_bool(
|
337
|
-
&channel_args->args[i], GRPC_ENABLE_CHANNELZ_DEFAULT);
|
277
|
+
const int initial_sequence_number =
|
278
|
+
channel_args.GetInt(GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER).value_or(-1);
|
279
|
+
if (initial_sequence_number > 0) {
|
280
|
+
if ((t->next_stream_id & 1) != (initial_sequence_number & 1)) {
|
281
|
+
gpr_log(GPR_ERROR, "%s: low bit must be %d on %s",
|
282
|
+
GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER, t->next_stream_id & 1,
|
283
|
+
is_client ? "client" : "server");
|
338
284
|
} else {
|
339
|
-
|
340
|
-
const char* channel_arg_name;
|
341
|
-
grpc_chttp2_setting_id setting_id;
|
342
|
-
grpc_integer_options integer_options;
|
343
|
-
bool availability[2] /* server, client */;
|
344
|
-
} settings_map[] = {{GRPC_ARG_MAX_CONCURRENT_STREAMS,
|
345
|
-
GRPC_CHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS,
|
346
|
-
{-1, 0, INT32_MAX},
|
347
|
-
{true, false}},
|
348
|
-
{GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_DECODER,
|
349
|
-
GRPC_CHTTP2_SETTINGS_HEADER_TABLE_SIZE,
|
350
|
-
{-1, 0, INT32_MAX},
|
351
|
-
{true, true}},
|
352
|
-
{GRPC_ARG_MAX_METADATA_SIZE,
|
353
|
-
GRPC_CHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE,
|
354
|
-
{-1, 0, INT32_MAX},
|
355
|
-
{true, true}},
|
356
|
-
{GRPC_ARG_HTTP2_MAX_FRAME_SIZE,
|
357
|
-
GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE,
|
358
|
-
{-1, 16384, 16777215},
|
359
|
-
{true, true}},
|
360
|
-
{GRPC_ARG_HTTP2_ENABLE_TRUE_BINARY,
|
361
|
-
GRPC_CHTTP2_SETTINGS_GRPC_ALLOW_TRUE_BINARY_METADATA,
|
362
|
-
{1, 0, 1},
|
363
|
-
{true, true}},
|
364
|
-
{GRPC_ARG_HTTP2_STREAM_LOOKAHEAD_BYTES,
|
365
|
-
GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE,
|
366
|
-
{-1, 5, INT32_MAX},
|
367
|
-
{true, true}}};
|
368
|
-
for (j = 0; j < static_cast<int> GPR_ARRAY_SIZE(settings_map); j++) {
|
369
|
-
if (0 == strcmp(channel_args->args[i].key,
|
370
|
-
settings_map[j].channel_arg_name)) {
|
371
|
-
if (!settings_map[j].availability[is_client]) {
|
372
|
-
gpr_log(GPR_DEBUG, "%s is not available on %s",
|
373
|
-
settings_map[j].channel_arg_name,
|
374
|
-
is_client ? "clients" : "servers");
|
375
|
-
} else {
|
376
|
-
int value = grpc_channel_arg_get_integer(
|
377
|
-
&channel_args->args[i], settings_map[j].integer_options);
|
378
|
-
if (value >= 0) {
|
379
|
-
queue_setting_update(t, settings_map[j].setting_id,
|
380
|
-
static_cast<uint32_t>(value));
|
381
|
-
}
|
382
|
-
}
|
383
|
-
break;
|
384
|
-
}
|
385
|
-
}
|
285
|
+
t->next_stream_id = static_cast<uint32_t>(initial_sequence_number);
|
386
286
|
}
|
387
287
|
}
|
388
|
-
|
288
|
+
|
289
|
+
const int max_hpack_table_size =
|
290
|
+
channel_args.GetInt(GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_ENCODER).value_or(-1);
|
291
|
+
if (max_hpack_table_size >= 0) {
|
292
|
+
t->hpack_compressor.SetMaxUsableSize(max_hpack_table_size);
|
293
|
+
}
|
294
|
+
|
295
|
+
t->ping_policy.max_pings_without_data =
|
296
|
+
std::max(0, channel_args.GetInt(GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA)
|
297
|
+
.value_or(g_default_max_pings_without_data));
|
298
|
+
t->ping_policy.max_ping_strikes =
|
299
|
+
std::max(0, channel_args.GetInt(GRPC_ARG_HTTP2_MAX_PING_STRIKES)
|
300
|
+
.value_or(g_default_max_ping_strikes));
|
301
|
+
t->ping_policy.min_recv_ping_interval_without_data =
|
302
|
+
std::max(grpc_core::Duration::Zero(),
|
303
|
+
channel_args
|
304
|
+
.GetDurationFromIntMillis(
|
305
|
+
GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS)
|
306
|
+
.value_or(grpc_core::Duration::Milliseconds(
|
307
|
+
g_default_min_recv_ping_interval_without_data_ms)));
|
308
|
+
t->write_buffer_size =
|
309
|
+
std::max(0, channel_args.GetInt(GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE)
|
310
|
+
.value_or(grpc_core::chttp2::kDefaultWindow));
|
311
|
+
t->keepalive_time =
|
312
|
+
std::max(grpc_core::Duration::Milliseconds(1),
|
313
|
+
channel_args.GetDurationFromIntMillis(GRPC_ARG_KEEPALIVE_TIME_MS)
|
314
|
+
.value_or(grpc_core::Duration::Milliseconds(
|
315
|
+
t->is_client ? g_default_client_keepalive_time_ms
|
316
|
+
: g_default_server_keepalive_time_ms)));
|
317
|
+
t->keepalive_timeout = std::max(
|
318
|
+
grpc_core::Duration::Zero(),
|
319
|
+
channel_args.GetDurationFromIntMillis(GRPC_ARG_KEEPALIVE_TIMEOUT_MS)
|
320
|
+
.value_or(grpc_core::Duration::Milliseconds(
|
321
|
+
t->is_client ? g_default_client_keepalive_timeout_ms
|
322
|
+
: g_default_server_keepalive_timeout_ms)));
|
323
|
+
t->keepalive_permit_without_calls =
|
324
|
+
channel_args.GetBool(GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS)
|
325
|
+
.value_or(false);
|
326
|
+
|
327
|
+
if (channel_args.GetBool(GRPC_ARG_ENABLE_CHANNELZ)
|
328
|
+
.value_or(GRPC_ENABLE_CHANNELZ_DEFAULT)) {
|
389
329
|
t->channelz_socket =
|
390
330
|
grpc_core::MakeRefCounted<grpc_core::channelz::SocketNode>(
|
391
331
|
std::string(grpc_endpoint_get_local_address(t->ep)), t->peer_string,
|
392
332
|
absl::StrFormat("%s %s", get_vtable()->name, t->peer_string),
|
393
|
-
|
394
|
-
|
333
|
+
channel_args
|
334
|
+
.GetObjectRef<grpc_core::channelz::SocketNode::Security>());
|
335
|
+
}
|
336
|
+
|
337
|
+
static const struct {
|
338
|
+
absl::string_view channel_arg_name;
|
339
|
+
grpc_chttp2_setting_id setting_id;
|
340
|
+
int default_value;
|
341
|
+
int min;
|
342
|
+
int max;
|
343
|
+
bool availability[2] /* server, client */;
|
344
|
+
} settings_map[] = {{GRPC_ARG_MAX_CONCURRENT_STREAMS,
|
345
|
+
GRPC_CHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS,
|
346
|
+
-1,
|
347
|
+
0,
|
348
|
+
INT32_MAX,
|
349
|
+
{true, false}},
|
350
|
+
{GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_DECODER,
|
351
|
+
GRPC_CHTTP2_SETTINGS_HEADER_TABLE_SIZE,
|
352
|
+
-1,
|
353
|
+
0,
|
354
|
+
INT32_MAX,
|
355
|
+
{true, true}},
|
356
|
+
{GRPC_ARG_MAX_METADATA_SIZE,
|
357
|
+
GRPC_CHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE,
|
358
|
+
-1,
|
359
|
+
0,
|
360
|
+
INT32_MAX,
|
361
|
+
{true, true}},
|
362
|
+
{GRPC_ARG_HTTP2_MAX_FRAME_SIZE,
|
363
|
+
GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE,
|
364
|
+
-1,
|
365
|
+
16384,
|
366
|
+
16777215,
|
367
|
+
{true, true}},
|
368
|
+
{GRPC_ARG_HTTP2_ENABLE_TRUE_BINARY,
|
369
|
+
GRPC_CHTTP2_SETTINGS_GRPC_ALLOW_TRUE_BINARY_METADATA,
|
370
|
+
1,
|
371
|
+
0,
|
372
|
+
1,
|
373
|
+
{true, true}},
|
374
|
+
{GRPC_ARG_HTTP2_STREAM_LOOKAHEAD_BYTES,
|
375
|
+
GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE,
|
376
|
+
-1,
|
377
|
+
5,
|
378
|
+
INT32_MAX,
|
379
|
+
{true, true}}};
|
380
|
+
|
381
|
+
for (size_t i = 0; i < GPR_ARRAY_SIZE(settings_map); i++) {
|
382
|
+
const auto& setting = settings_map[i];
|
383
|
+
if (setting.availability[is_client]) {
|
384
|
+
const int value = channel_args.GetInt(setting.channel_arg_name)
|
385
|
+
.value_or(setting.default_value);
|
386
|
+
if (value >= 0) {
|
387
|
+
queue_setting_update(t, setting.setting_id,
|
388
|
+
grpc_core::Clamp(value, setting.min, setting.max));
|
389
|
+
}
|
390
|
+
} else if (channel_args.Contains(setting.channel_arg_name)) {
|
391
|
+
gpr_log(GPR_DEBUG, "%s is not available on %s",
|
392
|
+
std::string(setting.channel_arg_name).c_str(),
|
393
|
+
is_client ? "clients" : "servers");
|
394
|
+
}
|
395
395
|
}
|
396
|
-
return enable_bdp;
|
397
396
|
}
|
398
397
|
|
399
398
|
static void init_transport_keepalive_settings(grpc_chttp2_transport* t) {
|
400
399
|
if (t->is_client) {
|
401
400
|
t->keepalive_time = g_default_client_keepalive_time_ms == INT_MAX
|
402
|
-
?
|
403
|
-
:
|
401
|
+
? grpc_core::Duration::Infinity()
|
402
|
+
: grpc_core::Duration::Milliseconds(
|
403
|
+
g_default_client_keepalive_time_ms);
|
404
404
|
t->keepalive_timeout = g_default_client_keepalive_timeout_ms == INT_MAX
|
405
|
-
?
|
406
|
-
:
|
405
|
+
? grpc_core::Duration::Infinity()
|
406
|
+
: grpc_core::Duration::Milliseconds(
|
407
|
+
g_default_client_keepalive_timeout_ms);
|
407
408
|
t->keepalive_permit_without_calls =
|
408
409
|
g_default_client_keepalive_permit_without_calls;
|
409
410
|
} else {
|
410
411
|
t->keepalive_time = g_default_server_keepalive_time_ms == INT_MAX
|
411
|
-
?
|
412
|
-
:
|
412
|
+
? grpc_core::Duration::Infinity()
|
413
|
+
: grpc_core::Duration::Milliseconds(
|
414
|
+
g_default_server_keepalive_time_ms);
|
413
415
|
t->keepalive_timeout = g_default_server_keepalive_timeout_ms == INT_MAX
|
414
|
-
?
|
415
|
-
:
|
416
|
+
? grpc_core::Duration::Infinity()
|
417
|
+
: grpc_core::Duration::Milliseconds(
|
418
|
+
g_default_server_keepalive_timeout_ms);
|
416
419
|
t->keepalive_permit_without_calls =
|
417
420
|
g_default_server_keepalive_permit_without_calls;
|
418
421
|
}
|
@@ -422,17 +425,18 @@ static void configure_transport_ping_policy(grpc_chttp2_transport* t) {
|
|
422
425
|
t->ping_policy.max_pings_without_data = g_default_max_pings_without_data;
|
423
426
|
t->ping_policy.max_ping_strikes = g_default_max_ping_strikes;
|
424
427
|
t->ping_policy.min_recv_ping_interval_without_data =
|
425
|
-
|
428
|
+
grpc_core::Duration::Milliseconds(
|
429
|
+
g_default_min_recv_ping_interval_without_data_ms);
|
426
430
|
}
|
427
431
|
|
428
432
|
static void init_keepalive_pings_if_enabled(grpc_chttp2_transport* t) {
|
429
|
-
if (t->keepalive_time !=
|
433
|
+
if (t->keepalive_time != grpc_core::Duration::Infinity()) {
|
430
434
|
t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_WAITING;
|
431
435
|
GRPC_CHTTP2_REF_TRANSPORT(t, "init keepalive ping");
|
432
436
|
GRPC_CLOSURE_INIT(&t->init_keepalive_ping_locked, init_keepalive_ping, t,
|
433
437
|
grpc_schedule_on_exec_ctx);
|
434
438
|
grpc_timer_init(&t->keepalive_ping_timer,
|
435
|
-
grpc_core::
|
439
|
+
grpc_core::Timestamp::Now() + t->keepalive_time,
|
436
440
|
&t->init_keepalive_ping_locked);
|
437
441
|
} else {
|
438
442
|
// Use GRPC_CHTTP2_KEEPALIVE_STATE_DISABLED to indicate there are no
|
@@ -442,19 +446,28 @@ static void init_keepalive_pings_if_enabled(grpc_chttp2_transport* t) {
|
|
442
446
|
}
|
443
447
|
|
444
448
|
grpc_chttp2_transport::grpc_chttp2_transport(
|
445
|
-
const
|
446
|
-
|
449
|
+
const grpc_core::ChannelArgs& channel_args, grpc_endpoint* ep,
|
450
|
+
bool is_client)
|
447
451
|
: refs(1, GRPC_TRACE_FLAG_ENABLED(grpc_trace_chttp2_refcount)
|
448
452
|
? "chttp2_refcount"
|
449
453
|
: nullptr),
|
450
454
|
ep(ep),
|
451
455
|
peer_string(grpc_endpoint_get_peer(ep)),
|
452
|
-
|
456
|
+
memory_owner(channel_args.GetObject<grpc_core::ResourceQuota>()
|
457
|
+
->memory_quota()
|
458
|
+
->CreateMemoryOwner(absl::StrCat(
|
459
|
+
grpc_endpoint_get_peer(ep), ":client_transport"))),
|
460
|
+
self_reservation(
|
461
|
+
memory_owner.MakeReservation(sizeof(grpc_chttp2_transport))),
|
453
462
|
combiner(grpc_combiner_create()),
|
454
463
|
state_tracker(is_client ? "client_transport" : "server_transport",
|
455
464
|
GRPC_CHANNEL_READY),
|
456
465
|
is_client(is_client),
|
457
466
|
next_stream_id(is_client ? 1 : 2),
|
467
|
+
flow_control(
|
468
|
+
peer_string.c_str(),
|
469
|
+
channel_args.GetBool(GRPC_ARG_HTTP2_BDP_PROBE).value_or(true),
|
470
|
+
&memory_owner),
|
458
471
|
deframe_state(is_client ? GRPC_DTS_FH_0 : GRPC_DTS_CLIENT_PREFIX_0) {
|
459
472
|
GPR_ASSERT(strlen(GRPC_CHTTP2_CLIENT_CONNECT_STRING) ==
|
460
473
|
GRPC_CHTTP2_CLIENT_CONNECT_STRLEN);
|
@@ -496,32 +509,21 @@ grpc_chttp2_transport::grpc_chttp2_transport(
|
|
496
509
|
configure_transport_ping_policy(this);
|
497
510
|
init_transport_keepalive_settings(this);
|
498
511
|
|
499
|
-
|
500
|
-
if (channel_args) {
|
501
|
-
enable_bdp = read_channel_args(this, channel_args, is_client);
|
502
|
-
}
|
503
|
-
|
504
|
-
if (g_flow_control_enabled) {
|
505
|
-
flow_control.Init<grpc_core::chttp2::TransportFlowControl>(this,
|
506
|
-
enable_bdp);
|
507
|
-
} else {
|
508
|
-
flow_control.Init<grpc_core::chttp2::TransportFlowControlDisabled>(this);
|
509
|
-
enable_bdp = false;
|
510
|
-
}
|
512
|
+
read_channel_args(this, channel_args, is_client);
|
511
513
|
|
512
514
|
// No pings allowed before receiving a header or data frame.
|
513
515
|
ping_state.pings_before_data_required = 0;
|
514
516
|
ping_state.is_delayed_ping_timer_set = false;
|
515
|
-
ping_state.last_ping_sent_time =
|
517
|
+
ping_state.last_ping_sent_time = grpc_core::Timestamp::InfPast();
|
516
518
|
|
517
|
-
ping_recv_state.last_ping_recv_time =
|
519
|
+
ping_recv_state.last_ping_recv_time = grpc_core::Timestamp::InfPast();
|
518
520
|
ping_recv_state.ping_strikes = 0;
|
519
521
|
|
520
522
|
init_keepalive_pings_if_enabled(this);
|
521
523
|
|
522
|
-
if (
|
524
|
+
if (flow_control.bdp_probe()) {
|
523
525
|
bdp_ping_blocked = true;
|
524
|
-
grpc_chttp2_act_on_flowctl_action(flow_control
|
526
|
+
grpc_chttp2_act_on_flowctl_action(flow_control.PeriodicUpdate(), this,
|
525
527
|
nullptr);
|
526
528
|
}
|
527
529
|
|
@@ -535,12 +537,11 @@ grpc_chttp2_transport::grpc_chttp2_transport(
|
|
535
537
|
static void destroy_transport_locked(void* tp, grpc_error_handle /*error*/) {
|
536
538
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
537
539
|
t->destroying = 1;
|
538
|
-
grpc_resource_user_shutdown(t->resource_user);
|
539
|
-
grpc_resource_user_unref(t->resource_user);
|
540
540
|
close_transport_locked(
|
541
|
-
t, grpc_error_set_int(
|
542
|
-
|
543
|
-
|
541
|
+
t, grpc_error_set_int(GRPC_ERROR_CREATE("Transport destroyed"),
|
542
|
+
grpc_core::StatusIntProperty::kOccurredDuringWrite,
|
543
|
+
t->write_state));
|
544
|
+
t->memory_owner.Reset();
|
544
545
|
// Must be the last line.
|
545
546
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "destroy");
|
546
547
|
}
|
@@ -548,30 +549,30 @@ static void destroy_transport_locked(void* tp, grpc_error_handle /*error*/) {
|
|
548
549
|
static void destroy_transport(grpc_transport* gt) {
|
549
550
|
grpc_chttp2_transport* t = reinterpret_cast<grpc_chttp2_transport*>(gt);
|
550
551
|
t->combiner->Run(GRPC_CLOSURE_CREATE(destroy_transport_locked, t, nullptr),
|
551
|
-
|
552
|
+
absl::OkStatus());
|
552
553
|
}
|
553
554
|
|
554
555
|
static void close_transport_locked(grpc_chttp2_transport* t,
|
555
556
|
grpc_error_handle error) {
|
556
|
-
end_all_the_calls(t,
|
557
|
-
cancel_pings(t,
|
558
|
-
if (t->closed_with_error
|
557
|
+
end_all_the_calls(t, error);
|
558
|
+
cancel_pings(t, error);
|
559
|
+
if (t->closed_with_error.ok()) {
|
559
560
|
if (!grpc_error_has_clear_grpc_status(error)) {
|
560
|
-
error =
|
561
|
-
|
561
|
+
error =
|
562
|
+
grpc_error_set_int(error, grpc_core::StatusIntProperty::kRpcStatus,
|
563
|
+
GRPC_STATUS_UNAVAILABLE);
|
562
564
|
}
|
563
565
|
if (t->write_state != GRPC_CHTTP2_WRITE_STATE_IDLE) {
|
564
|
-
if (t->close_transport_on_writes_finished
|
566
|
+
if (t->close_transport_on_writes_finished.ok()) {
|
565
567
|
t->close_transport_on_writes_finished =
|
566
|
-
|
567
|
-
"Delayed close due to in-progress write");
|
568
|
+
GRPC_ERROR_CREATE("Delayed close due to in-progress write");
|
568
569
|
}
|
569
570
|
t->close_transport_on_writes_finished =
|
570
571
|
grpc_error_add_child(t->close_transport_on_writes_finished, error);
|
571
572
|
return;
|
572
573
|
}
|
573
|
-
GPR_ASSERT(error
|
574
|
-
t->closed_with_error =
|
574
|
+
GPR_ASSERT(!error.ok());
|
575
|
+
t->closed_with_error = error;
|
575
576
|
connectivity_state_set(t, GRPC_CHANNEL_SHUTDOWN, absl::Status(),
|
576
577
|
"close_transport");
|
577
578
|
if (t->ping_state.is_delayed_ping_timer_set) {
|
@@ -600,19 +601,17 @@ static void close_transport_locked(grpc_chttp2_transport* t,
|
|
600
601
|
GRPC_CHTTP2_STREAM_UNREF(s, "chttp2_writing:close");
|
601
602
|
}
|
602
603
|
GPR_ASSERT(t->write_state == GRPC_CHTTP2_WRITE_STATE_IDLE);
|
603
|
-
grpc_endpoint_shutdown(t->ep,
|
604
|
+
grpc_endpoint_shutdown(t->ep, error);
|
604
605
|
}
|
605
606
|
if (t->notify_on_receive_settings != nullptr) {
|
606
607
|
grpc_core::ExecCtx::Run(DEBUG_LOCATION, t->notify_on_receive_settings,
|
607
|
-
|
608
|
+
error);
|
608
609
|
t->notify_on_receive_settings = nullptr;
|
609
610
|
}
|
610
611
|
if (t->notify_on_close != nullptr) {
|
611
|
-
grpc_core::ExecCtx::Run(DEBUG_LOCATION, t->notify_on_close,
|
612
|
-
GRPC_ERROR_REF(error));
|
612
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, t->notify_on_close, error);
|
613
613
|
t->notify_on_close = nullptr;
|
614
614
|
}
|
615
|
-
GRPC_ERROR_UNREF(error);
|
616
615
|
}
|
617
616
|
|
618
617
|
#ifndef NDEBUG
|
@@ -647,29 +646,23 @@ grpc_chttp2_stream::grpc_chttp2_stream(grpc_chttp2_transport* t,
|
|
647
646
|
refcount(refcount),
|
648
647
|
reffer(this),
|
649
648
|
initial_metadata_buffer(arena),
|
650
|
-
trailing_metadata_buffer(arena)
|
649
|
+
trailing_metadata_buffer(arena),
|
650
|
+
flow_control(&t->flow_control) {
|
651
651
|
if (server_data) {
|
652
652
|
id = static_cast<uint32_t>(reinterpret_cast<uintptr_t>(server_data));
|
653
653
|
*t->accepting_stream = this;
|
654
654
|
grpc_chttp2_stream_map_add(&t->stream_map, id, this);
|
655
655
|
post_destructive_reclaimer(t);
|
656
656
|
}
|
657
|
-
if (t->flow_control->flow_control_enabled()) {
|
658
|
-
flow_control.Init<grpc_core::chttp2::StreamFlowControl>(
|
659
|
-
static_cast<grpc_core::chttp2::TransportFlowControl*>(
|
660
|
-
t->flow_control.get()),
|
661
|
-
this);
|
662
|
-
} else {
|
663
|
-
flow_control.Init<grpc_core::chttp2::StreamFlowControlDisabled>();
|
664
|
-
}
|
665
657
|
|
666
658
|
grpc_slice_buffer_init(&frame_storage);
|
667
|
-
grpc_slice_buffer_init(&unprocessed_incoming_frames_buffer);
|
668
659
|
grpc_slice_buffer_init(&flow_controlled_buffer);
|
669
|
-
GRPC_CLOSURE_INIT(&reset_byte_stream, ::reset_byte_stream, this, nullptr);
|
670
660
|
}
|
671
661
|
|
672
662
|
grpc_chttp2_stream::~grpc_chttp2_stream() {
|
663
|
+
grpc_chttp2_list_remove_stalled_by_stream(t, this);
|
664
|
+
grpc_chttp2_list_remove_stalled_by_transport(t, this);
|
665
|
+
|
673
666
|
if (t->channelz_socket != nullptr) {
|
674
667
|
if ((t->is_client && eos_received) || (!t->is_client && eos_sent)) {
|
675
668
|
t->channelz_socket->RecordStreamSucceeded();
|
@@ -683,18 +676,10 @@ grpc_chttp2_stream::~grpc_chttp2_stream() {
|
|
683
676
|
GPR_ASSERT(grpc_chttp2_stream_map_find(&t->stream_map, id) == nullptr);
|
684
677
|
}
|
685
678
|
|
686
|
-
|
687
|
-
grpc_slice_buffer_destroy_internal(&frame_storage);
|
688
|
-
if (stream_compression_method != GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS) {
|
689
|
-
grpc_slice_buffer_destroy_internal(&compressed_data_buffer);
|
690
|
-
}
|
691
|
-
if (stream_decompression_method !=
|
692
|
-
GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS) {
|
693
|
-
grpc_slice_buffer_destroy_internal(&decompressed_data_buffer);
|
694
|
-
}
|
679
|
+
grpc_slice_buffer_destroy(&frame_storage);
|
695
680
|
|
696
681
|
for (int i = 0; i < STREAM_LIST_COUNT; i++) {
|
697
|
-
if (GPR_UNLIKELY(included
|
682
|
+
if (GPR_UNLIKELY(included.is_set(i))) {
|
698
683
|
gpr_log(GPR_ERROR, "%s stream %d still included in list %d",
|
699
684
|
t->is_client ? "client" : "server", id, i);
|
700
685
|
abort();
|
@@ -702,60 +687,37 @@ grpc_chttp2_stream::~grpc_chttp2_stream() {
|
|
702
687
|
}
|
703
688
|
|
704
689
|
GPR_ASSERT(send_initial_metadata_finished == nullptr);
|
705
|
-
GPR_ASSERT(fetching_send_message == nullptr);
|
706
690
|
GPR_ASSERT(send_trailing_metadata_finished == nullptr);
|
707
691
|
GPR_ASSERT(recv_initial_metadata_ready == nullptr);
|
708
692
|
GPR_ASSERT(recv_message_ready == nullptr);
|
709
693
|
GPR_ASSERT(recv_trailing_metadata_finished == nullptr);
|
710
|
-
|
711
|
-
GRPC_ERROR_UNREF(read_closed_error);
|
712
|
-
GRPC_ERROR_UNREF(write_closed_error);
|
713
|
-
GRPC_ERROR_UNREF(byte_stream_error);
|
714
|
-
flow_control.Destroy();
|
715
|
-
if (!t->is_client) {
|
716
|
-
grpc_resource_user_free(t->resource_user, GRPC_RESOURCE_QUOTA_CALL_SIZE);
|
717
|
-
}
|
694
|
+
grpc_slice_buffer_destroy(&flow_controlled_buffer);
|
718
695
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "stream");
|
719
|
-
grpc_core::ExecCtx::Run(DEBUG_LOCATION, destroy_stream_arg,
|
696
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, destroy_stream_arg, absl::OkStatus());
|
720
697
|
}
|
721
698
|
|
722
699
|
static int init_stream(grpc_transport* gt, grpc_stream* gs,
|
723
700
|
grpc_stream_refcount* refcount, const void* server_data,
|
724
701
|
grpc_core::Arena* arena) {
|
725
|
-
GPR_TIMER_SCOPE("init_stream", 0);
|
726
702
|
grpc_chttp2_transport* t = reinterpret_cast<grpc_chttp2_transport*>(gt);
|
727
703
|
new (gs) grpc_chttp2_stream(t, refcount, server_data, arena);
|
728
704
|
return 0;
|
729
705
|
}
|
730
706
|
|
731
707
|
static void destroy_stream_locked(void* sp, grpc_error_handle /*error*/) {
|
732
|
-
GPR_TIMER_SCOPE("destroy_stream", 0);
|
733
708
|
grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(sp);
|
734
709
|
s->~grpc_chttp2_stream();
|
735
710
|
}
|
736
711
|
|
737
712
|
static void destroy_stream(grpc_transport* gt, grpc_stream* gs,
|
738
713
|
grpc_closure* then_schedule_closure) {
|
739
|
-
GPR_TIMER_SCOPE("destroy_stream", 0);
|
740
714
|
grpc_chttp2_transport* t = reinterpret_cast<grpc_chttp2_transport*>(gt);
|
741
715
|
grpc_chttp2_stream* s = reinterpret_cast<grpc_chttp2_stream*>(gs);
|
742
|
-
if (s->stream_compression_method !=
|
743
|
-
GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS &&
|
744
|
-
s->stream_compression_ctx != nullptr) {
|
745
|
-
grpc_stream_compression_context_destroy(s->stream_compression_ctx);
|
746
|
-
s->stream_compression_ctx = nullptr;
|
747
|
-
}
|
748
|
-
if (s->stream_decompression_method !=
|
749
|
-
GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS &&
|
750
|
-
s->stream_decompression_ctx != nullptr) {
|
751
|
-
grpc_stream_compression_context_destroy(s->stream_decompression_ctx);
|
752
|
-
s->stream_decompression_ctx = nullptr;
|
753
|
-
}
|
754
716
|
|
755
717
|
s->destroy_stream_arg = then_schedule_closure;
|
756
718
|
t->combiner->Run(
|
757
719
|
GRPC_CLOSURE_INIT(&s->destroy_stream, destroy_stream_locked, s, nullptr),
|
758
|
-
|
720
|
+
absl::OkStatus());
|
759
721
|
}
|
760
722
|
|
761
723
|
grpc_chttp2_stream* grpc_chttp2_parsing_accept_stream(grpc_chttp2_transport* t,
|
@@ -763,18 +725,6 @@ grpc_chttp2_stream* grpc_chttp2_parsing_accept_stream(grpc_chttp2_transport* t,
|
|
763
725
|
if (t->accept_stream_cb == nullptr) {
|
764
726
|
return nullptr;
|
765
727
|
}
|
766
|
-
// Don't accept the stream if memory quota doesn't allow. Note that we should
|
767
|
-
// simply refuse the stream here instead of canceling the stream after it's
|
768
|
-
// accepted since the latter will create the call which costs much memory.
|
769
|
-
GPR_ASSERT(t->resource_user != nullptr);
|
770
|
-
if (!grpc_resource_user_safe_alloc(t->resource_user,
|
771
|
-
GRPC_RESOURCE_QUOTA_CALL_SIZE)) {
|
772
|
-
gpr_log(GPR_INFO, "Memory exhausted, rejecting the stream.");
|
773
|
-
grpc_chttp2_add_rst_stream_to_next_write(t, id, GRPC_HTTP2_REFUSED_STREAM,
|
774
|
-
nullptr);
|
775
|
-
grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_RST_STREAM);
|
776
|
-
return nullptr;
|
777
|
-
}
|
778
728
|
grpc_chttp2_stream* accepting = nullptr;
|
779
729
|
GPR_ASSERT(t->accepting_stream == nullptr);
|
780
730
|
t->accepting_stream = &accepting;
|
@@ -815,90 +765,18 @@ static void set_write_state(grpc_chttp2_transport* t,
|
|
815
765
|
// from peer while we had some pending writes)
|
816
766
|
if (st == GRPC_CHTTP2_WRITE_STATE_IDLE) {
|
817
767
|
grpc_core::ExecCtx::RunList(DEBUG_LOCATION, &t->run_after_write);
|
818
|
-
if (t->close_transport_on_writes_finished
|
768
|
+
if (!t->close_transport_on_writes_finished.ok()) {
|
819
769
|
grpc_error_handle err = t->close_transport_on_writes_finished;
|
820
|
-
t->close_transport_on_writes_finished =
|
770
|
+
t->close_transport_on_writes_finished = absl::OkStatus();
|
821
771
|
close_transport_locked(t, err);
|
822
772
|
}
|
823
773
|
}
|
824
774
|
}
|
825
775
|
|
826
|
-
static void inc_initiate_write_reason(
|
827
|
-
grpc_chttp2_initiate_write_reason reason) {
|
828
|
-
switch (reason) {
|
829
|
-
case GRPC_CHTTP2_INITIATE_WRITE_INITIAL_WRITE:
|
830
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_INITIAL_WRITE();
|
831
|
-
break;
|
832
|
-
case GRPC_CHTTP2_INITIATE_WRITE_START_NEW_STREAM:
|
833
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_START_NEW_STREAM();
|
834
|
-
break;
|
835
|
-
case GRPC_CHTTP2_INITIATE_WRITE_SEND_MESSAGE:
|
836
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_SEND_MESSAGE();
|
837
|
-
break;
|
838
|
-
case GRPC_CHTTP2_INITIATE_WRITE_SEND_INITIAL_METADATA:
|
839
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_SEND_INITIAL_METADATA();
|
840
|
-
break;
|
841
|
-
case GRPC_CHTTP2_INITIATE_WRITE_SEND_TRAILING_METADATA:
|
842
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_SEND_TRAILING_METADATA();
|
843
|
-
break;
|
844
|
-
case GRPC_CHTTP2_INITIATE_WRITE_RETRY_SEND_PING:
|
845
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_RETRY_SEND_PING();
|
846
|
-
break;
|
847
|
-
case GRPC_CHTTP2_INITIATE_WRITE_CONTINUE_PINGS:
|
848
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_CONTINUE_PINGS();
|
849
|
-
break;
|
850
|
-
case GRPC_CHTTP2_INITIATE_WRITE_GOAWAY_SENT:
|
851
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_GOAWAY_SENT();
|
852
|
-
break;
|
853
|
-
case GRPC_CHTTP2_INITIATE_WRITE_RST_STREAM:
|
854
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_RST_STREAM();
|
855
|
-
break;
|
856
|
-
case GRPC_CHTTP2_INITIATE_WRITE_CLOSE_FROM_API:
|
857
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_CLOSE_FROM_API();
|
858
|
-
break;
|
859
|
-
case GRPC_CHTTP2_INITIATE_WRITE_STREAM_FLOW_CONTROL:
|
860
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_STREAM_FLOW_CONTROL();
|
861
|
-
break;
|
862
|
-
case GRPC_CHTTP2_INITIATE_WRITE_TRANSPORT_FLOW_CONTROL:
|
863
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_TRANSPORT_FLOW_CONTROL();
|
864
|
-
break;
|
865
|
-
case GRPC_CHTTP2_INITIATE_WRITE_SEND_SETTINGS:
|
866
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_SEND_SETTINGS();
|
867
|
-
break;
|
868
|
-
case GRPC_CHTTP2_INITIATE_WRITE_FLOW_CONTROL_UNSTALLED_BY_SETTING:
|
869
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_FLOW_CONTROL_UNSTALLED_BY_SETTING();
|
870
|
-
break;
|
871
|
-
case GRPC_CHTTP2_INITIATE_WRITE_FLOW_CONTROL_UNSTALLED_BY_UPDATE:
|
872
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_FLOW_CONTROL_UNSTALLED_BY_UPDATE();
|
873
|
-
break;
|
874
|
-
case GRPC_CHTTP2_INITIATE_WRITE_APPLICATION_PING:
|
875
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_APPLICATION_PING();
|
876
|
-
break;
|
877
|
-
case GRPC_CHTTP2_INITIATE_WRITE_BDP_PING:
|
878
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_BDP_ESTIMATOR_PING();
|
879
|
-
break;
|
880
|
-
case GRPC_CHTTP2_INITIATE_WRITE_KEEPALIVE_PING:
|
881
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_KEEPALIVE_PING();
|
882
|
-
break;
|
883
|
-
case GRPC_CHTTP2_INITIATE_WRITE_TRANSPORT_FLOW_CONTROL_UNSTALLED:
|
884
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_TRANSPORT_FLOW_CONTROL_UNSTALLED();
|
885
|
-
break;
|
886
|
-
case GRPC_CHTTP2_INITIATE_WRITE_PING_RESPONSE:
|
887
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_PING_RESPONSE();
|
888
|
-
break;
|
889
|
-
case GRPC_CHTTP2_INITIATE_WRITE_FORCE_RST_STREAM:
|
890
|
-
GRPC_STATS_INC_HTTP2_INITIATE_WRITE_DUE_TO_FORCE_RST_STREAM();
|
891
|
-
break;
|
892
|
-
}
|
893
|
-
}
|
894
|
-
|
895
776
|
void grpc_chttp2_initiate_write(grpc_chttp2_transport* t,
|
896
777
|
grpc_chttp2_initiate_write_reason reason) {
|
897
|
-
GPR_TIMER_SCOPE("grpc_chttp2_initiate_write", 0);
|
898
|
-
|
899
778
|
switch (t->write_state) {
|
900
779
|
case GRPC_CHTTP2_WRITE_STATE_IDLE:
|
901
|
-
inc_initiate_write_reason(reason);
|
902
780
|
set_write_state(t, GRPC_CHTTP2_WRITE_STATE_WRITING,
|
903
781
|
grpc_chttp2_initiate_write_reason_string(reason));
|
904
782
|
GRPC_CHTTP2_REF_TRANSPORT(t, "writing");
|
@@ -921,7 +799,7 @@ void grpc_chttp2_initiate_write(grpc_chttp2_transport* t,
|
|
921
799
|
t->combiner->FinallyRun(
|
922
800
|
GRPC_CLOSURE_INIT(&t->write_action_begin_locked,
|
923
801
|
write_action_begin_locked, t, nullptr),
|
924
|
-
|
802
|
+
absl::OkStatus());
|
925
803
|
break;
|
926
804
|
case GRPC_CHTTP2_WRITE_STATE_WRITING:
|
927
805
|
set_write_state(t, GRPC_CHTTP2_WRITE_STATE_WRITING_WITH_MORE,
|
@@ -934,8 +812,7 @@ void grpc_chttp2_initiate_write(grpc_chttp2_transport* t,
|
|
934
812
|
|
935
813
|
void grpc_chttp2_mark_stream_writable(grpc_chttp2_transport* t,
|
936
814
|
grpc_chttp2_stream* s) {
|
937
|
-
if (t->closed_with_error
|
938
|
-
grpc_chttp2_list_add_writable_stream(t, s)) {
|
815
|
+
if (t->closed_with_error.ok() && grpc_chttp2_list_add_writable_stream(t, s)) {
|
939
816
|
GRPC_CHTTP2_STREAM_REF(s, "chttp2_writing:become");
|
940
817
|
}
|
941
818
|
}
|
@@ -950,24 +827,20 @@ static const char* begin_writing_desc(bool partial) {
|
|
950
827
|
|
951
828
|
static void write_action_begin_locked(void* gt,
|
952
829
|
grpc_error_handle /*error_ignored*/) {
|
953
|
-
GPR_TIMER_SCOPE("write_action_begin_locked", 0);
|
954
830
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(gt);
|
955
831
|
GPR_ASSERT(t->write_state != GRPC_CHTTP2_WRITE_STATE_IDLE);
|
956
832
|
grpc_chttp2_begin_write_result r;
|
957
|
-
if (t->closed_with_error
|
833
|
+
if (!t->closed_with_error.ok()) {
|
958
834
|
r.writing = false;
|
959
835
|
} else {
|
960
836
|
r = grpc_chttp2_begin_write(t);
|
961
837
|
}
|
962
838
|
if (r.writing) {
|
963
|
-
if (r.partial) {
|
964
|
-
GRPC_STATS_INC_HTTP2_PARTIAL_WRITES();
|
965
|
-
}
|
966
839
|
set_write_state(t,
|
967
840
|
r.partial ? GRPC_CHTTP2_WRITE_STATE_WRITING_WITH_MORE
|
968
841
|
: GRPC_CHTTP2_WRITE_STATE_WRITING,
|
969
842
|
begin_writing_desc(r.partial));
|
970
|
-
write_action(t,
|
843
|
+
write_action(t, absl::OkStatus());
|
971
844
|
if (t->reading_paused_on_pending_induced_frames) {
|
972
845
|
GPR_ASSERT(t->num_pending_induced_frames == 0);
|
973
846
|
// We had paused reading, because we had many induced frames (SETTINGS
|
@@ -982,49 +855,55 @@ static void write_action_begin_locked(void* gt,
|
|
982
855
|
continue_read_action_locked(t);
|
983
856
|
}
|
984
857
|
} else {
|
985
|
-
GRPC_STATS_INC_HTTP2_SPURIOUS_WRITES_BEGUN();
|
986
858
|
set_write_state(t, GRPC_CHTTP2_WRITE_STATE_IDLE, "begin writing nothing");
|
987
859
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "writing");
|
988
860
|
}
|
989
861
|
}
|
990
862
|
|
991
863
|
static void write_action(void* gt, grpc_error_handle /*error*/) {
|
992
|
-
GPR_TIMER_SCOPE("write_action", 0);
|
993
864
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(gt);
|
994
865
|
void* cl = t->cl;
|
995
866
|
t->cl = nullptr;
|
867
|
+
// If the peer_state_based_framing experiment is set to true,
|
868
|
+
// choose max_frame_size as 2 * max http2 frame size of peer. If peer is under
|
869
|
+
// high memory pressure, then it would advertise a smaller max http2 frame
|
870
|
+
// size. With this logic, the sender would automatically reduce the sending
|
871
|
+
// frame size as well.
|
872
|
+
int max_frame_size =
|
873
|
+
grpc_core::IsPeerStateBasedFramingEnabled()
|
874
|
+
? 2 * t->settings[GRPC_PEER_SETTINGS]
|
875
|
+
[GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE]
|
876
|
+
: INT_MAX;
|
996
877
|
grpc_endpoint_write(
|
997
878
|
t->ep, &t->outbuf,
|
998
879
|
GRPC_CLOSURE_INIT(&t->write_action_end_locked, write_action_end, t,
|
999
880
|
grpc_schedule_on_exec_ctx),
|
1000
|
-
cl);
|
881
|
+
cl, max_frame_size);
|
1001
882
|
}
|
1002
883
|
|
1003
884
|
static void write_action_end(void* tp, grpc_error_handle error) {
|
1004
885
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
1005
886
|
t->combiner->Run(GRPC_CLOSURE_INIT(&t->write_action_end_locked,
|
1006
887
|
write_action_end_locked, t, nullptr),
|
1007
|
-
|
888
|
+
error);
|
1008
889
|
}
|
1009
890
|
|
1010
891
|
// Callback from the grpc_endpoint after bytes have been written by calling
|
1011
892
|
// sendmsg
|
1012
893
|
static void write_action_end_locked(void* tp, grpc_error_handle error) {
|
1013
|
-
GPR_TIMER_SCOPE("terminate_writing_with_lock", 0);
|
1014
894
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
1015
895
|
|
1016
896
|
bool closed = false;
|
1017
|
-
if (error
|
1018
|
-
close_transport_locked(t,
|
897
|
+
if (!error.ok()) {
|
898
|
+
close_transport_locked(t, error);
|
1019
899
|
closed = true;
|
1020
900
|
}
|
1021
901
|
|
1022
|
-
if (t->sent_goaway_state ==
|
1023
|
-
t->sent_goaway_state =
|
902
|
+
if (t->sent_goaway_state == GRPC_CHTTP2_FINAL_GOAWAY_SEND_SCHEDULED) {
|
903
|
+
t->sent_goaway_state = GRPC_CHTTP2_FINAL_GOAWAY_SENT;
|
1024
904
|
closed = true;
|
1025
905
|
if (grpc_chttp2_stream_map_size(&t->stream_map) == 0) {
|
1026
|
-
close_transport_locked(
|
1027
|
-
t, GRPC_ERROR_CREATE_FROM_STATIC_STRING("goaway sent"));
|
906
|
+
close_transport_locked(t, GRPC_ERROR_CREATE("goaway sent"));
|
1028
907
|
}
|
1029
908
|
}
|
1030
909
|
|
@@ -1032,11 +911,9 @@ static void write_action_end_locked(void* tp, grpc_error_handle error) {
|
|
1032
911
|
case GRPC_CHTTP2_WRITE_STATE_IDLE:
|
1033
912
|
GPR_UNREACHABLE_CODE(break);
|
1034
913
|
case GRPC_CHTTP2_WRITE_STATE_WRITING:
|
1035
|
-
GPR_TIMER_MARK("state=writing", 0);
|
1036
914
|
set_write_state(t, GRPC_CHTTP2_WRITE_STATE_IDLE, "finish writing");
|
1037
915
|
break;
|
1038
916
|
case GRPC_CHTTP2_WRITE_STATE_WRITING_WITH_MORE:
|
1039
|
-
GPR_TIMER_MARK("state=writing_stale_no_poller", 0);
|
1040
917
|
set_write_state(t, GRPC_CHTTP2_WRITE_STATE_WRITING, "continue writing");
|
1041
918
|
GRPC_CHTTP2_REF_TRANSPORT(t, "writing");
|
1042
919
|
// If the transport is closed, we will retry writing on the endpoint
|
@@ -1050,11 +927,11 @@ static void write_action_end_locked(void* tp, grpc_error_handle error) {
|
|
1050
927
|
t->combiner->FinallyRun(
|
1051
928
|
GRPC_CLOSURE_INIT(&t->write_action_begin_locked,
|
1052
929
|
write_action_begin_locked, t, nullptr),
|
1053
|
-
|
930
|
+
absl::OkStatus());
|
1054
931
|
break;
|
1055
932
|
}
|
1056
933
|
|
1057
|
-
grpc_chttp2_end_write(t,
|
934
|
+
grpc_chttp2_end_write(t, error);
|
1058
935
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "writing");
|
1059
936
|
}
|
1060
937
|
|
@@ -1075,21 +952,32 @@ static void queue_setting_update(grpc_chttp2_transport* t,
|
|
1075
952
|
}
|
1076
953
|
}
|
1077
954
|
|
955
|
+
// Cancel out streams that haven't yet started if we have received a GOAWAY
|
956
|
+
static void cancel_unstarted_streams(grpc_chttp2_transport* t,
|
957
|
+
grpc_error_handle error) {
|
958
|
+
grpc_chttp2_stream* s;
|
959
|
+
while (grpc_chttp2_list_pop_waiting_for_concurrency(t, &s)) {
|
960
|
+
s->trailing_metadata_buffer.Set(
|
961
|
+
grpc_core::GrpcStreamNetworkState(),
|
962
|
+
grpc_core::GrpcStreamNetworkState::kNotSentOnWire);
|
963
|
+
grpc_chttp2_cancel_stream(t, s, error);
|
964
|
+
}
|
965
|
+
}
|
966
|
+
|
1078
967
|
void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
|
1079
968
|
uint32_t goaway_error,
|
1080
969
|
uint32_t last_stream_id,
|
1081
970
|
absl::string_view goaway_text) {
|
1082
971
|
// Discard the error from a previous goaway frame (if any)
|
1083
|
-
if (t->goaway_error
|
1084
|
-
GRPC_ERROR_UNREF(t->goaway_error);
|
972
|
+
if (!t->goaway_error.ok()) {
|
1085
973
|
}
|
1086
974
|
t->goaway_error = grpc_error_set_str(
|
1087
975
|
grpc_error_set_int(
|
1088
|
-
grpc_error_set_int(
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
976
|
+
grpc_error_set_int(GRPC_ERROR_CREATE("GOAWAY received"),
|
977
|
+
grpc_core::StatusIntProperty::kHttp2Error,
|
978
|
+
static_cast<intptr_t>(goaway_error)),
|
979
|
+
grpc_core::StatusIntProperty::kRpcStatus, GRPC_STATUS_UNAVAILABLE),
|
980
|
+
grpc_core::StatusStrProperty::kRawBytes, goaway_text);
|
1093
981
|
|
1094
982
|
GRPC_CHTTP2_IF_TRACING(
|
1095
983
|
gpr_log(GPR_INFO, "transport %p got goaway with last stream id %d", t,
|
@@ -1098,7 +986,24 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
|
|
1098
986
|
// received a GOAWAY with a non NO_ERROR code.
|
1099
987
|
if (goaway_error != GRPC_HTTP2_NO_ERROR) {
|
1100
988
|
gpr_log(GPR_INFO, "%s: Got goaway [%d] err=%s", t->peer_string.c_str(),
|
1101
|
-
goaway_error,
|
989
|
+
goaway_error, grpc_core::StatusToString(t->goaway_error).c_str());
|
990
|
+
}
|
991
|
+
if (t->is_client) {
|
992
|
+
cancel_unstarted_streams(t, t->goaway_error);
|
993
|
+
// Cancel all unseen streams
|
994
|
+
grpc_chttp2_stream_map_for_each(
|
995
|
+
&t->stream_map,
|
996
|
+
[](void* user_data, uint32_t /* key */, void* stream) {
|
997
|
+
uint32_t last_stream_id = *(static_cast<uint32_t*>(user_data));
|
998
|
+
grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(stream);
|
999
|
+
if (s->id > last_stream_id) {
|
1000
|
+
s->trailing_metadata_buffer.Set(
|
1001
|
+
grpc_core::GrpcStreamNetworkState(),
|
1002
|
+
grpc_core::GrpcStreamNetworkState::kNotSeenByServer);
|
1003
|
+
grpc_chttp2_cancel_stream(s->t, s, s->t->goaway_error);
|
1004
|
+
}
|
1005
|
+
},
|
1006
|
+
&last_stream_id);
|
1102
1007
|
}
|
1103
1008
|
absl::Status status = grpc_error_to_absl_status(t->goaway_error);
|
1104
1009
|
// When a client receives a GOAWAY with error code ENHANCE_YOUR_CALM and debug
|
@@ -1109,36 +1014,33 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
|
|
1109
1014
|
goaway_error == GRPC_HTTP2_ENHANCE_YOUR_CALM &&
|
1110
1015
|
goaway_text == "too_many_pings")) {
|
1111
1016
|
gpr_log(GPR_ERROR,
|
1112
|
-
"Received a GOAWAY with error code ENHANCE_YOUR_CALM and debug "
|
1113
|
-
"data equal to \"too_many_pings\""
|
1114
|
-
|
1115
|
-
|
1017
|
+
"%s: Received a GOAWAY with error code ENHANCE_YOUR_CALM and debug "
|
1018
|
+
"data equal to \"too_many_pings\". Current keepalive time (before "
|
1019
|
+
"throttling): %s",
|
1020
|
+
t->peer_string.c_str(), t->keepalive_time.ToString().c_str());
|
1021
|
+
constexpr int max_keepalive_time_millis =
|
1116
1022
|
INT_MAX / KEEPALIVE_TIME_BACKOFF_MULTIPLIER;
|
1117
|
-
|
1118
|
-
|
1119
|
-
?
|
1120
|
-
:
|
1121
|
-
KEEPALIVE_TIME_BACKOFF_MULTIPLIER);
|
1023
|
+
int64_t throttled_keepalive_time =
|
1024
|
+
t->keepalive_time.millis() > max_keepalive_time_millis
|
1025
|
+
? INT_MAX
|
1026
|
+
: t->keepalive_time.millis() * KEEPALIVE_TIME_BACKOFF_MULTIPLIER;
|
1122
1027
|
status.SetPayload(grpc_core::kKeepaliveThrottlingKey,
|
1123
|
-
absl::Cord(std::to_string(
|
1028
|
+
absl::Cord(std::to_string(throttled_keepalive_time)));
|
1124
1029
|
}
|
1125
1030
|
// lie: use transient failure from the transport to indicate goaway has been
|
1126
1031
|
// received.
|
1127
|
-
|
1128
|
-
|
1032
|
+
if (!grpc_core::test_only_disable_transient_failure_state_notification) {
|
1033
|
+
connectivity_state_set(t, GRPC_CHANNEL_TRANSIENT_FAILURE, status,
|
1034
|
+
"got_goaway");
|
1035
|
+
}
|
1129
1036
|
}
|
1130
1037
|
|
1131
1038
|
static void maybe_start_some_streams(grpc_chttp2_transport* t) {
|
1132
1039
|
grpc_chttp2_stream* s;
|
1133
|
-
// cancel out streams that haven't yet started if we have received a
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
t, s,
|
1138
|
-
grpc_error_set_int(
|
1139
|
-
GRPC_ERROR_CREATE_FROM_STATIC_STRING("GOAWAY received"),
|
1140
|
-
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE));
|
1141
|
-
}
|
1040
|
+
// maybe cancel out streams that haven't yet started if we have received a
|
1041
|
+
// GOAWAY
|
1042
|
+
if (!t->goaway_error.ok()) {
|
1043
|
+
cancel_unstarted_streams(t, t->goaway_error);
|
1142
1044
|
return;
|
1143
1045
|
}
|
1144
1046
|
// start streams where we have free grpc_chttp2_stream ids and free
|
@@ -1173,11 +1075,14 @@ static void maybe_start_some_streams(grpc_chttp2_transport* t) {
|
|
1173
1075
|
// cancel out streams that will never be started
|
1174
1076
|
if (t->next_stream_id >= MAX_CLIENT_STREAM_ID) {
|
1175
1077
|
while (grpc_chttp2_list_pop_waiting_for_concurrency(t, &s)) {
|
1078
|
+
s->trailing_metadata_buffer.Set(
|
1079
|
+
grpc_core::GrpcStreamNetworkState(),
|
1080
|
+
grpc_core::GrpcStreamNetworkState::kNotSentOnWire);
|
1176
1081
|
grpc_chttp2_cancel_stream(
|
1177
1082
|
t, s,
|
1178
|
-
grpc_error_set_int(
|
1179
|
-
|
1180
|
-
|
1083
|
+
grpc_error_set_int(GRPC_ERROR_CREATE("Stream IDs exhausted"),
|
1084
|
+
grpc_core::StatusIntProperty::kRpcStatus,
|
1085
|
+
GRPC_STATUS_UNAVAILABLE));
|
1181
1086
|
}
|
1182
1087
|
}
|
1183
1088
|
}
|
@@ -1198,7 +1103,13 @@ static grpc_closure* add_closure_barrier(grpc_closure* closure) {
|
|
1198
1103
|
static void null_then_sched_closure(grpc_closure** closure) {
|
1199
1104
|
grpc_closure* c = *closure;
|
1200
1105
|
*closure = nullptr;
|
1201
|
-
|
1106
|
+
// null_then_schedule_closure might be run during a start_batch which might
|
1107
|
+
// subsequently examine the batch for more operations contained within.
|
1108
|
+
// However, the closure run might make it back to the call object, push a
|
1109
|
+
// completion, have the application see it, and make a new operation on the
|
1110
|
+
// call which recycles the batch BEFORE the call to start_batch completes,
|
1111
|
+
// forcing a race.
|
1112
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, c, absl::OkStatus());
|
1202
1113
|
}
|
1203
1114
|
|
1204
1115
|
void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t,
|
@@ -1209,7 +1120,6 @@ void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t,
|
|
1209
1120
|
grpc_closure* closure = *pclosure;
|
1210
1121
|
*pclosure = nullptr;
|
1211
1122
|
if (closure == nullptr) {
|
1212
|
-
GRPC_ERROR_UNREF(error);
|
1213
1123
|
return;
|
1214
1124
|
}
|
1215
1125
|
closure->next_data.scratch -= CLOSURE_BARRIER_FIRST_REF_BIT;
|
@@ -1223,147 +1133,56 @@ void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t,
|
|
1223
1133
|
CLOSURE_BARRIER_FIRST_REF_BIT),
|
1224
1134
|
static_cast<int>(closure->next_data.scratch %
|
1225
1135
|
CLOSURE_BARRIER_FIRST_REF_BIT),
|
1226
|
-
desc,
|
1136
|
+
desc, grpc_core::StatusToString(error).c_str(),
|
1227
1137
|
write_state_name(t->write_state));
|
1228
1138
|
}
|
1229
|
-
if (error
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
|
1236
|
-
|
1237
|
-
|
1238
|
-
|
1139
|
+
if (!error.ok()) {
|
1140
|
+
grpc_error_handle cl_err =
|
1141
|
+
grpc_core::internal::StatusMoveFromHeapPtr(closure->error_data.error);
|
1142
|
+
if (cl_err.ok()) {
|
1143
|
+
cl_err = GRPC_ERROR_CREATE(absl::StrCat(
|
1144
|
+
"Error in HTTP transport completing operation: ", desc,
|
1145
|
+
" write_state=", write_state_name(t->write_state), " refs=",
|
1146
|
+
closure->next_data.scratch / CLOSURE_BARRIER_FIRST_REF_BIT, " flags=",
|
1147
|
+
closure->next_data.scratch % CLOSURE_BARRIER_FIRST_REF_BIT));
|
1148
|
+
cl_err = grpc_error_set_str(
|
1149
|
+
cl_err, grpc_core::StatusStrProperty::kTargetAddress, t->peer_string);
|
1150
|
+
}
|
1151
|
+
cl_err = grpc_error_add_child(cl_err, error);
|
1152
|
+
closure->error_data.error = grpc_core::internal::StatusAllocHeapPtr(cl_err);
|
1239
1153
|
}
|
1240
1154
|
if (closure->next_data.scratch < CLOSURE_BARRIER_FIRST_REF_BIT) {
|
1241
1155
|
if ((t->write_state == GRPC_CHTTP2_WRITE_STATE_IDLE) ||
|
1242
1156
|
!(closure->next_data.scratch & CLOSURE_BARRIER_MAY_COVER_WRITE)) {
|
1243
1157
|
// Using GRPC_CLOSURE_SCHED instead of GRPC_CLOSURE_RUN to avoid running
|
1244
1158
|
// closures earlier than when it is safe to do so.
|
1245
|
-
|
1246
|
-
|
1159
|
+
grpc_error_handle run_error =
|
1160
|
+
grpc_core::internal::StatusMoveFromHeapPtr(closure->error_data.error);
|
1161
|
+
closure->error_data.error = 0;
|
1162
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, run_error);
|
1247
1163
|
} else {
|
1248
|
-
grpc_closure_list_append(&t->run_after_write, closure
|
1249
|
-
closure->error_data.error);
|
1164
|
+
grpc_closure_list_append(&t->run_after_write, closure);
|
1250
1165
|
}
|
1251
1166
|
}
|
1252
1167
|
}
|
1253
1168
|
|
1254
1169
|
static bool contains_non_ok_status(grpc_metadata_batch* batch) {
|
1255
|
-
|
1256
|
-
|
1257
|
-
batch->legacy_index()->named.grpc_status->md,
|
1258
|
-
GRPC_MDELEM_GRPC_STATUS_0);
|
1259
|
-
}
|
1260
|
-
return false;
|
1261
|
-
}
|
1262
|
-
|
1263
|
-
static void maybe_become_writable_due_to_send_msg(grpc_chttp2_transport* t,
|
1264
|
-
grpc_chttp2_stream* s) {
|
1265
|
-
if (s->id != 0 && (!s->write_buffering ||
|
1266
|
-
s->flow_controlled_buffer.length > t->write_buffer_size)) {
|
1267
|
-
grpc_chttp2_mark_stream_writable(t, s);
|
1268
|
-
grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_SEND_MESSAGE);
|
1269
|
-
}
|
1270
|
-
}
|
1271
|
-
|
1272
|
-
static void add_fetched_slice_locked(grpc_chttp2_transport* t,
|
1273
|
-
grpc_chttp2_stream* s) {
|
1274
|
-
s->fetched_send_message_length +=
|
1275
|
-
static_cast<uint32_t> GRPC_SLICE_LENGTH(s->fetching_slice);
|
1276
|
-
grpc_slice_buffer_add(&s->flow_controlled_buffer, s->fetching_slice);
|
1277
|
-
maybe_become_writable_due_to_send_msg(t, s);
|
1278
|
-
}
|
1279
|
-
|
1280
|
-
static void continue_fetching_send_locked(grpc_chttp2_transport* t,
|
1281
|
-
grpc_chttp2_stream* s) {
|
1282
|
-
for (;;) {
|
1283
|
-
if (s->fetching_send_message == nullptr) {
|
1284
|
-
// Stream was cancelled before message fetch completed
|
1285
|
-
abort(); /* TODO(ctiller): what cleanup here? */
|
1286
|
-
}
|
1287
|
-
if (s->fetched_send_message_length == s->fetching_send_message->length()) {
|
1288
|
-
int64_t notify_offset = s->next_message_end_offset;
|
1289
|
-
if (notify_offset <= s->flow_controlled_bytes_written) {
|
1290
|
-
grpc_chttp2_complete_closure_step(
|
1291
|
-
t, s, &s->fetching_send_message_finished, GRPC_ERROR_NONE,
|
1292
|
-
"fetching_send_message_finished");
|
1293
|
-
} else {
|
1294
|
-
grpc_chttp2_write_cb* cb = t->write_cb_pool;
|
1295
|
-
if (cb == nullptr) {
|
1296
|
-
cb = static_cast<grpc_chttp2_write_cb*>(gpr_malloc(sizeof(*cb)));
|
1297
|
-
} else {
|
1298
|
-
t->write_cb_pool = cb->next;
|
1299
|
-
}
|
1300
|
-
cb->call_at_byte = notify_offset;
|
1301
|
-
cb->closure = s->fetching_send_message_finished;
|
1302
|
-
s->fetching_send_message_finished = nullptr;
|
1303
|
-
grpc_chttp2_write_cb** list =
|
1304
|
-
s->fetching_send_message->flags() & GRPC_WRITE_THROUGH
|
1305
|
-
? &s->on_write_finished_cbs
|
1306
|
-
: &s->on_flow_controlled_cbs;
|
1307
|
-
cb->next = *list;
|
1308
|
-
*list = cb;
|
1309
|
-
}
|
1310
|
-
s->fetching_send_message.reset();
|
1311
|
-
return; /* early out */
|
1312
|
-
} else if (s->fetching_send_message->Next(
|
1313
|
-
UINT32_MAX, GRPC_CLOSURE_INIT(&s->complete_fetch_locked,
|
1314
|
-
::complete_fetch, s,
|
1315
|
-
grpc_schedule_on_exec_ctx))) {
|
1316
|
-
grpc_error_handle error =
|
1317
|
-
s->fetching_send_message->Pull(&s->fetching_slice);
|
1318
|
-
if (error != GRPC_ERROR_NONE) {
|
1319
|
-
s->fetching_send_message.reset();
|
1320
|
-
grpc_chttp2_cancel_stream(t, s, error);
|
1321
|
-
} else {
|
1322
|
-
add_fetched_slice_locked(t, s);
|
1323
|
-
}
|
1324
|
-
}
|
1325
|
-
}
|
1326
|
-
}
|
1327
|
-
|
1328
|
-
static void complete_fetch(void* gs, grpc_error_handle error) {
|
1329
|
-
grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(gs);
|
1330
|
-
s->t->combiner->Run(GRPC_CLOSURE_INIT(&s->complete_fetch_locked,
|
1331
|
-
::complete_fetch_locked, s, nullptr),
|
1332
|
-
GRPC_ERROR_REF(error));
|
1333
|
-
}
|
1334
|
-
|
1335
|
-
static void complete_fetch_locked(void* gs, grpc_error_handle error) {
|
1336
|
-
grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(gs);
|
1337
|
-
grpc_chttp2_transport* t = s->t;
|
1338
|
-
if (error == GRPC_ERROR_NONE) {
|
1339
|
-
error = s->fetching_send_message->Pull(&s->fetching_slice);
|
1340
|
-
if (error == GRPC_ERROR_NONE) {
|
1341
|
-
add_fetched_slice_locked(t, s);
|
1342
|
-
continue_fetching_send_locked(t, s);
|
1343
|
-
}
|
1344
|
-
}
|
1345
|
-
if (error != GRPC_ERROR_NONE) {
|
1346
|
-
s->fetching_send_message.reset();
|
1347
|
-
grpc_chttp2_cancel_stream(t, s, error);
|
1348
|
-
}
|
1170
|
+
return batch->get(grpc_core::GrpcStatusMetadata()).value_or(GRPC_STATUS_OK) !=
|
1171
|
+
GRPC_STATUS_OK;
|
1349
1172
|
}
|
1350
1173
|
|
1351
1174
|
static void log_metadata(const grpc_metadata_batch* md_batch, uint32_t id,
|
1352
1175
|
bool is_client, bool is_initial) {
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
gpr_free(key);
|
1359
|
-
gpr_free(value);
|
1176
|
+
gpr_log(GPR_INFO, "--metadata--");
|
1177
|
+
const std::string prefix = absl::StrCat(
|
1178
|
+
"HTTP:", id, is_initial ? ":HDR" : ":TRL", is_client ? ":CLI:" : ":SVR:");
|
1179
|
+
md_batch->Log([&prefix](absl::string_view key, absl::string_view value) {
|
1180
|
+
gpr_log(GPR_INFO, "%s", absl::StrCat(prefix, key, ": ", value).c_str());
|
1360
1181
|
});
|
1361
1182
|
}
|
1362
1183
|
|
1363
1184
|
static void perform_stream_op_locked(void* stream_op,
|
1364
1185
|
grpc_error_handle /*error_ignored*/) {
|
1365
|
-
GPR_TIMER_SCOPE("perform_stream_op_locked", 0);
|
1366
|
-
|
1367
1186
|
grpc_transport_stream_op_batch* op =
|
1368
1187
|
static_cast<grpc_transport_stream_op_batch*>(stream_op);
|
1369
1188
|
grpc_chttp2_stream* s =
|
@@ -1371,13 +1190,13 @@ static void perform_stream_op_locked(void* stream_op,
|
|
1371
1190
|
grpc_transport_stream_op_batch_payload* op_payload = op->payload;
|
1372
1191
|
grpc_chttp2_transport* t = s->t;
|
1373
1192
|
|
1374
|
-
GRPC_STATS_INC_HTTP2_OP_BATCHES();
|
1375
|
-
|
1376
1193
|
s->context = op->payload->context;
|
1377
1194
|
s->traced = op->is_traced;
|
1378
1195
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
|
1379
|
-
gpr_log(GPR_INFO,
|
1380
|
-
|
1196
|
+
gpr_log(GPR_INFO,
|
1197
|
+
"perform_stream_op_locked[s=%p; op=%p]: %s; on_complete = %p", s,
|
1198
|
+
op, grpc_transport_stream_op_batch_string(op).c_str(),
|
1199
|
+
op->on_complete);
|
1381
1200
|
if (op->send_initial_metadata) {
|
1382
1201
|
log_metadata(op_payload->send_initial_metadata.send_initial_metadata,
|
1383
1202
|
s->id, t->is_client, true);
|
@@ -1394,11 +1213,10 @@ static void perform_stream_op_locked(void* stream_op,
|
|
1394
1213
|
// This batch has send ops. Use final_data as a barrier until enqueue time;
|
1395
1214
|
// the initial counter is dropped at the end of this function.
|
1396
1215
|
on_complete->next_data.scratch = CLOSURE_BARRIER_FIRST_REF_BIT;
|
1397
|
-
on_complete->error_data.error =
|
1216
|
+
on_complete->error_data.error = 0;
|
1398
1217
|
}
|
1399
1218
|
|
1400
1219
|
if (op->cancel_stream) {
|
1401
|
-
GRPC_STATS_INC_HTTP2_OP_CANCEL();
|
1402
1220
|
grpc_chttp2_cancel_stream(t, s, op_payload->cancel_stream.cancel_error);
|
1403
1221
|
}
|
1404
1222
|
|
@@ -1406,27 +1224,9 @@ static void perform_stream_op_locked(void* stream_op,
|
|
1406
1224
|
if (t->is_client && t->channelz_socket != nullptr) {
|
1407
1225
|
t->channelz_socket->RecordStreamStartedFromLocal();
|
1408
1226
|
}
|
1409
|
-
GRPC_STATS_INC_HTTP2_OP_SEND_INITIAL_METADATA();
|
1410
1227
|
GPR_ASSERT(s->send_initial_metadata_finished == nullptr);
|
1411
1228
|
on_complete->next_data.scratch |= CLOSURE_BARRIER_MAY_COVER_WRITE;
|
1412
1229
|
|
1413
|
-
// Identify stream compression
|
1414
|
-
if (op_payload->send_initial_metadata.send_initial_metadata->legacy_index()
|
1415
|
-
->named.content_encoding == nullptr ||
|
1416
|
-
grpc_stream_compression_method_parse(
|
1417
|
-
GRPC_MDVALUE(
|
1418
|
-
op_payload->send_initial_metadata.send_initial_metadata
|
1419
|
-
->legacy_index()
|
1420
|
-
->named.content_encoding->md),
|
1421
|
-
true, &s->stream_compression_method) == 0) {
|
1422
|
-
s->stream_compression_method = GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS;
|
1423
|
-
}
|
1424
|
-
if (s->stream_compression_method !=
|
1425
|
-
GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS) {
|
1426
|
-
s->uncompressed_data_size = 0;
|
1427
|
-
s->stream_compression_ctx = nullptr;
|
1428
|
-
grpc_slice_buffer_init(&s->compressed_data_buffer);
|
1429
|
-
}
|
1430
1230
|
s->send_initial_metadata_finished = add_closure_barrier(on_complete);
|
1431
1231
|
s->send_initial_metadata =
|
1432
1232
|
op_payload->send_initial_metadata.send_initial_metadata;
|
@@ -1434,31 +1234,34 @@ static void perform_stream_op_locked(void* stream_op,
|
|
1434
1234
|
s->deadline = std::min(
|
1435
1235
|
s->deadline,
|
1436
1236
|
s->send_initial_metadata->get(grpc_core::GrpcTimeoutMetadata())
|
1437
|
-
.value_or(
|
1237
|
+
.value_or(grpc_core::Timestamp::InfFuture()));
|
1438
1238
|
}
|
1439
1239
|
if (contains_non_ok_status(s->send_initial_metadata)) {
|
1440
1240
|
s->seen_error = true;
|
1441
1241
|
}
|
1442
1242
|
if (!s->write_closed) {
|
1443
1243
|
if (t->is_client) {
|
1444
|
-
if (t->closed_with_error
|
1244
|
+
if (t->closed_with_error.ok()) {
|
1445
1245
|
GPR_ASSERT(s->id == 0);
|
1446
1246
|
grpc_chttp2_list_add_waiting_for_concurrency(t, s);
|
1447
1247
|
maybe_start_some_streams(t);
|
1448
1248
|
} else {
|
1249
|
+
s->trailing_metadata_buffer.Set(
|
1250
|
+
grpc_core::GrpcStreamNetworkState(),
|
1251
|
+
grpc_core::GrpcStreamNetworkState::kNotSentOnWire);
|
1449
1252
|
grpc_chttp2_cancel_stream(
|
1450
1253
|
t, s,
|
1451
1254
|
grpc_error_set_int(
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1255
|
+
GRPC_ERROR_CREATE_REFERENCING("Transport closed",
|
1256
|
+
&t->closed_with_error, 1),
|
1257
|
+
grpc_core::StatusIntProperty::kRpcStatus,
|
1258
|
+
GRPC_STATUS_UNAVAILABLE));
|
1455
1259
|
}
|
1456
1260
|
} else {
|
1457
1261
|
GPR_ASSERT(s->id != 0);
|
1458
1262
|
grpc_chttp2_mark_stream_writable(t, s);
|
1459
1263
|
if (!(op->send_message &&
|
1460
|
-
(op->payload->send_message.
|
1461
|
-
GRPC_WRITE_BUFFER_HINT))) {
|
1264
|
+
(op->payload->send_message.flags & GRPC_WRITE_BUFFER_HINT))) {
|
1462
1265
|
grpc_chttp2_initiate_write(
|
1463
1266
|
t, GRPC_CHTTP2_INITIATE_WRITE_SEND_INITIAL_METADATA);
|
1464
1267
|
}
|
@@ -1467,7 +1270,7 @@ static void perform_stream_op_locked(void* stream_op,
|
|
1467
1270
|
s->send_initial_metadata = nullptr;
|
1468
1271
|
grpc_chttp2_complete_closure_step(
|
1469
1272
|
t, s, &s->send_initial_metadata_finished,
|
1470
|
-
|
1273
|
+
GRPC_ERROR_CREATE_REFERENCING(
|
1471
1274
|
"Attempt to send initial metadata after stream was closed",
|
1472
1275
|
&s->write_closed_error, 1),
|
1473
1276
|
"send_initial_metadata_finished");
|
@@ -1479,35 +1282,30 @@ static void perform_stream_op_locked(void* stream_op,
|
|
1479
1282
|
}
|
1480
1283
|
|
1481
1284
|
if (op->send_message) {
|
1482
|
-
GRPC_STATS_INC_HTTP2_OP_SEND_MESSAGE();
|
1483
1285
|
t->num_messages_in_next_write++;
|
1484
|
-
|
1485
|
-
op->payload->send_message.send_message->
|
1286
|
+
grpc_core::global_stats().IncrementHttp2SendMessageSize(
|
1287
|
+
op->payload->send_message.send_message->Length());
|
1486
1288
|
on_complete->next_data.scratch |= CLOSURE_BARRIER_MAY_COVER_WRITE;
|
1487
|
-
s->
|
1289
|
+
s->send_message_finished = add_closure_barrier(op->on_complete);
|
1290
|
+
const uint32_t flags = op_payload->send_message.flags;
|
1488
1291
|
if (s->write_closed) {
|
1489
1292
|
op->payload->send_message.stream_write_closed = true;
|
1490
1293
|
// We should NOT return an error here, so as to avoid a cancel OP being
|
1491
1294
|
// started. The surface layer will notice that the stream has been closed
|
1492
1295
|
// for writes and fail the send message op.
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
"fetching_send_message_finished");
|
1296
|
+
grpc_chttp2_complete_closure_step(t, s, &s->send_message_finished,
|
1297
|
+
absl::OkStatus(),
|
1298
|
+
"fetching_send_message_finished");
|
1497
1299
|
} else {
|
1498
|
-
GPR_ASSERT(s->fetching_send_message == nullptr);
|
1499
1300
|
uint8_t* frame_hdr = grpc_slice_buffer_tiny_add(
|
1500
1301
|
&s->flow_controlled_buffer, GRPC_HEADER_SIZE_IN_BYTES);
|
1501
|
-
uint32_t flags = op_payload->send_message.send_message->flags();
|
1502
1302
|
frame_hdr[0] = (flags & GRPC_WRITE_INTERNAL_COMPRESS) != 0;
|
1503
|
-
size_t len = op_payload->send_message.send_message->
|
1303
|
+
size_t len = op_payload->send_message.send_message->Length();
|
1504
1304
|
frame_hdr[1] = static_cast<uint8_t>(len >> 24);
|
1505
1305
|
frame_hdr[2] = static_cast<uint8_t>(len >> 16);
|
1506
1306
|
frame_hdr[3] = static_cast<uint8_t>(len >> 8);
|
1507
1307
|
frame_hdr[4] = static_cast<uint8_t>(len);
|
1508
|
-
|
1509
|
-
std::move(op_payload->send_message.send_message);
|
1510
|
-
s->fetched_send_message_length = 0;
|
1308
|
+
|
1511
1309
|
s->next_message_end_offset =
|
1512
1310
|
s->flow_controlled_bytes_written +
|
1513
1311
|
static_cast<int64_t>(s->flow_controlled_buffer.length) +
|
@@ -1518,13 +1316,48 @@ static void perform_stream_op_locked(void* stream_op,
|
|
1518
1316
|
} else {
|
1519
1317
|
s->write_buffering = false;
|
1520
1318
|
}
|
1521
|
-
|
1522
|
-
|
1319
|
+
|
1320
|
+
grpc_slice* const slices =
|
1321
|
+
op_payload->send_message.send_message->c_slice_buffer()->slices;
|
1322
|
+
grpc_slice* const end =
|
1323
|
+
slices + op_payload->send_message.send_message->Count();
|
1324
|
+
for (grpc_slice* slice = slices; slice != end; slice++) {
|
1325
|
+
grpc_slice_buffer_add(&s->flow_controlled_buffer,
|
1326
|
+
grpc_core::CSliceRef(*slice));
|
1327
|
+
}
|
1328
|
+
|
1329
|
+
int64_t notify_offset = s->next_message_end_offset;
|
1330
|
+
if (notify_offset <= s->flow_controlled_bytes_written) {
|
1331
|
+
grpc_chttp2_complete_closure_step(t, s, &s->send_message_finished,
|
1332
|
+
absl::OkStatus(),
|
1333
|
+
"fetching_send_message_finished");
|
1334
|
+
} else {
|
1335
|
+
grpc_chttp2_write_cb* cb = t->write_cb_pool;
|
1336
|
+
if (cb == nullptr) {
|
1337
|
+
cb = static_cast<grpc_chttp2_write_cb*>(gpr_malloc(sizeof(*cb)));
|
1338
|
+
} else {
|
1339
|
+
t->write_cb_pool = cb->next;
|
1340
|
+
}
|
1341
|
+
cb->call_at_byte = notify_offset;
|
1342
|
+
cb->closure = s->send_message_finished;
|
1343
|
+
s->send_message_finished = nullptr;
|
1344
|
+
grpc_chttp2_write_cb** list = flags & GRPC_WRITE_THROUGH
|
1345
|
+
? &s->on_write_finished_cbs
|
1346
|
+
: &s->on_flow_controlled_cbs;
|
1347
|
+
cb->next = *list;
|
1348
|
+
*list = cb;
|
1349
|
+
}
|
1350
|
+
|
1351
|
+
if (s->id != 0 &&
|
1352
|
+
(!s->write_buffering ||
|
1353
|
+
s->flow_controlled_buffer.length > t->write_buffer_size)) {
|
1354
|
+
grpc_chttp2_mark_stream_writable(t, s);
|
1355
|
+
grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_SEND_MESSAGE);
|
1356
|
+
}
|
1523
1357
|
}
|
1524
1358
|
}
|
1525
1359
|
|
1526
1360
|
if (op->send_trailing_metadata) {
|
1527
|
-
GRPC_STATS_INC_HTTP2_OP_SEND_TRAILING_METADATA();
|
1528
1361
|
GPR_ASSERT(s->send_trailing_metadata_finished == nullptr);
|
1529
1362
|
on_complete->next_data.scratch |= CLOSURE_BARRIER_MAY_COVER_WRITE;
|
1530
1363
|
s->send_trailing_metadata_finished = add_closure_barrier(on_complete);
|
@@ -1541,10 +1374,9 @@ static void perform_stream_op_locked(void* stream_op,
|
|
1541
1374
|
grpc_chttp2_complete_closure_step(
|
1542
1375
|
t, s, &s->send_trailing_metadata_finished,
|
1543
1376
|
op->payload->send_trailing_metadata.send_trailing_metadata->empty()
|
1544
|
-
?
|
1545
|
-
:
|
1546
|
-
|
1547
|
-
"stream was closed"),
|
1377
|
+
? absl::OkStatus()
|
1378
|
+
: GRPC_ERROR_CREATE("Attempt to send trailing metadata after "
|
1379
|
+
"stream was closed"),
|
1548
1380
|
"send_trailing_metadata_finished");
|
1549
1381
|
} else if (s->id != 0) {
|
1550
1382
|
// TODO(ctiller): check if there's flow control for any outstanding
|
@@ -1556,7 +1388,6 @@ static void perform_stream_op_locked(void* stream_op,
|
|
1556
1388
|
}
|
1557
1389
|
|
1558
1390
|
if (op->recv_initial_metadata) {
|
1559
|
-
GRPC_STATS_INC_HTTP2_OP_RECV_INITIAL_METADATA();
|
1560
1391
|
GPR_ASSERT(s->recv_initial_metadata_ready == nullptr);
|
1561
1392
|
s->recv_initial_metadata_ready =
|
1562
1393
|
op_payload->recv_initial_metadata.recv_initial_metadata_ready;
|
@@ -1564,6 +1395,9 @@ static void perform_stream_op_locked(void* stream_op,
|
|
1564
1395
|
op_payload->recv_initial_metadata.recv_initial_metadata;
|
1565
1396
|
s->trailing_metadata_available =
|
1566
1397
|
op_payload->recv_initial_metadata.trailing_metadata_available;
|
1398
|
+
if (s->parsed_trailers_only && s->trailing_metadata_available != nullptr) {
|
1399
|
+
*s->trailing_metadata_available = true;
|
1400
|
+
}
|
1567
1401
|
if (op_payload->recv_initial_metadata.peer_string != nullptr) {
|
1568
1402
|
gpr_atm_rel_store(op_payload->recv_initial_metadata.peer_string,
|
1569
1403
|
(gpr_atm)t->peer_string.c_str());
|
@@ -1572,33 +1406,17 @@ static void perform_stream_op_locked(void* stream_op,
|
|
1572
1406
|
}
|
1573
1407
|
|
1574
1408
|
if (op->recv_message) {
|
1575
|
-
GRPC_STATS_INC_HTTP2_OP_RECV_MESSAGE();
|
1576
|
-
size_t before = 0;
|
1577
1409
|
GPR_ASSERT(s->recv_message_ready == nullptr);
|
1578
|
-
GPR_ASSERT(!s->pending_byte_stream);
|
1579
1410
|
s->recv_message_ready = op_payload->recv_message.recv_message_ready;
|
1580
1411
|
s->recv_message = op_payload->recv_message.recv_message;
|
1412
|
+
s->recv_message->emplace();
|
1413
|
+
s->recv_message_flags = op_payload->recv_message.flags;
|
1581
1414
|
s->call_failed_before_recv_message =
|
1582
1415
|
op_payload->recv_message.call_failed_before_recv_message;
|
1583
|
-
|
1584
|
-
if (!s->read_closed) {
|
1585
|
-
before = s->frame_storage.length +
|
1586
|
-
s->unprocessed_incoming_frames_buffer.length;
|
1587
|
-
}
|
1588
|
-
}
|
1589
|
-
grpc_chttp2_maybe_complete_recv_message(t, s);
|
1590
|
-
if (s->id != 0) {
|
1591
|
-
if (!s->read_closed && s->frame_storage.length == 0) {
|
1592
|
-
size_t after = s->unprocessed_incoming_frames_buffer_cached_length;
|
1593
|
-
s->flow_control->IncomingByteStreamUpdate(GRPC_HEADER_SIZE_IN_BYTES,
|
1594
|
-
before - after);
|
1595
|
-
grpc_chttp2_act_on_flowctl_action(s->flow_control->MakeAction(), t, s);
|
1596
|
-
}
|
1597
|
-
}
|
1416
|
+
grpc_chttp2_maybe_complete_recv_trailing_metadata(t, s);
|
1598
1417
|
}
|
1599
1418
|
|
1600
1419
|
if (op->recv_trailing_metadata) {
|
1601
|
-
GRPC_STATS_INC_HTTP2_OP_RECV_TRAILING_METADATA();
|
1602
1420
|
GPR_ASSERT(s->collecting_stats == nullptr);
|
1603
1421
|
s->collecting_stats = op_payload->recv_trailing_metadata.collect_stats;
|
1604
1422
|
GPR_ASSERT(s->recv_trailing_metadata_finished == nullptr);
|
@@ -1611,7 +1429,7 @@ static void perform_stream_op_locked(void* stream_op,
|
|
1611
1429
|
}
|
1612
1430
|
|
1613
1431
|
if (on_complete != nullptr) {
|
1614
|
-
grpc_chttp2_complete_closure_step(t, s, &on_complete,
|
1432
|
+
grpc_chttp2_complete_closure_step(t, s, &on_complete, absl::OkStatus(),
|
1615
1433
|
"op->on_complete");
|
1616
1434
|
}
|
1617
1435
|
|
@@ -1620,7 +1438,6 @@ static void perform_stream_op_locked(void* stream_op,
|
|
1620
1438
|
|
1621
1439
|
static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
|
1622
1440
|
grpc_transport_stream_op_batch* op) {
|
1623
|
-
GPR_TIMER_SCOPE("perform_stream_op", 0);
|
1624
1441
|
grpc_chttp2_transport* t = reinterpret_cast<grpc_chttp2_transport*>(gt);
|
1625
1442
|
grpc_chttp2_stream* s = reinterpret_cast<grpc_chttp2_stream*>(gs);
|
1626
1443
|
|
@@ -1638,7 +1455,7 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
|
|
1638
1455
|
}
|
1639
1456
|
|
1640
1457
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
|
1641
|
-
gpr_log(GPR_INFO, "perform_stream_op[s=%p]: %s", s,
|
1458
|
+
gpr_log(GPR_INFO, "perform_stream_op[s=%p; op=%p]: %s", s, op,
|
1642
1459
|
grpc_transport_stream_op_batch_string(op).c_str());
|
1643
1460
|
}
|
1644
1461
|
|
@@ -1646,49 +1463,46 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
|
|
1646
1463
|
op->handler_private.extra_arg = gs;
|
1647
1464
|
t->combiner->Run(GRPC_CLOSURE_INIT(&op->handler_private.closure,
|
1648
1465
|
perform_stream_op_locked, op, nullptr),
|
1649
|
-
|
1466
|
+
absl::OkStatus());
|
1650
1467
|
}
|
1651
1468
|
|
1652
1469
|
static void cancel_pings(grpc_chttp2_transport* t, grpc_error_handle error) {
|
1653
1470
|
// callback remaining pings: they're not allowed to call into the transport,
|
1654
1471
|
// and maybe they hold resources that need to be freed
|
1655
1472
|
grpc_chttp2_ping_queue* pq = &t->ping_queue;
|
1656
|
-
GPR_ASSERT(error
|
1473
|
+
GPR_ASSERT(!error.ok());
|
1657
1474
|
for (size_t j = 0; j < GRPC_CHTTP2_PCL_COUNT; j++) {
|
1658
|
-
grpc_closure_list_fail_all(&pq->lists[j],
|
1475
|
+
grpc_closure_list_fail_all(&pq->lists[j], error);
|
1659
1476
|
grpc_core::ExecCtx::RunList(DEBUG_LOCATION, &pq->lists[j]);
|
1660
1477
|
}
|
1661
|
-
GRPC_ERROR_UNREF(error);
|
1662
1478
|
}
|
1663
1479
|
|
1664
1480
|
static void send_ping_locked(grpc_chttp2_transport* t,
|
1665
1481
|
grpc_closure* on_initiate, grpc_closure* on_ack) {
|
1666
|
-
if (t->closed_with_error
|
1667
|
-
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_initiate,
|
1668
|
-
|
1669
|
-
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_ack,
|
1670
|
-
GRPC_ERROR_REF(t->closed_with_error));
|
1482
|
+
if (!t->closed_with_error.ok()) {
|
1483
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_initiate, t->closed_with_error);
|
1484
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_ack, t->closed_with_error);
|
1671
1485
|
return;
|
1672
1486
|
}
|
1673
1487
|
grpc_chttp2_ping_queue* pq = &t->ping_queue;
|
1674
1488
|
grpc_closure_list_append(&pq->lists[GRPC_CHTTP2_PCL_INITIATE], on_initiate,
|
1675
|
-
|
1489
|
+
absl::OkStatus());
|
1676
1490
|
grpc_closure_list_append(&pq->lists[GRPC_CHTTP2_PCL_NEXT], on_ack,
|
1677
|
-
|
1491
|
+
absl::OkStatus());
|
1678
1492
|
}
|
1679
1493
|
|
1680
1494
|
// Specialized form of send_ping_locked for keepalive ping. If there is already
|
1681
1495
|
// a ping in progress, the keepalive ping would piggyback onto that ping,
|
1682
1496
|
// instead of waiting for that ping to complete and then starting a new ping.
|
1683
1497
|
static void send_keepalive_ping_locked(grpc_chttp2_transport* t) {
|
1684
|
-
if (t->closed_with_error
|
1498
|
+
if (!t->closed_with_error.ok()) {
|
1685
1499
|
t->combiner->Run(GRPC_CLOSURE_INIT(&t->start_keepalive_ping_locked,
|
1686
1500
|
start_keepalive_ping_locked, t, nullptr),
|
1687
|
-
|
1501
|
+
t->closed_with_error);
|
1688
1502
|
t->combiner->Run(
|
1689
1503
|
GRPC_CLOSURE_INIT(&t->finish_keepalive_ping_locked,
|
1690
1504
|
finish_keepalive_ping_locked, t, nullptr),
|
1691
|
-
|
1505
|
+
t->closed_with_error);
|
1692
1506
|
return;
|
1693
1507
|
}
|
1694
1508
|
grpc_chttp2_ping_queue* pq = &t->ping_queue;
|
@@ -1696,37 +1510,37 @@ static void send_keepalive_ping_locked(grpc_chttp2_transport* t) {
|
|
1696
1510
|
// There is a ping in flight. Add yourself to the inflight closure list.
|
1697
1511
|
t->combiner->Run(GRPC_CLOSURE_INIT(&t->start_keepalive_ping_locked,
|
1698
1512
|
start_keepalive_ping_locked, t, nullptr),
|
1699
|
-
|
1513
|
+
t->closed_with_error);
|
1700
1514
|
grpc_closure_list_append(
|
1701
1515
|
&pq->lists[GRPC_CHTTP2_PCL_INFLIGHT],
|
1702
1516
|
GRPC_CLOSURE_INIT(&t->finish_keepalive_ping_locked,
|
1703
1517
|
finish_keepalive_ping, t, grpc_schedule_on_exec_ctx),
|
1704
|
-
|
1518
|
+
absl::OkStatus());
|
1705
1519
|
return;
|
1706
1520
|
}
|
1707
1521
|
grpc_closure_list_append(
|
1708
1522
|
&pq->lists[GRPC_CHTTP2_PCL_INITIATE],
|
1709
1523
|
GRPC_CLOSURE_INIT(&t->start_keepalive_ping_locked, start_keepalive_ping,
|
1710
1524
|
t, grpc_schedule_on_exec_ctx),
|
1711
|
-
|
1525
|
+
absl::OkStatus());
|
1712
1526
|
grpc_closure_list_append(
|
1713
1527
|
&pq->lists[GRPC_CHTTP2_PCL_NEXT],
|
1714
1528
|
GRPC_CLOSURE_INIT(&t->finish_keepalive_ping_locked, finish_keepalive_ping,
|
1715
1529
|
t, grpc_schedule_on_exec_ctx),
|
1716
|
-
|
1530
|
+
absl::OkStatus());
|
1717
1531
|
}
|
1718
1532
|
|
1719
1533
|
void grpc_chttp2_retry_initiate_ping(void* tp, grpc_error_handle error) {
|
1720
1534
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
1721
1535
|
t->combiner->Run(GRPC_CLOSURE_INIT(&t->retry_initiate_ping_locked,
|
1722
1536
|
retry_initiate_ping_locked, t, nullptr),
|
1723
|
-
|
1537
|
+
error);
|
1724
1538
|
}
|
1725
1539
|
|
1726
1540
|
static void retry_initiate_ping_locked(void* tp, grpc_error_handle error) {
|
1727
1541
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
1728
1542
|
t->ping_state.is_delayed_ping_timer_set = false;
|
1729
|
-
if (error
|
1543
|
+
if (error.ok()) {
|
1730
1544
|
grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_RETRY_SEND_PING);
|
1731
1545
|
}
|
1732
1546
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "retry_initiate_ping_locked");
|
@@ -1746,40 +1560,150 @@ void grpc_chttp2_ack_ping(grpc_chttp2_transport* t, uint64_t id) {
|
|
1746
1560
|
}
|
1747
1561
|
}
|
1748
1562
|
|
1749
|
-
|
1750
|
-
|
1751
|
-
|
1752
|
-
|
1753
|
-
|
1563
|
+
namespace {
|
1564
|
+
|
1565
|
+
// Fire and forget (deletes itself on completion). Does a graceful shutdown by
|
1566
|
+
// sending a GOAWAY frame with the last stream id set to 2^31-1, sending a ping
|
1567
|
+
// and waiting for an ack (effective waiting for an RTT) and then sending a
|
1568
|
+
// final GOAWAY freame with an updated last stream identifier. This helps ensure
|
1569
|
+
// that a connection can be cleanly shut down without losing requests.
|
1570
|
+
// In the event, that the client does not respond to the ping for some reason,
|
1571
|
+
// we add a 20 second deadline, after which we send the second goaway.
|
1572
|
+
class GracefulGoaway : public grpc_core::RefCounted<GracefulGoaway> {
|
1573
|
+
public:
|
1574
|
+
static void Start(grpc_chttp2_transport* t) { new GracefulGoaway(t); }
|
1575
|
+
|
1576
|
+
~GracefulGoaway() override {
|
1577
|
+
GRPC_CHTTP2_UNREF_TRANSPORT(t_, "graceful goaway");
|
1578
|
+
}
|
1579
|
+
|
1580
|
+
private:
|
1581
|
+
explicit GracefulGoaway(grpc_chttp2_transport* t) : t_(t) {
|
1582
|
+
t->sent_goaway_state = GRPC_CHTTP2_GRACEFUL_GOAWAY;
|
1583
|
+
GRPC_CHTTP2_REF_TRANSPORT(t_, "graceful goaway");
|
1584
|
+
grpc_chttp2_goaway_append((1u << 31) - 1, 0, grpc_empty_slice(), &t->qbuf);
|
1585
|
+
send_ping_locked(
|
1586
|
+
t, nullptr, GRPC_CLOSURE_INIT(&on_ping_ack_, OnPingAck, this, nullptr));
|
1587
|
+
grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_GOAWAY_SENT);
|
1588
|
+
Ref().release(); // Ref for the timer
|
1589
|
+
grpc_timer_init(
|
1590
|
+
&timer_, grpc_core::Timestamp::Now() + grpc_core::Duration::Seconds(20),
|
1591
|
+
GRPC_CLOSURE_INIT(&on_timer_, OnTimer, this, nullptr));
|
1592
|
+
}
|
1593
|
+
|
1594
|
+
void MaybeSendFinalGoawayLocked() {
|
1595
|
+
if (t_->sent_goaway_state != GRPC_CHTTP2_GRACEFUL_GOAWAY) {
|
1596
|
+
// We already sent the final GOAWAY.
|
1597
|
+
return;
|
1598
|
+
}
|
1599
|
+
if (t_->destroying || !t_->closed_with_error.ok()) {
|
1600
|
+
GRPC_CHTTP2_IF_TRACING(gpr_log(
|
1601
|
+
GPR_INFO,
|
1602
|
+
"transport:%p %s peer:%s Transport already shutting down. "
|
1603
|
+
"Graceful GOAWAY abandoned.",
|
1604
|
+
t_, t_->is_client ? "CLIENT" : "SERVER", t_->peer_string.c_str()));
|
1605
|
+
return;
|
1606
|
+
}
|
1607
|
+
// Ping completed. Send final goaway.
|
1608
|
+
GRPC_CHTTP2_IF_TRACING(
|
1609
|
+
gpr_log(GPR_INFO,
|
1610
|
+
"transport:%p %s peer:%s Graceful shutdown: Ping received. "
|
1611
|
+
"Sending final GOAWAY with stream_id:%d",
|
1612
|
+
t_, t_->is_client ? "CLIENT" : "SERVER",
|
1613
|
+
t_->peer_string.c_str(), t_->last_new_stream_id));
|
1614
|
+
t_->sent_goaway_state = GRPC_CHTTP2_FINAL_GOAWAY_SEND_SCHEDULED;
|
1615
|
+
grpc_chttp2_goaway_append(t_->last_new_stream_id, 0, grpc_empty_slice(),
|
1616
|
+
&t_->qbuf);
|
1617
|
+
grpc_chttp2_initiate_write(t_, GRPC_CHTTP2_INITIATE_WRITE_GOAWAY_SENT);
|
1618
|
+
}
|
1619
|
+
|
1620
|
+
static void OnPingAck(void* arg, grpc_error_handle /* error */) {
|
1621
|
+
auto* self = static_cast<GracefulGoaway*>(arg);
|
1622
|
+
self->t_->combiner->Run(
|
1623
|
+
GRPC_CLOSURE_INIT(&self->on_ping_ack_, OnPingAckLocked, self, nullptr),
|
1624
|
+
absl::OkStatus());
|
1625
|
+
}
|
1626
|
+
|
1627
|
+
static void OnPingAckLocked(void* arg, grpc_error_handle /* error */) {
|
1628
|
+
auto* self = static_cast<GracefulGoaway*>(arg);
|
1629
|
+
grpc_timer_cancel(&self->timer_);
|
1630
|
+
self->MaybeSendFinalGoawayLocked();
|
1631
|
+
self->Unref();
|
1632
|
+
}
|
1633
|
+
|
1634
|
+
static void OnTimer(void* arg, grpc_error_handle error) {
|
1635
|
+
auto* self = static_cast<GracefulGoaway*>(arg);
|
1636
|
+
if (!error.ok()) {
|
1637
|
+
self->Unref();
|
1638
|
+
return;
|
1639
|
+
}
|
1640
|
+
self->t_->combiner->Run(
|
1641
|
+
GRPC_CLOSURE_INIT(&self->on_timer_, OnTimerLocked, self, nullptr),
|
1642
|
+
absl::OkStatus());
|
1643
|
+
}
|
1644
|
+
|
1645
|
+
static void OnTimerLocked(void* arg, grpc_error_handle /* error */) {
|
1646
|
+
auto* self = static_cast<GracefulGoaway*>(arg);
|
1647
|
+
self->MaybeSendFinalGoawayLocked();
|
1648
|
+
self->Unref();
|
1649
|
+
}
|
1650
|
+
|
1651
|
+
grpc_chttp2_transport* t_;
|
1652
|
+
grpc_closure on_ping_ack_;
|
1653
|
+
grpc_timer timer_;
|
1654
|
+
grpc_closure on_timer_;
|
1655
|
+
};
|
1656
|
+
|
1657
|
+
} // namespace
|
1658
|
+
|
1659
|
+
static void send_goaway(grpc_chttp2_transport* t, grpc_error_handle error,
|
1660
|
+
bool immediate_disconnect_hint) {
|
1754
1661
|
grpc_http2_error_code http_error;
|
1755
1662
|
std::string message;
|
1756
|
-
grpc_error_get_status(error,
|
1757
|
-
&http_error, nullptr);
|
1758
|
-
|
1759
|
-
|
1760
|
-
|
1663
|
+
grpc_error_get_status(error, grpc_core::Timestamp::InfFuture(), nullptr,
|
1664
|
+
&message, &http_error, nullptr);
|
1665
|
+
if (!t->is_client && http_error == GRPC_HTTP2_NO_ERROR &&
|
1666
|
+
!immediate_disconnect_hint) {
|
1667
|
+
// Do a graceful shutdown.
|
1668
|
+
if (t->sent_goaway_state == GRPC_CHTTP2_NO_GOAWAY_SEND) {
|
1669
|
+
GracefulGoaway::Start(t);
|
1670
|
+
} else {
|
1671
|
+
// Graceful GOAWAY is already in progress.
|
1672
|
+
}
|
1673
|
+
} else if (t->sent_goaway_state == GRPC_CHTTP2_NO_GOAWAY_SEND ||
|
1674
|
+
t->sent_goaway_state == GRPC_CHTTP2_GRACEFUL_GOAWAY) {
|
1675
|
+
// We want to log this irrespective of whether http tracing is enabled
|
1676
|
+
gpr_log(GPR_DEBUG, "%s: Sending goaway err=%s", t->peer_string.c_str(),
|
1677
|
+
grpc_core::StatusToString(error).c_str());
|
1678
|
+
t->sent_goaway_state = GRPC_CHTTP2_FINAL_GOAWAY_SEND_SCHEDULED;
|
1679
|
+
grpc_chttp2_goaway_append(
|
1680
|
+
t->last_new_stream_id, static_cast<uint32_t>(http_error),
|
1681
|
+
grpc_slice_from_cpp_string(std::move(message)), &t->qbuf);
|
1682
|
+
} else {
|
1683
|
+
// Final GOAWAY has already been sent.
|
1684
|
+
}
|
1761
1685
|
grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_GOAWAY_SENT);
|
1762
|
-
GRPC_ERROR_UNREF(error);
|
1763
1686
|
}
|
1764
1687
|
|
1765
1688
|
void grpc_chttp2_add_ping_strike(grpc_chttp2_transport* t) {
|
1766
1689
|
if (++t->ping_recv_state.ping_strikes > t->ping_policy.max_ping_strikes &&
|
1767
1690
|
t->ping_policy.max_ping_strikes != 0) {
|
1768
1691
|
send_goaway(t,
|
1769
|
-
grpc_error_set_int(
|
1770
|
-
|
1771
|
-
|
1692
|
+
grpc_error_set_int(GRPC_ERROR_CREATE("too_many_pings"),
|
1693
|
+
grpc_core::StatusIntProperty::kHttp2Error,
|
1694
|
+
GRPC_HTTP2_ENHANCE_YOUR_CALM),
|
1695
|
+
/*immediate_disconnect_hint=*/true);
|
1772
1696
|
// The transport will be closed after the write is done
|
1773
1697
|
close_transport_locked(
|
1774
|
-
t, grpc_error_set_int(
|
1775
|
-
|
1776
|
-
|
1698
|
+
t, grpc_error_set_int(GRPC_ERROR_CREATE("Too many pings"),
|
1699
|
+
grpc_core::StatusIntProperty::kRpcStatus,
|
1700
|
+
GRPC_STATUS_UNAVAILABLE));
|
1777
1701
|
}
|
1778
1702
|
}
|
1779
1703
|
|
1780
1704
|
void grpc_chttp2_reset_ping_clock(grpc_chttp2_transport* t) {
|
1781
1705
|
if (!t->is_client) {
|
1782
|
-
t->ping_recv_state.last_ping_recv_time =
|
1706
|
+
t->ping_recv_state.last_ping_recv_time = grpc_core::Timestamp::InfPast();
|
1783
1707
|
t->ping_recv_state.ping_strikes = 0;
|
1784
1708
|
}
|
1785
1709
|
t->ping_state.pings_before_data_required =
|
@@ -1792,8 +1716,8 @@ static void perform_transport_op_locked(void* stream_op,
|
|
1792
1716
|
grpc_chttp2_transport* t =
|
1793
1717
|
static_cast<grpc_chttp2_transport*>(op->handler_private.extra_arg);
|
1794
1718
|
|
1795
|
-
if (op->goaway_error
|
1796
|
-
send_goaway(t, op->goaway_error);
|
1719
|
+
if (!op->goaway_error.ok()) {
|
1720
|
+
send_goaway(t, op->goaway_error, /*immediate_disconnect_hint=*/false);
|
1797
1721
|
}
|
1798
1722
|
|
1799
1723
|
if (op->set_accept_stream) {
|
@@ -1822,11 +1746,13 @@ static void perform_transport_op_locked(void* stream_op,
|
|
1822
1746
|
t->state_tracker.RemoveWatcher(op->stop_connectivity_watch);
|
1823
1747
|
}
|
1824
1748
|
|
1825
|
-
if (op->disconnect_with_error
|
1749
|
+
if (!op->disconnect_with_error.ok()) {
|
1750
|
+
send_goaway(t, op->disconnect_with_error,
|
1751
|
+
/*immediate_disconnect_hint=*/true);
|
1826
1752
|
close_transport_locked(t, op->disconnect_with_error);
|
1827
1753
|
}
|
1828
1754
|
|
1829
|
-
grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_consumed,
|
1755
|
+
grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_consumed, absl::OkStatus());
|
1830
1756
|
|
1831
1757
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "transport_op");
|
1832
1758
|
}
|
@@ -1841,116 +1767,101 @@ static void perform_transport_op(grpc_transport* gt, grpc_transport_op* op) {
|
|
1841
1767
|
GRPC_CHTTP2_REF_TRANSPORT(t, "transport_op");
|
1842
1768
|
t->combiner->Run(GRPC_CLOSURE_INIT(&op->handler_private.closure,
|
1843
1769
|
perform_transport_op_locked, op, nullptr),
|
1844
|
-
|
1770
|
+
absl::OkStatus());
|
1845
1771
|
}
|
1846
1772
|
|
1847
1773
|
//
|
1848
1774
|
// INPUT PROCESSING - GENERAL
|
1849
1775
|
//
|
1850
1776
|
|
1851
|
-
void grpc_chttp2_maybe_complete_recv_initial_metadata(
|
1852
|
-
|
1777
|
+
void grpc_chttp2_maybe_complete_recv_initial_metadata(grpc_chttp2_transport* t,
|
1778
|
+
grpc_chttp2_stream* s) {
|
1853
1779
|
if (s->recv_initial_metadata_ready != nullptr &&
|
1854
1780
|
s->published_metadata[0] != GRPC_METADATA_NOT_PUBLISHED) {
|
1855
1781
|
if (s->seen_error) {
|
1856
|
-
|
1857
|
-
if (!s->pending_byte_stream) {
|
1858
|
-
grpc_slice_buffer_reset_and_unref_internal(
|
1859
|
-
&s->unprocessed_incoming_frames_buffer);
|
1860
|
-
}
|
1782
|
+
grpc_slice_buffer_reset_and_unref(&s->frame_storage);
|
1861
1783
|
}
|
1862
1784
|
*s->recv_initial_metadata = std::move(s->initial_metadata_buffer);
|
1785
|
+
s->recv_initial_metadata->Set(grpc_core::PeerString(), t->peer_string);
|
1786
|
+
// If we didn't receive initial metadata from the wire and instead faked a
|
1787
|
+
// status (due to stream cancellations for example), let upper layers know
|
1788
|
+
// that trailing metadata is immediately available.
|
1789
|
+
if (s->trailing_metadata_available != nullptr &&
|
1790
|
+
s->published_metadata[0] != GRPC_METADATA_PUBLISHED_FROM_WIRE &&
|
1791
|
+
s->published_metadata[1] == GRPC_METADATA_SYNTHESIZED_FROM_FAKE) {
|
1792
|
+
*s->trailing_metadata_available = true;
|
1793
|
+
s->trailing_metadata_available = nullptr;
|
1794
|
+
}
|
1863
1795
|
null_then_sched_closure(&s->recv_initial_metadata_ready);
|
1864
1796
|
}
|
1865
1797
|
}
|
1866
1798
|
|
1867
|
-
void grpc_chttp2_maybe_complete_recv_message(grpc_chttp2_transport*
|
1799
|
+
void grpc_chttp2_maybe_complete_recv_message(grpc_chttp2_transport* t,
|
1868
1800
|
grpc_chttp2_stream* s) {
|
1869
|
-
|
1870
|
-
|
1871
|
-
|
1801
|
+
if (s->recv_message_ready == nullptr) return;
|
1802
|
+
|
1803
|
+
grpc_core::chttp2::StreamFlowControl::IncomingUpdateContext upd(
|
1804
|
+
&s->flow_control);
|
1805
|
+
grpc_error_handle error;
|
1806
|
+
|
1807
|
+
// Lambda is immediately invoked as a big scoped section that can be
|
1808
|
+
// exited out of at any point by returning.
|
1809
|
+
[&]() {
|
1872
1810
|
if (s->final_metadata_requested && s->seen_error) {
|
1873
|
-
|
1874
|
-
|
1875
|
-
|
1876
|
-
|
1877
|
-
|
1878
|
-
|
1879
|
-
|
1880
|
-
|
1881
|
-
|
1882
|
-
|
1883
|
-
|
1884
|
-
|
1885
|
-
|
1886
|
-
|
1887
|
-
|
1888
|
-
|
1889
|
-
|
1890
|
-
GPR_ASSERT(s->decompressed_data_buffer.length == 0);
|
1891
|
-
bool end_of_context;
|
1892
|
-
if (!s->stream_decompression_ctx) {
|
1893
|
-
s->stream_decompression_ctx =
|
1894
|
-
grpc_stream_compression_context_create(
|
1895
|
-
s->stream_decompression_method);
|
1896
|
-
}
|
1897
|
-
if (!grpc_stream_decompress(
|
1898
|
-
s->stream_decompression_ctx,
|
1899
|
-
&s->unprocessed_incoming_frames_buffer,
|
1900
|
-
&s->decompressed_data_buffer, nullptr,
|
1901
|
-
GRPC_HEADER_SIZE_IN_BYTES - s->decompressed_header_bytes,
|
1902
|
-
&end_of_context)) {
|
1903
|
-
grpc_slice_buffer_reset_and_unref_internal(&s->frame_storage);
|
1904
|
-
grpc_slice_buffer_reset_and_unref_internal(
|
1905
|
-
&s->unprocessed_incoming_frames_buffer);
|
1906
|
-
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
1907
|
-
"Stream decompression error.");
|
1908
|
-
} else {
|
1909
|
-
s->decompressed_header_bytes += s->decompressed_data_buffer.length;
|
1910
|
-
if (s->decompressed_header_bytes == GRPC_HEADER_SIZE_IN_BYTES) {
|
1911
|
-
s->decompressed_header_bytes = 0;
|
1811
|
+
grpc_slice_buffer_reset_and_unref(&s->frame_storage);
|
1812
|
+
s->recv_message->reset();
|
1813
|
+
} else {
|
1814
|
+
if (s->frame_storage.length != 0) {
|
1815
|
+
while (true) {
|
1816
|
+
GPR_ASSERT(s->frame_storage.length > 0);
|
1817
|
+
int64_t min_progress_size;
|
1818
|
+
auto r = grpc_deframe_unprocessed_incoming_frames(
|
1819
|
+
s, &min_progress_size, &**s->recv_message, s->recv_message_flags);
|
1820
|
+
if (absl::holds_alternative<grpc_core::Pending>(r)) {
|
1821
|
+
if (s->read_closed) {
|
1822
|
+
grpc_slice_buffer_reset_and_unref(&s->frame_storage);
|
1823
|
+
s->recv_message->reset();
|
1824
|
+
break;
|
1825
|
+
} else {
|
1826
|
+
upd.SetMinProgressSize(min_progress_size);
|
1827
|
+
return; // Out of lambda to enclosing function
|
1912
1828
|
}
|
1913
|
-
|
1914
|
-
|
1915
|
-
|
1916
|
-
|
1917
|
-
|
1918
|
-
|
1919
|
-
|
1829
|
+
} else {
|
1830
|
+
error = absl::get<grpc_error_handle>(r);
|
1831
|
+
if (!error.ok()) {
|
1832
|
+
s->seen_error = true;
|
1833
|
+
grpc_slice_buffer_reset_and_unref(&s->frame_storage);
|
1834
|
+
break;
|
1835
|
+
} else {
|
1836
|
+
if (t->channelz_socket != nullptr) {
|
1837
|
+
t->channelz_socket->RecordMessageReceived();
|
1838
|
+
}
|
1839
|
+
break;
|
1920
1840
|
}
|
1921
1841
|
}
|
1922
|
-
} else {
|
1923
|
-
error = grpc_deframe_unprocessed_incoming_frames(
|
1924
|
-
&s->data_parser, s, &s->unprocessed_incoming_frames_buffer,
|
1925
|
-
nullptr, s->recv_message);
|
1926
|
-
}
|
1927
|
-
if (error != GRPC_ERROR_NONE) {
|
1928
|
-
s->seen_error = true;
|
1929
|
-
grpc_slice_buffer_reset_and_unref_internal(&s->frame_storage);
|
1930
|
-
grpc_slice_buffer_reset_and_unref_internal(
|
1931
|
-
&s->unprocessed_incoming_frames_buffer);
|
1932
|
-
break;
|
1933
|
-
} else if (*s->recv_message != nullptr) {
|
1934
|
-
break;
|
1935
1842
|
}
|
1843
|
+
} else if (s->read_closed) {
|
1844
|
+
s->recv_message->reset();
|
1845
|
+
} else {
|
1846
|
+
upd.SetMinProgressSize(GRPC_HEADER_SIZE_IN_BYTES);
|
1847
|
+
return; // Out of lambda to enclosing function
|
1936
1848
|
}
|
1937
1849
|
}
|
1938
1850
|
// save the length of the buffer before handing control back to application
|
1939
1851
|
// threads. Needed to support correct flow control bookkeeping
|
1940
|
-
s->
|
1941
|
-
s->unprocessed_incoming_frames_buffer.length;
|
1942
|
-
if (error == GRPC_ERROR_NONE && *s->recv_message != nullptr) {
|
1852
|
+
if (error.ok() && s->recv_message->has_value()) {
|
1943
1853
|
null_then_sched_closure(&s->recv_message_ready);
|
1944
1854
|
} else if (s->published_metadata[1] != GRPC_METADATA_NOT_PUBLISHED) {
|
1945
|
-
*s->recv_message = nullptr;
|
1946
1855
|
if (s->call_failed_before_recv_message != nullptr) {
|
1947
1856
|
*s->call_failed_before_recv_message =
|
1948
1857
|
(s->published_metadata[1] != GRPC_METADATA_PUBLISHED_AT_CLOSE);
|
1949
1858
|
}
|
1950
1859
|
null_then_sched_closure(&s->recv_message_ready);
|
1951
1860
|
}
|
1952
|
-
|
1953
|
-
|
1861
|
+
}();
|
1862
|
+
|
1863
|
+
upd.SetPendingSize(s->frame_storage.length);
|
1864
|
+
grpc_chttp2_act_on_flowctl_action(upd.MakeAction(), t, s);
|
1954
1865
|
}
|
1955
1866
|
|
1956
1867
|
void grpc_chttp2_maybe_complete_recv_trailing_metadata(grpc_chttp2_transport* t,
|
@@ -1959,61 +1870,14 @@ void grpc_chttp2_maybe_complete_recv_trailing_metadata(grpc_chttp2_transport* t,
|
|
1959
1870
|
if (s->recv_trailing_metadata_finished != nullptr && s->read_closed &&
|
1960
1871
|
s->write_closed) {
|
1961
1872
|
if (s->seen_error || !t->is_client) {
|
1962
|
-
|
1963
|
-
if (!s->pending_byte_stream) {
|
1964
|
-
grpc_slice_buffer_reset_and_unref_internal(
|
1965
|
-
&s->unprocessed_incoming_frames_buffer);
|
1966
|
-
}
|
1873
|
+
grpc_slice_buffer_reset_and_unref(&s->frame_storage);
|
1967
1874
|
}
|
1968
|
-
|
1969
|
-
s->unprocessed_incoming_frames_buffer.length > 0;
|
1970
|
-
if (s->read_closed && s->frame_storage.length > 0 && !pending_data &&
|
1971
|
-
!s->seen_error && s->recv_trailing_metadata_finished != nullptr) {
|
1972
|
-
// Maybe some SYNC_FLUSH data is left in frame_storage. Consume them and
|
1973
|
-
// maybe decompress the next 5 bytes in the stream.
|
1974
|
-
if (s->stream_decompression_method ==
|
1975
|
-
GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS) {
|
1976
|
-
grpc_slice_buffer_move_first(
|
1977
|
-
&s->frame_storage,
|
1978
|
-
std::min(s->frame_storage.length,
|
1979
|
-
size_t(GRPC_HEADER_SIZE_IN_BYTES)),
|
1980
|
-
&s->unprocessed_incoming_frames_buffer);
|
1981
|
-
if (s->unprocessed_incoming_frames_buffer.length > 0) {
|
1982
|
-
s->unprocessed_incoming_frames_decompressed = true;
|
1983
|
-
pending_data = true;
|
1984
|
-
}
|
1985
|
-
} else {
|
1986
|
-
bool end_of_context;
|
1987
|
-
if (!s->stream_decompression_ctx) {
|
1988
|
-
s->stream_decompression_ctx = grpc_stream_compression_context_create(
|
1989
|
-
s->stream_decompression_method);
|
1990
|
-
}
|
1991
|
-
if (!grpc_stream_decompress(
|
1992
|
-
s->stream_decompression_ctx, &s->frame_storage,
|
1993
|
-
&s->unprocessed_incoming_frames_buffer, nullptr,
|
1994
|
-
GRPC_HEADER_SIZE_IN_BYTES, &end_of_context)) {
|
1995
|
-
grpc_slice_buffer_reset_and_unref_internal(&s->frame_storage);
|
1996
|
-
grpc_slice_buffer_reset_and_unref_internal(
|
1997
|
-
&s->unprocessed_incoming_frames_buffer);
|
1998
|
-
s->seen_error = true;
|
1999
|
-
} else {
|
2000
|
-
if (s->unprocessed_incoming_frames_buffer.length > 0) {
|
2001
|
-
s->unprocessed_incoming_frames_decompressed = true;
|
2002
|
-
pending_data = true;
|
2003
|
-
}
|
2004
|
-
if (end_of_context) {
|
2005
|
-
grpc_stream_compression_context_destroy(
|
2006
|
-
s->stream_decompression_ctx);
|
2007
|
-
s->stream_decompression_ctx = nullptr;
|
2008
|
-
}
|
2009
|
-
}
|
2010
|
-
}
|
2011
|
-
}
|
2012
|
-
if (s->read_closed && s->frame_storage.length == 0 && !pending_data &&
|
1875
|
+
if (s->read_closed && s->frame_storage.length == 0 &&
|
2013
1876
|
s->recv_trailing_metadata_finished != nullptr) {
|
2014
1877
|
grpc_transport_move_stats(&s->stats, s->collecting_stats);
|
2015
1878
|
s->collecting_stats = nullptr;
|
2016
1879
|
*s->recv_trailing_metadata = std::move(s->trailing_metadata_buffer);
|
1880
|
+
s->recv_trailing_metadata->Set(grpc_core::PeerString(), t->peer_string);
|
2017
1881
|
null_then_sched_closure(&s->recv_trailing_metadata_finished);
|
2018
1882
|
}
|
2019
1883
|
}
|
@@ -2028,26 +1892,12 @@ static void remove_stream(grpc_chttp2_transport* t, uint32_t id,
|
|
2028
1892
|
t->incoming_stream = nullptr;
|
2029
1893
|
grpc_chttp2_parsing_become_skip_parser(t);
|
2030
1894
|
}
|
2031
|
-
if (s->pending_byte_stream) {
|
2032
|
-
if (s->on_next != nullptr) {
|
2033
|
-
grpc_core::Chttp2IncomingByteStream* bs = s->data_parser.parsing_frame;
|
2034
|
-
if (error == GRPC_ERROR_NONE) {
|
2035
|
-
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Truncated message");
|
2036
|
-
}
|
2037
|
-
bs->PublishError(error);
|
2038
|
-
bs->Unref();
|
2039
|
-
s->data_parser.parsing_frame = nullptr;
|
2040
|
-
} else {
|
2041
|
-
GRPC_ERROR_UNREF(s->byte_stream_error);
|
2042
|
-
s->byte_stream_error = GRPC_ERROR_REF(error);
|
2043
|
-
}
|
2044
|
-
}
|
2045
1895
|
|
2046
1896
|
if (grpc_chttp2_stream_map_size(&t->stream_map) == 0) {
|
2047
1897
|
post_benign_reclaimer(t);
|
2048
|
-
if (t->sent_goaway_state ==
|
1898
|
+
if (t->sent_goaway_state == GRPC_CHTTP2_FINAL_GOAWAY_SENT) {
|
2049
1899
|
close_transport_locked(
|
2050
|
-
t,
|
1900
|
+
t, GRPC_ERROR_CREATE_REFERENCING(
|
2051
1901
|
"Last stream closed after sending GOAWAY", &error, 1));
|
2052
1902
|
}
|
2053
1903
|
}
|
@@ -2057,8 +1907,6 @@ static void remove_stream(grpc_chttp2_transport* t, uint32_t id,
|
|
2057
1907
|
grpc_chttp2_list_remove_stalled_by_stream(t, s);
|
2058
1908
|
grpc_chttp2_list_remove_stalled_by_transport(t, s);
|
2059
1909
|
|
2060
|
-
GRPC_ERROR_UNREF(error);
|
2061
|
-
|
2062
1910
|
maybe_start_some_streams(t);
|
2063
1911
|
}
|
2064
1912
|
|
@@ -2080,7 +1928,7 @@ void grpc_chttp2_cancel_stream(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
|
|
2080
1928
|
grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_RST_STREAM);
|
2081
1929
|
}
|
2082
1930
|
}
|
2083
|
-
if (due_to_error
|
1931
|
+
if (!due_to_error.ok() && !s->seen_error) {
|
2084
1932
|
s->seen_error = true;
|
2085
1933
|
}
|
2086
1934
|
grpc_chttp2_mark_stream_closed(t, s, 1, 1, due_to_error);
|
@@ -2103,28 +1951,20 @@ void grpc_chttp2_fake_status(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
|
|
2103
1951
|
// about the metadata yet
|
2104
1952
|
if (s->published_metadata[1] == GRPC_METADATA_NOT_PUBLISHED ||
|
2105
1953
|
s->recv_trailing_metadata_finished != nullptr) {
|
2106
|
-
|
2107
|
-
gpr_ltoa(status, status_string);
|
2108
|
-
GRPC_LOG_IF_ERROR("add_status",
|
2109
|
-
s->trailing_metadata_buffer.ReplaceOrAppend(
|
2110
|
-
GRPC_MDSTR_GRPC_STATUS,
|
2111
|
-
grpc_core::UnmanagedMemorySlice(status_string)));
|
1954
|
+
s->trailing_metadata_buffer.Set(grpc_core::GrpcStatusMetadata(), status);
|
2112
1955
|
if (!message.empty()) {
|
2113
|
-
|
2114
|
-
|
2115
|
-
|
2116
|
-
GRPC_MDSTR_GRPC_MESSAGE, message_slice));
|
1956
|
+
s->trailing_metadata_buffer.Set(
|
1957
|
+
grpc_core::GrpcMessageMetadata(),
|
1958
|
+
grpc_core::Slice::FromCopiedBuffer(message));
|
2117
1959
|
}
|
2118
1960
|
s->published_metadata[1] = GRPC_METADATA_SYNTHESIZED_FROM_FAKE;
|
2119
1961
|
grpc_chttp2_maybe_complete_recv_trailing_metadata(t, s);
|
2120
1962
|
}
|
2121
|
-
|
2122
|
-
GRPC_ERROR_UNREF(error);
|
2123
1963
|
}
|
2124
1964
|
|
2125
1965
|
static void add_error(grpc_error_handle error, grpc_error_handle* refs,
|
2126
1966
|
size_t* nrefs) {
|
2127
|
-
if (error
|
1967
|
+
if (error.ok()) return;
|
2128
1968
|
for (size_t i = 0; i < *nrefs; i++) {
|
2129
1969
|
if (error == refs[i]) {
|
2130
1970
|
return;
|
@@ -2142,12 +1982,10 @@ static grpc_error_handle removal_error(grpc_error_handle extra_error,
|
|
2142
1982
|
add_error(s->read_closed_error, refs, &nrefs);
|
2143
1983
|
add_error(s->write_closed_error, refs, &nrefs);
|
2144
1984
|
add_error(extra_error, refs, &nrefs);
|
2145
|
-
grpc_error_handle error
|
1985
|
+
grpc_error_handle error;
|
2146
1986
|
if (nrefs > 0) {
|
2147
|
-
error =
|
2148
|
-
refs, nrefs);
|
1987
|
+
error = GRPC_ERROR_CREATE_REFERENCING(main_error_msg, refs, nrefs);
|
2149
1988
|
}
|
2150
|
-
GRPC_ERROR_UNREF(extra_error);
|
2151
1989
|
return error;
|
2152
1990
|
}
|
2153
1991
|
|
@@ -2157,12 +1995,11 @@ static void flush_write_list(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
|
|
2157
1995
|
while (*list) {
|
2158
1996
|
grpc_chttp2_write_cb* cb = *list;
|
2159
1997
|
*list = cb->next;
|
2160
|
-
grpc_chttp2_complete_closure_step(t, s, &cb->closure,
|
1998
|
+
grpc_chttp2_complete_closure_step(t, s, &cb->closure, error,
|
2161
1999
|
"on_write_finished_cb");
|
2162
2000
|
cb->next = t->write_cb_pool;
|
2163
2001
|
t->write_cb_pool = cb;
|
2164
2002
|
}
|
2165
|
-
GRPC_ERROR_UNREF(error);
|
2166
2003
|
}
|
2167
2004
|
|
2168
2005
|
void grpc_chttp2_fail_pending_writes(grpc_chttp2_transport* t,
|
@@ -2172,20 +2009,16 @@ void grpc_chttp2_fail_pending_writes(grpc_chttp2_transport* t,
|
|
2172
2009
|
removal_error(error, s, "Pending writes failed due to stream closure");
|
2173
2010
|
s->send_initial_metadata = nullptr;
|
2174
2011
|
grpc_chttp2_complete_closure_step(t, s, &s->send_initial_metadata_finished,
|
2175
|
-
|
2176
|
-
"send_initial_metadata_finished");
|
2012
|
+
error, "send_initial_metadata_finished");
|
2177
2013
|
|
2178
2014
|
s->send_trailing_metadata = nullptr;
|
2179
2015
|
s->sent_trailing_metadata_op = nullptr;
|
2180
2016
|
grpc_chttp2_complete_closure_step(t, s, &s->send_trailing_metadata_finished,
|
2181
|
-
|
2182
|
-
"send_trailing_metadata_finished");
|
2017
|
+
error, "send_trailing_metadata_finished");
|
2183
2018
|
|
2184
|
-
s->
|
2185
|
-
grpc_chttp2_complete_closure_step(t, s, &s->fetching_send_message_finished,
|
2186
|
-
GRPC_ERROR_REF(error),
|
2019
|
+
grpc_chttp2_complete_closure_step(t, s, &s->send_message_finished, error,
|
2187
2020
|
"fetching_send_message_finished");
|
2188
|
-
flush_write_list(t, s, &s->on_write_finished_cbs,
|
2021
|
+
flush_write_list(t, s, &s->on_write_finished_cbs, error);
|
2189
2022
|
flush_write_list(t, s, &s->on_flow_controlled_cbs, error);
|
2190
2023
|
}
|
2191
2024
|
|
@@ -2195,7 +2028,7 @@ void grpc_chttp2_mark_stream_closed(grpc_chttp2_transport* t,
|
|
2195
2028
|
if (s->read_closed && s->write_closed) {
|
2196
2029
|
// already closed, but we should still fake the status if needed.
|
2197
2030
|
grpc_error_handle overall_error = removal_error(error, s, "Stream removed");
|
2198
|
-
if (overall_error
|
2031
|
+
if (!overall_error.ok()) {
|
2199
2032
|
grpc_chttp2_fake_status(t, s, overall_error);
|
2200
2033
|
}
|
2201
2034
|
grpc_chttp2_maybe_complete_recv_trailing_metadata(t, s);
|
@@ -2204,26 +2037,25 @@ void grpc_chttp2_mark_stream_closed(grpc_chttp2_transport* t,
|
|
2204
2037
|
bool closed_read = false;
|
2205
2038
|
bool became_closed = false;
|
2206
2039
|
if (close_reads && !s->read_closed) {
|
2207
|
-
s->read_closed_error =
|
2040
|
+
s->read_closed_error = error;
|
2208
2041
|
s->read_closed = true;
|
2209
2042
|
closed_read = true;
|
2210
2043
|
}
|
2211
2044
|
if (close_writes && !s->write_closed) {
|
2212
|
-
s->write_closed_error =
|
2045
|
+
s->write_closed_error = error;
|
2213
2046
|
s->write_closed = true;
|
2214
|
-
grpc_chttp2_fail_pending_writes(t, s,
|
2047
|
+
grpc_chttp2_fail_pending_writes(t, s, error);
|
2215
2048
|
}
|
2216
2049
|
if (s->read_closed && s->write_closed) {
|
2217
2050
|
became_closed = true;
|
2218
|
-
grpc_error_handle overall_error =
|
2219
|
-
removal_error(GRPC_ERROR_REF(error), s, "Stream removed");
|
2051
|
+
grpc_error_handle overall_error = removal_error(error, s, "Stream removed");
|
2220
2052
|
if (s->id != 0) {
|
2221
|
-
remove_stream(t, s->id,
|
2053
|
+
remove_stream(t, s->id, overall_error);
|
2222
2054
|
} else {
|
2223
2055
|
// Purge streams waiting on concurrency still waiting for id assignment
|
2224
2056
|
grpc_chttp2_list_remove_waiting_for_concurrency(t, s);
|
2225
2057
|
}
|
2226
|
-
if (overall_error
|
2058
|
+
if (!overall_error.ok()) {
|
2227
2059
|
grpc_chttp2_fake_status(t, s, overall_error);
|
2228
2060
|
}
|
2229
2061
|
}
|
@@ -2240,7 +2072,6 @@ void grpc_chttp2_mark_stream_closed(grpc_chttp2_transport* t,
|
|
2240
2072
|
grpc_chttp2_maybe_complete_recv_trailing_metadata(t, s);
|
2241
2073
|
GRPC_CHTTP2_STREAM_UNREF(s, "chttp2");
|
2242
2074
|
}
|
2243
|
-
GRPC_ERROR_UNREF(error);
|
2244
2075
|
}
|
2245
2076
|
|
2246
2077
|
static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
|
@@ -2349,7 +2180,7 @@ static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
|
|
2349
2180
|
|
2350
2181
|
size_t msg_len = message.length();
|
2351
2182
|
GPR_ASSERT(msg_len <= UINT32_MAX);
|
2352
|
-
grpc_core::VarintWriter<1> msg_len_writer(msg_len);
|
2183
|
+
grpc_core::VarintWriter<1> msg_len_writer(static_cast<uint32_t>(msg_len));
|
2353
2184
|
message_pfx = GRPC_SLICE_MALLOC(14 + msg_len_writer.length());
|
2354
2185
|
p = GRPC_SLICE_START_PTR(message_pfx);
|
2355
2186
|
*p++ = 0x00; /* literal header, not indexed */
|
@@ -2410,7 +2241,7 @@ struct cancel_stream_cb_args {
|
|
2410
2241
|
static void cancel_stream_cb(void* user_data, uint32_t /*key*/, void* stream) {
|
2411
2242
|
cancel_stream_cb_args* args = static_cast<cancel_stream_cb_args*>(user_data);
|
2412
2243
|
grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(stream);
|
2413
|
-
grpc_chttp2_cancel_stream(args->t, s,
|
2244
|
+
grpc_chttp2_cancel_stream(args->t, s, args->error);
|
2414
2245
|
}
|
2415
2246
|
|
2416
2247
|
static void end_all_the_calls(grpc_chttp2_transport* t,
|
@@ -2418,13 +2249,14 @@ static void end_all_the_calls(grpc_chttp2_transport* t,
|
|
2418
2249
|
intptr_t http2_error;
|
2419
2250
|
// If there is no explicit grpc or HTTP/2 error, set to UNAVAILABLE on server.
|
2420
2251
|
if (!t->is_client && !grpc_error_has_clear_grpc_status(error) &&
|
2421
|
-
!grpc_error_get_int(error,
|
2422
|
-
|
2252
|
+
!grpc_error_get_int(error, grpc_core::StatusIntProperty::kHttp2Error,
|
2253
|
+
&http2_error)) {
|
2254
|
+
error = grpc_error_set_int(error, grpc_core::StatusIntProperty::kRpcStatus,
|
2423
2255
|
GRPC_STATUS_UNAVAILABLE);
|
2424
2256
|
}
|
2257
|
+
cancel_unstarted_streams(t, error);
|
2425
2258
|
cancel_stream_cb_args args = {error, t};
|
2426
2259
|
grpc_chttp2_stream_map_for_each(&t->stream_map, cancel_stream_cb, &args);
|
2427
|
-
GRPC_ERROR_UNREF(error);
|
2428
2260
|
}
|
2429
2261
|
|
2430
2262
|
//
|
@@ -2451,8 +2283,11 @@ void grpc_chttp2_act_on_flowctl_action(
|
|
2451
2283
|
const grpc_core::chttp2::FlowControlAction& action,
|
2452
2284
|
grpc_chttp2_transport* t, grpc_chttp2_stream* s) {
|
2453
2285
|
WithUrgency(t, action.send_stream_update(),
|
2454
|
-
GRPC_CHTTP2_INITIATE_WRITE_STREAM_FLOW_CONTROL,
|
2455
|
-
|
2286
|
+
GRPC_CHTTP2_INITIATE_WRITE_STREAM_FLOW_CONTROL, [t, s]() {
|
2287
|
+
if (s->id != 0 && !s->read_closed) {
|
2288
|
+
grpc_chttp2_mark_stream_writable(t, s);
|
2289
|
+
}
|
2290
|
+
});
|
2456
2291
|
WithUrgency(t, action.send_transport_update(),
|
2457
2292
|
GRPC_CHTTP2_INITIATE_WRITE_TRANSPORT_FLOW_CONTROL, []() {});
|
2458
2293
|
WithUrgency(t, action.send_initial_window_update(),
|
@@ -2471,26 +2306,25 @@ void grpc_chttp2_act_on_flowctl_action(
|
|
2471
2306
|
static grpc_error_handle try_http_parsing(grpc_chttp2_transport* t) {
|
2472
2307
|
grpc_http_parser parser;
|
2473
2308
|
size_t i = 0;
|
2474
|
-
grpc_error_handle error
|
2309
|
+
grpc_error_handle error;
|
2475
2310
|
grpc_http_response response;
|
2476
2311
|
|
2477
2312
|
grpc_http_parser_init(&parser, GRPC_HTTP_RESPONSE, &response);
|
2478
2313
|
|
2479
|
-
grpc_error_handle parse_error
|
2480
|
-
for (; i < t->read_buffer.count && parse_error
|
2314
|
+
grpc_error_handle parse_error;
|
2315
|
+
for (; i < t->read_buffer.count && parse_error.ok(); i++) {
|
2481
2316
|
parse_error =
|
2482
2317
|
grpc_http_parser_parse(&parser, t->read_buffer.slices[i], nullptr);
|
2483
2318
|
}
|
2484
|
-
if (parse_error
|
2485
|
-
(parse_error = grpc_http_parser_eof(&parser)) ==
|
2319
|
+
if (parse_error.ok() &&
|
2320
|
+
(parse_error = grpc_http_parser_eof(&parser)) == absl::OkStatus()) {
|
2486
2321
|
error = grpc_error_set_int(
|
2487
|
-
grpc_error_set_int(
|
2488
|
-
|
2489
|
-
|
2490
|
-
|
2322
|
+
grpc_error_set_int(
|
2323
|
+
GRPC_ERROR_CREATE("Trying to connect an http1.x server"),
|
2324
|
+
grpc_core::StatusIntProperty::kHttpStatus, response.status),
|
2325
|
+
grpc_core::StatusIntProperty::kRpcStatus,
|
2491
2326
|
grpc_http2_status_to_grpc_status(response.status));
|
2492
2327
|
}
|
2493
|
-
GRPC_ERROR_UNREF(parse_error);
|
2494
2328
|
|
2495
2329
|
grpc_http_parser_destroy(&parser);
|
2496
2330
|
grpc_http_response_destroy(&response);
|
@@ -2501,44 +2335,33 @@ static void read_action(void* tp, grpc_error_handle error) {
|
|
2501
2335
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
2502
2336
|
t->combiner->Run(
|
2503
2337
|
GRPC_CLOSURE_INIT(&t->read_action_locked, read_action_locked, t, nullptr),
|
2504
|
-
|
2338
|
+
error);
|
2505
2339
|
}
|
2506
2340
|
|
2507
2341
|
static void read_action_locked(void* tp, grpc_error_handle error) {
|
2508
|
-
GPR_TIMER_SCOPE("reading_action_locked", 0);
|
2509
|
-
|
2510
2342
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
2511
2343
|
|
2512
|
-
(void)GRPC_ERROR_REF(error);
|
2513
|
-
|
2514
2344
|
grpc_error_handle err = error;
|
2515
|
-
if (err
|
2516
|
-
err = grpc_error_set_int(
|
2517
|
-
|
2518
|
-
|
2519
|
-
t->write_state);
|
2345
|
+
if (!err.ok()) {
|
2346
|
+
err = grpc_error_set_int(
|
2347
|
+
GRPC_ERROR_CREATE_REFERENCING("Endpoint read failed", &err, 1),
|
2348
|
+
grpc_core::StatusIntProperty::kOccurredDuringWrite, t->write_state);
|
2520
2349
|
}
|
2521
2350
|
std::swap(err, error);
|
2522
|
-
|
2523
|
-
if (t->closed_with_error == GRPC_ERROR_NONE) {
|
2524
|
-
GPR_TIMER_SCOPE("reading_action.parse", 0);
|
2351
|
+
if (t->closed_with_error.ok()) {
|
2525
2352
|
size_t i = 0;
|
2526
|
-
grpc_error_handle errors[3] = {
|
2527
|
-
|
2528
|
-
for (; i < t->read_buffer.count && errors[1] == GRPC_ERROR_NONE; i++) {
|
2353
|
+
grpc_error_handle errors[3] = {error, absl::OkStatus(), absl::OkStatus()};
|
2354
|
+
for (; i < t->read_buffer.count && errors[1] == absl::OkStatus(); i++) {
|
2529
2355
|
errors[1] = grpc_chttp2_perform_read(t, t->read_buffer.slices[i]);
|
2530
2356
|
}
|
2531
|
-
if (errors[1] !=
|
2357
|
+
if (errors[1] != absl::OkStatus()) {
|
2532
2358
|
errors[2] = try_http_parsing(t);
|
2533
|
-
|
2534
|
-
|
2535
|
-
"Failed parsing HTTP/2", errors, GPR_ARRAY_SIZE(errors));
|
2359
|
+
error = GRPC_ERROR_CREATE_REFERENCING("Failed parsing HTTP/2", errors,
|
2360
|
+
GPR_ARRAY_SIZE(errors));
|
2536
2361
|
}
|
2537
2362
|
for (i = 0; i < GPR_ARRAY_SIZE(errors); i++) {
|
2538
|
-
GRPC_ERROR_UNREF(errors[i]);
|
2539
2363
|
}
|
2540
2364
|
|
2541
|
-
GPR_TIMER_SCOPE("post_parse_locked", 0);
|
2542
2365
|
if (t->initial_window_update != 0) {
|
2543
2366
|
if (t->initial_window_update > 0) {
|
2544
2367
|
grpc_chttp2_stream* s;
|
@@ -2552,29 +2375,28 @@ static void read_action_locked(void* tp, grpc_error_handle error) {
|
|
2552
2375
|
}
|
2553
2376
|
}
|
2554
2377
|
|
2555
|
-
GPR_TIMER_SCOPE("post_reading_action_locked", 0);
|
2556
2378
|
bool keep_reading = false;
|
2557
|
-
if (error
|
2558
|
-
error =
|
2559
|
-
|
2379
|
+
if (error.ok() && !t->closed_with_error.ok()) {
|
2380
|
+
error = GRPC_ERROR_CREATE_REFERENCING("Transport closed",
|
2381
|
+
&t->closed_with_error, 1);
|
2560
2382
|
}
|
2561
|
-
if (error
|
2383
|
+
if (!error.ok()) {
|
2562
2384
|
// If a goaway frame was received, this might be the reason why the read
|
2563
2385
|
// failed. Add this info to the error
|
2564
|
-
if (t->goaway_error
|
2565
|
-
error = grpc_error_add_child(error,
|
2386
|
+
if (!t->goaway_error.ok()) {
|
2387
|
+
error = grpc_error_add_child(error, t->goaway_error);
|
2566
2388
|
}
|
2567
2389
|
|
2568
|
-
close_transport_locked(t,
|
2390
|
+
close_transport_locked(t, error);
|
2569
2391
|
t->endpoint_reading = 0;
|
2570
|
-
} else if (t->closed_with_error
|
2392
|
+
} else if (t->closed_with_error.ok()) {
|
2571
2393
|
keep_reading = true;
|
2572
2394
|
// Since we have read a byte, reset the keepalive timer
|
2573
2395
|
if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_WAITING) {
|
2574
2396
|
grpc_timer_cancel(&t->keepalive_ping_timer);
|
2575
2397
|
}
|
2576
2398
|
}
|
2577
|
-
|
2399
|
+
grpc_slice_buffer_reset_and_unref(&t->read_buffer);
|
2578
2400
|
|
2579
2401
|
if (keep_reading) {
|
2580
2402
|
if (t->num_pending_induced_frames >= DEFAULT_MAX_PENDING_INDUCED_FRAMES) {
|
@@ -2590,22 +2412,20 @@ static void read_action_locked(void* tp, grpc_error_handle error) {
|
|
2590
2412
|
} else {
|
2591
2413
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "reading_action");
|
2592
2414
|
}
|
2593
|
-
|
2594
|
-
GRPC_ERROR_UNREF(error);
|
2595
2415
|
}
|
2596
2416
|
|
2597
2417
|
static void continue_read_action_locked(grpc_chttp2_transport* t) {
|
2598
|
-
const bool urgent = t->goaway_error
|
2418
|
+
const bool urgent = !t->goaway_error.ok();
|
2599
2419
|
GRPC_CLOSURE_INIT(&t->read_action_locked, read_action, t,
|
2600
2420
|
grpc_schedule_on_exec_ctx);
|
2601
|
-
grpc_endpoint_read(t->ep, &t->read_buffer, &t->read_action_locked, urgent
|
2602
|
-
|
2421
|
+
grpc_endpoint_read(t->ep, &t->read_buffer, &t->read_action_locked, urgent,
|
2422
|
+
grpc_chttp2_min_read_progress_size(t));
|
2603
2423
|
}
|
2604
2424
|
|
2605
2425
|
// t is reffed prior to calling the first time, and once the callback chain
|
2606
2426
|
// that kicks off finishes, it's unreffed
|
2607
2427
|
void schedule_bdp_ping_locked(grpc_chttp2_transport* t) {
|
2608
|
-
t->flow_control
|
2428
|
+
t->flow_control.bdp_estimator()->SchedulePing();
|
2609
2429
|
send_ping_locked(
|
2610
2430
|
t,
|
2611
2431
|
GRPC_CLOSURE_INIT(&t->start_bdp_ping_locked, start_bdp_ping, t,
|
@@ -2619,23 +2439,23 @@ static void start_bdp_ping(void* tp, grpc_error_handle error) {
|
|
2619
2439
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
2620
2440
|
t->combiner->Run(GRPC_CLOSURE_INIT(&t->start_bdp_ping_locked,
|
2621
2441
|
start_bdp_ping_locked, t, nullptr),
|
2622
|
-
|
2442
|
+
error);
|
2623
2443
|
}
|
2624
2444
|
|
2625
2445
|
static void start_bdp_ping_locked(void* tp, grpc_error_handle error) {
|
2626
2446
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
2627
2447
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
|
2628
2448
|
gpr_log(GPR_INFO, "%s: Start BDP ping err=%s", t->peer_string.c_str(),
|
2629
|
-
|
2449
|
+
grpc_core::StatusToString(error).c_str());
|
2630
2450
|
}
|
2631
|
-
if (error
|
2451
|
+
if (!error.ok() || !t->closed_with_error.ok()) {
|
2632
2452
|
return;
|
2633
2453
|
}
|
2634
2454
|
// Reset the keepalive ping timer
|
2635
2455
|
if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_WAITING) {
|
2636
2456
|
grpc_timer_cancel(&t->keepalive_ping_timer);
|
2637
2457
|
}
|
2638
|
-
t->flow_control
|
2458
|
+
t->flow_control.bdp_estimator()->StartPing();
|
2639
2459
|
t->bdp_ping_started = true;
|
2640
2460
|
}
|
2641
2461
|
|
@@ -2643,16 +2463,16 @@ static void finish_bdp_ping(void* tp, grpc_error_handle error) {
|
|
2643
2463
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
2644
2464
|
t->combiner->Run(GRPC_CLOSURE_INIT(&t->finish_bdp_ping_locked,
|
2645
2465
|
finish_bdp_ping_locked, t, nullptr),
|
2646
|
-
|
2466
|
+
error);
|
2647
2467
|
}
|
2648
2468
|
|
2649
2469
|
static void finish_bdp_ping_locked(void* tp, grpc_error_handle error) {
|
2650
2470
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
2651
2471
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
|
2652
2472
|
gpr_log(GPR_INFO, "%s: Complete BDP ping err=%s", t->peer_string.c_str(),
|
2653
|
-
|
2473
|
+
grpc_core::StatusToString(error).c_str());
|
2654
2474
|
}
|
2655
|
-
if (error
|
2475
|
+
if (!error.ok() || !t->closed_with_error.ok()) {
|
2656
2476
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "bdp_ping");
|
2657
2477
|
return;
|
2658
2478
|
}
|
@@ -2661,12 +2481,13 @@ static void finish_bdp_ping_locked(void* tp, grpc_error_handle error) {
|
|
2661
2481
|
// finish_bdp_ping_locked to be run later.
|
2662
2482
|
t->combiner->Run(GRPC_CLOSURE_INIT(&t->finish_bdp_ping_locked,
|
2663
2483
|
finish_bdp_ping_locked, t, nullptr),
|
2664
|
-
|
2484
|
+
error);
|
2665
2485
|
return;
|
2666
2486
|
}
|
2667
2487
|
t->bdp_ping_started = false;
|
2668
|
-
|
2669
|
-
|
2488
|
+
grpc_core::Timestamp next_ping =
|
2489
|
+
t->flow_control.bdp_estimator()->CompletePing();
|
2490
|
+
grpc_chttp2_act_on_flowctl_action(t->flow_control.PeriodicUpdate(), t,
|
2670
2491
|
nullptr);
|
2671
2492
|
GPR_ASSERT(!t->have_next_bdp_ping_timer);
|
2672
2493
|
t->have_next_bdp_ping_timer = true;
|
@@ -2681,7 +2502,7 @@ static void next_bdp_ping_timer_expired(void* tp, grpc_error_handle error) {
|
|
2681
2502
|
t->combiner->Run(
|
2682
2503
|
GRPC_CLOSURE_INIT(&t->next_bdp_ping_timer_expired_locked,
|
2683
2504
|
next_bdp_ping_timer_expired_locked, t, nullptr),
|
2684
|
-
|
2505
|
+
error);
|
2685
2506
|
}
|
2686
2507
|
|
2687
2508
|
static void next_bdp_ping_timer_expired_locked(void* tp,
|
@@ -2689,11 +2510,11 @@ static void next_bdp_ping_timer_expired_locked(void* tp,
|
|
2689
2510
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
|
2690
2511
|
GPR_ASSERT(t->have_next_bdp_ping_timer);
|
2691
2512
|
t->have_next_bdp_ping_timer = false;
|
2692
|
-
if (error
|
2513
|
+
if (!error.ok()) {
|
2693
2514
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "bdp_ping");
|
2694
2515
|
return;
|
2695
2516
|
}
|
2696
|
-
if (t->flow_control
|
2517
|
+
if (t->flow_control.bdp_estimator()->accumulator() == 0) {
|
2697
2518
|
// Block the bdp ping till we receive more data.
|
2698
2519
|
t->bdp_ping_blocked = true;
|
2699
2520
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "bdp_ping");
|
@@ -2765,15 +2586,15 @@ static void init_keepalive_ping(void* arg, grpc_error_handle error) {
|
|
2765
2586
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
|
2766
2587
|
t->combiner->Run(GRPC_CLOSURE_INIT(&t->init_keepalive_ping_locked,
|
2767
2588
|
init_keepalive_ping_locked, t, nullptr),
|
2768
|
-
|
2589
|
+
error);
|
2769
2590
|
}
|
2770
2591
|
|
2771
2592
|
static void init_keepalive_ping_locked(void* arg, grpc_error_handle error) {
|
2772
2593
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
|
2773
2594
|
GPR_ASSERT(t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_WAITING);
|
2774
|
-
if (t->destroying || t->closed_with_error
|
2595
|
+
if (t->destroying || !t->closed_with_error.ok()) {
|
2775
2596
|
t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_DYING;
|
2776
|
-
} else if (error
|
2597
|
+
} else if (error.ok()) {
|
2777
2598
|
if (t->keepalive_permit_without_calls ||
|
2778
2599
|
grpc_chttp2_stream_map_size(&t->stream_map) > 0) {
|
2779
2600
|
t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_PINGING;
|
@@ -2786,16 +2607,21 @@ static void init_keepalive_ping_locked(void* arg, grpc_error_handle error) {
|
|
2786
2607
|
GRPC_CLOSURE_INIT(&t->init_keepalive_ping_locked, init_keepalive_ping, t,
|
2787
2608
|
grpc_schedule_on_exec_ctx);
|
2788
2609
|
grpc_timer_init(&t->keepalive_ping_timer,
|
2789
|
-
grpc_core::
|
2610
|
+
grpc_core::Timestamp::Now() + t->keepalive_time,
|
2790
2611
|
&t->init_keepalive_ping_locked);
|
2791
2612
|
}
|
2792
|
-
} else if (error ==
|
2613
|
+
} else if (error == absl::CancelledError()) {
|
2793
2614
|
// The keepalive ping timer may be cancelled by bdp
|
2615
|
+
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) ||
|
2616
|
+
GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) {
|
2617
|
+
gpr_log(GPR_INFO, "%s: Keepalive ping cancelled. Resetting timer.",
|
2618
|
+
t->peer_string.c_str());
|
2619
|
+
}
|
2794
2620
|
GRPC_CHTTP2_REF_TRANSPORT(t, "init keepalive ping");
|
2795
2621
|
GRPC_CLOSURE_INIT(&t->init_keepalive_ping_locked, init_keepalive_ping, t,
|
2796
2622
|
grpc_schedule_on_exec_ctx);
|
2797
2623
|
grpc_timer_init(&t->keepalive_ping_timer,
|
2798
|
-
grpc_core::
|
2624
|
+
grpc_core::Timestamp::Now() + t->keepalive_time,
|
2799
2625
|
&t->init_keepalive_ping_locked);
|
2800
2626
|
}
|
2801
2627
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "init keepalive ping");
|
@@ -2805,12 +2631,12 @@ static void start_keepalive_ping(void* arg, grpc_error_handle error) {
|
|
2805
2631
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
|
2806
2632
|
t->combiner->Run(GRPC_CLOSURE_INIT(&t->start_keepalive_ping_locked,
|
2807
2633
|
start_keepalive_ping_locked, t, nullptr),
|
2808
|
-
|
2634
|
+
error);
|
2809
2635
|
}
|
2810
2636
|
|
2811
2637
|
static void start_keepalive_ping_locked(void* arg, grpc_error_handle error) {
|
2812
2638
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
|
2813
|
-
if (error
|
2639
|
+
if (!error.ok()) {
|
2814
2640
|
return;
|
2815
2641
|
}
|
2816
2642
|
if (t->channelz_socket != nullptr) {
|
@@ -2824,7 +2650,7 @@ static void start_keepalive_ping_locked(void* arg, grpc_error_handle error) {
|
|
2824
2650
|
GRPC_CLOSURE_INIT(&t->keepalive_watchdog_fired_locked,
|
2825
2651
|
keepalive_watchdog_fired, t, grpc_schedule_on_exec_ctx);
|
2826
2652
|
grpc_timer_init(&t->keepalive_watchdog_timer,
|
2827
|
-
grpc_core::
|
2653
|
+
grpc_core::Timestamp::Now() + t->keepalive_timeout,
|
2828
2654
|
&t->keepalive_watchdog_fired_locked);
|
2829
2655
|
t->keepalive_ping_started = true;
|
2830
2656
|
}
|
@@ -2833,13 +2659,13 @@ static void finish_keepalive_ping(void* arg, grpc_error_handle error) {
|
|
2833
2659
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
|
2834
2660
|
t->combiner->Run(GRPC_CLOSURE_INIT(&t->finish_keepalive_ping_locked,
|
2835
2661
|
finish_keepalive_ping_locked, t, nullptr),
|
2836
|
-
|
2662
|
+
error);
|
2837
2663
|
}
|
2838
2664
|
|
2839
2665
|
static void finish_keepalive_ping_locked(void* arg, grpc_error_handle error) {
|
2840
2666
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
|
2841
2667
|
if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_PINGING) {
|
2842
|
-
if (error
|
2668
|
+
if (error.ok()) {
|
2843
2669
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) ||
|
2844
2670
|
GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) {
|
2845
2671
|
gpr_log(GPR_INFO, "%s: Finish keepalive ping", t->peer_string.c_str());
|
@@ -2850,7 +2676,7 @@ static void finish_keepalive_ping_locked(void* arg, grpc_error_handle error) {
|
|
2850
2676
|
t->combiner->Run(
|
2851
2677
|
GRPC_CLOSURE_INIT(&t->finish_keepalive_ping_locked,
|
2852
2678
|
finish_keepalive_ping_locked, t, nullptr),
|
2853
|
-
|
2679
|
+
error);
|
2854
2680
|
return;
|
2855
2681
|
}
|
2856
2682
|
t->keepalive_ping_started = false;
|
@@ -2860,7 +2686,7 @@ static void finish_keepalive_ping_locked(void* arg, grpc_error_handle error) {
|
|
2860
2686
|
GRPC_CLOSURE_INIT(&t->init_keepalive_ping_locked, init_keepalive_ping, t,
|
2861
2687
|
grpc_schedule_on_exec_ctx);
|
2862
2688
|
grpc_timer_init(&t->keepalive_ping_timer,
|
2863
|
-
grpc_core::
|
2689
|
+
grpc_core::Timestamp::Now() + t->keepalive_time,
|
2864
2690
|
&t->init_keepalive_ping_locked);
|
2865
2691
|
}
|
2866
2692
|
}
|
@@ -2872,27 +2698,26 @@ static void keepalive_watchdog_fired(void* arg, grpc_error_handle error) {
|
|
2872
2698
|
t->combiner->Run(
|
2873
2699
|
GRPC_CLOSURE_INIT(&t->keepalive_watchdog_fired_locked,
|
2874
2700
|
keepalive_watchdog_fired_locked, t, nullptr),
|
2875
|
-
|
2701
|
+
error);
|
2876
2702
|
}
|
2877
2703
|
|
2878
2704
|
static void keepalive_watchdog_fired_locked(void* arg,
|
2879
2705
|
grpc_error_handle error) {
|
2880
2706
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
|
2881
2707
|
if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_PINGING) {
|
2882
|
-
if (error
|
2708
|
+
if (error.ok()) {
|
2883
2709
|
gpr_log(GPR_INFO, "%s: Keepalive watchdog fired. Closing transport.",
|
2884
2710
|
t->peer_string.c_str());
|
2885
2711
|
t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_DYING;
|
2886
2712
|
close_transport_locked(
|
2887
|
-
t, grpc_error_set_int(
|
2888
|
-
|
2889
|
-
GRPC_ERROR_INT_GRPC_STATUS,
|
2713
|
+
t, grpc_error_set_int(GRPC_ERROR_CREATE("keepalive watchdog timeout"),
|
2714
|
+
grpc_core::StatusIntProperty::kRpcStatus,
|
2890
2715
|
GRPC_STATUS_UNAVAILABLE));
|
2891
2716
|
}
|
2892
2717
|
} else {
|
2893
2718
|
// The watchdog timer should have been cancelled by
|
2894
2719
|
// finish_keepalive_ping_locked.
|
2895
|
-
if (GPR_UNLIKELY(error !=
|
2720
|
+
if (GPR_UNLIKELY(error != absl::CancelledError())) {
|
2896
2721
|
gpr_log(GPR_ERROR, "keepalive_ping_end state error: %d (expect: %d)",
|
2897
2722
|
t->keepalive_state, GRPC_CHTTP2_KEEPALIVE_STATE_PINGING);
|
2898
2723
|
}
|
@@ -2929,225 +2754,6 @@ static void set_pollset_set(grpc_transport* gt, grpc_stream* /*gs*/,
|
|
2929
2754
|
grpc_endpoint_add_to_pollset_set(t->ep, pollset_set);
|
2930
2755
|
}
|
2931
2756
|
|
2932
|
-
//
|
2933
|
-
// BYTE STREAM
|
2934
|
-
//
|
2935
|
-
|
2936
|
-
static void reset_byte_stream(void* arg, grpc_error_handle error) {
|
2937
|
-
grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(arg);
|
2938
|
-
s->pending_byte_stream = false;
|
2939
|
-
if (error == GRPC_ERROR_NONE) {
|
2940
|
-
grpc_chttp2_maybe_complete_recv_message(s->t, s);
|
2941
|
-
grpc_chttp2_maybe_complete_recv_trailing_metadata(s->t, s);
|
2942
|
-
} else {
|
2943
|
-
GPR_ASSERT(error != GRPC_ERROR_NONE);
|
2944
|
-
grpc_core::ExecCtx::Run(DEBUG_LOCATION, s->on_next, GRPC_ERROR_REF(error));
|
2945
|
-
s->on_next = nullptr;
|
2946
|
-
GRPC_ERROR_UNREF(s->byte_stream_error);
|
2947
|
-
s->byte_stream_error = GRPC_ERROR_NONE;
|
2948
|
-
grpc_chttp2_cancel_stream(s->t, s, GRPC_ERROR_REF(error));
|
2949
|
-
s->byte_stream_error = GRPC_ERROR_REF(error);
|
2950
|
-
}
|
2951
|
-
}
|
2952
|
-
|
2953
|
-
namespace grpc_core {
|
2954
|
-
|
2955
|
-
Chttp2IncomingByteStream::Chttp2IncomingByteStream(
|
2956
|
-
grpc_chttp2_transport* transport, grpc_chttp2_stream* stream,
|
2957
|
-
uint32_t frame_size, uint32_t flags)
|
2958
|
-
: ByteStream(frame_size, flags),
|
2959
|
-
transport_(transport),
|
2960
|
-
stream_(stream),
|
2961
|
-
refs_(2),
|
2962
|
-
remaining_bytes_(frame_size) {
|
2963
|
-
GRPC_ERROR_UNREF(stream->byte_stream_error);
|
2964
|
-
stream->byte_stream_error = GRPC_ERROR_NONE;
|
2965
|
-
}
|
2966
|
-
|
2967
|
-
void Chttp2IncomingByteStream::OrphanLocked(
|
2968
|
-
void* arg, grpc_error_handle /*error_ignored*/) {
|
2969
|
-
Chttp2IncomingByteStream* bs = static_cast<Chttp2IncomingByteStream*>(arg);
|
2970
|
-
grpc_chttp2_stream* s = bs->stream_;
|
2971
|
-
grpc_chttp2_transport* t = s->t;
|
2972
|
-
bs->Unref();
|
2973
|
-
s->pending_byte_stream = false;
|
2974
|
-
grpc_chttp2_maybe_complete_recv_message(t, s);
|
2975
|
-
grpc_chttp2_maybe_complete_recv_trailing_metadata(t, s);
|
2976
|
-
}
|
2977
|
-
|
2978
|
-
void Chttp2IncomingByteStream::Orphan() {
|
2979
|
-
GPR_TIMER_SCOPE("incoming_byte_stream_destroy", 0);
|
2980
|
-
transport_->combiner->Run(
|
2981
|
-
GRPC_CLOSURE_INIT(&destroy_action_,
|
2982
|
-
&Chttp2IncomingByteStream::OrphanLocked, this, nullptr),
|
2983
|
-
GRPC_ERROR_NONE);
|
2984
|
-
}
|
2985
|
-
|
2986
|
-
void Chttp2IncomingByteStream::NextLocked(void* arg,
|
2987
|
-
grpc_error_handle /*error_ignored*/) {
|
2988
|
-
Chttp2IncomingByteStream* bs = static_cast<Chttp2IncomingByteStream*>(arg);
|
2989
|
-
grpc_chttp2_transport* t = bs->transport_;
|
2990
|
-
grpc_chttp2_stream* s = bs->stream_;
|
2991
|
-
size_t cur_length = s->frame_storage.length;
|
2992
|
-
if (!s->read_closed) {
|
2993
|
-
s->flow_control->IncomingByteStreamUpdate(bs->next_action_.max_size_hint,
|
2994
|
-
cur_length);
|
2995
|
-
grpc_chttp2_act_on_flowctl_action(s->flow_control->MakeAction(), t, s);
|
2996
|
-
}
|
2997
|
-
GPR_ASSERT(s->unprocessed_incoming_frames_buffer.length == 0);
|
2998
|
-
if (s->frame_storage.length > 0) {
|
2999
|
-
grpc_slice_buffer_swap(&s->frame_storage,
|
3000
|
-
&s->unprocessed_incoming_frames_buffer);
|
3001
|
-
s->unprocessed_incoming_frames_decompressed = false;
|
3002
|
-
grpc_core::ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete,
|
3003
|
-
GRPC_ERROR_NONE);
|
3004
|
-
} else if (s->byte_stream_error != GRPC_ERROR_NONE) {
|
3005
|
-
grpc_core::ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete,
|
3006
|
-
GRPC_ERROR_REF(s->byte_stream_error));
|
3007
|
-
if (s->data_parser.parsing_frame != nullptr) {
|
3008
|
-
s->data_parser.parsing_frame->Unref();
|
3009
|
-
s->data_parser.parsing_frame = nullptr;
|
3010
|
-
}
|
3011
|
-
} else if (s->read_closed) {
|
3012
|
-
if (bs->remaining_bytes_ != 0) {
|
3013
|
-
s->byte_stream_error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
|
3014
|
-
"Truncated message", &s->read_closed_error, 1);
|
3015
|
-
grpc_core::ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete,
|
3016
|
-
GRPC_ERROR_REF(s->byte_stream_error));
|
3017
|
-
if (s->data_parser.parsing_frame != nullptr) {
|
3018
|
-
s->data_parser.parsing_frame->Unref();
|
3019
|
-
s->data_parser.parsing_frame = nullptr;
|
3020
|
-
}
|
3021
|
-
} else {
|
3022
|
-
// Should never reach here.
|
3023
|
-
GPR_ASSERT(false);
|
3024
|
-
}
|
3025
|
-
} else {
|
3026
|
-
s->on_next = bs->next_action_.on_complete;
|
3027
|
-
}
|
3028
|
-
bs->Unref();
|
3029
|
-
}
|
3030
|
-
|
3031
|
-
bool Chttp2IncomingByteStream::Next(size_t max_size_hint,
|
3032
|
-
grpc_closure* on_complete) {
|
3033
|
-
GPR_TIMER_SCOPE("incoming_byte_stream_next", 0);
|
3034
|
-
if (stream_->unprocessed_incoming_frames_buffer.length > 0) {
|
3035
|
-
return true;
|
3036
|
-
} else {
|
3037
|
-
Ref();
|
3038
|
-
next_action_.max_size_hint = max_size_hint;
|
3039
|
-
next_action_.on_complete = on_complete;
|
3040
|
-
transport_->combiner->Run(
|
3041
|
-
GRPC_CLOSURE_INIT(&next_action_.closure,
|
3042
|
-
&Chttp2IncomingByteStream::NextLocked, this, nullptr),
|
3043
|
-
GRPC_ERROR_NONE);
|
3044
|
-
return false;
|
3045
|
-
}
|
3046
|
-
}
|
3047
|
-
|
3048
|
-
void Chttp2IncomingByteStream::MaybeCreateStreamDecompressionCtx() {
|
3049
|
-
GPR_DEBUG_ASSERT(stream_->stream_decompression_method !=
|
3050
|
-
GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS);
|
3051
|
-
if (!stream_->stream_decompression_ctx) {
|
3052
|
-
stream_->stream_decompression_ctx = grpc_stream_compression_context_create(
|
3053
|
-
stream_->stream_decompression_method);
|
3054
|
-
}
|
3055
|
-
}
|
3056
|
-
|
3057
|
-
grpc_error_handle Chttp2IncomingByteStream::Pull(grpc_slice* slice) {
|
3058
|
-
GPR_TIMER_SCOPE("incoming_byte_stream_pull", 0);
|
3059
|
-
grpc_error_handle error;
|
3060
|
-
if (stream_->unprocessed_incoming_frames_buffer.length > 0) {
|
3061
|
-
if (!stream_->unprocessed_incoming_frames_decompressed &&
|
3062
|
-
stream_->stream_decompression_method !=
|
3063
|
-
GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS) {
|
3064
|
-
bool end_of_context;
|
3065
|
-
MaybeCreateStreamDecompressionCtx();
|
3066
|
-
if (!grpc_stream_decompress(stream_->stream_decompression_ctx,
|
3067
|
-
&stream_->unprocessed_incoming_frames_buffer,
|
3068
|
-
&stream_->decompressed_data_buffer, nullptr,
|
3069
|
-
MAX_SIZE_T, &end_of_context)) {
|
3070
|
-
error =
|
3071
|
-
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Stream decompression error.");
|
3072
|
-
return error;
|
3073
|
-
}
|
3074
|
-
GPR_ASSERT(stream_->unprocessed_incoming_frames_buffer.length == 0);
|
3075
|
-
grpc_slice_buffer_swap(&stream_->unprocessed_incoming_frames_buffer,
|
3076
|
-
&stream_->decompressed_data_buffer);
|
3077
|
-
stream_->unprocessed_incoming_frames_decompressed = true;
|
3078
|
-
if (end_of_context) {
|
3079
|
-
grpc_stream_compression_context_destroy(
|
3080
|
-
stream_->stream_decompression_ctx);
|
3081
|
-
stream_->stream_decompression_ctx = nullptr;
|
3082
|
-
}
|
3083
|
-
if (stream_->unprocessed_incoming_frames_buffer.length == 0) {
|
3084
|
-
*slice = grpc_empty_slice();
|
3085
|
-
}
|
3086
|
-
}
|
3087
|
-
error = grpc_deframe_unprocessed_incoming_frames(
|
3088
|
-
&stream_->data_parser, stream_,
|
3089
|
-
&stream_->unprocessed_incoming_frames_buffer, slice, nullptr);
|
3090
|
-
if (error != GRPC_ERROR_NONE) {
|
3091
|
-
return error;
|
3092
|
-
}
|
3093
|
-
} else {
|
3094
|
-
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Truncated message");
|
3095
|
-
stream_->t->combiner->Run(&stream_->reset_byte_stream,
|
3096
|
-
GRPC_ERROR_REF(error));
|
3097
|
-
return error;
|
3098
|
-
}
|
3099
|
-
return GRPC_ERROR_NONE;
|
3100
|
-
}
|
3101
|
-
|
3102
|
-
void Chttp2IncomingByteStream::PublishError(grpc_error_handle error) {
|
3103
|
-
GPR_ASSERT(error != GRPC_ERROR_NONE);
|
3104
|
-
grpc_core::ExecCtx::Run(DEBUG_LOCATION, stream_->on_next,
|
3105
|
-
GRPC_ERROR_REF(error));
|
3106
|
-
stream_->on_next = nullptr;
|
3107
|
-
GRPC_ERROR_UNREF(stream_->byte_stream_error);
|
3108
|
-
stream_->byte_stream_error = GRPC_ERROR_REF(error);
|
3109
|
-
grpc_chttp2_cancel_stream(transport_, stream_, GRPC_ERROR_REF(error));
|
3110
|
-
}
|
3111
|
-
|
3112
|
-
grpc_error_handle Chttp2IncomingByteStream::Push(const grpc_slice& slice,
|
3113
|
-
grpc_slice* slice_out) {
|
3114
|
-
if (remaining_bytes_ < GRPC_SLICE_LENGTH(slice)) {
|
3115
|
-
grpc_error_handle error =
|
3116
|
-
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Too many bytes in stream");
|
3117
|
-
transport_->combiner->Run(&stream_->reset_byte_stream,
|
3118
|
-
GRPC_ERROR_REF(error));
|
3119
|
-
grpc_slice_unref_internal(slice);
|
3120
|
-
return error;
|
3121
|
-
} else {
|
3122
|
-
remaining_bytes_ -= static_cast<uint32_t> GRPC_SLICE_LENGTH(slice);
|
3123
|
-
if (slice_out != nullptr) {
|
3124
|
-
*slice_out = slice;
|
3125
|
-
}
|
3126
|
-
return GRPC_ERROR_NONE;
|
3127
|
-
}
|
3128
|
-
}
|
3129
|
-
|
3130
|
-
grpc_error_handle Chttp2IncomingByteStream::Finished(grpc_error_handle error,
|
3131
|
-
bool reset_on_error) {
|
3132
|
-
if (error == GRPC_ERROR_NONE) {
|
3133
|
-
if (remaining_bytes_ != 0) {
|
3134
|
-
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Truncated message");
|
3135
|
-
}
|
3136
|
-
}
|
3137
|
-
if (error != GRPC_ERROR_NONE && reset_on_error) {
|
3138
|
-
transport_->combiner->Run(&stream_->reset_byte_stream,
|
3139
|
-
GRPC_ERROR_REF(error));
|
3140
|
-
}
|
3141
|
-
Unref();
|
3142
|
-
return error;
|
3143
|
-
}
|
3144
|
-
|
3145
|
-
void Chttp2IncomingByteStream::Shutdown(grpc_error_handle error) {
|
3146
|
-
GRPC_ERROR_UNREF(Finished(error, true /* reset_on_error */));
|
3147
|
-
}
|
3148
|
-
|
3149
|
-
} // namespace grpc_core
|
3150
|
-
|
3151
2757
|
//
|
3152
2758
|
// RESOURCE QUOTAS
|
3153
2759
|
//
|
@@ -3156,10 +2762,19 @@ static void post_benign_reclaimer(grpc_chttp2_transport* t) {
|
|
3156
2762
|
if (!t->benign_reclaimer_registered) {
|
3157
2763
|
t->benign_reclaimer_registered = true;
|
3158
2764
|
GRPC_CHTTP2_REF_TRANSPORT(t, "benign_reclaimer");
|
3159
|
-
|
3160
|
-
|
3161
|
-
|
3162
|
-
|
2765
|
+
t->memory_owner.PostReclaimer(
|
2766
|
+
grpc_core::ReclamationPass::kBenign,
|
2767
|
+
[t](absl::optional<grpc_core::ReclamationSweep> sweep) {
|
2768
|
+
if (sweep.has_value()) {
|
2769
|
+
GRPC_CLOSURE_INIT(&t->benign_reclaimer_locked,
|
2770
|
+
benign_reclaimer_locked, t,
|
2771
|
+
grpc_schedule_on_exec_ctx);
|
2772
|
+
t->active_reclamation = std::move(*sweep);
|
2773
|
+
t->combiner->Run(&t->benign_reclaimer_locked, absl::OkStatus());
|
2774
|
+
} else {
|
2775
|
+
GRPC_CHTTP2_UNREF_TRANSPORT(t, "benign_reclaimer");
|
2776
|
+
}
|
2777
|
+
});
|
3163
2778
|
}
|
3164
2779
|
}
|
3165
2780
|
|
@@ -3167,24 +2782,26 @@ static void post_destructive_reclaimer(grpc_chttp2_transport* t) {
|
|
3167
2782
|
if (!t->destructive_reclaimer_registered) {
|
3168
2783
|
t->destructive_reclaimer_registered = true;
|
3169
2784
|
GRPC_CHTTP2_REF_TRANSPORT(t, "destructive_reclaimer");
|
3170
|
-
|
3171
|
-
|
3172
|
-
|
3173
|
-
|
2785
|
+
t->memory_owner.PostReclaimer(
|
2786
|
+
grpc_core::ReclamationPass::kDestructive,
|
2787
|
+
[t](absl::optional<grpc_core::ReclamationSweep> sweep) {
|
2788
|
+
if (sweep.has_value()) {
|
2789
|
+
GRPC_CLOSURE_INIT(&t->destructive_reclaimer_locked,
|
2790
|
+
destructive_reclaimer_locked, t,
|
2791
|
+
grpc_schedule_on_exec_ctx);
|
2792
|
+
t->active_reclamation = std::move(*sweep);
|
2793
|
+
t->combiner->Run(&t->destructive_reclaimer_locked,
|
2794
|
+
absl::OkStatus());
|
2795
|
+
} else {
|
2796
|
+
GRPC_CHTTP2_UNREF_TRANSPORT(t, "benign_reclaimer");
|
2797
|
+
}
|
2798
|
+
});
|
3174
2799
|
}
|
3175
2800
|
}
|
3176
2801
|
|
3177
|
-
static void benign_reclaimer(void* arg, grpc_error_handle error) {
|
3178
|
-
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
|
3179
|
-
t->combiner->Run(GRPC_CLOSURE_INIT(&t->benign_reclaimer_locked,
|
3180
|
-
benign_reclaimer_locked, t, nullptr),
|
3181
|
-
GRPC_ERROR_REF(error));
|
3182
|
-
}
|
3183
|
-
|
3184
2802
|
static void benign_reclaimer_locked(void* arg, grpc_error_handle error) {
|
3185
2803
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
|
3186
|
-
if (error ==
|
3187
|
-
grpc_chttp2_stream_map_size(&t->stream_map) == 0) {
|
2804
|
+
if (error.ok() && grpc_chttp2_stream_map_size(&t->stream_map) == 0) {
|
3188
2805
|
// Channel with no active streams: send a goaway to try and make it
|
3189
2806
|
// disconnect cleanly
|
3190
2807
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
|
@@ -3192,11 +2809,11 @@ static void benign_reclaimer_locked(void* arg, grpc_error_handle error) {
|
|
3192
2809
|
t->peer_string.c_str());
|
3193
2810
|
}
|
3194
2811
|
send_goaway(t,
|
3195
|
-
grpc_error_set_int(
|
3196
|
-
|
3197
|
-
|
3198
|
-
|
3199
|
-
|
2812
|
+
grpc_error_set_int(GRPC_ERROR_CREATE("Buffers full"),
|
2813
|
+
grpc_core::StatusIntProperty::kHttp2Error,
|
2814
|
+
GRPC_HTTP2_ENHANCE_YOUR_CALM),
|
2815
|
+
/*immediate_disconnect_hint=*/true);
|
2816
|
+
} else if (error.ok() && GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
|
3200
2817
|
gpr_log(GPR_INFO,
|
3201
2818
|
"HTTP2: %s - skip benign reclamation, there are still %" PRIdPTR
|
3202
2819
|
" streams",
|
@@ -3204,24 +2821,17 @@ static void benign_reclaimer_locked(void* arg, grpc_error_handle error) {
|
|
3204
2821
|
grpc_chttp2_stream_map_size(&t->stream_map));
|
3205
2822
|
}
|
3206
2823
|
t->benign_reclaimer_registered = false;
|
3207
|
-
if (error !=
|
3208
|
-
|
2824
|
+
if (error != absl::CancelledError()) {
|
2825
|
+
t->active_reclamation.Finish();
|
3209
2826
|
}
|
3210
2827
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "benign_reclaimer");
|
3211
2828
|
}
|
3212
2829
|
|
3213
|
-
static void destructive_reclaimer(void* arg, grpc_error_handle error) {
|
3214
|
-
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
|
3215
|
-
t->combiner->Run(GRPC_CLOSURE_INIT(&t->destructive_reclaimer_locked,
|
3216
|
-
destructive_reclaimer_locked, t, nullptr),
|
3217
|
-
GRPC_ERROR_REF(error));
|
3218
|
-
}
|
3219
|
-
|
3220
2830
|
static void destructive_reclaimer_locked(void* arg, grpc_error_handle error) {
|
3221
2831
|
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
|
3222
2832
|
size_t n = grpc_chttp2_stream_map_size(&t->stream_map);
|
3223
2833
|
t->destructive_reclaimer_registered = false;
|
3224
|
-
if (error
|
2834
|
+
if (error.ok() && n > 0) {
|
3225
2835
|
grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(
|
3226
2836
|
grpc_chttp2_stream_map_rand(&t->stream_map));
|
3227
2837
|
if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
|
@@ -3230,8 +2840,8 @@ static void destructive_reclaimer_locked(void* arg, grpc_error_handle error) {
|
|
3230
2840
|
}
|
3231
2841
|
grpc_chttp2_cancel_stream(
|
3232
2842
|
t, s,
|
3233
|
-
grpc_error_set_int(
|
3234
|
-
|
2843
|
+
grpc_error_set_int(GRPC_ERROR_CREATE("Buffers full"),
|
2844
|
+
grpc_core::StatusIntProperty::kHttp2Error,
|
3235
2845
|
GRPC_HTTP2_ENHANCE_YOUR_CALM));
|
3236
2846
|
if (n > 1) {
|
3237
2847
|
// Since we cancel one stream per destructive reclamation, if
|
@@ -3241,8 +2851,8 @@ static void destructive_reclaimer_locked(void* arg, grpc_error_handle error) {
|
|
3241
2851
|
post_destructive_reclaimer(t);
|
3242
2852
|
}
|
3243
2853
|
}
|
3244
|
-
if (error !=
|
3245
|
-
|
2854
|
+
if (error != absl::CancelledError()) {
|
2855
|
+
t->active_reclamation.Finish();
|
3246
2856
|
}
|
3247
2857
|
GRPC_CHTTP2_UNREF_TRANSPORT(t, "destructive_reclaimer");
|
3248
2858
|
}
|
@@ -3280,6 +2890,8 @@ const char* grpc_chttp2_initiate_write_reason_string(
|
|
3280
2890
|
return "TRANSPORT_FLOW_CONTROL";
|
3281
2891
|
case GRPC_CHTTP2_INITIATE_WRITE_SEND_SETTINGS:
|
3282
2892
|
return "SEND_SETTINGS";
|
2893
|
+
case GRPC_CHTTP2_INITIATE_WRITE_SETTINGS_ACK:
|
2894
|
+
return "SETTINGS_ACK";
|
3283
2895
|
case GRPC_CHTTP2_INITIATE_WRITE_FLOW_CONTROL_UNSTALLED_BY_SETTING:
|
3284
2896
|
return "FLOW_CONTROL_UNSTALLED_BY_SETTING";
|
3285
2897
|
case GRPC_CHTTP2_INITIATE_WRITE_FLOW_CONTROL_UNSTALLED_BY_UPDATE:
|
@@ -3307,6 +2919,7 @@ static grpc_endpoint* chttp2_get_endpoint(grpc_transport* t) {
|
|
3307
2919
|
static const grpc_transport_vtable vtable = {sizeof(grpc_chttp2_stream),
|
3308
2920
|
"chttp2",
|
3309
2921
|
init_stream,
|
2922
|
+
nullptr,
|
3310
2923
|
set_pollset,
|
3311
2924
|
set_pollset_set,
|
3312
2925
|
perform_stream_op,
|
@@ -3325,10 +2938,9 @@ grpc_chttp2_transport_get_socket_node(grpc_transport* transport) {
|
|
3325
2938
|
}
|
3326
2939
|
|
3327
2940
|
grpc_transport* grpc_create_chttp2_transport(
|
3328
|
-
const
|
3329
|
-
|
3330
|
-
auto t =
|
3331
|
-
new grpc_chttp2_transport(channel_args, ep, is_client, resource_user);
|
2941
|
+
const grpc_core::ChannelArgs& channel_args, grpc_endpoint* ep,
|
2942
|
+
bool is_client) {
|
2943
|
+
auto t = new grpc_chttp2_transport(channel_args, ep, is_client);
|
3332
2944
|
return &t->base;
|
3333
2945
|
}
|
3334
2946
|
|
@@ -3347,5 +2959,5 @@ void grpc_chttp2_transport_start_reading(
|
|
3347
2959
|
t->notify_on_close = notify_on_close;
|
3348
2960
|
t->combiner->Run(
|
3349
2961
|
GRPC_CLOSURE_INIT(&t->read_action_locked, read_action_locked, t, nullptr),
|
3350
|
-
|
2962
|
+
absl::OkStatus());
|
3351
2963
|
}
|