grpc 1.75.0.pre1 → 1.76.0.pre1
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 +18 -5
- data/include/grpc/credentials.h +21 -5
- data/src/core/call/call_filters.cc +4 -4
- data/src/core/call/call_filters.h +36 -36
- data/src/core/call/call_spine.h +27 -27
- data/src/core/call/client_call.cc +6 -5
- data/src/core/call/filter_fusion.h +5 -5
- data/src/core/call/metadata_batch.h +3 -3
- data/src/core/call/security_context.cc +1 -1
- data/src/core/call/server_call.cc +4 -4
- data/src/core/call/server_call.h +1 -1
- data/src/core/channelz/channelz.cc +12 -18
- data/src/core/channelz/channelz.h +32 -16
- data/src/core/channelz/channelz_registry.h +11 -0
- data/src/core/channelz/property_list.cc +18 -0
- data/src/core/channelz/property_list.h +10 -1
- data/src/core/channelz/text_encode.cc +66 -0
- data/src/core/channelz/text_encode.h +29 -0
- data/src/core/channelz/v2tov1/convert.cc +11 -0
- data/src/core/channelz/v2tov1/legacy_api.cc +15 -8
- data/src/core/channelz/ztrace_collector.h +247 -86
- data/src/core/client_channel/backup_poller.cc +5 -6
- data/src/core/client_channel/client_channel.cc +20 -13
- data/src/core/client_channel/client_channel_filter.cc +53 -45
- data/src/core/client_channel/client_channel_filter.h +2 -2
- data/src/core/client_channel/client_channel_internal.h +3 -4
- data/src/core/client_channel/config_selector.h +3 -3
- data/src/core/client_channel/dynamic_filters.cc +3 -3
- data/src/core/client_channel/global_subchannel_pool.cc +0 -37
- data/src/core/client_channel/global_subchannel_pool.h +0 -27
- data/src/core/client_channel/load_balanced_call_destination.cc +7 -7
- data/src/core/client_channel/local_subchannel_pool.cc +4 -4
- data/src/core/client_channel/retry_filter.h +3 -3
- data/src/core/client_channel/retry_filter_legacy_call_data.cc +5 -5
- data/src/core/client_channel/subchannel.cc +8 -8
- data/src/core/client_channel/subchannel_stream_client.cc +4 -4
- data/src/core/config/config_vars.cc +30 -1
- data/src/core/config/config_vars.h +21 -0
- data/src/core/config/core_configuration.cc +5 -5
- data/src/core/config/core_configuration.h +7 -7
- data/src/core/config/load_config.cc +12 -0
- data/src/core/config/load_config.h +2 -0
- data/src/core/credentials/call/call_credentials.h +2 -2
- data/src/core/credentials/call/call_creds_util.cc +4 -3
- data/src/core/credentials/call/composite/composite_call_credentials.cc +4 -4
- data/src/core/credentials/call/external/aws_external_account_credentials.cc +3 -3
- data/src/core/credentials/call/external/external_account_credentials.cc +1 -1
- data/src/core/credentials/call/external/url_external_account_credentials.cc +1 -1
- data/src/core/credentials/call/iam/iam_credentials.cc +4 -4
- data/src/core/credentials/call/jwt/json_token.cc +3 -3
- data/src/core/credentials/call/jwt/jwt_credentials.cc +2 -2
- data/src/core/credentials/call/jwt/jwt_verifier.cc +14 -13
- data/src/core/credentials/call/oauth2/oauth2_credentials.cc +20 -12
- data/src/core/credentials/call/plugin/plugin_credentials.cc +2 -2
- data/src/core/credentials/transport/alts/alts_credentials.cc +4 -4
- data/src/core/credentials/transport/alts/alts_security_connector.cc +14 -12
- data/src/core/credentials/transport/alts/grpc_alts_credentials_client_options.cc +22 -2
- data/src/core/credentials/transport/alts/grpc_alts_credentials_options.cc +10 -1
- data/src/core/credentials/transport/alts/grpc_alts_credentials_options.h +31 -0
- data/src/core/credentials/transport/alts/grpc_alts_credentials_server_options.cc +8 -3
- data/src/core/credentials/transport/composite/composite_channel_credentials.cc +5 -5
- data/src/core/credentials/transport/fake/fake_security_connector.cc +2 -2
- data/src/core/credentials/transport/google_default/google_default_credentials.cc +78 -28
- data/src/core/credentials/transport/insecure/insecure_security_connector.cc +3 -3
- data/src/core/credentials/transport/local/local_security_connector.cc +8 -8
- data/src/core/credentials/transport/security_connector.cc +5 -5
- data/src/core/credentials/transport/ssl/ssl_credentials.cc +12 -12
- data/src/core/credentials/transport/ssl/ssl_credentials.h +2 -2
- data/src/core/credentials/transport/ssl/ssl_security_connector.cc +3 -3
- data/src/core/credentials/transport/tls/certificate_provider_registry.cc +2 -2
- data/src/core/credentials/transport/tls/grpc_tls_certificate_distributor.cc +24 -24
- data/src/core/credentials/transport/tls/grpc_tls_certificate_provider.cc +5 -5
- data/src/core/credentials/transport/tls/grpc_tls_certificate_provider.h +2 -2
- data/src/core/credentials/transport/tls/grpc_tls_certificate_verifier.cc +2 -2
- data/src/core/credentials/transport/tls/grpc_tls_certificate_verifier.h +2 -2
- data/src/core/credentials/transport/tls/grpc_tls_credentials_options.cc +17 -17
- data/src/core/credentials/transport/tls/ssl_utils.cc +14 -9
- data/src/core/credentials/transport/tls/tls_credentials.cc +2 -2
- data/src/core/credentials/transport/tls/tls_security_connector.cc +11 -11
- data/src/core/credentials/transport/transport_credentials.cc +2 -2
- data/src/core/credentials/transport/transport_credentials.h +2 -2
- data/src/core/credentials/transport/xds/xds_credentials.cc +5 -5
- data/src/core/ext/filters/channel_idle/legacy_channel_idle_filter.cc +2 -0
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.cc +1 -1
- data/src/core/ext/filters/http/message_compress/compression_filter.cc +8 -8
- data/src/core/ext/filters/http/message_compress/compression_filter.h +3 -3
- data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +7 -7
- data/src/core/ext/transport/chttp2/alpn/alpn.cc +2 -2
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +10 -9
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +10 -7
- data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +5 -5
- data/src/core/ext/transport/chttp2/transport/bin_encoder.cc +6 -6
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +96 -88
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +3 -3
- data/src/core/ext/transport/chttp2/transport/flow_control.h +12 -7
- data/src/core/ext/transport/chttp2/transport/flow_control_manager.h +60 -0
- data/src/core/ext/transport/chttp2/transport/frame.cc +32 -10
- data/src/core/ext/transport/chttp2/transport/frame.h +16 -2
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +4 -4
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +3 -3
- data/src/core/ext/transport/chttp2/transport/header_assembler.h +28 -12
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +4 -2
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc +8 -8
- data/src/core/ext/transport/chttp2/transport/hpack_parse_result.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/hpack_parse_result.h +2 -2
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +27 -27
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +2 -3
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +4 -4
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +543 -366
- data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +198 -277
- data/src/core/ext/transport/chttp2/transport/http2_settings_manager.cc +3 -0
- data/src/core/ext/transport/chttp2/transport/http2_settings_manager.h +11 -0
- data/src/core/ext/transport/chttp2/transport/http2_settings_promises.h +179 -0
- data/src/core/ext/transport/chttp2/transport/http2_transport.cc +51 -23
- data/src/core/ext/transport/chttp2/transport/http2_transport.h +13 -6
- data/src/core/ext/transport/chttp2/transport/http2_ztrace_collector.h +115 -71
- data/src/core/ext/transport/chttp2/transport/internal.h +6 -14
- data/src/core/ext/transport/chttp2/transport/message_assembler.h +7 -7
- data/src/core/ext/transport/chttp2/transport/parsing.cc +17 -15
- data/src/core/ext/transport/chttp2/transport/ping_callbacks.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/ping_promise.cc +62 -26
- data/src/core/ext/transport/chttp2/transport/ping_promise.h +58 -22
- data/src/core/ext/transport/chttp2/transport/stream.h +207 -0
- data/src/core/ext/transport/chttp2/transport/stream_data_queue.h +328 -187
- data/src/core/ext/transport/chttp2/transport/stream_lists.cc +7 -7
- data/src/core/ext/transport/chttp2/transport/transport_common.cc +17 -1
- data/src/core/ext/transport/chttp2/transport/transport_common.h +52 -0
- data/src/core/ext/transport/chttp2/transport/varint.h +2 -2
- data/src/core/ext/transport/chttp2/transport/writable_streams.h +181 -79
- data/src/core/ext/transport/chttp2/transport/write_size_policy.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/writing.cc +3 -3
- data/src/core/ext/transport/inproc/inproc_transport.cc +1 -1
- data/src/core/ext/transport/inproc/legacy_inproc_transport.cc +3 -3
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/service.upb.h +740 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/service.upb_minitable.c +218 -0
- data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/service.upb_minitable.h +46 -0
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb.h +87 -55
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb_minitable.c +23 -21
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/channelz.upbdefs.c +80 -0
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/channelz.upbdefs.h +47 -0
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/service.upbdefs.c +129 -0
- data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/service.upbdefs.h +72 -0
- data/src/core/filter/auth/server_auth_filter.cc +2 -2
- data/src/core/handshaker/handshaker.cc +3 -3
- data/src/core/handshaker/http_connect/http_proxy_mapper.cc +2 -2
- data/src/core/handshaker/security/legacy_secure_endpoint.cc +2 -2
- data/src/core/handshaker/security/pipelined_secure_endpoint.cc +31 -8
- data/src/core/handshaker/security/secure_endpoint.cc +16 -6
- data/src/core/handshaker/security/security_handshaker.cc +3 -3
- data/src/core/handshaker/tcp_connect/tcp_connect_handshaker.cc +2 -2
- data/src/core/lib/channel/channel_stack.cc +8 -5
- data/src/core/lib/channel/channel_stack.h +3 -0
- data/src/core/lib/channel/channel_stack_builder_impl.cc +1 -0
- data/src/core/lib/channel/connected_channel.cc +2 -2
- data/src/core/lib/channel/promise_based_filter.cc +69 -64
- data/src/core/lib/channel/promise_based_filter.h +16 -15
- data/src/core/lib/compression/compression_internal.cc +2 -2
- data/src/core/lib/compression/message_compress.cc +7 -7
- data/src/core/lib/event_engine/ares_resolver.cc +22 -20
- data/src/core/lib/event_engine/cf_engine/cf_engine.cc +2 -2
- data/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc +2 -2
- data/src/core/lib/event_engine/cf_engine/dns_service_resolver.h +2 -2
- data/src/core/lib/event_engine/extensions/channelz.h +2 -2
- data/src/core/lib/event_engine/extensions/supports_fd.h +5 -5
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +8 -8
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +10 -10
- data/src/core/lib/event_engine/posix_engine/lockfree_event.cc +2 -2
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +23 -22
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +11 -11
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +168 -170
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +33 -54
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +4 -3
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +5 -5
- data/src/core/lib/event_engine/posix_engine/posix_interface.h +1 -1
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +1 -1
- data/src/core/lib/event_engine/posix_engine/timer_manager.cc +3 -3
- data/src/core/lib/event_engine/resolved_address.cc +3 -3
- data/src/core/lib/event_engine/shim.cc +8 -11
- data/src/core/lib/event_engine/shim.h +2 -1
- data/src/core/lib/event_engine/slice.cc +2 -2
- data/src/core/lib/event_engine/tcp_socket_utils.cc +11 -11
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +7 -7
- data/src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc +31 -31
- data/src/core/lib/event_engine/windows/iocp.cc +10 -10
- data/src/core/lib/event_engine/windows/win_socket.cc +6 -6
- data/src/core/lib/event_engine/windows/windows_endpoint.cc +11 -11
- data/src/core/lib/event_engine/windows/windows_engine.cc +16 -14
- data/src/core/lib/event_engine/windows/windows_listener.cc +7 -7
- data/src/core/lib/experiments/experiments.cc +105 -18
- data/src/core/lib/experiments/experiments.h +43 -11
- data/src/core/lib/iomgr/call_combiner.cc +3 -3
- data/src/core/lib/iomgr/endpoint_cfstream.cc +6 -6
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +5 -5
- data/src/core/lib/iomgr/endpoint_pair_windows.cc +15 -14
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +15 -15
- data/src/core/lib/iomgr/ev_poll_posix.cc +11 -11
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +5 -4
- data/src/core/lib/iomgr/event_engine_shims/endpoint.h +1 -1
- data/src/core/lib/iomgr/iocp_windows.cc +8 -8
- data/src/core/lib/iomgr/iomgr_windows.cc +3 -3
- data/src/core/lib/iomgr/lockfree_event.cc +2 -2
- data/src/core/lib/iomgr/polling_entity.cc +3 -3
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +2 -2
- data/src/core/lib/iomgr/socket_windows.cc +4 -4
- data/src/core/lib/iomgr/tcp_client_posix.cc +4 -4
- data/src/core/lib/iomgr/tcp_client_windows.cc +4 -4
- data/src/core/lib/iomgr/tcp_posix.cc +42 -42
- data/src/core/lib/iomgr/tcp_server.cc +5 -0
- data/src/core/lib/iomgr/tcp_server.h +7 -0
- data/src/core/lib/iomgr/tcp_server_posix.cc +47 -27
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +3 -0
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +5 -5
- data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +2 -2
- data/src/core/lib/iomgr/tcp_server_windows.cc +68 -29
- data/src/core/lib/iomgr/tcp_windows.cc +7 -7
- data/src/core/lib/iomgr/timer_generic.cc +2 -2
- data/src/core/lib/iomgr/timer_manager.cc +2 -2
- data/src/core/lib/iomgr/unix_sockets_posix.cc +2 -2
- data/src/core/lib/iomgr/unix_sockets_posix_noop.cc +2 -2
- data/src/core/lib/promise/activity.cc +2 -2
- data/src/core/lib/promise/activity.h +6 -6
- data/src/core/lib/promise/context.h +2 -2
- data/src/core/lib/promise/detail/join_state.h +9 -9
- data/src/core/lib/promise/detail/seq_state.h +13 -13
- data/src/core/lib/promise/detail/status.h +2 -2
- data/src/core/lib/promise/for_each.h +5 -5
- data/src/core/lib/promise/interceptor_list.h +2 -2
- data/src/core/lib/promise/latch.h +7 -7
- data/src/core/lib/promise/mpsc.cc +26 -26
- data/src/core/lib/promise/mpsc.h +2 -2
- data/src/core/lib/promise/observable.h +4 -4
- data/src/core/lib/promise/party.cc +32 -25
- data/src/core/lib/promise/party.h +16 -19
- data/src/core/lib/promise/pipe.h +15 -15
- data/src/core/lib/promise/poll.h +5 -4
- data/src/core/lib/promise/promise.h +0 -2
- data/src/core/lib/promise/sleep.cc +3 -1
- data/src/core/lib/promise/status_flag.h +7 -7
- data/src/core/lib/promise/try_join.h +2 -2
- data/src/core/lib/promise/try_seq.h +2 -2
- data/src/core/lib/resource_quota/arena.h +15 -2
- data/src/core/lib/resource_quota/connection_quota.cc +9 -7
- data/src/core/lib/resource_quota/memory_quota.cc +45 -24
- data/src/core/lib/resource_quota/memory_quota.h +48 -16
- data/src/core/lib/resource_quota/telemetry.h +54 -0
- data/src/core/lib/resource_quota/thread_quota.cc +2 -2
- data/src/core/lib/resource_tracker/resource_tracker.cc +33 -0
- data/src/core/lib/resource_tracker/resource_tracker.h +46 -0
- data/src/core/lib/security/authorization/audit_logging.cc +5 -5
- data/src/core/lib/security/authorization/grpc_authorization_engine.cc +2 -2
- data/src/core/lib/security/authorization/stdout_logger.cc +3 -3
- data/src/core/lib/surface/byte_buffer_reader.cc +2 -2
- data/src/core/lib/surface/call.cc +16 -14
- data/src/core/lib/surface/call.h +1 -1
- data/src/core/lib/surface/call_utils.cc +2 -2
- data/src/core/lib/surface/call_utils.h +2 -2
- data/src/core/lib/surface/channel.cc +4 -4
- data/src/core/lib/surface/channel_create.cc +10 -6
- data/src/core/lib/surface/channel_init.cc +80 -23
- data/src/core/lib/surface/channel_init.h +26 -11
- data/src/core/lib/surface/completion_queue.cc +17 -16
- data/src/core/lib/surface/completion_queue_factory.cc +7 -7
- data/src/core/lib/surface/connection_context.h +45 -2
- data/src/core/lib/surface/filter_stack_call.cc +12 -23
- data/src/core/lib/surface/filter_stack_call.h +3 -4
- data/src/core/lib/surface/legacy_channel.cc +7 -7
- data/src/core/lib/surface/validate_metadata.h +2 -2
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/bdp_estimator.cc +2 -2
- data/src/core/lib/transport/bdp_estimator.h +3 -3
- data/src/core/lib/transport/promise_endpoint.cc +3 -3
- data/src/core/lib/transport/promise_endpoint.h +8 -8
- data/src/core/lib/transport/timeout_encoding.cc +4 -4
- data/src/core/load_balancing/child_policy_handler.cc +4 -4
- data/src/core/load_balancing/endpoint_list.cc +2 -2
- data/src/core/load_balancing/grpclb/grpclb.cc +24 -24
- data/src/core/load_balancing/health_check_client.cc +4 -4
- data/src/core/load_balancing/health_check_client_internal.h +2 -2
- data/src/core/load_balancing/lb_policy_registry.cc +2 -2
- data/src/core/load_balancing/oob_backend_metric.cc +4 -4
- data/src/core/load_balancing/oob_backend_metric_internal.h +2 -2
- data/src/core/load_balancing/outlier_detection/outlier_detection.cc +2 -2
- data/src/core/load_balancing/pick_first/pick_first.cc +14 -14
- data/src/core/load_balancing/priority/priority.cc +23 -24
- data/src/core/load_balancing/ring_hash/ring_hash.cc +3 -3
- data/src/core/load_balancing/rls/rls.cc +13 -13
- data/src/core/load_balancing/round_robin/round_robin.cc +9 -9
- data/src/core/load_balancing/weighted_round_robin/static_stride_scheduler.cc +3 -3
- data/src/core/load_balancing/weighted_round_robin/weighted_round_robin.cc +33 -26
- data/src/core/load_balancing/weighted_target/weighted_target.cc +5 -5
- data/src/core/load_balancing/xds/cds.cc +76 -32
- data/src/core/load_balancing/xds/xds_cluster_impl.cc +3 -3
- data/src/core/load_balancing/xds/xds_override_host.cc +4 -4
- data/src/core/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +2 -2
- data/src/core/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +33 -33
- data/src/core/resolver/dns/c_ares/grpc_ares_wrapper.cc +10 -10
- data/src/core/resolver/dns/dns_resolver_plugin.cc +6 -3
- data/src/core/resolver/dns/event_engine/event_engine_client_channel_resolver.cc +2 -2
- data/src/core/resolver/endpoint_addresses.cc +3 -3
- data/src/core/resolver/endpoint_addresses.h +3 -0
- data/src/core/resolver/fake/fake_resolver.cc +2 -2
- data/src/core/resolver/google_c2p/google_c2p_resolver.cc +41 -54
- data/src/core/resolver/polling_resolver.cc +3 -3
- data/src/core/resolver/resolver_registry.cc +5 -4
- data/src/core/resolver/xds/xds_dependency_manager.cc +5 -5
- data/src/core/resolver/xds/xds_resolver.cc +9 -9
- data/src/core/server/server.cc +38 -38
- data/src/core/server/server_call_tracer_filter.h +4 -4
- data/src/core/server/server_config_selector_filter.cc +2 -2
- data/src/core/server/xds_server_config_fetcher.cc +9 -8
- data/src/core/service_config/service_config_impl.h +2 -2
- data/src/core/telemetry/call_tracer.cc +39 -49
- data/src/core/telemetry/call_tracer.h +199 -22
- data/src/core/telemetry/histogram.h +205 -0
- data/src/core/telemetry/instrument.cc +719 -0
- data/src/core/telemetry/instrument.h +932 -0
- data/src/core/telemetry/metrics.cc +13 -5
- data/src/core/telemetry/metrics.h +3 -1
- data/src/core/telemetry/stats_data.cc +0 -19
- data/src/core/telemetry/stats_data.h +0 -19
- data/src/core/transport/auth_context.cc +2 -2
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +78 -45
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.h +1 -0
- data/src/core/tsi/alts/handshaker/alts_shared_resource.cc +3 -3
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +39 -31
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.cc +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc +3 -3
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc +7 -7
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +3 -3
- data/src/core/tsi/fake_transport_security.cc +4 -4
- data/src/core/tsi/ssl/key_logging/ssl_key_logging.cc +4 -4
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +9 -9
- data/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc +3 -3
- data/src/core/tsi/ssl_transport_security.cc +26 -25
- data/src/core/tsi/ssl_transport_security_utils.cc +9 -9
- data/src/core/util/chunked_vector.h +4 -4
- data/src/core/util/event_log.cc +2 -2
- data/src/core/util/gcp_metadata_query.cc +2 -2
- data/src/core/util/grpc_check.cc +22 -0
- data/src/core/util/grpc_check.h +103 -0
- data/src/core/util/http_client/httpcli.cc +3 -3
- data/src/core/util/http_client/parser.cc +4 -4
- data/src/core/util/latent_see.h +7 -4
- data/src/core/util/lru_cache.h +4 -4
- data/src/core/util/memory_usage.h +16 -0
- data/src/core/util/posix/directory_reader.cc +3 -2
- data/src/core/util/posix/sync.cc +24 -24
- data/src/core/util/postmortem_emit.cc +52 -0
- data/src/core/util/postmortem_emit.h +30 -0
- data/src/core/util/ref_counted_ptr.h +5 -0
- data/src/core/util/trie_lookup.h +170 -0
- data/src/core/util/unique_ptr_with_bitset.h +5 -5
- data/src/core/xds/grpc/xds_bootstrap_grpc.h +6 -1
- data/src/core/xds/grpc/xds_certificate_provider.cc +3 -3
- data/src/core/xds/grpc/xds_client_grpc.cc +34 -15
- data/src/core/xds/grpc/xds_client_grpc.h +4 -1
- data/src/core/xds/grpc/xds_cluster_parser.cc +2 -2
- data/src/core/xds/grpc/xds_cluster_specifier_plugin.cc +2 -2
- data/src/core/xds/grpc/xds_endpoint_parser.cc +2 -2
- data/src/core/xds/grpc/xds_http_filter_registry.cc +4 -3
- data/src/core/xds/grpc/xds_listener_parser.cc +3 -3
- data/src/core/xds/grpc/xds_matcher.cc +277 -0
- data/src/core/xds/grpc/xds_matcher.h +432 -0
- data/src/core/xds/grpc/xds_matcher_action.cc +47 -0
- data/src/core/xds/grpc/xds_matcher_action.h +48 -0
- data/src/core/xds/grpc/xds_matcher_context.cc +29 -0
- data/src/core/xds/grpc/xds_matcher_context.h +46 -0
- data/src/core/xds/grpc/xds_matcher_input.cc +79 -0
- data/src/core/xds/grpc/xds_matcher_input.h +105 -0
- data/src/core/xds/grpc/xds_matcher_parse.cc +356 -0
- data/src/core/xds/grpc/xds_matcher_parse.h +39 -0
- data/src/core/xds/grpc/xds_metadata.cc +4 -3
- data/src/core/xds/grpc/xds_route_config_parser.cc +6 -6
- data/src/core/xds/grpc/xds_routing.cc +3 -3
- data/src/core/xds/grpc/xds_transport_grpc.cc +10 -10
- data/src/core/xds/xds_client/lrs_client.cc +6 -6
- data/src/core/xds/xds_client/xds_client.cc +9 -9
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +2 -2
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/third_party/abseil-cpp/absl/container/internal/node_slot_policy.h +95 -0
- data/third_party/abseil-cpp/absl/container/node_hash_map.h +687 -0
- metadata +37 -2
@@ -23,7 +23,6 @@
|
|
23
23
|
#include <utility>
|
24
24
|
|
25
25
|
#include "absl/base/attributes.h"
|
26
|
-
#include "absl/log/check.h"
|
27
26
|
#include "absl/log/log.h"
|
28
27
|
#include "absl/strings/str_cat.h"
|
29
28
|
#include "src/core/lib/debug/trace.h"
|
@@ -33,6 +32,7 @@
|
|
33
32
|
#include "src/core/lib/promise/promise.h"
|
34
33
|
#include "src/core/util/construct_destruct.h"
|
35
34
|
#include "src/core/util/debug_location.h"
|
35
|
+
#include "src/core/util/grpc_check.h"
|
36
36
|
|
37
37
|
// A sequence under some traits for some set of callables P, Fs.
|
38
38
|
// P should be a promise-like object that yields a value.
|
@@ -124,7 +124,7 @@ struct SeqState<Traits, P, F0> {
|
|
124
124
|
SeqState& operator=(const SeqState& other) = delete;
|
125
125
|
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept
|
126
126
|
: state(other.state), whence(other.whence) {
|
127
|
-
|
127
|
+
GRPC_DCHECK(state == State::kState0);
|
128
128
|
Construct(&prior.current_promise, std::move(other.prior.current_promise));
|
129
129
|
Construct(&prior.next_factory, std::move(other.prior.next_factory));
|
130
130
|
}
|
@@ -272,7 +272,7 @@ struct SeqState<Traits, P, F0, F1> {
|
|
272
272
|
SeqState& operator=(const SeqState& other) = delete;
|
273
273
|
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept
|
274
274
|
: state(other.state), whence(other.whence) {
|
275
|
-
|
275
|
+
GRPC_DCHECK(state == State::kState0);
|
276
276
|
Construct(&prior.prior.current_promise,
|
277
277
|
std::move(other.prior.prior.current_promise));
|
278
278
|
Construct(&prior.prior.next_factory,
|
@@ -479,7 +479,7 @@ struct SeqState<Traits, P, F0, F1, F2> {
|
|
479
479
|
SeqState& operator=(const SeqState& other) = delete;
|
480
480
|
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept
|
481
481
|
: state(other.state), whence(other.whence) {
|
482
|
-
|
482
|
+
GRPC_DCHECK(state == State::kState0);
|
483
483
|
Construct(&prior.prior.prior.current_promise,
|
484
484
|
std::move(other.prior.prior.prior.current_promise));
|
485
485
|
Construct(&prior.prior.prior.next_factory,
|
@@ -743,7 +743,7 @@ struct SeqState<Traits, P, F0, F1, F2, F3> {
|
|
743
743
|
SeqState& operator=(const SeqState& other) = delete;
|
744
744
|
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept
|
745
745
|
: state(other.state), whence(other.whence) {
|
746
|
-
|
746
|
+
GRPC_DCHECK(state == State::kState0);
|
747
747
|
Construct(&prior.prior.prior.prior.current_promise,
|
748
748
|
std::move(other.prior.prior.prior.prior.current_promise));
|
749
749
|
Construct(&prior.prior.prior.prior.next_factory,
|
@@ -1073,7 +1073,7 @@ struct SeqState<Traits, P, F0, F1, F2, F3, F4> {
|
|
1073
1073
|
SeqState& operator=(const SeqState& other) = delete;
|
1074
1074
|
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept
|
1075
1075
|
: state(other.state), whence(other.whence) {
|
1076
|
-
|
1076
|
+
GRPC_DCHECK(state == State::kState0);
|
1077
1077
|
Construct(&prior.prior.prior.prior.prior.current_promise,
|
1078
1078
|
std::move(other.prior.prior.prior.prior.prior.current_promise));
|
1079
1079
|
Construct(&prior.prior.prior.prior.prior.next_factory,
|
@@ -1464,7 +1464,7 @@ struct SeqState<Traits, P, F0, F1, F2, F3, F4, F5> {
|
|
1464
1464
|
SeqState& operator=(const SeqState& other) = delete;
|
1465
1465
|
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept
|
1466
1466
|
: state(other.state), whence(other.whence) {
|
1467
|
-
|
1467
|
+
GRPC_DCHECK(state == State::kState0);
|
1468
1468
|
Construct(
|
1469
1469
|
&prior.prior.prior.prior.prior.prior.current_promise,
|
1470
1470
|
std::move(other.prior.prior.prior.prior.prior.prior.current_promise));
|
@@ -1918,7 +1918,7 @@ struct SeqState<Traits, P, F0, F1, F2, F3, F4, F5, F6> {
|
|
1918
1918
|
SeqState& operator=(const SeqState& other) = delete;
|
1919
1919
|
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept
|
1920
1920
|
: state(other.state), whence(other.whence) {
|
1921
|
-
|
1921
|
+
GRPC_DCHECK(state == State::kState0);
|
1922
1922
|
Construct(
|
1923
1923
|
&prior.prior.prior.prior.prior.prior.prior.current_promise,
|
1924
1924
|
std::move(
|
@@ -2438,7 +2438,7 @@ struct SeqState<Traits, P, F0, F1, F2, F3, F4, F5, F6, F7> {
|
|
2438
2438
|
SeqState& operator=(const SeqState& other) = delete;
|
2439
2439
|
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept
|
2440
2440
|
: state(other.state), whence(other.whence) {
|
2441
|
-
|
2441
|
+
GRPC_DCHECK(state == State::kState0);
|
2442
2442
|
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.current_promise,
|
2443
2443
|
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
|
2444
2444
|
.current_promise));
|
@@ -3027,7 +3027,7 @@ struct SeqState<Traits, P, F0, F1, F2, F3, F4, F5, F6, F7, F8> {
|
|
3027
3027
|
SeqState& operator=(const SeqState& other) = delete;
|
3028
3028
|
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept
|
3029
3029
|
: state(other.state), whence(other.whence) {
|
3030
|
-
|
3030
|
+
GRPC_DCHECK(state == State::kState0);
|
3031
3031
|
Construct(
|
3032
3032
|
&prior.prior.prior.prior.prior.prior.prior.prior.prior.current_promise,
|
3033
3033
|
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior.prior
|
@@ -3688,7 +3688,7 @@ struct SeqState<Traits, P, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9> {
|
|
3688
3688
|
SeqState& operator=(const SeqState& other) = delete;
|
3689
3689
|
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept
|
3690
3690
|
: state(other.state), whence(other.whence) {
|
3691
|
-
|
3691
|
+
GRPC_DCHECK(state == State::kState0);
|
3692
3692
|
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
|
3693
3693
|
.current_promise,
|
3694
3694
|
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
|
@@ -4421,7 +4421,7 @@ struct SeqState<Traits, P, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10> {
|
|
4421
4421
|
SeqState& operator=(const SeqState& other) = delete;
|
4422
4422
|
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept
|
4423
4423
|
: state(other.state), whence(other.whence) {
|
4424
|
-
|
4424
|
+
GRPC_DCHECK(state == State::kState0);
|
4425
4425
|
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
|
4426
4426
|
.current_promise,
|
4427
4427
|
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
|
@@ -5229,7 +5229,7 @@ struct SeqState<Traits, P, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11> {
|
|
5229
5229
|
SeqState& operator=(const SeqState& other) = delete;
|
5230
5230
|
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept
|
5231
5231
|
: state(other.state), whence(other.whence) {
|
5232
|
-
|
5232
|
+
GRPC_DCHECK(state == State::kState0);
|
5233
5233
|
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
|
5234
5234
|
.prior.current_promise,
|
5235
5235
|
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
|
@@ -19,9 +19,9 @@
|
|
19
19
|
|
20
20
|
#include <utility>
|
21
21
|
|
22
|
-
#include "absl/log/check.h"
|
23
22
|
#include "absl/status/status.h"
|
24
23
|
#include "absl/status/statusor.h"
|
24
|
+
#include "src/core/util/grpc_check.h"
|
25
25
|
|
26
26
|
// Helpers for dealing with absl::Status/StatusOr generically
|
27
27
|
|
@@ -128,7 +128,7 @@ struct FailureStatusCastImpl<absl::StatusOr<T>, const absl::Status&> {
|
|
128
128
|
|
129
129
|
template <typename To, typename From>
|
130
130
|
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION inline To FailureStatusCast(From&& from) {
|
131
|
-
|
131
|
+
GRPC_DCHECK(!IsStatusOk(from));
|
132
132
|
return FailureStatusCastImpl<To, From>::Cast(std::forward<From>(from));
|
133
133
|
}
|
134
134
|
|
@@ -21,7 +21,6 @@
|
|
21
21
|
#include <string>
|
22
22
|
#include <utility>
|
23
23
|
|
24
|
-
#include "absl/log/check.h"
|
25
24
|
#include "absl/log/log.h"
|
26
25
|
#include "absl/status/status.h"
|
27
26
|
#include "absl/strings/str_cat.h"
|
@@ -32,6 +31,7 @@
|
|
32
31
|
#include "src/core/lib/promise/poll.h"
|
33
32
|
#include "src/core/lib/promise/status_flag.h"
|
34
33
|
#include "src/core/util/construct_destruct.h"
|
34
|
+
#include "src/core/util/grpc_check.h"
|
35
35
|
|
36
36
|
namespace grpc_core {
|
37
37
|
|
@@ -145,13 +145,13 @@ class ForEach {
|
|
145
145
|
: reader_(std::move(other.reader_)),
|
146
146
|
action_factory_(std::move(other.action_factory_)),
|
147
147
|
whence_(other.whence_) {
|
148
|
-
|
149
|
-
|
148
|
+
GRPC_DCHECK(reading_next_);
|
149
|
+
GRPC_DCHECK(other.reading_next_);
|
150
150
|
Construct(&reader_next_, std::move(other.reader_next_));
|
151
151
|
}
|
152
152
|
ForEach& operator=(ForEach&& other) noexcept {
|
153
|
-
|
154
|
-
|
153
|
+
GRPC_DCHECK(reading_next_);
|
154
|
+
GRPC_DCHECK(other.reading_next_);
|
155
155
|
reader_ = std::move(other.reader_);
|
156
156
|
action_factory_ = std::move(other.action_factory_);
|
157
157
|
reader_next_ = std::move(other.reader_next_);
|
@@ -24,7 +24,6 @@
|
|
24
24
|
#include <string>
|
25
25
|
#include <utility>
|
26
26
|
|
27
|
-
#include "absl/log/check.h"
|
28
27
|
#include "absl/log/log.h"
|
29
28
|
#include "absl/strings/str_cat.h"
|
30
29
|
#include "absl/strings/str_format.h"
|
@@ -34,6 +33,7 @@
|
|
34
33
|
#include "src/core/lib/resource_quota/arena.h"
|
35
34
|
#include "src/core/util/construct_destruct.h"
|
36
35
|
#include "src/core/util/debug_location.h"
|
36
|
+
#include "src/core/util/grpc_check.h"
|
37
37
|
|
38
38
|
namespace grpc_core {
|
39
39
|
|
@@ -64,7 +64,7 @@ class InterceptorList {
|
|
64
64
|
// Update the next pointer stored with this map.
|
65
65
|
// This is only valid to call once, and only before the map is used.
|
66
66
|
void SetNext(Map* next) {
|
67
|
-
|
67
|
+
GRPC_DCHECK_EQ(next_, nullptr);
|
68
68
|
next_ = next;
|
69
69
|
}
|
70
70
|
|
@@ -22,12 +22,12 @@
|
|
22
22
|
#include <string>
|
23
23
|
#include <utility>
|
24
24
|
|
25
|
-
#include "absl/log/check.h"
|
26
25
|
#include "absl/log/log.h"
|
27
26
|
#include "absl/strings/str_cat.h"
|
28
27
|
#include "src/core/lib/debug/trace.h"
|
29
28
|
#include "src/core/lib/promise/activity.h"
|
30
29
|
#include "src/core/lib/promise/poll.h"
|
30
|
+
#include "src/core/util/grpc_check.h"
|
31
31
|
|
32
32
|
namespace grpc_core {
|
33
33
|
|
@@ -54,12 +54,12 @@ class Latch {
|
|
54
54
|
Latch(Latch&& other) noexcept
|
55
55
|
: value_(std::move(other.value_)), has_value_(other.has_value_) {
|
56
56
|
#ifndef NDEBUG
|
57
|
-
|
57
|
+
GRPC_DCHECK(!other.has_had_waiters_);
|
58
58
|
#endif
|
59
59
|
}
|
60
60
|
Latch& operator=(Latch&& other) noexcept {
|
61
61
|
#ifndef NDEBUG
|
62
|
-
|
62
|
+
GRPC_DCHECK(!other.has_had_waiters_);
|
63
63
|
#endif
|
64
64
|
value_ = std::move(other.value_);
|
65
65
|
has_value_ = other.has_value_;
|
@@ -104,7 +104,7 @@ class Latch {
|
|
104
104
|
void Set(T value) {
|
105
105
|
GRPC_TRACE_LOG(promise_primitives, INFO)
|
106
106
|
<< DebugTag() << "Set " << StateString();
|
107
|
-
|
107
|
+
GRPC_DCHECK(!has_value_);
|
108
108
|
value_ = std::move(value);
|
109
109
|
has_value_ = true;
|
110
110
|
waiter_.Wake();
|
@@ -147,12 +147,12 @@ class Latch<void> {
|
|
147
147
|
Latch& operator=(const Latch&) = delete;
|
148
148
|
Latch(Latch&& other) noexcept : is_set_(other.is_set_) {
|
149
149
|
#ifndef NDEBUG
|
150
|
-
|
150
|
+
GRPC_DCHECK(!other.has_had_waiters_);
|
151
151
|
#endif
|
152
152
|
}
|
153
153
|
Latch& operator=(Latch&& other) noexcept {
|
154
154
|
#ifndef NDEBUG
|
155
|
-
|
155
|
+
GRPC_DCHECK(!other.has_had_waiters_);
|
156
156
|
#endif
|
157
157
|
is_set_ = other.is_set_;
|
158
158
|
return *this;
|
@@ -178,7 +178,7 @@ class Latch<void> {
|
|
178
178
|
void Set() {
|
179
179
|
GRPC_TRACE_LOG(promise_primitives, INFO)
|
180
180
|
<< DebugTag() << "Set " << StateString();
|
181
|
-
|
181
|
+
GRPC_DCHECK(!is_set_);
|
182
182
|
is_set_ = true;
|
183
183
|
waiter_.Wake();
|
184
184
|
}
|
@@ -17,9 +17,9 @@
|
|
17
17
|
#include <atomic>
|
18
18
|
#include <cstdint>
|
19
19
|
|
20
|
-
#include "absl/log/check.h"
|
21
20
|
#include "src/core/channelz/property_list.h"
|
22
21
|
#include "src/core/lib/promise/activity.h"
|
22
|
+
#include "src/core/util/grpc_check.h"
|
23
23
|
#include "src/core/util/sync.h"
|
24
24
|
|
25
25
|
namespace grpc_core::mpscpipe_detail {
|
@@ -51,7 +51,7 @@ void Mpsc::Enqueue(Node* node) {
|
|
51
51
|
} else {
|
52
52
|
node->state_.store(2 /*refs*/, std::memory_order_release);
|
53
53
|
}
|
54
|
-
|
54
|
+
GRPC_DCHECK_EQ(node->next_.load(std::memory_order_relaxed), 0u);
|
55
55
|
Node* prev = head_.exchange(node, std::memory_order_acq_rel);
|
56
56
|
uintptr_t prev_next = prev->next_.exchange(reinterpret_cast<uintptr_t>(node),
|
57
57
|
std::memory_order_acq_rel);
|
@@ -59,9 +59,9 @@ void Mpsc::Enqueue(Node* node) {
|
|
59
59
|
DrainMpsc();
|
60
60
|
}
|
61
61
|
if (prev_next == 0) return;
|
62
|
-
|
62
|
+
GRPC_DCHECK_NE(prev_next & Node::kWakerPtr, 0u);
|
63
63
|
Waker* waker = reinterpret_cast<Waker*>(prev_next & ~Node::kWakerPtr);
|
64
|
-
|
64
|
+
GRPC_DCHECK_NE(waker, nullptr);
|
65
65
|
waker->Wakeup();
|
66
66
|
delete waker;
|
67
67
|
}
|
@@ -89,9 +89,9 @@ StatusFlag Mpsc::UnbufferedImmediateSend(Node* node) {
|
|
89
89
|
DrainMpsc();
|
90
90
|
}
|
91
91
|
if (prev_next == 0) return Success{};
|
92
|
-
|
92
|
+
GRPC_DCHECK_NE(prev_next & Node::kWakerPtr, 0u);
|
93
93
|
Waker* waker = reinterpret_cast<Waker*>(prev_next & ~Node::kWakerPtr);
|
94
|
-
|
94
|
+
GRPC_DCHECK_NE(waker, nullptr);
|
95
95
|
waker->Wakeup();
|
96
96
|
delete waker;
|
97
97
|
return Success{};
|
@@ -131,13 +131,13 @@ Poll<ValueOrFailure<Mpsc::Node*>> Mpsc::PollNext() {
|
|
131
131
|
auto r = Dequeue();
|
132
132
|
if (r.pending()) return Pending{};
|
133
133
|
accepted_head = r.value();
|
134
|
-
|
134
|
+
GRPC_DCHECK_NE(accepted_head, &stub_);
|
135
135
|
accepted_head->spsc_next_ = nullptr;
|
136
136
|
if (AcceptNode(accepted_head)) {
|
137
137
|
Node* accepted_tail = accepted_head;
|
138
138
|
while (true) {
|
139
139
|
Node* node = DequeueImmediate();
|
140
|
-
|
140
|
+
GRPC_DCHECK_NE(node, &stub_);
|
141
141
|
if (node == nullptr) break;
|
142
142
|
node->spsc_next_ = nullptr;
|
143
143
|
accepted_tail->spsc_next_ = node;
|
@@ -151,7 +151,7 @@ Poll<ValueOrFailure<Mpsc::Node*>> Mpsc::PollNext() {
|
|
151
151
|
|
152
152
|
bool Mpsc::AcceptNode(Node* node) {
|
153
153
|
GRPC_LATENT_SEE_SCOPE("Mpsc::AcceptNode");
|
154
|
-
|
154
|
+
GRPC_DCHECK_NE(node, nullptr);
|
155
155
|
if (node->state_.fetch_and(255 - Node::kBlockedState,
|
156
156
|
std::memory_order_relaxed) &
|
157
157
|
Node::kBlockedState) {
|
@@ -191,7 +191,7 @@ bool Mpsc::CheckActiveTokens() {
|
|
191
191
|
void Mpsc::DrainMpsc() {
|
192
192
|
GRPC_LATENT_SEE_SCOPE("Mpsc::DrainMpsc");
|
193
193
|
#ifndef NDEBUG
|
194
|
-
|
194
|
+
GRPC_DCHECK(!drained);
|
195
195
|
drained = true;
|
196
196
|
#endif
|
197
197
|
while (true) {
|
@@ -232,7 +232,7 @@ retry_all:
|
|
232
232
|
}
|
233
233
|
if (next & Node::kWakerPtr) {
|
234
234
|
// null next waker => list closed
|
235
|
-
|
235
|
+
GRPC_DCHECK_NE(next, Node::kWakerPtr);
|
236
236
|
// List is (ephemerally) empty - but we've already asked to be notified
|
237
237
|
// when non-empty.
|
238
238
|
return Pending{}; // pending
|
@@ -246,7 +246,7 @@ retry_all:
|
|
246
246
|
return tail;
|
247
247
|
}
|
248
248
|
Node* head = head_.load(std::memory_order_acquire);
|
249
|
-
|
249
|
+
GRPC_DCHECK_NE(head, nullptr);
|
250
250
|
if (tail != head) {
|
251
251
|
auto tail_next = tail->next_.load(std::memory_order_acquire);
|
252
252
|
while (true) {
|
@@ -257,11 +257,11 @@ retry_all:
|
|
257
257
|
}
|
258
258
|
if (tail_next & Node::kWakerPtr) {
|
259
259
|
// null next waker => list closed
|
260
|
-
|
260
|
+
GRPC_DCHECK_NE(tail_next, Node::kWakerPtr);
|
261
261
|
// Node still being added, and we've already asked to be notified.
|
262
262
|
return Pending{}; // pending
|
263
263
|
}
|
264
|
-
|
264
|
+
GRPC_DCHECK_EQ(tail_next, 0u);
|
265
265
|
Waker* waker = new Waker(GetContext<Activity>()->MakeNonOwningWaker());
|
266
266
|
// Inform the adder we'd like to be woken up.
|
267
267
|
if (!tail->next_.compare_exchange_weak(
|
@@ -284,7 +284,7 @@ retry_all:
|
|
284
284
|
// Node still being added, and we've already asked to be notified.
|
285
285
|
return Pending{}; // pending
|
286
286
|
}
|
287
|
-
|
287
|
+
GRPC_DCHECK_EQ(next, 0u);
|
288
288
|
Waker* waker = new Waker(GetContext<Activity>()->MakeNonOwningWaker());
|
289
289
|
if (!tail->next_.compare_exchange_weak(
|
290
290
|
next, reinterpret_cast<uintptr_t>(waker) | Node::kWakerPtr,
|
@@ -298,7 +298,7 @@ retry_all:
|
|
298
298
|
void Mpsc::PushStub() {
|
299
299
|
stub_.next_.store(0, std::memory_order_relaxed);
|
300
300
|
Node* prev = head_.exchange(&stub_, std::memory_order_acq_rel);
|
301
|
-
|
301
|
+
GRPC_DCHECK_NE(prev, nullptr);
|
302
302
|
prev->next_.store(reinterpret_cast<uintptr_t>(&stub_),
|
303
303
|
std::memory_order_release);
|
304
304
|
}
|
@@ -314,7 +314,7 @@ Mpsc::Node* Mpsc::DequeueImmediate() {
|
|
314
314
|
}
|
315
315
|
if (next & Node::kWakerPtr) {
|
316
316
|
// null next waker => list closed
|
317
|
-
|
317
|
+
GRPC_DCHECK_NE(next, Node::kWakerPtr);
|
318
318
|
// List is (ephemerally) empty - but we've already asked to be notified
|
319
319
|
// when non-empty.
|
320
320
|
return nullptr; // pending
|
@@ -362,21 +362,21 @@ void Mpsc::Close(bool wake_reader) {
|
|
362
362
|
void Mpsc::ReleaseTokens(Node* node) {
|
363
363
|
auto prev_queued =
|
364
364
|
queued_tokens_.fetch_sub(node->tokens_, std::memory_order_relaxed);
|
365
|
-
|
365
|
+
GRPC_DCHECK_GE(prev_queued, node->tokens_);
|
366
366
|
ReleaseActiveTokens(true, node->tokens_);
|
367
367
|
node->Unref();
|
368
368
|
}
|
369
369
|
|
370
370
|
void Mpsc::ReleaseTokensAndClose(Node* node) {
|
371
|
-
|
371
|
+
GRPC_DCHECK_NE(node, &stub_);
|
372
372
|
auto prev_queued =
|
373
373
|
queued_tokens_.fetch_sub(node->tokens_, std::memory_order_relaxed);
|
374
|
-
|
374
|
+
GRPC_DCHECK_GE(prev_queued, node->tokens_);
|
375
375
|
// Called when the node has not yet been dequeued -- so we don't need to
|
376
376
|
// decrement active tokens_.
|
377
377
|
uint8_t state = node->state_.load(std::memory_order_relaxed);
|
378
378
|
while (true) {
|
379
|
-
|
379
|
+
GRPC_DCHECK_EQ(state & Node::kClosedState, 0) << int(state);
|
380
380
|
uint8_t new_state = state;
|
381
381
|
new_state &= ~Node::kBlockedState;
|
382
382
|
new_state |= Node::kClosedState;
|
@@ -391,10 +391,10 @@ void Mpsc::ReleaseTokensAndClose(Node* node) {
|
|
391
391
|
}
|
392
392
|
|
393
393
|
void Mpsc::ReleaseActiveTokens(bool wake_reader, uint64_t tokens) {
|
394
|
-
|
394
|
+
GRPC_DCHECK_EQ(tokens & kActiveTokensMask, tokens);
|
395
395
|
auto prev_active =
|
396
396
|
active_tokens_.fetch_sub(tokens, std::memory_order_relaxed);
|
397
|
-
|
397
|
+
GRPC_DCHECK_GE(prev_active & kActiveTokensMask, tokens);
|
398
398
|
while ((prev_active & kActiveTokensWakerBit) != 0 &&
|
399
399
|
(prev_active & kActiveTokensMask) - tokens <= max_queued_) {
|
400
400
|
if (active_tokens_.compare_exchange_weak(
|
@@ -402,11 +402,11 @@ void Mpsc::ReleaseActiveTokens(bool wake_reader, uint64_t tokens) {
|
|
402
402
|
(prev_active & kActiveTokensMask) | kActiveTokensWakingBit,
|
403
403
|
std::memory_order_acquire, std::memory_order_relaxed)) {
|
404
404
|
auto waker = std::move(active_tokens_waker_);
|
405
|
-
|
405
|
+
GRPC_DCHECK(!waker.is_unwakeable());
|
406
406
|
auto prev = active_tokens_.fetch_and(kActiveTokensMask,
|
407
407
|
std::memory_order_release);
|
408
|
-
|
409
|
-
|
408
|
+
GRPC_DCHECK_EQ(prev & (kActiveTokensWakerBit | kActiveTokensWakingBit),
|
409
|
+
kActiveTokensWakingBit)
|
410
410
|
<< prev;
|
411
411
|
if (wake_reader) waker.Wakeup();
|
412
412
|
return;
|
data/src/core/lib/promise/mpsc.h
CHANGED
@@ -23,12 +23,12 @@
|
|
23
23
|
#include <cstdint>
|
24
24
|
#include <utility>
|
25
25
|
|
26
|
-
#include "absl/log/check.h"
|
27
26
|
#include "src/core/channelz/property_list.h"
|
28
27
|
#include "src/core/lib/promise/activity.h"
|
29
28
|
#include "src/core/lib/promise/map.h"
|
30
29
|
#include "src/core/lib/promise/poll.h"
|
31
30
|
#include "src/core/lib/promise/status_flag.h"
|
31
|
+
#include "src/core/util/grpc_check.h"
|
32
32
|
#include "src/core/util/ref_counted.h"
|
33
33
|
#include "src/core/util/ref_counted_ptr.h"
|
34
34
|
|
@@ -181,7 +181,7 @@ class Mpsc {
|
|
181
181
|
|
182
182
|
public:
|
183
183
|
auto Send(Node* node) {
|
184
|
-
|
184
|
+
GRPC_DCHECK(node->waker_.is_unwakeable());
|
185
185
|
// Enqueue the node immediately; this means that Send() must be called
|
186
186
|
// from the same activity that will poll the result.
|
187
187
|
Enqueue(node);
|
@@ -19,9 +19,9 @@
|
|
19
19
|
|
20
20
|
#include "absl/container/flat_hash_set.h"
|
21
21
|
#include "absl/functional/any_invocable.h"
|
22
|
-
#include "absl/log/check.h"
|
23
22
|
#include "src/core/lib/promise/activity.h"
|
24
23
|
#include "src/core/lib/promise/poll.h"
|
24
|
+
#include "src/core/util/grpc_check.h"
|
25
25
|
#include "src/core/util/sync.h"
|
26
26
|
|
27
27
|
namespace grpc_core {
|
@@ -123,9 +123,9 @@ class Observable {
|
|
123
123
|
Observer(const Observer&) = delete;
|
124
124
|
Observer& operator=(const Observer&) = delete;
|
125
125
|
Observer(Observer&& other) noexcept : state_(std::move(other.state_)) {
|
126
|
-
|
127
|
-
|
128
|
-
|
126
|
+
GRPC_CHECK(other.waker_.is_unwakeable());
|
127
|
+
GRPC_DCHECK(waker_.is_unwakeable());
|
128
|
+
GRPC_CHECK(!other.saw_pending_);
|
129
129
|
}
|
130
130
|
Observer& operator=(Observer&& other) noexcept = delete;
|
131
131
|
|
@@ -21,12 +21,13 @@
|
|
21
21
|
#include <limits>
|
22
22
|
|
23
23
|
#include "absl/base/thread_annotations.h"
|
24
|
-
#include "absl/log/check.h"
|
25
24
|
#include "absl/log/log.h"
|
26
25
|
#include "absl/strings/str_format.h"
|
26
|
+
#include "src/core/channelz/property_list.h"
|
27
27
|
#include "src/core/lib/event_engine/event_engine_context.h"
|
28
28
|
#include "src/core/lib/iomgr/exec_ctx.h"
|
29
29
|
#include "src/core/lib/promise/activity.h"
|
30
|
+
#include "src/core/util/grpc_check.h"
|
30
31
|
#include "src/core/util/json/json_writer.h"
|
31
32
|
#include "src/core/util/latent_see.h"
|
32
33
|
#include "src/core/util/sync.h"
|
@@ -73,7 +74,7 @@ class Party::Handle final : public Wakeable {
|
|
73
74
|
// Activity is going away... drop its reference and sever the connection back.
|
74
75
|
void DropActivity() ABSL_LOCKS_EXCLUDED(mu_) {
|
75
76
|
mu_.Lock();
|
76
|
-
|
77
|
+
GRPC_CHECK_NE(party_, nullptr);
|
77
78
|
party_ = nullptr;
|
78
79
|
mu_.Unlock();
|
79
80
|
Unref();
|
@@ -202,13 +203,17 @@ void Party::ToJson(absl::AnyInvocable<void(Json::Object)> f) {
|
|
202
203
|
}
|
203
204
|
|
204
205
|
void Party::ExportToChannelz(std::string name, channelz::DataSink sink) {
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
206
|
+
arena()->GetContext<grpc_event_engine::experimental::EventEngine>()->Run(
|
207
|
+
[self = Ref(), name = std::move(name), sink = std::move(sink)]() mutable {
|
208
|
+
ExecCtx exec_ctx;
|
209
|
+
self->Spawn(
|
210
|
+
"export-to-channelz",
|
211
|
+
[name = std::move(name), sink = std::move(sink), self]() mutable {
|
212
|
+
sink.AddData(std::move(name), self->ChannelzPropertiesLocked());
|
213
|
+
return absl::OkStatus();
|
214
|
+
},
|
215
|
+
[](absl::Status) {});
|
216
|
+
});
|
212
217
|
}
|
213
218
|
|
214
219
|
channelz::PropertyList Party::ChannelzPropertiesLocked() {
|
@@ -226,7 +231,8 @@ channelz::PropertyList Party::ChannelzPropertiesLocked() {
|
|
226
231
|
for (size_t i = 0; i < party_detail::kMaxParticipants; i++) {
|
227
232
|
if (auto* p = participants_[i].load(std::memory_order_acquire);
|
228
233
|
p != nullptr) {
|
229
|
-
table.AppendRow(
|
234
|
+
table.AppendRow(channelz::PropertyList().Set(
|
235
|
+
"participant", p->ChannelzProperties()));
|
230
236
|
}
|
231
237
|
}
|
232
238
|
return table;
|
@@ -259,13 +265,13 @@ std::string Party::ActivityDebugTag(WakeupMask wakeup_mask) const {
|
|
259
265
|
}
|
260
266
|
|
261
267
|
Waker Party::MakeOwningWaker() {
|
262
|
-
|
268
|
+
GRPC_DCHECK(currently_polling_ != kNotPolling);
|
263
269
|
IncrementRefCount();
|
264
270
|
return Waker(this, 1u << currently_polling_);
|
265
271
|
}
|
266
272
|
|
267
273
|
Waker Party::MakeNonOwningWaker() {
|
268
|
-
|
274
|
+
GRPC_DCHECK(currently_polling_ != kNotPolling);
|
269
275
|
return Waker(participants_[currently_polling_]
|
270
276
|
.load(std::memory_order_relaxed)
|
271
277
|
->MakeNonOwningWakeable(this),
|
@@ -273,7 +279,7 @@ Waker Party::MakeNonOwningWaker() {
|
|
273
279
|
}
|
274
280
|
|
275
281
|
void Party::ForceImmediateRepoll(WakeupMask mask) {
|
276
|
-
|
282
|
+
GRPC_DCHECK(is_current());
|
277
283
|
wakeup_mask_ |= mask;
|
278
284
|
}
|
279
285
|
|
@@ -306,11 +312,11 @@ void Party::RunLockedAndUnref(Party* party, uint64_t prev_state) {
|
|
306
312
|
g_run_state = this;
|
307
313
|
do {
|
308
314
|
GRPC_LATENT_SEE_SCOPE("run_one_party");
|
309
|
-
|
315
|
+
GRPC_CHECK(first.party != nullptr);
|
310
316
|
first.party->RunPartyAndUnref(first.prev_state);
|
311
317
|
first = std::exchange(next, PartyWakeup{});
|
312
318
|
} while (first.party != nullptr);
|
313
|
-
|
319
|
+
GRPC_DCHECK(g_run_state == this);
|
314
320
|
g_run_state = nullptr;
|
315
321
|
}
|
316
322
|
};
|
@@ -338,10 +344,11 @@ void Party::RunLockedAndUnref(Party* party, uint64_t prev_state) {
|
|
338
344
|
auto wakeup =
|
339
345
|
std::exchange(g_run_state->next, PartyWakeup{party, prev_state});
|
340
346
|
auto arena = wakeup.party->arena_.get();
|
341
|
-
|
347
|
+
GRPC_CHECK(arena != nullptr);
|
342
348
|
auto* event_engine =
|
343
349
|
arena->GetContext<grpc_event_engine::experimental::EventEngine>();
|
344
|
-
|
350
|
+
GRPC_CHECK(event_engine != nullptr)
|
351
|
+
<< "; " << GRPC_DUMP_ARGS(party, arena);
|
345
352
|
GRPC_LATENT_SEE_SCOPE("offload_one_party");
|
346
353
|
event_engine->Run([wakeup]() {
|
347
354
|
GRPC_LATENT_SEE_SCOPE("Party::RunLocked offload");
|
@@ -360,11 +367,11 @@ void Party::RunLockedAndUnref(Party* party, uint64_t prev_state) {
|
|
360
367
|
void Party::RunPartyAndUnref(uint64_t prev_state) {
|
361
368
|
ScopedActivity activity(this);
|
362
369
|
promise_detail::Context<Arena> arena_ctx(arena_.get());
|
363
|
-
|
370
|
+
GRPC_DCHECK_EQ(prev_state & kLocked, 0u)
|
364
371
|
<< "Party should be unlocked prior to first wakeup";
|
365
|
-
|
372
|
+
GRPC_DCHECK_GE(prev_state & kRefMask, kOneRef);
|
366
373
|
// Now update prev_state to be what we want the CAS to see below.
|
367
|
-
|
374
|
+
GRPC_DCHECK_EQ(prev_state & ~(kRefMask | kAllocatedMask), 0u)
|
368
375
|
<< "Party should have contained no wakeups on lock";
|
369
376
|
prev_state |= kLocked;
|
370
377
|
#if !TARGET_OS_IPHONE
|
@@ -432,9 +439,9 @@ void Party::RunPartyAndUnref(uint64_t prev_state) {
|
|
432
439
|
}
|
433
440
|
LogStateChange("Run:Continue", prev_state,
|
434
441
|
prev_state & (kRefMask | kLocked | keep_allocated_mask));
|
435
|
-
|
442
|
+
GRPC_DCHECK(prev_state & kLocked)
|
436
443
|
<< "Party should be locked; prev_state=" << prev_state;
|
437
|
-
|
444
|
+
GRPC_DCHECK_GE(prev_state & kRefMask, kOneRef);
|
438
445
|
// From the previous state, extract which participants we're to wakeup.
|
439
446
|
wakeup_mask_ |= prev_state & kWakeupMask;
|
440
447
|
// Now update prev_state to be what we want the CAS to see once wakeups
|
@@ -457,7 +464,7 @@ uint64_t Party::NextAllocationMask(uint64_t current_allocation_mask) {
|
|
457
464
|
}
|
458
465
|
#else
|
459
466
|
uint64_t Party::NextAllocationMask(uint64_t current_allocation_mask) {
|
460
|
-
|
467
|
+
GRPC_CHECK_EQ(current_allocation_mask & ~kWakeupMask, 0);
|
461
468
|
if (current_allocation_mask == kWakeupMask) return kWakeupMask + 1;
|
462
469
|
// Count number of unset bits in the wakeup mask
|
463
470
|
size_t unset_bits = 0;
|
@@ -465,7 +472,7 @@ uint64_t Party::NextAllocationMask(uint64_t current_allocation_mask) {
|
|
465
472
|
if (current_allocation_mask & (1ull << i)) continue;
|
466
473
|
++unset_bits;
|
467
474
|
}
|
468
|
-
|
475
|
+
GRPC_CHECK_GT(unset_bits, 0);
|
469
476
|
absl::BitGen bitgen;
|
470
477
|
size_t selected = absl::Uniform<size_t>(bitgen, 0, unset_bits);
|
471
478
|
for (size_t i = 0; i < party_detail::kMaxParticipants; i++) {
|
@@ -494,7 +501,7 @@ size_t Party::AddParticipant(Participant* participant) {
|
|
494
501
|
if (GPR_UNLIKELY((wakeup_mask & kWakeupMask) == 0)) {
|
495
502
|
return std::numeric_limits<size_t>::max();
|
496
503
|
}
|
497
|
-
|
504
|
+
GRPC_DCHECK_NE(wakeup_mask & kWakeupMask, 0u)
|
498
505
|
<< "No available slots for new participant; allocated=" << allocated
|
499
506
|
<< " state=" << state << " wakeup_mask=" << wakeup_mask;
|
500
507
|
allocated |= wakeup_mask;
|