grpc 1.73.0 → 1.74.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Makefile +38 -17
- data/include/grpc/create_channel_from_endpoint.h +54 -0
- data/include/grpc/credentials.h +11 -5
- data/include/grpc/event_engine/event_engine.h +74 -17
- data/include/grpc/grpc_posix.h +20 -1
- data/include/grpc/impl/channel_arg_names.h +2 -4
- data/include/grpc/module.modulemap +1 -0
- data/include/grpc/support/json.h +24 -0
- data/src/core/call/interception_chain.h +7 -11
- data/src/core/channelz/channel_trace.cc +213 -115
- data/src/core/channelz/channel_trace.h +380 -86
- data/src/core/channelz/channelz.cc +270 -181
- data/src/core/channelz/channelz.h +168 -55
- data/src/core/channelz/channelz_registry.cc +2 -1
- data/src/core/channelz/channelz_registry.h +24 -0
- data/src/core/channelz/property_list.cc +357 -0
- data/src/core/channelz/property_list.h +202 -0
- data/src/core/channelz/ztrace_collector.h +3 -2
- data/src/core/client_channel/backup_poller.cc +17 -2
- data/src/core/client_channel/client_channel.cc +17 -28
- data/src/core/client_channel/client_channel_filter.cc +19 -29
- data/src/core/client_channel/config_selector.h +8 -2
- data/src/core/client_channel/dynamic_filters.cc +5 -6
- data/src/core/client_channel/dynamic_filters.h +1 -1
- data/src/core/client_channel/global_subchannel_pool.cc +4 -1
- data/src/core/client_channel/retry_filter.cc +21 -27
- data/src/core/client_channel/retry_filter.h +10 -7
- data/src/core/client_channel/retry_filter_legacy_call_data.cc +5 -5
- data/src/core/client_channel/retry_filter_legacy_call_data.h +1 -1
- data/src/core/client_channel/retry_interceptor.cc +30 -44
- data/src/core/client_channel/retry_interceptor.h +18 -17
- data/src/core/client_channel/retry_throttle.cc +46 -61
- data/src/core/client_channel/retry_throttle.h +17 -39
- data/src/core/client_channel/subchannel.cc +43 -19
- data/src/core/client_channel/subchannel.h +8 -0
- data/src/core/config/config_vars.cc +2 -0
- data/src/core/config/core_configuration.cc +1 -0
- data/src/core/config/core_configuration.h +11 -0
- data/src/core/credentials/call/call_creds_registry.h +125 -0
- data/src/core/credentials/call/call_creds_registry_init.cc +91 -0
- data/src/core/credentials/call/gcp_service_account_identity/gcp_service_account_identity_credentials.cc +6 -48
- data/src/core/credentials/call/jwt_token_file/jwt_token_file_call_credentials.cc +86 -0
- data/src/core/credentials/call/jwt_token_file/jwt_token_file_call_credentials.h +74 -0
- data/src/core/credentials/call/jwt_util.cc +70 -0
- data/src/core/credentials/call/jwt_util.h +32 -0
- data/src/core/credentials/transport/channel_creds_registry_init.cc +1 -1
- data/src/core/credentials/transport/google_default/google_default_credentials.cc +72 -4
- data/src/core/credentials/transport/ssl/ssl_credentials.cc +0 -1
- data/src/core/credentials/transport/tls/load_system_roots_supported.cc +1 -0
- data/src/core/credentials/transport/xds/xds_credentials.cc +0 -3
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.cc +8 -8
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.h +16 -16
- data/src/core/ext/filters/http/client_authority_filter.cc +2 -4
- data/src/core/ext/filters/http/message_compress/compression_filter.h +25 -22
- data/src/core/ext/filters/http/server/http_server_filter.h +12 -11
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +120 -35
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +6 -5
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +162 -115
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +0 -3
- data/src/core/ext/transport/chttp2/transport/decode_huff.cc +1239 -3514
- data/src/core/ext/transport/chttp2/transport/decode_huff.h +1008 -1486
- data/src/core/ext/transport/chttp2/transport/flow_control.h +22 -17
- data/src/core/ext/transport/chttp2/transport/frame.cc +10 -0
- data/src/core/ext/transport/chttp2/transport/frame.h +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +7 -8
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +4 -5
- data/src/core/ext/transport/chttp2/transport/header_assembler.h +299 -0
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +1 -1
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +11 -5
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +12 -1
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +1017 -0
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +593 -0
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +19 -22
- data/{third_party/abseil-cpp/absl/strings/cord_buffer.cc → src/core/ext/transport/chttp2/transport/http2_stats_collector.cc} +14 -14
- data/src/core/ext/transport/chttp2/transport/http2_stats_collector.h +33 -0
- data/src/core/ext/transport/chttp2/transport/http2_status.h +6 -1
- data/src/core/ext/transport/chttp2/transport/http2_transport.cc +43 -0
- data/src/core/ext/transport/chttp2/transport/http2_transport.h +65 -0
- data/src/core/ext/transport/chttp2/transport/http2_ztrace_collector.h +0 -29
- data/src/core/ext/transport/chttp2/transport/internal.h +18 -8
- data/src/core/ext/transport/chttp2/transport/keepalive.cc +105 -0
- data/src/core/ext/transport/chttp2/transport/keepalive.h +138 -0
- data/src/core/ext/transport/chttp2/transport/message_assembler.h +185 -0
- data/src/core/ext/transport/chttp2/transport/parsing.cc +2 -4
- data/src/core/ext/transport/chttp2/transport/ping_callbacks.h +19 -0
- data/src/core/ext/transport/chttp2/transport/ping_promise.cc +151 -0
- data/src/core/ext/transport/chttp2/transport/ping_promise.h +180 -0
- data/src/core/ext/transport/chttp2/transport/ping_rate_policy.cc +5 -9
- data/src/core/ext/transport/chttp2/transport/ping_rate_policy.h +11 -0
- data/src/core/ext/transport/chttp2/transport/stream_lists.cc +39 -1
- data/src/core/ext/transport/chttp2/transport/transport_common.cc +19 -0
- data/src/core/ext/transport/chttp2/transport/transport_common.h +27 -0
- data/src/core/ext/transport/chttp2/transport/writing.cc +37 -11
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb.h +571 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb_minitable.c +120 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb_minitable.h +36 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb.h +1272 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.c +312 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.h +50 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb.h +984 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb_minitable.c +226 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb_minitable.h +44 -0
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/promise.upbdefs.c +175 -0
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/promise.upbdefs.h +82 -0
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/property_list.upbdefs.c +135 -0
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/property_list.upbdefs.h +67 -0
- data/src/core/filter/auth/auth_filters.h +0 -25
- data/src/core/filter/auth/client_auth_filter.cc +0 -118
- data/src/core/filter/filter_args.h +9 -23
- data/src/core/handshaker/handshaker.cc +23 -14
- data/src/core/handshaker/handshaker.h +3 -0
- data/src/core/handshaker/http_connect/http_connect_handshaker.cc +3 -1
- data/src/core/handshaker/security/legacy_secure_endpoint.cc +6 -5
- data/src/core/handshaker/security/secure_endpoint.cc +70 -25
- data/src/core/handshaker/security/security_handshaker.cc +4 -1
- data/src/core/handshaker/tcp_connect/tcp_connect_handshaker.cc +7 -1
- data/src/core/lib/channel/channel_args.cc +15 -0
- data/src/core/lib/channel/channel_args.h +3 -0
- data/src/core/lib/channel/channel_stack.cc +22 -23
- data/src/core/lib/channel/channel_stack.h +9 -7
- data/src/core/lib/channel/channel_stack_builder_impl.cc +1 -1
- data/src/core/lib/channel/channel_stack_builder_impl.h +2 -7
- data/src/core/lib/channel/promise_based_filter.h +5 -5
- data/src/core/lib/debug/trace_impl.h +0 -1
- data/src/core/lib/event_engine/ares_resolver.cc +165 -46
- data/src/core/lib/event_engine/ares_resolver.h +48 -2
- data/src/core/lib/event_engine/cf_engine/cf_engine.cc +3 -1
- data/src/core/lib/event_engine/cf_engine/cf_engine.h +1 -4
- data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.h +2 -6
- data/src/core/lib/event_engine/endpoint_channel_arg_wrapper.cc +40 -0
- data/src/core/lib/event_engine/endpoint_channel_arg_wrapper.h +60 -0
- data/src/core/lib/event_engine/event_engine.cc +7 -0
- data/src/core/lib/event_engine/extensions/channelz.h +10 -6
- data/src/core/lib/event_engine/grpc_polled_fd.h +5 -0
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +130 -162
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h +11 -15
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +75 -117
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.h +7 -9
- data/src/core/lib/event_engine/posix_engine/event_poller.h +18 -15
- data/src/core/lib/event_engine/posix_engine/event_poller_posix_default.cc +0 -18
- data/src/core/lib/event_engine/posix_engine/file_descriptor_collection.cc +124 -0
- data/src/core/lib/event_engine/posix_engine/file_descriptor_collection.h +243 -0
- data/src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h +29 -19
- data/src/core/lib/event_engine/posix_engine/internal_errqueue.cc +6 -2
- data/src/core/lib/event_engine/posix_engine/internal_errqueue.h +6 -1
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +145 -92
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +9 -19
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +333 -116
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +61 -18
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +45 -37
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.h +6 -4
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +32 -142
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.h +6 -5
- data/src/core/lib/event_engine/posix_engine/posix_interface.h +211 -0
- data/src/core/lib/event_engine/posix_engine/posix_interface_posix.cc +1083 -0
- data/src/core/lib/event_engine/posix_engine/posix_interface_windows.cc +281 -0
- data/src/core/lib/event_engine/posix_engine/posix_write_event_sink.cc +154 -0
- data/src/core/lib/event_engine/posix_engine/posix_write_event_sink.h +174 -0
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +3 -719
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +10 -170
- data/src/core/lib/event_engine/posix_engine/timer_manager.cc +33 -22
- data/src/core/lib/event_engine/posix_engine/timer_manager.h +13 -11
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc +117 -151
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.h +26 -94
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.cc +26 -25
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.h +6 -2
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.cc +36 -62
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.h +6 -2
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix.h +7 -6
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.cc +12 -6
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.h +3 -1
- data/src/core/lib/event_engine/shim.cc +9 -0
- data/src/core/lib/event_engine/shim.h +3 -0
- data/src/core/lib/event_engine/thread_pool/thread_pool.h +7 -3
- data/src/core/lib/event_engine/thread_pool/thread_pool_factory.cc +0 -17
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +4 -2
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h +3 -2
- data/src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc +4 -0
- data/src/core/lib/event_engine/windows/grpc_polled_fd_windows.h +4 -0
- data/src/core/lib/event_engine/windows/windows_endpoint.h +2 -6
- data/src/core/lib/event_engine/windows/windows_engine.cc +0 -1
- data/src/core/lib/event_engine/windows/windows_engine.h +1 -3
- data/src/core/lib/event_engine/windows/windows_listener.cc +14 -2
- data/src/core/lib/experiments/experiments.cc +45 -93
- data/src/core/lib/experiments/experiments.h +21 -51
- data/src/core/lib/iomgr/endpoint.cc +4 -3
- data/src/core/lib/iomgr/endpoint.h +7 -4
- data/src/core/lib/iomgr/endpoint_cfstream.cc +3 -2
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +7 -2
- data/src/core/lib/iomgr/ev_poll_posix.cc +7 -2
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +4 -6
- data/src/core/lib/iomgr/tcp_posix.cc +12 -6
- data/src/core/lib/iomgr/tcp_windows.cc +3 -2
- data/src/core/lib/promise/activity.h +1 -0
- data/src/core/lib/promise/arena_promise.h +23 -7
- data/src/core/lib/promise/detail/promise_factory.h +10 -0
- data/src/core/lib/promise/detail/promise_like.h +118 -11
- data/src/core/lib/promise/detail/promise_variant.h +50 -0
- data/src/core/lib/promise/detail/seq_state.h +687 -548
- data/src/core/lib/promise/if.h +20 -0
- data/src/core/lib/promise/inter_activity_latch.h +147 -0
- data/src/core/lib/promise/inter_activity_mutex.h +547 -0
- data/src/core/lib/promise/loop.h +65 -3
- data/src/core/lib/promise/map.h +24 -0
- data/src/core/lib/promise/match_promise.h +103 -0
- data/src/core/lib/promise/mpsc.cc +425 -0
- data/src/core/lib/promise/mpsc.h +490 -0
- data/src/core/lib/promise/party.cc +50 -1
- data/src/core/lib/promise/party.h +66 -1
- data/src/core/lib/promise/race.h +31 -0
- data/src/core/lib/promise/seq.h +4 -1
- data/src/core/lib/promise/status_flag.h +7 -0
- data/src/core/lib/promise/try_seq.h +4 -1
- data/src/core/lib/promise/wait_set.cc +28 -0
- data/src/core/lib/promise/wait_set.h +86 -0
- data/src/core/lib/resource_quota/arena.h +19 -0
- data/src/core/lib/slice/slice.h +5 -0
- data/src/core/lib/surface/channel_create.cc +88 -13
- data/src/core/lib/surface/channel_create.h +4 -0
- data/src/core/lib/surface/channel_init.cc +164 -47
- data/src/core/lib/surface/channel_init.h +64 -1
- data/src/core/lib/surface/filter_stack_call.cc +18 -9
- data/src/core/lib/surface/init.cc +6 -15
- data/src/core/lib/surface/legacy_channel.cc +3 -5
- data/src/core/lib/surface/legacy_channel.h +3 -1
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/promise_endpoint.cc +110 -0
- data/src/core/lib/transport/promise_endpoint.h +307 -0
- data/src/core/load_balancing/child_policy_handler.cc +2 -4
- data/src/core/load_balancing/delegating_helper.h +2 -3
- data/src/core/load_balancing/health_check_client.cc +1 -5
- data/src/core/load_balancing/lb_policy.h +1 -3
- data/src/core/load_balancing/oob_backend_metric.cc +1 -5
- data/src/core/load_balancing/pick_first/pick_first.cc +3 -0
- data/src/core/load_balancing/xds/cds.cc +10 -1
- data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +2 -0
- data/src/core/resolver/xds/xds_config.cc +6 -3
- data/src/core/resolver/xds/xds_config.h +9 -4
- data/src/core/resolver/xds/xds_dependency_manager.cc +21 -6
- data/src/core/resolver/xds/xds_dependency_manager.h +2 -1
- data/src/core/resolver/xds/xds_resolver.cc +31 -11
- data/src/core/server/server.cc +83 -12
- data/src/core/server/server.h +21 -2
- data/src/core/server/xds_server_config_fetcher.cc +63 -25
- data/src/core/service_config/service_config.h +1 -1
- data/src/core/service_config/service_config_impl.h +1 -1
- data/src/core/telemetry/context_list_entry.cc +38 -0
- data/src/core/telemetry/context_list_entry.h +42 -12
- data/src/core/telemetry/stats_data.cc +233 -207
- data/src/core/telemetry/stats_data.h +250 -153
- data/src/core/telemetry/tcp_tracer.h +1 -1
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +11 -3
- data/src/core/tsi/fake_transport_security.cc +17 -0
- data/src/core/tsi/ssl_transport_security.cc +2 -0
- data/src/core/tsi/transport_security_grpc.cc +8 -0
- data/src/core/tsi/transport_security_grpc.h +15 -0
- data/src/core/util/backoff.cc +1 -5
- data/src/core/util/backoff.h +1 -0
- data/src/core/util/down_cast.h +1 -1
- data/src/core/util/function_signature.h +15 -1
- data/src/core/util/http_client/httpcli.cc +12 -5
- data/src/core/util/http_client/httpcli.h +4 -1
- data/src/core/util/latent_see.h +8 -5
- data/src/core/util/log.cc +4 -0
- data/src/core/util/memory_usage.h +268 -0
- data/src/core/util/per_cpu.cc +2 -0
- data/src/core/util/per_cpu.h +7 -0
- data/src/core/util/shared_bit_gen.h +20 -0
- data/src/core/util/single_set_ptr.h +2 -2
- data/src/core/util/upb_utils.h +42 -0
- data/src/core/util/uri.cc +3 -2
- data/src/core/util/useful.h +53 -2
- data/src/core/util/wait_for_single_owner.cc +31 -0
- data/src/core/util/wait_for_single_owner.h +24 -0
- data/src/core/xds/grpc/xds_bootstrap_grpc.cc +2 -0
- data/src/core/xds/grpc/xds_bootstrap_grpc.h +5 -0
- data/src/core/xds/grpc/xds_client_grpc.cc +6 -2
- data/src/core/xds/grpc/xds_common_types_parser.cc +138 -50
- data/src/core/xds/grpc/xds_common_types_parser.h +12 -0
- data/src/core/xds/grpc/xds_http_filter.h +7 -0
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.cc +22 -0
- data/src/core/xds/grpc/xds_http_gcp_authn_filter.h +3 -0
- data/src/core/xds/grpc/xds_route_config_parser.cc +15 -38
- data/src/core/xds/grpc/xds_server_grpc.cc +63 -13
- data/src/core/xds/grpc/xds_server_grpc.h +10 -2
- data/src/core/xds/grpc/xds_server_grpc_interface.h +4 -0
- data/src/core/xds/grpc/xds_transport_grpc.cc +18 -0
- data/src/core/xds/xds_client/xds_bootstrap.h +2 -0
- data/src/core/xds/xds_client/xds_client.cc +26 -5
- data/src/ruby/ext/grpc/extconf.rb +2 -0
- data/src/ruby/ext/grpc/rb_call.c +1 -8
- data/src/ruby/ext/grpc/rb_channel.c +72 -568
- data/src/ruby/ext/grpc/rb_channel.h +0 -3
- data/src/ruby/ext/grpc/rb_completion_queue.c +26 -14
- data/src/ruby/ext/grpc/rb_completion_queue.h +1 -7
- data/src/ruby/ext/grpc/rb_grpc.c +9 -5
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +1 -1
- data/src/ruby/ext/grpc/rb_loader.c +0 -4
- data/src/ruby/ext/grpc/rb_server.c +31 -50
- data/src/ruby/lib/grpc/generic/client_stub.rb +4 -4
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/spec/core_spec.rb +22 -0
- data/src/ruby/spec/generic/active_call_spec.rb +1 -1
- data/third_party/abseil-cpp/absl/algorithm/container.h +2 -19
- data/third_party/abseil-cpp/absl/base/attributes.h +76 -7
- data/third_party/abseil-cpp/absl/base/call_once.h +11 -12
- data/third_party/abseil-cpp/absl/base/config.h +20 -129
- data/third_party/abseil-cpp/absl/base/{internal/fast_type_id.h → fast_type_id.h} +11 -16
- data/third_party/abseil-cpp/absl/base/internal/cycleclock.cc +0 -5
- data/third_party/abseil-cpp/absl/base/internal/cycleclock_config.h +7 -7
- data/third_party/abseil-cpp/absl/base/internal/endian.h +34 -38
- data/third_party/abseil-cpp/absl/base/internal/iterator_traits.h +71 -0
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc +6 -5
- data/third_party/abseil-cpp/absl/base/internal/{nullability_impl.h → nullability_deprecated.h} +45 -8
- data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +0 -9
- data/third_party/abseil-cpp/absl/base/internal/spinlock.h +3 -13
- data/third_party/abseil-cpp/absl/base/internal/unaligned_access.h +6 -6
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +8 -3
- data/third_party/abseil-cpp/absl/base/no_destructor.h +11 -32
- data/third_party/abseil-cpp/absl/base/nullability.h +84 -72
- data/third_party/abseil-cpp/absl/base/options.h +3 -80
- data/third_party/abseil-cpp/absl/base/policy_checks.h +7 -7
- data/third_party/abseil-cpp/absl/cleanup/cleanup.h +1 -3
- data/third_party/abseil-cpp/absl/cleanup/internal/cleanup.h +3 -4
- data/third_party/abseil-cpp/absl/container/btree_map.h +4 -2
- data/third_party/abseil-cpp/absl/container/btree_set.h +4 -2
- data/third_party/abseil-cpp/absl/container/fixed_array.h +7 -14
- data/third_party/abseil-cpp/absl/container/flat_hash_map.h +5 -0
- data/third_party/abseil-cpp/absl/container/flat_hash_set.h +6 -1
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +8 -5
- data/third_party/abseil-cpp/absl/container/internal/btree.h +132 -29
- data/third_party/abseil-cpp/absl/container/internal/btree_container.h +175 -71
- data/third_party/abseil-cpp/absl/container/internal/common.h +43 -0
- data/third_party/abseil-cpp/absl/container/internal/common_policy_traits.h +1 -2
- data/third_party/abseil-cpp/absl/container/internal/container_memory.h +9 -10
- data/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +1 -8
- data/third_party/abseil-cpp/absl/container/internal/hash_policy_traits.h +0 -4
- data/third_party/abseil-cpp/absl/container/internal/hashtable_control_bytes.h +527 -0
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +20 -4
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +31 -12
- data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +2 -7
- data/third_party/abseil-cpp/absl/container/internal/layout.h +26 -42
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +199 -68
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +1354 -183
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +881 -1424
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set_resize_impl.h +80 -0
- data/third_party/abseil-cpp/absl/crc/crc32c.cc +0 -4
- data/third_party/abseil-cpp/absl/crc/crc32c.h +7 -5
- data/third_party/abseil-cpp/absl/crc/internal/crc32_x86_arm_combined_simd.h +0 -22
- data/third_party/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc +45 -74
- data/third_party/abseil-cpp/absl/debugging/internal/addresses.h +57 -0
- data/third_party/abseil-cpp/absl/debugging/internal/decode_rust_punycode.cc +1 -1
- data/third_party/abseil-cpp/absl/debugging/internal/decode_rust_punycode.h +5 -5
- data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +8 -35
- data/third_party/abseil-cpp/absl/debugging/internal/demangle_rust.cc +16 -16
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +40 -37
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc +16 -7
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc +14 -5
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_generic-inl.inc +10 -4
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +27 -16
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +13 -4
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_unimplemented-inl.inc +4 -3
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_win32-inl.inc +15 -28
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +19 -9
- data/third_party/abseil-cpp/absl/debugging/stacktrace.cc +144 -27
- data/third_party/abseil-cpp/absl/debugging/stacktrace.h +73 -5
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +19 -9
- data/third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc +3 -2
- data/third_party/abseil-cpp/absl/debugging/symbolize_win32.inc +25 -6
- data/third_party/abseil-cpp/absl/flags/commandlineflag.h +2 -2
- data/third_party/abseil-cpp/absl/flags/flag.h +4 -3
- data/third_party/abseil-cpp/absl/flags/internal/commandlineflag.h +2 -2
- data/third_party/abseil-cpp/absl/flags/internal/flag.cc +2 -1
- data/third_party/abseil-cpp/absl/flags/internal/flag.h +7 -6
- data/third_party/abseil-cpp/absl/flags/internal/registry.h +4 -3
- data/third_party/abseil-cpp/absl/flags/reflection.cc +2 -3
- data/third_party/abseil-cpp/absl/functional/any_invocable.h +8 -10
- data/third_party/abseil-cpp/absl/functional/function_ref.h +2 -9
- data/third_party/abseil-cpp/absl/functional/internal/any_invocable.h +110 -226
- data/third_party/abseil-cpp/absl/functional/internal/front_binder.h +10 -12
- data/third_party/abseil-cpp/absl/functional/internal/function_ref.h +2 -5
- data/third_party/abseil-cpp/absl/hash/hash.h +18 -0
- data/third_party/abseil-cpp/absl/hash/internal/hash.cc +1 -5
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +86 -61
- data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc +25 -68
- data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.h +2 -6
- data/third_party/abseil-cpp/absl/hash/internal/weakly_mixed_integer.h +38 -0
- data/third_party/abseil-cpp/absl/log/check.h +2 -1
- data/third_party/abseil-cpp/absl/log/globals.h +4 -5
- data/third_party/abseil-cpp/absl/log/internal/append_truncated.h +28 -0
- data/third_party/abseil-cpp/absl/log/internal/check_op.cc +22 -22
- data/third_party/abseil-cpp/absl/log/internal/check_op.h +65 -62
- data/third_party/abseil-cpp/absl/log/internal/conditions.cc +5 -3
- data/third_party/abseil-cpp/absl/log/internal/conditions.h +7 -2
- data/third_party/abseil-cpp/absl/log/internal/log_message.cc +85 -43
- data/third_party/abseil-cpp/absl/log/internal/log_message.h +84 -59
- data/third_party/abseil-cpp/absl/log/internal/nullstream.h +1 -0
- data/third_party/abseil-cpp/absl/log/internal/proto.cc +3 -2
- data/third_party/abseil-cpp/absl/log/internal/proto.h +3 -3
- data/third_party/abseil-cpp/absl/log/internal/strip.h +4 -12
- data/third_party/abseil-cpp/absl/log/internal/vlog_config.h +8 -6
- data/third_party/abseil-cpp/absl/log/internal/voidify.h +10 -4
- data/third_party/abseil-cpp/absl/log/log.h +48 -35
- data/third_party/abseil-cpp/absl/log/log_sink_registry.h +2 -2
- data/third_party/abseil-cpp/absl/meta/type_traits.h +46 -175
- data/third_party/abseil-cpp/absl/numeric/bits.h +68 -2
- data/third_party/abseil-cpp/absl/numeric/int128.cc +0 -52
- data/third_party/abseil-cpp/absl/numeric/internal/bits.h +7 -3
- data/third_party/abseil-cpp/absl/profiling/internal/exponential_biased.cc +1 -1
- data/third_party/abseil-cpp/absl/random/bit_gen_ref.h +10 -11
- data/third_party/abseil-cpp/absl/random/distributions.h +6 -8
- data/third_party/abseil-cpp/absl/random/gaussian_distribution.h +1 -1
- data/third_party/abseil-cpp/absl/random/internal/distribution_caller.h +5 -6
- data/third_party/abseil-cpp/absl/random/internal/{pool_urbg.cc → entropy_pool.cc} +22 -90
- data/third_party/abseil-cpp/absl/random/internal/entropy_pool.h +35 -0
- data/third_party/abseil-cpp/absl/random/internal/nonsecure_base.h +5 -6
- data/third_party/abseil-cpp/absl/random/internal/randen_detect.cc +1 -1
- data/third_party/abseil-cpp/absl/random/internal/seed_material.cc +20 -12
- data/third_party/abseil-cpp/absl/random/internal/seed_material.h +5 -5
- data/third_party/abseil-cpp/absl/random/random.h +88 -53
- data/third_party/abseil-cpp/absl/random/seed_sequences.cc +6 -2
- data/third_party/abseil-cpp/absl/status/internal/status_internal.cc +3 -4
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +3 -4
- data/third_party/abseil-cpp/absl/status/internal/statusor_internal.h +4 -3
- data/third_party/abseil-cpp/absl/status/status.cc +4 -8
- data/third_party/abseil-cpp/absl/status/status.h +8 -8
- data/third_party/abseil-cpp/absl/status/status_payload_printer.h +2 -2
- data/third_party/abseil-cpp/absl/status/statusor.cc +2 -2
- data/third_party/abseil-cpp/absl/status/statusor.h +6 -6
- data/third_party/abseil-cpp/absl/strings/ascii.cc +9 -9
- data/third_party/abseil-cpp/absl/strings/ascii.h +18 -18
- data/third_party/abseil-cpp/absl/strings/charconv.cc +21 -22
- data/third_party/abseil-cpp/absl/strings/charconv.h +5 -5
- data/third_party/abseil-cpp/absl/strings/cord.cc +54 -58
- data/third_party/abseil-cpp/absl/strings/cord.h +94 -83
- data/third_party/abseil-cpp/absl/strings/cord_analysis.cc +11 -11
- data/third_party/abseil-cpp/absl/strings/cord_analysis.h +3 -3
- data/third_party/abseil-cpp/absl/strings/escaping.cc +130 -149
- data/third_party/abseil-cpp/absl/strings/escaping.h +9 -10
- data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +6 -8
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +0 -4
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +0 -4
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +7 -63
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +1 -11
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +0 -22
- data/third_party/abseil-cpp/absl/strings/internal/str_format/output.cc +5 -3
- data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +4 -2
- data/third_party/abseil-cpp/absl/strings/internal/str_join_internal.h +3 -3
- data/third_party/abseil-cpp/absl/strings/internal/string_constant.h +0 -5
- data/third_party/abseil-cpp/absl/strings/internal/utf8.cc +96 -1
- data/third_party/abseil-cpp/absl/strings/internal/utf8.h +15 -1
- data/third_party/abseil-cpp/absl/strings/numbers.cc +53 -32
- data/third_party/abseil-cpp/absl/strings/numbers.h +87 -58
- data/third_party/abseil-cpp/absl/strings/str_cat.cc +6 -7
- data/third_party/abseil-cpp/absl/strings/str_cat.h +32 -32
- data/third_party/abseil-cpp/absl/strings/str_format.h +18 -18
- data/third_party/abseil-cpp/absl/strings/str_replace.cc +3 -3
- data/third_party/abseil-cpp/absl/strings/str_replace.h +6 -6
- data/third_party/abseil-cpp/absl/strings/string_view.cc +4 -9
- data/third_party/abseil-cpp/absl/strings/string_view.h +27 -32
- data/third_party/abseil-cpp/absl/strings/strip.h +4 -4
- data/third_party/abseil-cpp/absl/strings/substitute.cc +5 -4
- data/third_party/abseil-cpp/absl/strings/substitute.h +66 -64
- data/third_party/abseil-cpp/absl/synchronization/internal/futex_waiter.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.cc +0 -5
- data/third_party/abseil-cpp/absl/synchronization/internal/pthread_waiter.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/sem_waiter.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/stdcpp_waiter.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter_base.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/win32_waiter.cc +0 -4
- data/third_party/abseil-cpp/absl/synchronization/mutex.cc +1 -1
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +97 -69
- data/third_party/abseil-cpp/absl/synchronization/notification.h +1 -1
- data/third_party/abseil-cpp/absl/time/civil_time.cc +1 -0
- data/third_party/abseil-cpp/absl/time/duration.cc +12 -7
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +90 -111
- data/third_party/abseil-cpp/absl/time/time.h +20 -15
- data/third_party/abseil-cpp/absl/types/optional.h +7 -747
- data/third_party/abseil-cpp/absl/types/span.h +13 -11
- data/third_party/abseil-cpp/absl/types/variant.h +5 -784
- data/third_party/abseil-cpp/absl/utility/utility.h +10 -185
- metadata +72 -20
- data/src/core/lib/event_engine/forkable.cc +0 -105
- data/src/core/lib/event_engine/forkable.h +0 -67
- data/src/core/lib/iomgr/python_util.h +0 -46
- data/third_party/abseil-cpp/absl/base/internal/inline_variable.h +0 -108
- data/third_party/abseil-cpp/absl/base/internal/invoke.h +0 -241
- data/third_party/abseil-cpp/absl/log/log_entry.cc +0 -41
- data/third_party/abseil-cpp/absl/random/internal/pool_urbg.h +0 -131
- data/third_party/abseil-cpp/absl/types/bad_optional_access.cc +0 -66
- data/third_party/abseil-cpp/absl/types/bad_optional_access.h +0 -78
- data/third_party/abseil-cpp/absl/types/bad_variant_access.cc +0 -82
- data/third_party/abseil-cpp/absl/types/bad_variant_access.h +0 -82
- data/third_party/abseil-cpp/absl/types/internal/optional.h +0 -352
- data/third_party/abseil-cpp/absl/types/internal/variant.h +0 -1622
@@ -1,30 +1,30 @@
|
|
1
|
-
//
|
1
|
+
//
|
2
|
+
//
|
3
|
+
// Copyright 2025 gRPC authors.
|
2
4
|
//
|
3
5
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
6
|
// you may not use this file except in compliance with the License.
|
5
7
|
// You may obtain a copy of the License at
|
6
8
|
//
|
7
|
-
//
|
9
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
10
|
//
|
9
11
|
// Unless required by applicable law or agreed to in writing, software
|
10
12
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
13
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
14
|
// See the License for the specific language governing permissions and
|
13
15
|
// limitations under the License.
|
16
|
+
//
|
17
|
+
//
|
14
18
|
|
15
|
-
#include "
|
16
|
-
|
17
|
-
#include <cstddef>
|
19
|
+
#include "src/core/ext/transport/chttp2/transport/http2_stats_collector.h"
|
18
20
|
|
19
|
-
#include
|
21
|
+
#include <grpc/credentials.h>
|
20
22
|
|
21
|
-
namespace
|
22
|
-
ABSL_NAMESPACE_BEGIN
|
23
|
+
namespace grpc_core {
|
23
24
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
std::shared_ptr<Http2StatsCollector> CreateHttp2StatsCollector(
|
26
|
+
grpc_auth_context* /*ctx*/) {
|
27
|
+
return std::make_shared<Http2StatsCollector>();
|
28
|
+
}
|
28
29
|
|
29
|
-
|
30
|
-
} // namespace absl
|
30
|
+
} // namespace grpc_core
|
@@ -0,0 +1,33 @@
|
|
1
|
+
//
|
2
|
+
//
|
3
|
+
// Copyright 2025 gRPC authors.
|
4
|
+
//
|
5
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
// you may not use this file except in compliance with the License.
|
7
|
+
// You may obtain a copy of the License at
|
8
|
+
//
|
9
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
//
|
11
|
+
// Unless required by applicable law or agreed to in writing, software
|
12
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
// See the License for the specific language governing permissions and
|
15
|
+
// limitations under the License.
|
16
|
+
//
|
17
|
+
//
|
18
|
+
|
19
|
+
#ifndef GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_STATS_COLLECTOR_H
|
20
|
+
#define GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_STATS_COLLECTOR_H
|
21
|
+
|
22
|
+
#include <grpc/credentials.h>
|
23
|
+
|
24
|
+
#include "src/core/telemetry/stats_data.h"
|
25
|
+
|
26
|
+
namespace grpc_core {
|
27
|
+
|
28
|
+
std::shared_ptr<Http2StatsCollector> CreateHttp2StatsCollector(
|
29
|
+
grpc_auth_context* ctx);
|
30
|
+
|
31
|
+
} // namespace grpc_core
|
32
|
+
|
33
|
+
#endif // GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_STATS_COLLECTOR_H
|
@@ -51,6 +51,7 @@ enum class Http2ErrorCode : uint8_t {
|
|
51
51
|
kConnectError = 0xa,
|
52
52
|
kEnhanceYourCalm = 0xb,
|
53
53
|
kInadequateSecurity = 0xc,
|
54
|
+
kHTTP11Required = 0xd,
|
54
55
|
kDoNotUse = 0xffu // Force use of a default clause
|
55
56
|
};
|
56
57
|
|
@@ -75,6 +76,10 @@ inline absl::StatusCode ErrorCodeToAbslStatusCode(
|
|
75
76
|
GPR_UNREACHABLE_CODE(return absl::StatusCode::kUnknown);
|
76
77
|
}
|
77
78
|
|
79
|
+
inline uint8_t GetMaxHttp2ErrorCode() {
|
80
|
+
return static_cast<uint8_t>(Http2ErrorCode::kHTTP11Required);
|
81
|
+
}
|
82
|
+
|
78
83
|
inline Http2ErrorCode AbslStatusCodeToErrorCode(const absl::StatusCode status) {
|
79
84
|
switch (status) {
|
80
85
|
case absl::StatusCode::kOk:
|
@@ -323,7 +328,7 @@ class GRPC_MUST_USE_RESULT Http2Status {
|
|
323
328
|
};
|
324
329
|
|
325
330
|
// We can add more methods and helpers as needed.
|
326
|
-
// This class is similar to ValueOrFailure but a more
|
331
|
+
// This class is similar to ValueOrFailure but a more minimalist version.
|
327
332
|
// Reference :
|
328
333
|
// https://github.com/grpc/grpc/blob/master/src/core/lib/promise/status_flag.h
|
329
334
|
|
@@ -0,0 +1,43 @@
|
|
1
|
+
//
|
2
|
+
//
|
3
|
+
// Copyright 2025 gRPC authors.
|
4
|
+
//
|
5
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
// you may not use this file except in compliance with the License.
|
7
|
+
// You may obtain a copy of the License at
|
8
|
+
//
|
9
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
//
|
11
|
+
// Unless required by applicable law or agreed to in writing, software
|
12
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
// See the License for the specific language governing permissions and
|
15
|
+
// limitations under the License.
|
16
|
+
//
|
17
|
+
//
|
18
|
+
|
19
|
+
#include <cstdint>
|
20
|
+
#include <utility>
|
21
|
+
|
22
|
+
#include "src/core/call/call_spine.h"
|
23
|
+
#include "src/core/ext/transport/chttp2/transport/frame.h"
|
24
|
+
#include "src/core/ext/transport/chttp2/transport/http2_settings.h"
|
25
|
+
#include "src/core/lib/promise/mpsc.h"
|
26
|
+
#include "src/core/lib/promise/party.h"
|
27
|
+
#include "src/core/lib/transport/promise_endpoint.h"
|
28
|
+
#include "src/core/lib/transport/transport.h"
|
29
|
+
#include "src/core/util/ref_counted_ptr.h"
|
30
|
+
#include "src/core/util/sync.h"
|
31
|
+
|
32
|
+
namespace grpc_core {
|
33
|
+
namespace http2 {
|
34
|
+
|
35
|
+
// Experimental : This is just the initial skeleton of class
|
36
|
+
// and it is functions. The code will be written iteratively.
|
37
|
+
// Do not use or edit any of these functions unless you are
|
38
|
+
// familiar with the PH2 project (Moving chttp2 to promises.)
|
39
|
+
// TODO(tjagtap) : [PH2][P3] : We may not need this file. Delete once Server
|
40
|
+
// Transport is complete.
|
41
|
+
|
42
|
+
} // namespace http2
|
43
|
+
} // namespace grpc_core
|
@@ -0,0 +1,65 @@
|
|
1
|
+
//
|
2
|
+
//
|
3
|
+
// Copyright 2025 gRPC authors.
|
4
|
+
//
|
5
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
// you may not use this file except in compliance with the License.
|
7
|
+
// You may obtain a copy of the License at
|
8
|
+
//
|
9
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
//
|
11
|
+
// Unless required by applicable law or agreed to in writing, software
|
12
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
// See the License for the specific language governing permissions and
|
15
|
+
// limitations under the License.
|
16
|
+
//
|
17
|
+
//
|
18
|
+
|
19
|
+
#ifndef GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_TRANSPORT_H
|
20
|
+
#define GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_TRANSPORT_H
|
21
|
+
|
22
|
+
#include <cstdint>
|
23
|
+
#include <utility>
|
24
|
+
|
25
|
+
#include "src/core/call/call_spine.h"
|
26
|
+
#include "src/core/ext/transport/chttp2/transport/frame.h"
|
27
|
+
#include "src/core/ext/transport/chttp2/transport/http2_settings.h"
|
28
|
+
#include "src/core/lib/promise/mpsc.h"
|
29
|
+
#include "src/core/lib/promise/party.h"
|
30
|
+
#include "src/core/lib/transport/promise_endpoint.h"
|
31
|
+
#include "src/core/lib/transport/transport.h"
|
32
|
+
#include "src/core/util/ref_counted_ptr.h"
|
33
|
+
#include "src/core/util/sync.h"
|
34
|
+
|
35
|
+
namespace grpc_core {
|
36
|
+
namespace http2 {
|
37
|
+
|
38
|
+
// Experimental : This is just the initial skeleton of class
|
39
|
+
// and it is functions. The code will be written iteratively.
|
40
|
+
// Do not use or edit any of these functions unless you are
|
41
|
+
// familiar with the PH2 project (Moving chttp2 to promises.)
|
42
|
+
// TODO(tjagtap) : [PH2][P3] : Update the experimental status of the code before
|
43
|
+
// http2 rollout begins.
|
44
|
+
|
45
|
+
#define GRPC_HTTP2_CLIENT_DLOG \
|
46
|
+
DLOG_IF(INFO, GRPC_TRACE_FLAG_ENABLED(http2_ph2_transport))
|
47
|
+
|
48
|
+
// TODO(akshitpatel) : [PH2][P2] : Choose appropriate size later.
|
49
|
+
constexpr int kMpscSize = 10;
|
50
|
+
|
51
|
+
enum class HttpStreamState : uint8_t {
|
52
|
+
// https://www.rfc-editor.org/rfc/rfc9113.html#name-stream-states
|
53
|
+
kIdle,
|
54
|
+
kOpen,
|
55
|
+
kHalfClosedLocal,
|
56
|
+
kHalfClosedRemote,
|
57
|
+
kClosed,
|
58
|
+
};
|
59
|
+
|
60
|
+
class TransportSendQeueue {};
|
61
|
+
|
62
|
+
} // namespace http2
|
63
|
+
} // namespace grpc_core
|
64
|
+
|
65
|
+
#endif // GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_TRANSPORT_H
|
@@ -43,8 +43,6 @@ struct H2DataTrace {
|
|
43
43
|
bool end_stream;
|
44
44
|
uint32_t payload_length;
|
45
45
|
|
46
|
-
size_t MemoryUsage() const { return sizeof(*this); }
|
47
|
-
|
48
46
|
void RenderJson(Json::Object& json) const {
|
49
47
|
json["read"] = Json::FromBool(kRead);
|
50
48
|
json["frame_type"] = Json::FromString("DATA");
|
@@ -62,8 +60,6 @@ struct H2HeaderTrace {
|
|
62
60
|
bool continuation;
|
63
61
|
uint32_t payload_length;
|
64
62
|
|
65
|
-
size_t MemoryUsage() const { return sizeof(*this); }
|
66
|
-
|
67
63
|
void RenderJson(Json::Object& json) const {
|
68
64
|
json["read"] = Json::FromBool(kRead);
|
69
65
|
json["frame_type"] = continuation ? Json::FromString("CONTINUATION")
|
@@ -80,8 +76,6 @@ struct H2RstStreamTrace {
|
|
80
76
|
uint32_t stream_id;
|
81
77
|
uint32_t error_code;
|
82
78
|
|
83
|
-
size_t MemoryUsage() const { return sizeof(*this); }
|
84
|
-
|
85
79
|
void RenderJson(Json::Object& json) const {
|
86
80
|
json["read"] = Json::FromBool(kRead);
|
87
81
|
json["frame_type"] = Json::FromString("RST_STREAM");
|
@@ -95,11 +89,6 @@ struct H2SettingsTrace {
|
|
95
89
|
bool ack;
|
96
90
|
std::vector<Http2SettingsFrame::Setting> settings;
|
97
91
|
|
98
|
-
size_t MemoryUsage() const {
|
99
|
-
return sizeof(*this) +
|
100
|
-
sizeof(Http2SettingsFrame::Setting) * settings.size();
|
101
|
-
}
|
102
|
-
|
103
92
|
void RenderJson(Json::Object& json) const {
|
104
93
|
json["read"] = Json::FromBool(kRead);
|
105
94
|
json["frame_type"] = Json::FromString("SETTINGS");
|
@@ -120,8 +109,6 @@ struct H2PingTrace {
|
|
120
109
|
bool ack;
|
121
110
|
uint64_t opaque;
|
122
111
|
|
123
|
-
size_t MemoryUsage() const { return sizeof(*this); }
|
124
|
-
|
125
112
|
void RenderJson(Json::Object& json) const {
|
126
113
|
json["read"] = Json::FromBool(kRead);
|
127
114
|
json["frame_type"] = Json::FromString("PING");
|
@@ -136,8 +123,6 @@ struct H2GoAwayTrace {
|
|
136
123
|
uint32_t error_code;
|
137
124
|
std::string debug_data;
|
138
125
|
|
139
|
-
size_t MemoryUsage() const { return sizeof(*this) + debug_data.size(); }
|
140
|
-
|
141
126
|
void RenderJson(Json::Object& json) const {
|
142
127
|
json["read"] = Json::FromBool(kRead);
|
143
128
|
json["frame_type"] = Json::FromString("GOAWAY");
|
@@ -152,8 +137,6 @@ struct H2WindowUpdateTrace {
|
|
152
137
|
uint32_t stream_id;
|
153
138
|
uint32_t window_size_increment;
|
154
139
|
|
155
|
-
size_t MemoryUsage() const { return sizeof(*this); }
|
156
|
-
|
157
140
|
void RenderJson(Json::Object& json) const {
|
158
141
|
json["read"] = Json::FromBool(kRead);
|
159
142
|
json["frame_type"] = Json::FromString("WINDOW_UPDATE");
|
@@ -166,8 +149,6 @@ template <bool kRead>
|
|
166
149
|
struct H2SecurityTrace {
|
167
150
|
uint32_t payload_length;
|
168
151
|
|
169
|
-
size_t MemoryUsage() const { return sizeof(*this); }
|
170
|
-
|
171
152
|
void RenderJson(Json::Object& json) const {
|
172
153
|
json["read"] = Json::FromBool(kRead);
|
173
154
|
json["frame_type"] = Json::FromString("SECURITY");
|
@@ -181,8 +162,6 @@ struct H2UnknownFrameTrace {
|
|
181
162
|
uint32_t stream_id;
|
182
163
|
uint32_t payload_length;
|
183
164
|
|
184
|
-
size_t MemoryUsage() const { return sizeof(*this); }
|
185
|
-
|
186
165
|
void RenderJson(Json::Object& json) const {
|
187
166
|
json["frame_type"] = Json::FromString("UNKNOWN");
|
188
167
|
json["type"] = Json::FromNumber(type);
|
@@ -197,8 +176,6 @@ struct H2FlowControlStall {
|
|
197
176
|
int64_t stream_window;
|
198
177
|
uint32_t stream_id;
|
199
178
|
|
200
|
-
size_t MemoryUsage() const { return sizeof(*this); }
|
201
|
-
|
202
179
|
void RenderJson(Json::Object& json) const {
|
203
180
|
json["metadata_type"] = Json::FromString("FLOW_CONTROL_STALL");
|
204
181
|
json["transport_window"] = Json::FromNumber(transport_window);
|
@@ -210,8 +187,6 @@ struct H2FlowControlStall {
|
|
210
187
|
struct H2BeginWriteCycle {
|
211
188
|
uint32_t target_size;
|
212
189
|
|
213
|
-
size_t MemoryUsage() const { return sizeof(*this); }
|
214
|
-
|
215
190
|
void RenderJson(Json::Object& json) const {
|
216
191
|
json["metadata_type"] = Json::FromString("BEGIN_WRITE_CYCLE");
|
217
192
|
json["target_size"] = Json::FromNumber(target_size);
|
@@ -221,8 +196,6 @@ struct H2BeginWriteCycle {
|
|
221
196
|
struct H2BeginEndpointWrite {
|
222
197
|
uint32_t write_size;
|
223
198
|
|
224
|
-
size_t MemoryUsage() const { return sizeof(*this); }
|
225
|
-
|
226
199
|
void RenderJson(Json::Object& json) const {
|
227
200
|
json["metadata_type"] = Json::FromString("BEGIN_ENDPOINT_WRITE");
|
228
201
|
json["write_size"] = Json::FromNumber(write_size);
|
@@ -230,8 +203,6 @@ struct H2BeginEndpointWrite {
|
|
230
203
|
};
|
231
204
|
|
232
205
|
struct H2EndWriteCycle {
|
233
|
-
size_t MemoryUsage() const { return sizeof(*this); }
|
234
|
-
|
235
206
|
void RenderJson(Json::Object& json) const {
|
236
207
|
json["metadata_type"] = Json::FromString("END_WRITE_CYCLE");
|
237
208
|
}
|
@@ -57,6 +57,7 @@
|
|
57
57
|
#include "src/core/ext/transport/chttp2/transport/ping_abuse_policy.h"
|
58
58
|
#include "src/core/ext/transport/chttp2/transport/ping_callbacks.h"
|
59
59
|
#include "src/core/ext/transport/chttp2/transport/ping_rate_policy.h"
|
60
|
+
#include "src/core/ext/transport/chttp2/transport/transport_common.h"
|
60
61
|
#include "src/core/ext/transport/chttp2/transport/write_size_policy.h"
|
61
62
|
#include "src/core/lib/channel/channel_args.h"
|
62
63
|
#include "src/core/lib/debug/trace.h"
|
@@ -76,6 +77,7 @@
|
|
76
77
|
#include "src/core/telemetry/call_tracer.h"
|
77
78
|
#include "src/core/telemetry/context_list_entry.h"
|
78
79
|
#include "src/core/telemetry/stats.h"
|
80
|
+
#include "src/core/telemetry/tcp_tracer.h"
|
79
81
|
#include "src/core/util/bitset.h"
|
80
82
|
#include "src/core/util/debug_location.h"
|
81
83
|
#include "src/core/util/ref_counted.h"
|
@@ -236,10 +238,12 @@ struct grpc_chttp2_transport final : public grpc_core::FilterStackTransport,
|
|
236
238
|
public:
|
237
239
|
explicit ChannelzDataSource(grpc_chttp2_transport* transport)
|
238
240
|
: grpc_core::channelz::DataSource(transport->channelz_socket),
|
239
|
-
transport_(transport) {
|
240
|
-
|
241
|
+
transport_(transport) {
|
242
|
+
SourceConstructed();
|
243
|
+
}
|
244
|
+
~ChannelzDataSource() { SourceDestructing(); }
|
241
245
|
|
242
|
-
void AddData(grpc_core::channelz::DataSink
|
246
|
+
void AddData(grpc_core::channelz::DataSink sink) override;
|
243
247
|
std::unique_ptr<grpc_core::channelz::ZTrace> GetZTrace(
|
244
248
|
absl::string_view name) override;
|
245
249
|
|
@@ -283,6 +287,9 @@ struct grpc_chttp2_transport final : public grpc_core::FilterStackTransport,
|
|
283
287
|
void WriteSecurityFrame(grpc_core::SliceBuffer* data);
|
284
288
|
void WriteSecurityFrameLocked(grpc_core::SliceBuffer* data);
|
285
289
|
|
290
|
+
// We depend on the ep being available for the life of the transport in
|
291
|
+
// at least one place - event callback in WriteEventSink. Hence, this should
|
292
|
+
// only be orphaned in the destructor.
|
286
293
|
grpc_core::OrphanablePtr<grpc_endpoint> ep;
|
287
294
|
grpc_core::Mutex ep_destroy_mu; // Guards endpoint destruction only.
|
288
295
|
|
@@ -581,7 +588,7 @@ struct grpc_chttp2_transport final : public grpc_core::FilterStackTransport,
|
|
581
588
|
grpc_core::Timestamp last_window_update_time =
|
582
589
|
grpc_core::Timestamp::InfPast();
|
583
590
|
|
584
|
-
grpc_core::Http2StatsCollector http2_stats;
|
591
|
+
std::shared_ptr<grpc_core::Http2StatsCollector> http2_stats;
|
585
592
|
grpc_core::Http2ZTraceCollector http2_ztrace_collector;
|
586
593
|
|
587
594
|
GPR_NO_UNIQUE_ADDRESS grpc_core::latent_see::Flow write_flow;
|
@@ -759,6 +766,11 @@ struct grpc_chttp2_stream {
|
|
759
766
|
void grpc_chttp2_initiate_write(grpc_chttp2_transport* t,
|
760
767
|
grpc_chttp2_initiate_write_reason reason);
|
761
768
|
|
769
|
+
struct TcpCallTracerWithOffset {
|
770
|
+
std::shared_ptr<grpc_core::TcpCallTracer> tcp_call_tracer;
|
771
|
+
size_t byte_offset;
|
772
|
+
};
|
773
|
+
|
762
774
|
struct grpc_chttp2_begin_write_result {
|
763
775
|
/// are we writing?
|
764
776
|
bool writing;
|
@@ -766,6 +778,8 @@ struct grpc_chttp2_begin_write_result {
|
|
766
778
|
bool partial;
|
767
779
|
/// did we queue any completions as part of beginning the write
|
768
780
|
bool early_results_scheduled;
|
781
|
+
/// Tcp Call Tracers if any
|
782
|
+
std::vector<TcpCallTracerWithOffset> tcp_call_tracers;
|
769
783
|
};
|
770
784
|
grpc_chttp2_begin_write_result grpc_chttp2_begin_write(
|
771
785
|
grpc_chttp2_transport* t);
|
@@ -822,10 +836,6 @@ void grpc_chttp2_settings_timeout(
|
|
822
836
|
#define GRPC_HEADER_SIZE_IN_BYTES 5
|
823
837
|
#define MAX_SIZE_T (~(size_t)0)
|
824
838
|
|
825
|
-
#define GRPC_CHTTP2_CLIENT_CONNECT_STRING "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"
|
826
|
-
#define GRPC_CHTTP2_CLIENT_CONNECT_STRLEN \
|
827
|
-
(sizeof(GRPC_CHTTP2_CLIENT_CONNECT_STRING) - 1)
|
828
|
-
|
829
839
|
#define GRPC_CHTTP2_IF_TRACING(severity) \
|
830
840
|
LOG_IF(severity, GRPC_TRACE_FLAG_ENABLED(http))
|
831
841
|
|
@@ -0,0 +1,105 @@
|
|
1
|
+
//
|
2
|
+
//
|
3
|
+
// Copyright 2025 gRPC authors.
|
4
|
+
//
|
5
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
// you may not use this file except in compliance with the License.
|
7
|
+
// You may obtain a copy of the License at
|
8
|
+
//
|
9
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
//
|
11
|
+
// Unless required by applicable law or agreed to in writing, software
|
12
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
// See the License for the specific language governing permissions and
|
15
|
+
// limitations under the License.
|
16
|
+
//
|
17
|
+
//
|
18
|
+
#include "src/core/ext/transport/chttp2/transport/keepalive.h"
|
19
|
+
|
20
|
+
#include "src/core/lib/promise/all_ok.h"
|
21
|
+
#include "src/core/lib/promise/if.h"
|
22
|
+
#include "src/core/lib/promise/loop.h"
|
23
|
+
#include "src/core/lib/promise/race.h"
|
24
|
+
#include "src/core/lib/promise/sleep.h"
|
25
|
+
#include "src/core/lib/promise/try_seq.h"
|
26
|
+
|
27
|
+
namespace grpc_core {
|
28
|
+
namespace http2 {
|
29
|
+
KeepaliveManager::KeepaliveManager(
|
30
|
+
std::unique_ptr<KeepAliveInterface> keep_alive_interface,
|
31
|
+
Duration keepalive_timeout, const Duration keepalive_time)
|
32
|
+
: keep_alive_interface_(std::move(keep_alive_interface)),
|
33
|
+
keepalive_timeout_(keepalive_timeout),
|
34
|
+
keepalive_time_(keepalive_time) {}
|
35
|
+
|
36
|
+
auto KeepaliveManager::WaitForKeepAliveTimeout() {
|
37
|
+
return AssertResultType<absl::Status>(
|
38
|
+
TrySeq(Sleep(keepalive_timeout_), [this] {
|
39
|
+
return If(
|
40
|
+
data_received_in_last_cycle_,
|
41
|
+
[] {
|
42
|
+
GRPC_HTTP2_KEEPALIVE_LOG
|
43
|
+
<< "Keepalive timeout triggered but "
|
44
|
+
<< "received data. Resolving with ok status";
|
45
|
+
return Immediate(absl::OkStatus());
|
46
|
+
},
|
47
|
+
[this] {
|
48
|
+
GRPC_HTTP2_KEEPALIVE_LOG
|
49
|
+
<< "Keepalive timeout triggered and no "
|
50
|
+
"data received. Triggering keepalive timeout.";
|
51
|
+
// Once the keepalive timeout is triggered, ensure that
|
52
|
+
// WaitForData() is never resolved. This is needed as the
|
53
|
+
// keepalive loop should break once the timeout is triggered.
|
54
|
+
keep_alive_timeout_triggered_ = true;
|
55
|
+
return TrySeq(keep_alive_interface_->OnKeepAliveTimeout(), [] {
|
56
|
+
return absl::CancelledError("keepalive timeout");
|
57
|
+
});
|
58
|
+
});
|
59
|
+
}));
|
60
|
+
}
|
61
|
+
auto KeepaliveManager::TimeoutAndSendPing() {
|
62
|
+
DCHECK(!data_received_in_last_cycle_);
|
63
|
+
DCHECK(keepalive_timeout_ != Duration::Infinity());
|
64
|
+
|
65
|
+
return AllOk<absl::Status>(Race(WaitForData(), WaitForKeepAliveTimeout()),
|
66
|
+
SendPingAndWaitForAck());
|
67
|
+
}
|
68
|
+
auto KeepaliveManager::MaybeSendKeepAlivePing() {
|
69
|
+
GRPC_HTTP2_KEEPALIVE_LOG << "KeepaliveManager::MaybeSendKeepAlivePing";
|
70
|
+
return AssertResultType<absl::Status>(
|
71
|
+
TrySeq(If(
|
72
|
+
NeedToSendKeepAlivePing(),
|
73
|
+
[this]() {
|
74
|
+
return If(
|
75
|
+
keepalive_timeout_ != Duration::Infinity(),
|
76
|
+
[this] { return TimeoutAndSendPing(); },
|
77
|
+
[this] { return SendPingAndWaitForAck(); });
|
78
|
+
},
|
79
|
+
[]() { return Immediate(absl::OkStatus()); }),
|
80
|
+
[this] {
|
81
|
+
data_received_in_last_cycle_ = false;
|
82
|
+
return Immediate(absl::OkStatus());
|
83
|
+
}));
|
84
|
+
}
|
85
|
+
|
86
|
+
void KeepaliveManager::Spawn(Party* party) {
|
87
|
+
if (!IsKeepAliveNeeded()) {
|
88
|
+
GRPC_HTTP2_KEEPALIVE_LOG << "Not spawning keepalive loop.";
|
89
|
+
return;
|
90
|
+
}
|
91
|
+
keep_alive_spawned_ = true;
|
92
|
+
|
93
|
+
party->Spawn("KeepAliveLoop", Loop([this]() {
|
94
|
+
return TrySeq(
|
95
|
+
Sleep(keepalive_time_),
|
96
|
+
[this]() { return MaybeSendKeepAlivePing(); },
|
97
|
+
[]() -> LoopCtl<absl::Status> { return Continue(); });
|
98
|
+
}),
|
99
|
+
[](auto status) {
|
100
|
+
GRPC_HTTP2_KEEPALIVE_LOG << "KeepAlive end with status: "
|
101
|
+
<< status;
|
102
|
+
});
|
103
|
+
}
|
104
|
+
} // namespace http2
|
105
|
+
} // namespace grpc_core
|
@@ -0,0 +1,138 @@
|
|
1
|
+
//
|
2
|
+
//
|
3
|
+
// Copyright 2025 gRPC authors.
|
4
|
+
//
|
5
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
// you may not use this file except in compliance with the License.
|
7
|
+
// You may obtain a copy of the License at
|
8
|
+
//
|
9
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
//
|
11
|
+
// Unless required by applicable law or agreed to in writing, software
|
12
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
// See the License for the specific language governing permissions and
|
15
|
+
// limitations under the License.
|
16
|
+
//
|
17
|
+
//
|
18
|
+
#ifndef GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_KEEPALIVE_H
|
19
|
+
#define GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_KEEPALIVE_H
|
20
|
+
|
21
|
+
#include "absl/status/status.h"
|
22
|
+
#include "src/core/lib/promise/party.h"
|
23
|
+
#include "src/core/lib/promise/promise.h"
|
24
|
+
|
25
|
+
namespace grpc_core {
|
26
|
+
namespace http2 {
|
27
|
+
|
28
|
+
#define GRPC_HTTP2_KEEPALIVE_LOG VLOG(2)
|
29
|
+
|
30
|
+
class KeepAliveInterface {
|
31
|
+
public:
|
32
|
+
// Returns a promise that sends a ping frame and resolves when the ack is
|
33
|
+
// received.
|
34
|
+
virtual Promise<absl::Status> SendPingAndWaitForAck() = 0;
|
35
|
+
|
36
|
+
// Returns a promise that processes the keepalive timeout.
|
37
|
+
virtual Promise<absl::Status> OnKeepAliveTimeout() = 0;
|
38
|
+
|
39
|
+
// Returns true if a keepalive ping needs to be sent.
|
40
|
+
virtual bool NeedToSendKeepAlivePing() = 0;
|
41
|
+
virtual ~KeepAliveInterface() = default;
|
42
|
+
};
|
43
|
+
|
44
|
+
class KeepaliveManager {
|
45
|
+
public:
|
46
|
+
KeepaliveManager(std::unique_ptr<KeepAliveInterface> keep_alive_interface,
|
47
|
+
Duration keepalive_timeout, Duration keepalive_time);
|
48
|
+
|
49
|
+
// Spawns the keepalive loop on the given party. This MUST be called at most
|
50
|
+
// once during the lifetime of the keepalive manager.
|
51
|
+
void Spawn(Party* party);
|
52
|
+
|
53
|
+
// Needs to be called when any data is read from the endpoint.
|
54
|
+
void GotData() {
|
55
|
+
if (keep_alive_timeout_triggered_) {
|
56
|
+
GRPC_HTTP2_KEEPALIVE_LOG
|
57
|
+
<< "KeepAlive timeout triggered. Not setting data_received_ to true";
|
58
|
+
return;
|
59
|
+
}
|
60
|
+
GRPC_HTTP2_KEEPALIVE_LOG << "Data received. Setting data_received_ to true";
|
61
|
+
data_received_in_last_cycle_ = true;
|
62
|
+
auto waker = std::move(waker_);
|
63
|
+
// This will only trigger a wakeup if WaitForData() is pending on this
|
64
|
+
// waker. Otherwise this would be noop.
|
65
|
+
waker.Wakeup();
|
66
|
+
}
|
67
|
+
void SetKeepAliveTimeout(Duration keepalive_timeout) {
|
68
|
+
keepalive_timeout_ = keepalive_timeout;
|
69
|
+
}
|
70
|
+
|
71
|
+
private:
|
72
|
+
// Returns a promise that sleeps for the keepalive_timeout_ and triggers the
|
73
|
+
// keepalive timeout unless data is read within the keepalive timeout.
|
74
|
+
auto WaitForKeepAliveTimeout();
|
75
|
+
|
76
|
+
// Returns a promise that sends a keepalive ping and spawns the keepalive
|
77
|
+
// timeout promise. The promise resolves in the following scenarios:
|
78
|
+
// 1. Ping ack is received within the keepalive timeout (when the ping ack is
|
79
|
+
// received, a call to GotData() is expected).
|
80
|
+
// 2. Ping ack is received after keepalive timeout (but before the ping
|
81
|
+
// timeout). In this case, if there is some data received while
|
82
|
+
// waiting for ping ack, the keepalive timeout is not triggered and the
|
83
|
+
// promise resolves when SendPingAndWaitForAck() resolves.
|
84
|
+
// 3. No data is received within the keepalive timeout and the keepalive
|
85
|
+
// timeout is triggered.
|
86
|
+
auto TimeoutAndSendPing();
|
87
|
+
|
88
|
+
// Returns a promise that determines if a keepalive ping needs to be sent and
|
89
|
+
// sends a keepalive ping if needed. The promise resolves when either a ping
|
90
|
+
// ack is received or the keepalive timeout is triggered.
|
91
|
+
auto MaybeSendKeepAlivePing();
|
92
|
+
|
93
|
+
auto WaitForData() {
|
94
|
+
return [this]() -> Poll<absl::Status> {
|
95
|
+
if (data_received_in_last_cycle_) {
|
96
|
+
GRPC_HTTP2_KEEPALIVE_LOG << "WaitForData: Data received. Poll resolved";
|
97
|
+
return absl::OkStatus();
|
98
|
+
} else {
|
99
|
+
GRPC_HTTP2_KEEPALIVE_LOG
|
100
|
+
<< "WaitForData: Data not received. Poll pending";
|
101
|
+
waker_ = GetContext<Activity>()->MakeNonOwningWaker();
|
102
|
+
return Pending{};
|
103
|
+
}
|
104
|
+
};
|
105
|
+
}
|
106
|
+
auto SendPingAndWaitForAck() {
|
107
|
+
DCHECK_EQ(data_received_in_last_cycle_, false);
|
108
|
+
return keep_alive_interface_->SendPingAndWaitForAck();
|
109
|
+
}
|
110
|
+
|
111
|
+
// If no data is received in the last keepalive_time, we should send a
|
112
|
+
// keepalive ping. This also means that there can be scenarios where we would
|
113
|
+
// send one keepalive ping in ~(2*keepalive_time).
|
114
|
+
bool NeedToSendKeepAlivePing() {
|
115
|
+
return (!data_received_in_last_cycle_) &&
|
116
|
+
(keep_alive_interface_->NeedToSendKeepAlivePing());
|
117
|
+
}
|
118
|
+
|
119
|
+
bool IsKeepAliveNeeded() {
|
120
|
+
return (keepalive_time_ != Duration::Infinity() && !keep_alive_spawned_);
|
121
|
+
}
|
122
|
+
|
123
|
+
std::unique_ptr<KeepAliveInterface> keep_alive_interface_;
|
124
|
+
// If the keepalive_timeout_ is set to infinity, then the timeout is dictated
|
125
|
+
// by the ping timeout. Otherwise, this field can be used to set a specific
|
126
|
+
// timeout for keepalive pings.
|
127
|
+
Duration keepalive_timeout_;
|
128
|
+
const Duration keepalive_time_;
|
129
|
+
bool data_received_in_last_cycle_ = false;
|
130
|
+
bool keep_alive_timeout_triggered_ = false;
|
131
|
+
bool keep_alive_spawned_ = false;
|
132
|
+
Waker waker_;
|
133
|
+
};
|
134
|
+
|
135
|
+
} // namespace http2
|
136
|
+
} // namespace grpc_core
|
137
|
+
|
138
|
+
#endif // GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_KEEPALIVE_H
|