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
@@ -22,8 +22,8 @@
|
|
22
22
|
#include <stdint.h>
|
23
23
|
|
24
24
|
#include <atomic>
|
25
|
-
#include <list>
|
26
25
|
#include <memory>
|
26
|
+
#include <string>
|
27
27
|
#include <utility>
|
28
28
|
|
29
29
|
#include "absl/container/inlined_vector.h"
|
@@ -35,6 +35,7 @@
|
|
35
35
|
#include "src/core/lib/event_engine/poller.h"
|
36
36
|
#include "src/core/lib/event_engine/posix_engine/event_poller.h"
|
37
37
|
#include "src/core/lib/event_engine/posix_engine/posix_engine_closure.h"
|
38
|
+
#include "src/core/lib/event_engine/posix_engine/posix_interface.h"
|
38
39
|
#include "src/core/lib/iomgr/port.h"
|
39
40
|
#include "src/core/util/crash.h"
|
40
41
|
|
@@ -51,7 +52,6 @@
|
|
51
52
|
#include "src/core/lib/event_engine/posix_engine/wakeup_fd_posix.h"
|
52
53
|
#include "src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.h"
|
53
54
|
#include "src/core/lib/event_engine/time_util.h"
|
54
|
-
#include "src/core/util/fork.h"
|
55
55
|
#include "src/core/util/status_helper.h"
|
56
56
|
#include "src/core/util/strerror.h"
|
57
57
|
#include "src/core/util/sync.h"
|
@@ -68,10 +68,9 @@ using Events = absl::InlinedVector<PollEventHandle*, 5>;
|
|
68
68
|
|
69
69
|
class PollEventHandle : public EventHandle {
|
70
70
|
public:
|
71
|
-
PollEventHandle(
|
71
|
+
PollEventHandle(FileDescriptor fd, std::shared_ptr<PollPoller> poller)
|
72
72
|
: fd_(fd),
|
73
73
|
pending_actions_(0),
|
74
|
-
fork_fd_list_(this),
|
75
74
|
poller_handles_list_(this),
|
76
75
|
scheduler_(poller->GetScheduler()),
|
77
76
|
poller_(std::move(poller)),
|
@@ -108,14 +107,14 @@ class PollEventHandle : public EventHandle {
|
|
108
107
|
grpc_core::MutexLock lock(&poller_->mu_);
|
109
108
|
poller_->PollerHandlesListRemoveHandle(this);
|
110
109
|
}
|
111
|
-
|
110
|
+
FileDescriptor WrappedFd() override { return fd_; }
|
112
111
|
bool IsOrphaned() const ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) {
|
113
112
|
return is_orphaned_;
|
114
113
|
}
|
115
114
|
void CloseFd() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) {
|
116
115
|
if (!released_ && !closed_) {
|
117
116
|
closed_ = true;
|
118
|
-
|
117
|
+
poller_->posix_interface().Close(fd_);
|
119
118
|
}
|
120
119
|
}
|
121
120
|
bool IsPollhup() const ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) { return pollhup_; }
|
@@ -132,7 +131,7 @@ class PollEventHandle : public EventHandle {
|
|
132
131
|
void SetWatched(int watch_mask) ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) {
|
133
132
|
watch_mask_ = watch_mask;
|
134
133
|
}
|
135
|
-
void OrphanHandle(PosixEngineClosure* on_done,
|
134
|
+
void OrphanHandle(PosixEngineClosure* on_done, FileDescriptor* release_fd,
|
136
135
|
absl::string_view reason) override;
|
137
136
|
void ShutdownHandle(absl::Status why) override;
|
138
137
|
void NotifyOnRead(PosixEngineClosure* on_read) override;
|
@@ -183,7 +182,6 @@ class PollEventHandle : public EventHandle {
|
|
183
182
|
}
|
184
183
|
~PollEventHandle() override = default;
|
185
184
|
grpc_core::Mutex* mu() ABSL_LOCK_RETURNED(mu_) { return &mu_; }
|
186
|
-
PollPoller::HandlesList& ForkFdListPos() { return fork_fd_list_; }
|
187
185
|
PollPoller::HandlesList& PollerHandlesListPos() {
|
188
186
|
return poller_handles_list_;
|
189
187
|
}
|
@@ -199,9 +197,8 @@ class PollEventHandle : public EventHandle {
|
|
199
197
|
// required.
|
200
198
|
grpc_core::Mutex mu_;
|
201
199
|
std::atomic<int> ref_count_{1};
|
202
|
-
|
200
|
+
FileDescriptor fd_;
|
203
201
|
int pending_actions_;
|
204
|
-
PollPoller::HandlesList fork_fd_list_;
|
205
202
|
PollPoller::HandlesList poller_handles_list_;
|
206
203
|
Scheduler* scheduler_;
|
207
204
|
std::shared_ptr<PollPoller> poller_;
|
@@ -219,26 +216,6 @@ class PollEventHandle : public EventHandle {
|
|
219
216
|
};
|
220
217
|
|
221
218
|
namespace {
|
222
|
-
// Only used when GRPC_ENABLE_FORK_SUPPORT=1
|
223
|
-
std::list<PollPoller*> fork_poller_list;
|
224
|
-
|
225
|
-
gpr_mu fork_fd_list_mu;
|
226
|
-
|
227
|
-
void ForkPollerListAddPoller(PollPoller* poller) {
|
228
|
-
if (grpc_core::Fork::Enabled()) {
|
229
|
-
gpr_mu_lock(&fork_fd_list_mu);
|
230
|
-
fork_poller_list.push_back(poller);
|
231
|
-
gpr_mu_unlock(&fork_fd_list_mu);
|
232
|
-
}
|
233
|
-
}
|
234
|
-
|
235
|
-
void ForkPollerListRemovePoller(PollPoller* poller) {
|
236
|
-
if (grpc_core::Fork::Enabled()) {
|
237
|
-
gpr_mu_lock(&fork_fd_list_mu);
|
238
|
-
fork_poller_list.remove(poller);
|
239
|
-
gpr_mu_unlock(&fork_fd_list_mu);
|
240
|
-
}
|
241
|
-
}
|
242
219
|
|
243
220
|
// Returns the number of milliseconds elapsed between now and start timestamp.
|
244
221
|
int PollElapsedTimeToMillis(grpc_core::Timestamp start) {
|
@@ -255,42 +232,10 @@ int PollElapsedTimeToMillis(grpc_core::Timestamp start) {
|
|
255
232
|
}
|
256
233
|
}
|
257
234
|
|
258
|
-
bool InitPollPollerPosix();
|
259
|
-
|
260
|
-
// Called by the child process's post-fork handler to close open fds,
|
261
|
-
// including the global epoll fd of each poller. This allows gRPC to shutdown
|
262
|
-
// in the child process without interfering with connections or RPCs ongoing
|
263
|
-
// in the parent.
|
264
|
-
void ResetEventManagerOnFork() {
|
265
|
-
gpr_mu_lock(&fork_fd_list_mu);
|
266
|
-
// Delete all registered pollers.
|
267
|
-
while (!fork_poller_list.empty()) {
|
268
|
-
PollPoller* poller = fork_poller_list.front();
|
269
|
-
fork_poller_list.pop_front();
|
270
|
-
poller->Close();
|
271
|
-
}
|
272
|
-
gpr_mu_unlock(&fork_fd_list_mu);
|
273
|
-
InitPollPollerPosix();
|
274
|
-
}
|
275
|
-
|
276
|
-
// It is possible that GLIBC has epoll but the underlying kernel doesn't.
|
277
|
-
// Create epoll_fd to make sure epoll support is available
|
278
|
-
bool InitPollPollerPosix() {
|
279
|
-
if (!grpc_event_engine::experimental::SupportsWakeupFd()) {
|
280
|
-
return false;
|
281
|
-
}
|
282
|
-
if (grpc_core::Fork::Enabled()) {
|
283
|
-
if (grpc_core::Fork::RegisterResetChildPollingEngineFunc(
|
284
|
-
ResetEventManagerOnFork)) {
|
285
|
-
gpr_mu_init(&fork_fd_list_mu);
|
286
|
-
}
|
287
|
-
}
|
288
|
-
return true;
|
289
|
-
}
|
290
|
-
|
291
235
|
} // namespace
|
292
236
|
|
293
|
-
EventHandle* PollPoller::CreateHandle(
|
237
|
+
EventHandle* PollPoller::CreateHandle(FileDescriptor fd,
|
238
|
+
absl::string_view /*name*/,
|
294
239
|
bool track_err) {
|
295
240
|
// Avoid unused-parameter warning for debug-only parameter
|
296
241
|
(void)track_err;
|
@@ -302,7 +247,8 @@ EventHandle* PollPoller::CreateHandle(int fd, absl::string_view /*name*/,
|
|
302
247
|
return handle;
|
303
248
|
}
|
304
249
|
|
305
|
-
void PollEventHandle::OrphanHandle(PosixEngineClosure* on_done,
|
250
|
+
void PollEventHandle::OrphanHandle(PosixEngineClosure* on_done,
|
251
|
+
FileDescriptor* release_fd,
|
306
252
|
absl::string_view /*reason*/) {
|
307
253
|
ForceRemoveHandleFromPoller();
|
308
254
|
{
|
@@ -327,7 +273,7 @@ void PollEventHandle::OrphanHandle(PosixEngineClosure* on_done, int* release_fd,
|
|
327
273
|
}
|
328
274
|
// signal read/write closed to OS so that future operations fail.
|
329
275
|
if (!released_) {
|
330
|
-
|
276
|
+
poller_->posix_interface().Shutdown(fd_, SHUT_RDWR);
|
331
277
|
}
|
332
278
|
if (!IsWatched()) {
|
333
279
|
CloseFd();
|
@@ -395,10 +341,11 @@ void PollEventHandle::ShutdownHandle(absl::Status why) {
|
|
395
341
|
// only shutdown once
|
396
342
|
if (!is_shutdown_) {
|
397
343
|
is_shutdown_ = true;
|
398
|
-
shutdown_error_ = why;
|
399
|
-
grpc_core::StatusSetInt(
|
400
|
-
|
401
|
-
|
344
|
+
shutdown_error_ = std::move(why);
|
345
|
+
grpc_core::StatusSetInt(
|
346
|
+
&shutdown_error_, grpc_core::StatusIntProperty::kRpcStatus,
|
347
|
+
absl::IsCancelled(shutdown_error_) ? GRPC_STATUS_CANCELLED
|
348
|
+
: GRPC_STATUS_UNAVAILABLE);
|
402
349
|
SetReadyLocked(&read_closure_);
|
403
350
|
SetReadyLocked(&write_closure_);
|
404
351
|
}
|
@@ -556,19 +503,6 @@ void PollPoller::PollerHandlesListRemoveHandle(PollEventHandle* handle) {
|
|
556
503
|
--num_poll_handles_;
|
557
504
|
}
|
558
505
|
|
559
|
-
PollPoller::PollPoller(Scheduler* scheduler)
|
560
|
-
: scheduler_(scheduler),
|
561
|
-
use_phony_poll_(false),
|
562
|
-
was_kicked_(false),
|
563
|
-
was_kicked_ext_(false),
|
564
|
-
num_poll_handles_(0),
|
565
|
-
poll_handles_list_head_(nullptr),
|
566
|
-
closed_(false) {
|
567
|
-
wakeup_fd_ = *CreateWakeupFd();
|
568
|
-
CHECK(wakeup_fd_ != nullptr);
|
569
|
-
ForkPollerListAddPoller(this);
|
570
|
-
}
|
571
|
-
|
572
506
|
PollPoller::PollPoller(Scheduler* scheduler, bool use_phony_poll)
|
573
507
|
: scheduler_(scheduler),
|
574
508
|
use_phony_poll_(use_phony_poll),
|
@@ -577,9 +511,8 @@ PollPoller::PollPoller(Scheduler* scheduler, bool use_phony_poll)
|
|
577
511
|
num_poll_handles_(0),
|
578
512
|
poll_handles_list_head_(nullptr),
|
579
513
|
closed_(false) {
|
580
|
-
wakeup_fd_ = *CreateWakeupFd();
|
514
|
+
wakeup_fd_ = *CreateWakeupFd(&posix_interface());
|
581
515
|
CHECK(wakeup_fd_ != nullptr);
|
582
|
-
ForkPollerListAddPoller(this);
|
583
516
|
}
|
584
517
|
|
585
518
|
PollPoller::~PollPoller() {
|
@@ -628,9 +561,12 @@ Poller::WorkResult PollPoller::Work(
|
|
628
561
|
}
|
629
562
|
|
630
563
|
pfd_count = 1;
|
631
|
-
|
564
|
+
auto wakeup_fd = posix_interface().GetFd(wakeup_fd_->ReadFd());
|
565
|
+
CHECK(wakeup_fd.ok()) << wakeup_fd.StrError();
|
566
|
+
pfds[0].fd = *wakeup_fd;
|
632
567
|
pfds[0].events = POLLIN;
|
633
568
|
pfds[0].revents = 0;
|
569
|
+
// Event handles from before fork, need to be notified
|
634
570
|
PollEventHandle* head = poll_handles_list_head_;
|
635
571
|
while (head != nullptr) {
|
636
572
|
{
|
@@ -640,27 +576,32 @@ Poller::WorkResult PollPoller::Work(
|
|
640
576
|
// poll handle list for the poller under the poller lock.
|
641
577
|
CHECK(!head->IsOrphaned());
|
642
578
|
if (!head->IsPollhup()) {
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
579
|
+
if (auto file_descriptor = posix_interface().GetFd(head->WrappedFd());
|
580
|
+
file_descriptor.ok()) {
|
581
|
+
pfds[pfd_count].fd = *file_descriptor;
|
582
|
+
watchers[pfd_count] = head;
|
583
|
+
// BeginPollLocked takes a ref of the handle. It also marks the
|
584
|
+
// fd as Watched with an appropriate watch_mask. The watch_mask
|
585
|
+
// is 0 if the fd is shutdown or if the fd is already ready (i.e
|
586
|
+
// both read and write events are already available) and doesn't
|
587
|
+
// need to be polled again. The watch_mask is > 0 otherwise
|
588
|
+
// indicating the fd needs to be polled.
|
589
|
+
pfds[pfd_count].events = head->BeginPollLocked(POLLIN, POLLOUT);
|
590
|
+
pfd_count++;
|
591
|
+
} else {
|
592
|
+
LOG(ERROR) << "Polling FD from a wrong generation: "
|
593
|
+
<< head->WrappedFd();
|
594
|
+
}
|
653
595
|
}
|
654
596
|
}
|
655
597
|
head = head->PollerHandlesListPos().next;
|
656
598
|
}
|
657
599
|
mu_.Unlock();
|
658
|
-
|
659
600
|
if (!use_phony_poll_ || timeout_ms == 0 || pfd_count == 1) {
|
660
601
|
// If use_phony_poll is true and pfd_count == 1, it implies only the
|
661
602
|
// wakeup_fd is present. Allow the call to get blocked in this case as
|
662
603
|
// well instead of crashing. This is because the poller::Work is called
|
663
|
-
// right after an event
|
604
|
+
// right after an event engine is constructed. Even if phony poll is
|
664
605
|
// expected to be used, we dont want to check for it until some actual
|
665
606
|
// event handles are registered. Otherwise the EventEngine construction
|
666
607
|
// may crash.
|
@@ -778,22 +719,43 @@ Poller::WorkResult PollPoller::Work(
|
|
778
719
|
return was_kicked_ext ? Poller::WorkResult::kKicked : Poller::WorkResult::kOk;
|
779
720
|
}
|
780
721
|
|
781
|
-
void PollPoller::Shutdown() { ForkPollerListRemovePoller(this); }
|
782
|
-
|
783
|
-
void PollPoller::PrepareFork() { Kick(); }
|
784
|
-
// TODO(vigneshbabu): implement
|
785
|
-
void PollPoller::PostforkParent() {}
|
786
|
-
// TODO(vigneshbabu): implement
|
787
|
-
void PollPoller::PostforkChild() {}
|
788
|
-
|
789
722
|
void PollPoller::Close() {
|
790
723
|
grpc_core::MutexLock lock(&mu_);
|
791
724
|
closed_ = true;
|
792
725
|
}
|
793
726
|
|
727
|
+
#ifdef GRPC_ENABLE_FORK_SUPPORT
|
728
|
+
void PollPoller::HandleForkInChild() {
|
729
|
+
if (grpc_core::IsEventEngineForkEnabled()) {
|
730
|
+
posix_interface().AdvanceGeneration();
|
731
|
+
}
|
732
|
+
PollEventHandle* handle;
|
733
|
+
{
|
734
|
+
grpc_core::MutexLock lock(&mu_);
|
735
|
+
handle = poll_handles_list_head_;
|
736
|
+
}
|
737
|
+
while (handle != nullptr) {
|
738
|
+
handle->ShutdownHandle(absl::CancelledError("Closed on fork"));
|
739
|
+
handle = handle->PollerHandlesListPos().next;
|
740
|
+
}
|
741
|
+
}
|
742
|
+
#endif // GRPC_ENABLE_FORK_SUPPORT
|
743
|
+
|
744
|
+
void PollPoller::ResetKickState() {
|
745
|
+
wakeup_fd_ = *CreateWakeupFd(&posix_interface());
|
746
|
+
// Sometimes there's "kick" signalled on the wakeup FD. We need to redo it on
|
747
|
+
// new fd
|
748
|
+
// TODO (eostroukhov): Need to consider merging kicked/kicked_ext
|
749
|
+
// with the wakeup_fd so there's no duplicate state.
|
750
|
+
grpc_core::MutexLock lock(&mu_);
|
751
|
+
was_kicked_ = false;
|
752
|
+
was_kicked_ext_ = false;
|
753
|
+
}
|
754
|
+
|
794
755
|
std::shared_ptr<PollPoller> MakePollPoller(Scheduler* scheduler,
|
795
756
|
bool use_phony_poll) {
|
796
|
-
static bool kPollPollerSupported =
|
757
|
+
static bool kPollPollerSupported =
|
758
|
+
grpc_event_engine::experimental::SupportsWakeupFd();
|
797
759
|
if (kPollPollerSupported) {
|
798
760
|
return std::make_shared<PollPoller>(scheduler, use_phony_poll);
|
799
761
|
}
|
@@ -808,15 +770,10 @@ std::shared_ptr<PollPoller> MakePollPoller(Scheduler* scheduler,
|
|
808
770
|
|
809
771
|
namespace grpc_event_engine::experimental {
|
810
772
|
|
811
|
-
PollPoller::PollPoller(Scheduler* /* engine */) {
|
812
|
-
grpc_core::Crash("unimplemented");
|
813
|
-
}
|
814
|
-
|
815
|
-
void PollPoller::Shutdown() { grpc_core::Crash("unimplemented"); }
|
816
|
-
|
817
773
|
PollPoller::~PollPoller() { grpc_core::Crash("unimplemented"); }
|
818
774
|
|
819
|
-
EventHandle* PollPoller::CreateHandle(
|
775
|
+
EventHandle* PollPoller::CreateHandle(FileDescriptor /*fd*/,
|
776
|
+
absl::string_view /*name*/,
|
820
777
|
bool /*track_err*/) {
|
821
778
|
grpc_core::Crash("unimplemented");
|
822
779
|
}
|
@@ -836,10 +793,11 @@ std::shared_ptr<PollPoller> MakePollPoller(Scheduler* /*scheduler*/,
|
|
836
793
|
return nullptr;
|
837
794
|
}
|
838
795
|
|
839
|
-
|
840
|
-
void PollPoller::
|
841
|
-
|
796
|
+
#ifdef GRPC_ENABLE_FORK_SUPPORT
|
797
|
+
void PollPoller::HandleForkInChild() { grpc_core::Crash("unimplemented"); }
|
798
|
+
#endif // GRPC_ENABLE_FORK_SUPPORT
|
842
799
|
|
800
|
+
void PollPoller::ResetKickState() { grpc_core::Crash("unimplemented"); }
|
843
801
|
void PollPoller::Close() { grpc_core::Crash("unimplemented"); }
|
844
802
|
|
845
803
|
void PollPoller::KickExternal(bool /*ext*/) {
|
@@ -37,9 +37,8 @@ class PollEventHandle;
|
|
37
37
|
class PollPoller : public PosixEventPoller,
|
38
38
|
public std::enable_shared_from_this<PollPoller> {
|
39
39
|
public:
|
40
|
-
explicit PollPoller(Scheduler* scheduler);
|
41
|
-
|
42
|
-
EventHandle* CreateHandle(int fd, absl::string_view name,
|
40
|
+
explicit PollPoller(Scheduler* scheduler, bool use_phony_poll = false);
|
41
|
+
EventHandle* CreateHandle(FileDescriptor fd, absl::string_view name,
|
43
42
|
bool track_err) override;
|
44
43
|
Poller::WorkResult Work(
|
45
44
|
grpc_event_engine::experimental::EventEngine::Duration timeout,
|
@@ -47,17 +46,16 @@ class PollPoller : public PosixEventPoller,
|
|
47
46
|
std::string Name() override { return "poll"; }
|
48
47
|
void Kick() override;
|
49
48
|
Scheduler* GetScheduler() { return scheduler_; }
|
50
|
-
void Shutdown() override;
|
51
49
|
bool CanTrackErrors() const override { return false; }
|
52
50
|
~PollPoller() override;
|
53
51
|
|
54
|
-
// Forkable
|
55
|
-
void PrepareFork() override;
|
56
|
-
void PostforkParent() override;
|
57
|
-
void PostforkChild() override;
|
58
|
-
|
59
52
|
void Close();
|
60
53
|
|
54
|
+
#ifdef GRPC_ENABLE_FORK_SUPPORT
|
55
|
+
void HandleForkInChild() override;
|
56
|
+
#endif // GRPC_ENABLE_FORK_SUPPORT
|
57
|
+
void ResetKickState() override;
|
58
|
+
|
61
59
|
private:
|
62
60
|
void KickExternal(bool ext);
|
63
61
|
void PollerHandlesListAddHandle(PollEventHandle* handle)
|
@@ -22,9 +22,9 @@
|
|
22
22
|
#include "absl/functional/any_invocable.h"
|
23
23
|
#include "absl/status/status.h"
|
24
24
|
#include "absl/strings/string_view.h"
|
25
|
-
#include "src/core/lib/event_engine/forkable.h"
|
26
25
|
#include "src/core/lib/event_engine/poller.h"
|
27
26
|
#include "src/core/lib/event_engine/posix_engine/posix_engine_closure.h"
|
27
|
+
#include "src/core/lib/event_engine/posix_engine/posix_interface.h"
|
28
28
|
|
29
29
|
namespace grpc_event_engine::experimental {
|
30
30
|
|
@@ -39,14 +39,15 @@ class PosixEventPoller;
|
|
39
39
|
|
40
40
|
class EventHandle {
|
41
41
|
public:
|
42
|
-
virtual
|
42
|
+
virtual FileDescriptor WrappedFd() = 0;
|
43
43
|
// Delete the handle and optionally close the underlying file descriptor if
|
44
44
|
// release_fd != nullptr. The on_done closure is scheduled to be invoked
|
45
45
|
// after the operation is complete. After this operation, NotifyXXX and SetXXX
|
46
46
|
// operations cannot be performed on the handle. In general, this method
|
47
47
|
// should only be called after ShutdownHandle and after all existing NotifyXXX
|
48
48
|
// closures have run and there is no waiting NotifyXXX closure.
|
49
|
-
virtual void OrphanHandle(PosixEngineClosure* on_done,
|
49
|
+
virtual void OrphanHandle(PosixEngineClosure* on_done,
|
50
|
+
FileDescriptor* release_fd,
|
50
51
|
absl::string_view reason) = 0;
|
51
52
|
// Shutdown a handle. If there is an attempt to call NotifyXXX operations
|
52
53
|
// after Shutdown handle, those closures will be run immediately with the
|
@@ -84,24 +85,26 @@ class EventHandle {
|
|
84
85
|
virtual ~EventHandle() = default;
|
85
86
|
};
|
86
87
|
|
87
|
-
class PosixEventPoller : public grpc_event_engine::experimental::Poller
|
88
|
-
public Forkable {
|
88
|
+
class PosixEventPoller : public grpc_event_engine::experimental::Poller {
|
89
89
|
public:
|
90
90
|
// Return an opaque handle to perform actions on the provided file descriptor.
|
91
|
-
virtual EventHandle* CreateHandle(
|
91
|
+
virtual EventHandle* CreateHandle(FileDescriptor fd, absl::string_view name,
|
92
92
|
bool track_err) = 0;
|
93
93
|
virtual bool CanTrackErrors() const = 0;
|
94
94
|
virtual std::string Name() = 0;
|
95
|
-
|
96
|
-
//
|
97
|
-
//
|
98
|
-
//
|
99
|
-
//
|
100
|
-
|
101
|
-
//
|
102
|
-
|
103
|
-
|
95
|
+
#ifdef GRPC_ENABLE_FORK_SUPPORT
|
96
|
+
// Handles fork in the child process. It performs cleanups like closing file
|
97
|
+
// descriptors, resetting lingering state to make sure the child and parent
|
98
|
+
// processes do not interfere with each other and that the child process
|
99
|
+
// remains in valid state.
|
100
|
+
virtual void HandleForkInChild() = 0;
|
101
|
+
#endif // GRPC_ENABLE_FORK_SUPPORT
|
102
|
+
virtual void ResetKickState() = 0;
|
103
|
+
EventEnginePosixInterface& posix_interface() { return posix_interface_; }
|
104
104
|
~PosixEventPoller() override = default;
|
105
|
+
|
106
|
+
private:
|
107
|
+
EventEnginePosixInterface posix_interface_;
|
105
108
|
};
|
106
109
|
|
107
110
|
} // namespace grpc_event_engine::experimental
|
@@ -15,33 +15,19 @@
|
|
15
15
|
#include <grpc/support/port_platform.h>
|
16
16
|
|
17
17
|
#include <memory>
|
18
|
-
#include <string>
|
19
18
|
|
20
19
|
#include "absl/strings/str_split.h"
|
21
20
|
#include "absl/strings/string_view.h"
|
22
21
|
#include "src/core/config/config_vars.h"
|
23
|
-
#include "src/core/lib/event_engine/forkable.h"
|
24
22
|
#include "src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h"
|
25
23
|
#include "src/core/lib/event_engine/posix_engine/ev_poll_posix.h"
|
26
24
|
#include "src/core/lib/event_engine/posix_engine/event_poller.h"
|
27
25
|
#include "src/core/lib/iomgr/port.h"
|
28
|
-
#include "src/core/util/no_destruct.h"
|
29
26
|
|
30
27
|
namespace grpc_event_engine::experimental {
|
31
28
|
|
32
29
|
#ifdef GRPC_POSIX_SOCKET_TCP
|
33
30
|
namespace {
|
34
|
-
// TODO(yijiem): this object is thread-unsafe, if we are creating pollers in
|
35
|
-
// multiple threads (e.g. multiple event engines) or if we are creating pollers
|
36
|
-
// while we are forking then we will run into issues.
|
37
|
-
grpc_core::NoDestruct<ObjectGroupForkHandler> g_poller_fork_manager;
|
38
|
-
|
39
|
-
class PollerForkCallbackMethods {
|
40
|
-
public:
|
41
|
-
static void Prefork() { g_poller_fork_manager->Prefork(); }
|
42
|
-
static void PostforkParent() { g_poller_fork_manager->PostforkParent(); }
|
43
|
-
static void PostforkChild() { g_poller_fork_manager->PostforkChild(); }
|
44
|
-
};
|
45
31
|
|
46
32
|
bool PollStrategyMatches(absl::string_view strategy, absl::string_view want) {
|
47
33
|
return strategy == "all" || strategy == want;
|
@@ -66,10 +52,6 @@ std::shared_ptr<PosixEventPoller> MakeDefaultPoller(Scheduler* scheduler) {
|
|
66
52
|
poller = MakePollPoller(scheduler, /*use_phony_poll=*/true);
|
67
53
|
}
|
68
54
|
}
|
69
|
-
g_poller_fork_manager->RegisterForkable(
|
70
|
-
poller, PollerForkCallbackMethods::Prefork,
|
71
|
-
PollerForkCallbackMethods::PostforkParent,
|
72
|
-
PollerForkCallbackMethods::PostforkChild);
|
73
55
|
return poller;
|
74
56
|
}
|
75
57
|
|
@@ -0,0 +1,124 @@
|
|
1
|
+
// Copyright 2025 The gRPC Authors
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
#include "src/core/lib/event_engine/posix_engine/file_descriptor_collection.h"
|
16
|
+
|
17
|
+
#include "absl/strings/substitute.h"
|
18
|
+
#include "src/core/lib/experiments/experiments.h"
|
19
|
+
#include "src/core/util/crash.h" // IWYU pragma: keep
|
20
|
+
#include "src/core/util/strerror.h"
|
21
|
+
|
22
|
+
namespace grpc_event_engine::experimental {
|
23
|
+
|
24
|
+
#ifdef GRPC_ENABLE_FORK_SUPPORT
|
25
|
+
|
26
|
+
namespace {
|
27
|
+
|
28
|
+
bool IsForkEnabled() { return grpc_core::IsEventEngineForkEnabled(); }
|
29
|
+
|
30
|
+
} // namespace
|
31
|
+
|
32
|
+
FileDescriptorCollection::FileDescriptorCollection(int generation) noexcept
|
33
|
+
: generation_(generation) {}
|
34
|
+
|
35
|
+
FileDescriptorCollection::FileDescriptorCollection(
|
36
|
+
FileDescriptorCollection&& other) noexcept
|
37
|
+
: generation_(other.generation_) {
|
38
|
+
grpc_core::MutexLock lock(&other.mu_);
|
39
|
+
file_descriptors_ = std::move(other.file_descriptors_);
|
40
|
+
other.generation_ = -1;
|
41
|
+
other.file_descriptors_.clear();
|
42
|
+
}
|
43
|
+
|
44
|
+
FileDescriptorCollection& FileDescriptorCollection::operator=(
|
45
|
+
FileDescriptorCollection&& other) noexcept {
|
46
|
+
generation_ = other.generation_;
|
47
|
+
grpc_core::MutexLock self_lock(&mu_);
|
48
|
+
grpc_core::MutexLock other_lock(&other.mu_);
|
49
|
+
file_descriptors_ = std::move(other.file_descriptors_);
|
50
|
+
other.generation_ = -1;
|
51
|
+
other.file_descriptors_.clear();
|
52
|
+
return *this;
|
53
|
+
}
|
54
|
+
|
55
|
+
FileDescriptor FileDescriptorCollection::Add(int fd) {
|
56
|
+
if (IsForkEnabled()) {
|
57
|
+
grpc_core::MutexLock lock(&mu_);
|
58
|
+
file_descriptors_.emplace(fd);
|
59
|
+
}
|
60
|
+
return FileDescriptor(fd, generation_);
|
61
|
+
}
|
62
|
+
|
63
|
+
bool FileDescriptorCollection::Remove(const FileDescriptor& fd) {
|
64
|
+
if (!IsForkEnabled()) {
|
65
|
+
return true;
|
66
|
+
}
|
67
|
+
if (fd.generation() == generation_) {
|
68
|
+
grpc_core::MutexLock lock(&mu_);
|
69
|
+
return file_descriptors_.erase(fd.fd()) == 1;
|
70
|
+
}
|
71
|
+
return false;
|
72
|
+
}
|
73
|
+
|
74
|
+
absl::flat_hash_set<int>
|
75
|
+
FileDescriptorCollection::ClearAndReturnRawDescriptors() {
|
76
|
+
if (!IsForkEnabled()) {
|
77
|
+
return {};
|
78
|
+
}
|
79
|
+
grpc_core::MutexLock lock(&mu_);
|
80
|
+
absl::flat_hash_set<int> file_descriptors = std::move(file_descriptors_);
|
81
|
+
// Should not be necessary, but standard is not clear if move would empty
|
82
|
+
// the collection
|
83
|
+
file_descriptors_.clear();
|
84
|
+
return file_descriptors;
|
85
|
+
}
|
86
|
+
|
87
|
+
#else // GRPC_ENABLE_FORK_SUPPORT
|
88
|
+
|
89
|
+
FileDescriptorCollection::FileDescriptorCollection(
|
90
|
+
int /* generation */) noexcept {}
|
91
|
+
|
92
|
+
FileDescriptorCollection::FileDescriptorCollection(
|
93
|
+
FileDescriptorCollection&& other) noexcept = default;
|
94
|
+
|
95
|
+
FileDescriptorCollection& FileDescriptorCollection::operator=(
|
96
|
+
FileDescriptorCollection&& other) noexcept = default;
|
97
|
+
|
98
|
+
FileDescriptor FileDescriptorCollection::Add(int fd) {
|
99
|
+
return FileDescriptor(fd, 0);
|
100
|
+
}
|
101
|
+
|
102
|
+
bool FileDescriptorCollection::Remove(const FileDescriptor& /* fd */) {
|
103
|
+
return true;
|
104
|
+
}
|
105
|
+
|
106
|
+
absl::flat_hash_set<int>
|
107
|
+
FileDescriptorCollection::ClearAndReturnRawDescriptors() {
|
108
|
+
return {};
|
109
|
+
}
|
110
|
+
|
111
|
+
#endif // GRPC_ENABLE_FORK_SUPPORT
|
112
|
+
|
113
|
+
std::string PosixError::StrError() const {
|
114
|
+
if (ok()) {
|
115
|
+
return "ok";
|
116
|
+
}
|
117
|
+
if (IsWrongGenerationError()) {
|
118
|
+
return "file descriptor was created pre fork";
|
119
|
+
}
|
120
|
+
int value = *errno_value();
|
121
|
+
return absl::Substitute("$0 ($1)", grpc_core::StrError(value), value);
|
122
|
+
}
|
123
|
+
|
124
|
+
} // namespace grpc_event_engine::experimental
|