grpc 1.57.0.pre1 → 1.58.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Makefile +534 -284
- data/include/grpc/event_engine/event_engine.h +0 -1
- data/include/grpc/event_engine/memory_allocator.h +2 -2
- data/include/grpc/impl/channel_arg_names.h +371 -0
- data/include/grpc/impl/grpc_types.h +1 -353
- data/include/grpc/module.modulemap +1 -0
- data/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +1 -1
- data/src/core/ext/filters/channel_idle/channel_idle_filter.cc +2 -1
- data/src/core/ext/filters/client_channel/client_channel.cc +7 -3
- data/src/core/ext/filters/client_channel/http_proxy.cc +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc +10 -5
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.h +7 -5
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +1 -0
- data/src/core/ext/filters/client_channel/lb_policy/health_check_client.cc +5 -3
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc +4 -2
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +115 -109
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.h +0 -5
- data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +7 -2
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +2 -1
- data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +1 -0
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/weighted_round_robin.cc +11 -3
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +6 -1
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +8 -5
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +102 -11
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +9 -4
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +4 -1
- data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_plugin.cc +6 -0
- data/src/core/ext/filters/client_channel/resolver/dns/event_engine/event_engine_client_channel_resolver.cc +41 -14
- data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.cc +3 -2
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +1 -1
- data/src/core/ext/filters/client_channel/retry_filter.h +1 -0
- data/src/core/ext/filters/client_channel/retry_service_config.cc +1 -1
- data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +1 -1
- data/src/core/ext/filters/client_channel/subchannel.cc +9 -5
- data/src/core/ext/filters/client_channel/subchannel.h +8 -2
- data/src/core/ext/filters/deadline/deadline_filter.cc +1 -1
- data/src/core/ext/filters/http/client/http_client_filter.cc +1 -0
- data/src/core/ext/filters/http/client_authority_filter.cc +1 -1
- data/src/core/ext/filters/http/message_compress/compression_filter.cc +1 -0
- data/src/core/ext/filters/http/server/http_server_filter.cc +1 -1
- data/src/core/ext/filters/message_size/message_size_filter.cc +1 -0
- data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +4 -7
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +1 -0
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +8 -12
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +357 -358
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +5 -18
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +63 -4
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +7 -2
- data/src/core/ext/transport/chttp2/transport/internal.h +30 -57
- data/src/core/ext/transport/chttp2/transport/parsing.cc +16 -7
- data/src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc +80 -0
- data/src/core/ext/transport/chttp2/transport/ping_abuse_policy.h +55 -0
- data/src/core/ext/transport/chttp2/transport/ping_rate_policy.cc +98 -0
- data/src/core/ext/transport/chttp2/transport/ping_rate_policy.h +73 -0
- data/src/core/ext/transport/chttp2/transport/writing.cc +81 -89
- data/src/core/ext/transport/inproc/inproc_transport.cc +1 -0
- data/src/core/ext/xds/xds_client_grpc.cc +1 -0
- data/src/core/ext/xds/xds_http_fault_filter.cc +1 -2
- data/src/core/ext/xds/xds_http_fault_filter.h +1 -2
- data/src/core/ext/xds/xds_http_filters.h +2 -4
- data/src/core/ext/xds/xds_http_rbac_filter.cc +3 -8
- data/src/core/ext/xds/xds_http_rbac_filter.h +1 -2
- data/src/core/ext/xds/xds_http_stateful_session_filter.cc +1 -2
- data/src/core/ext/xds/xds_http_stateful_session_filter.h +1 -2
- data/src/core/ext/xds/xds_lb_policy_registry.cc +3 -6
- data/src/core/ext/xds/xds_routing.cc +2 -2
- data/src/core/ext/xds/xds_transport_grpc.cc +1 -0
- data/src/core/lib/avl/avl.h +10 -173
- data/src/core/lib/channel/call_tracer.cc +289 -0
- data/src/core/lib/channel/call_tracer.h +35 -0
- data/src/core/lib/channel/channel_args.cc +84 -79
- data/src/core/lib/channel/channel_args.h +29 -17
- data/src/core/lib/channel/connected_channel.cc +0 -1
- data/src/core/lib/channel/promise_based_filter.cc +4 -1
- data/src/core/lib/compression/compression_internal.cc +8 -4
- data/src/core/lib/debug/stats_data.cc +93 -21
- data/src/core/lib/debug/stats_data.h +41 -0
- data/src/core/lib/event_engine/ares_resolver.cc +712 -0
- data/src/core/lib/event_engine/ares_resolver.h +150 -0
- data/src/core/lib/event_engine/cf_engine/cf_engine.cc +9 -3
- data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc +2 -2
- data/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc +229 -0
- data/src/core/lib/event_engine/cf_engine/dns_service_resolver.h +117 -0
- data/src/core/lib/event_engine/forkable.cc +15 -1
- data/src/core/lib/event_engine/forkable.h +15 -0
- data/src/core/lib/event_engine/grpc_polled_fd.h +73 -0
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +25 -3
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.h +10 -1
- data/src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h +197 -0
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +3 -3
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +47 -1
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +12 -1
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +1 -0
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc +2 -0
- data/src/core/lib/event_engine/thread_pool/thread_count.cc +58 -0
- data/src/core/lib/event_engine/thread_pool/thread_count.h +161 -0
- data/src/core/lib/event_engine/thread_pool/thread_pool_factory.cc +7 -0
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +86 -111
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h +15 -61
- data/src/core/lib/event_engine/windows/windows_endpoint.cc +3 -4
- data/src/core/lib/experiments/config.cc +14 -0
- data/src/core/lib/experiments/experiments.cc +141 -304
- data/src/core/lib/experiments/experiments.h +16 -17
- data/src/core/lib/gprpp/ref_counted.h +3 -1
- data/src/core/lib/gprpp/ref_counted_string.cc +44 -0
- data/src/core/lib/gprpp/ref_counted_string.h +146 -0
- data/src/core/lib/gprpp/time.h +2 -2
- data/src/core/lib/gprpp/work_serializer.cc +36 -0
- data/src/core/lib/gprpp/work_serializer.h +5 -0
- data/src/core/lib/http/httpcli_security_connector.cc +1 -0
- data/src/core/lib/iomgr/buffer_list.cc +2 -0
- data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +7 -22
- data/src/core/lib/iomgr/tcp_posix.cc +3 -3
- data/src/core/lib/promise/detail/basic_seq.h +1 -372
- data/src/core/lib/promise/detail/seq_state.h +2076 -0
- data/src/core/lib/promise/seq.h +19 -2
- data/src/core/lib/promise/sleep.h +5 -10
- data/src/core/lib/promise/try_seq.h +34 -2
- data/src/core/lib/resource_quota/api.cc +1 -0
- data/src/core/lib/resource_quota/arena.cc +2 -0
- data/src/core/lib/resource_quota/arena.h +42 -8
- data/src/core/lib/resource_quota/memory_quota.cc +0 -1
- data/src/core/lib/resource_quota/resource_quota.h +1 -0
- data/src/core/lib/security/authorization/authorization_policy_provider.h +1 -1
- data/src/core/lib/security/authorization/rbac_policy.h +1 -1
- data/src/core/lib/security/credentials/external/aws_request_signer.cc +8 -0
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +1 -0
- data/src/core/lib/security/credentials/jwt/json_token.cc +17 -0
- data/src/core/lib/security/credentials/jwt/json_token.h +4 -0
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +42 -0
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +1 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +4 -0
- data/src/core/lib/security/credentials/tls/tls_credentials.cc +1 -0
- data/src/core/lib/security/credentials/xds/xds_credentials.cc +1 -0
- data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +1 -0
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +1 -0
- data/src/core/lib/security/security_connector/ssl_utils.cc +1 -0
- data/src/core/lib/security/transport/client_auth_filter.cc +8 -5
- data/src/core/lib/security/transport/security_handshaker.cc +1 -0
- data/src/core/lib/security/transport/server_auth_filter.cc +2 -0
- data/src/core/lib/surface/call.cc +32 -8
- data/src/core/lib/surface/channel.cc +1 -0
- data/src/core/lib/surface/completion_queue.cc +10 -0
- data/src/core/lib/surface/init.cc +1 -0
- data/src/core/lib/surface/server.cc +67 -64
- data/src/core/lib/surface/server.h +1 -15
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/tsi/alts/crypt/aes_gcm.cc +27 -2
- data/src/core/tsi/ssl_transport_security.cc +11 -0
- data/src/ruby/ext/grpc/rb_channel.c +1 -53
- data/src/ruby/lib/grpc/generic/active_call.rb +9 -14
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/test/client.rb +16 -0
- data/src/ruby/spec/generic/rpc_server_spec.rb +3 -3
- data/third_party/abseil-cpp/absl/algorithm/container.h +3 -2
- data/third_party/abseil-cpp/absl/base/attributes.h +58 -5
- data/third_party/abseil-cpp/absl/base/call_once.h +1 -1
- data/third_party/abseil-cpp/absl/base/casts.h +8 -8
- data/third_party/abseil-cpp/absl/base/config.h +89 -106
- data/third_party/abseil-cpp/absl/base/dynamic_annotations.h +26 -1
- data/third_party/abseil-cpp/absl/base/internal/direct_mmap.h +2 -2
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc +50 -39
- data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.h +2 -1
- data/third_party/abseil-cpp/absl/base/internal/prefetch.h +17 -18
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +32 -3
- data/third_party/abseil-cpp/absl/base/internal/raw_logging.h +24 -4
- data/third_party/abseil-cpp/absl/base/internal/sysinfo.cc +31 -73
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.cc +9 -8
- data/third_party/abseil-cpp/absl/base/internal/thread_identity.h +11 -11
- data/third_party/abseil-cpp/absl/base/internal/throw_delegate.cc +23 -32
- data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +2 -3
- data/third_party/abseil-cpp/absl/base/options.h +1 -1
- data/third_party/abseil-cpp/absl/base/policy_checks.h +3 -3
- data/third_party/abseil-cpp/absl/base/prefetch.h +198 -0
- data/third_party/abseil-cpp/absl/container/fixed_array.h +54 -29
- data/third_party/abseil-cpp/absl/container/flat_hash_map.h +5 -1
- data/third_party/abseil-cpp/absl/container/flat_hash_set.h +6 -2
- data/third_party/abseil-cpp/absl/container/inlined_vector.h +167 -79
- data/third_party/abseil-cpp/absl/container/internal/common_policy_traits.h +1 -1
- data/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h +3 -21
- data/third_party/abseil-cpp/absl/container/internal/container_memory.h +1 -1
- data/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +46 -0
- data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +2 -0
- data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +85 -26
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +35 -18
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +70 -29
- data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +437 -236
- data/third_party/abseil-cpp/absl/crc/crc32c.h +8 -1
- data/third_party/abseil-cpp/absl/crc/internal/cpu_detect.cc +14 -8
- data/third_party/abseil-cpp/absl/crc/internal/crc.cc +4 -35
- data/third_party/abseil-cpp/absl/crc/internal/crc.h +2 -10
- data/third_party/abseil-cpp/absl/crc/internal/crc32_x86_arm_combined_simd.h +1 -1
- data/third_party/abseil-cpp/absl/crc/internal/crc_cord_state.cc +1 -1
- data/third_party/abseil-cpp/absl/crc/internal/crc_cord_state.h +4 -4
- data/third_party/abseil-cpp/absl/crc/internal/crc_internal.h +8 -10
- data/third_party/abseil-cpp/absl/crc/internal/crc_memcpy_x86_64.cc +17 -19
- data/third_party/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc +8 -8
- data/third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.h +2 -1
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +59 -23
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +1 -1
- data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +1 -1
- data/third_party/abseil-cpp/absl/debugging/internal/symbolize.h +1 -1
- data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +43 -19
- data/third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc +3 -0
- data/third_party/abseil-cpp/absl/flags/commandlineflag.h +1 -1
- data/third_party/abseil-cpp/absl/flags/internal/commandlineflag.cc +1 -1
- data/third_party/abseil-cpp/absl/flags/internal/flag.cc +2 -2
- data/third_party/abseil-cpp/absl/flags/internal/flag.h +16 -15
- data/third_party/abseil-cpp/absl/flags/internal/flag_msvc.inc +1 -1
- data/third_party/abseil-cpp/absl/flags/marshalling.cc +43 -2
- data/third_party/abseil-cpp/absl/flags/marshalling.h +5 -0
- data/third_party/abseil-cpp/absl/functional/any_invocable.h +9 -1
- data/third_party/abseil-cpp/absl/functional/bind_front.h +1 -1
- data/third_party/abseil-cpp/absl/functional/function_ref.h +3 -3
- data/third_party/abseil-cpp/absl/functional/internal/any_invocable.h +37 -24
- data/third_party/abseil-cpp/absl/functional/internal/function_ref.h +19 -9
- data/third_party/abseil-cpp/absl/hash/hash.h +7 -4
- data/third_party/abseil-cpp/absl/hash/internal/hash.h +38 -15
- data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc +6 -0
- data/third_party/abseil-cpp/absl/meta/type_traits.h +48 -373
- data/third_party/abseil-cpp/absl/numeric/bits.h +4 -4
- data/third_party/abseil-cpp/absl/numeric/int128.cc +20 -8
- data/third_party/abseil-cpp/absl/numeric/int128.h +36 -39
- data/third_party/abseil-cpp/absl/numeric/int128_have_intrinsic.inc +0 -3
- data/third_party/abseil-cpp/absl/numeric/int128_no_intrinsic.inc +47 -30
- data/third_party/abseil-cpp/absl/random/internal/fast_uniform_bits.h +4 -3
- data/third_party/abseil-cpp/absl/random/internal/generate_real.h +1 -1
- data/third_party/abseil-cpp/absl/random/internal/platform.h +1 -1
- data/third_party/abseil-cpp/absl/random/internal/randen_detect.cc +4 -0
- data/third_party/abseil-cpp/absl/random/internal/randen_engine.h +1 -1
- data/third_party/abseil-cpp/absl/random/internal/randen_hwaes.cc +1 -1
- data/third_party/abseil-cpp/absl/random/internal/uniform_helper.h +1 -1
- data/third_party/abseil-cpp/absl/status/internal/status_internal.h +4 -0
- data/third_party/abseil-cpp/absl/status/internal/statusor_internal.h +12 -24
- data/third_party/abseil-cpp/absl/status/status.cc +11 -7
- data/third_party/abseil-cpp/absl/status/status.h +11 -2
- data/third_party/abseil-cpp/absl/status/statusor.h +22 -8
- data/third_party/abseil-cpp/absl/strings/ascii.cc +54 -6
- data/third_party/abseil-cpp/absl/strings/charconv.cc +21 -4
- data/third_party/abseil-cpp/absl/strings/charconv.h +2 -2
- data/third_party/abseil-cpp/absl/strings/cord.cc +1 -2
- data/third_party/abseil-cpp/absl/strings/cord.h +32 -5
- data/third_party/abseil-cpp/absl/strings/cord_analysis.cc +23 -1
- data/third_party/abseil-cpp/absl/strings/cord_analysis.h +18 -0
- data/third_party/abseil-cpp/absl/strings/cord_buffer.h +2 -5
- data/third_party/abseil-cpp/absl/strings/escaping.cc +10 -32
- data/third_party/abseil-cpp/absl/strings/escaping.h +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc +2 -4
- data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.h +3 -3
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.cc +0 -1
- data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +15 -13
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +13 -4
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.h +8 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.cc +5 -3
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_consume.h +4 -7
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_flat.h +8 -0
- data/third_party/abseil-cpp/absl/strings/internal/cord_rep_ring.h +2 -2
- data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.cc +46 -20
- data/third_party/abseil-cpp/absl/strings/internal/cordz_handle.h +1 -34
- data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +2 -1
- data/third_party/abseil-cpp/absl/strings/internal/escaping.cc +23 -0
- data/third_party/abseil-cpp/absl/strings/internal/escaping.h +1 -0
- data/third_party/abseil-cpp/absl/strings/internal/memutil.cc +2 -77
- data/third_party/abseil-cpp/absl/strings/internal/memutil.h +4 -112
- data/third_party/abseil-cpp/absl/strings/internal/stl_type_traits.h +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +10 -31
- data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +8 -8
- data/third_party/abseil-cpp/absl/strings/internal/str_format/bind.h +5 -20
- data/third_party/abseil-cpp/absl/strings/internal/str_format/constexpr_parser.h +1 -0
- data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.h +1 -1
- data/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +9 -9
- data/third_party/abseil-cpp/absl/strings/internal/str_split_internal.h +56 -6
- data/third_party/abseil-cpp/absl/strings/match.cc +87 -0
- data/third_party/abseil-cpp/absl/strings/match.h +19 -0
- data/third_party/abseil-cpp/absl/strings/numbers.cc +154 -122
- data/third_party/abseil-cpp/absl/strings/numbers.h +1 -6
- data/third_party/abseil-cpp/absl/strings/str_cat.cc +7 -50
- data/third_party/abseil-cpp/absl/strings/str_cat.h +83 -15
- data/third_party/abseil-cpp/absl/strings/str_format.h +6 -3
- data/third_party/abseil-cpp/absl/strings/str_split.cc +9 -6
- data/third_party/abseil-cpp/absl/strings/string_view.cc +26 -4
- data/third_party/abseil-cpp/absl/synchronization/internal/create_thread_identity.cc +5 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/futex.h +63 -43
- data/third_party/abseil-cpp/absl/synchronization/internal/futex_waiter.cc +111 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/futex_waiter.h +63 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc +11 -7
- data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.cc +225 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.h +122 -114
- data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.cc +12 -8
- data/third_party/abseil-cpp/absl/synchronization/internal/per_thread_sem.h +10 -1
- data/third_party/abseil-cpp/absl/synchronization/internal/pthread_waiter.cc +167 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/pthread_waiter.h +60 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/sem_waiter.cc +122 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/sem_waiter.h +65 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/stdcpp_waiter.cc +91 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/stdcpp_waiter.h +56 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.h +19 -113
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter_base.cc +42 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter_base.h +90 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/win32_waiter.cc +151 -0
- data/third_party/abseil-cpp/absl/synchronization/internal/win32_waiter.h +70 -0
- data/third_party/abseil-cpp/absl/synchronization/mutex.cc +407 -411
- data/third_party/abseil-cpp/absl/synchronization/mutex.h +152 -118
- data/third_party/abseil-cpp/absl/time/clock.cc +6 -7
- data/third_party/abseil-cpp/absl/time/duration.cc +24 -26
- data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h +1 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_fixed.cc +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc +3 -3
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.cc +8 -6
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_if.h +6 -3
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.cc +4 -2
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_impl.h +4 -0
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc +322 -295
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.h +8 -17
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc +51 -33
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.h +7 -2
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +128 -2
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_posix.h +1 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +5 -1
- data/third_party/abseil-cpp/absl/time/internal/cctz/src/zone_info_source.cc +34 -34
- data/third_party/abseil-cpp/absl/time/time.cc +9 -2
- data/third_party/abseil-cpp/absl/time/time.h +115 -15
- data/third_party/abseil-cpp/absl/types/internal/optional.h +0 -52
- data/third_party/abseil-cpp/absl/types/internal/span.h +2 -2
- data/third_party/abseil-cpp/absl/types/internal/variant.h +2 -2
- data/third_party/abseil-cpp/absl/types/optional.h +15 -13
- data/third_party/abseil-cpp/absl/types/span.h +1 -2
- data/third_party/boringssl-with-bazel/err_data.c +15 -14
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_gentm.c +7 -3
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_strex.c +7 -7
- data/third_party/boringssl-with-bazel/src/crypto/asn1/a_utctm.c +7 -3
- data/third_party/boringssl-with-bazel/src/crypto/bio/connect.c +5 -5
- data/third_party/boringssl-with-bazel/src/crypto/bio/errno.c +92 -0
- data/third_party/boringssl-with-bazel/src/crypto/bio/fd.c +4 -48
- data/third_party/boringssl-with-bazel/src/crypto/bio/file.c +11 -6
- data/third_party/boringssl-with-bazel/src/crypto/bio/internal.h +16 -6
- data/third_party/boringssl-with-bazel/src/crypto/bio/socket.c +2 -2
- data/third_party/boringssl-with-bazel/src/crypto/bio/socket_helper.c +9 -0
- data/third_party/boringssl-with-bazel/src/crypto/bytestring/cbs.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/conf/conf.c +3 -7
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_apple.c +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_fuchsia.c +0 -1
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_linux.c +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_openbsd.c +0 -1
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_sysreg.c +93 -0
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_win.c +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_freebsd.c +0 -1
- data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_linux.c +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/dh_extra/dh_asn1.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/dh_extra/params.c +5 -0
- data/third_party/boringssl-with-bazel/src/crypto/ec_extra/hash_to_curve.c +9 -14
- data/third_party/boringssl-with-bazel/src/crypto/ec_extra/internal.h +4 -6
- data/third_party/boringssl-with-bazel/src/crypto/err/err.c +10 -11
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/check.c +37 -8
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/dh.c +38 -19
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/internal.h +7 -0
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +39 -16
- data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/service_indicator/service_indicator.c +4 -7
- data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +7 -0
- data/third_party/boringssl-with-bazel/src/crypto/internal.h +13 -21
- data/third_party/boringssl-with-bazel/src/crypto/obj/obj.c +6 -23
- data/third_party/boringssl-with-bazel/src/crypto/rand_extra/getentropy.c +4 -0
- data/third_party/boringssl-with-bazel/src/crypto/stack/stack.c +5 -0
- data/third_party/boringssl-with-bazel/src/crypto/x509/by_dir.c +1 -6
- data/third_party/boringssl-with-bazel/src/crypto/x509/by_file.c +0 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509/x509_d2.c +1 -3
- data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_alt.c +2 -3
- data/third_party/boringssl-with-bazel/src/include/openssl/base.h +9 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/bio.h +11 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/dh.h +4 -1
- data/third_party/boringssl-with-bazel/src/include/openssl/ec.h +7 -9
- data/third_party/boringssl-with-bazel/src/include/openssl/hpke.h +6 -2
- data/third_party/boringssl-with-bazel/src/include/openssl/span.h +22 -20
- data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +4 -0
- data/third_party/boringssl-with-bazel/src/include/openssl/stack.h +20 -12
- data/third_party/boringssl-with-bazel/src/include/openssl/target.h +50 -3
- data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +0 -4
- data/third_party/boringssl-with-bazel/src/ssl/ssl_cipher.cc +2 -2
- data/third_party/boringssl-with-bazel/src/ssl/ssl_file.cc +4 -4
- data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +2 -0
- metadata +39 -31
- data/src/core/lib/promise/detail/basic_join.h +0 -197
- data/src/core/lib/promise/detail/switch.h +0 -1455
- data/src/core/lib/promise/try_join.h +0 -82
- data/third_party/abseil-cpp/absl/synchronization/internal/waiter.cc +0 -403
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_freebsd.c +0 -62
- data/third_party/boringssl-with-bazel/src/crypto/cpu_arm.c +0 -38
- data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_openbsd.c +0 -31
- data/third_party/re2/util/benchmark.h +0 -156
- data/third_party/re2/util/flags.h +0 -26
- data/third_party/re2/util/malloc_counter.h +0 -19
- data/third_party/re2/util/pcre.cc +0 -1025
- data/third_party/re2/util/pcre.h +0 -681
- data/third_party/re2/util/test.h +0 -50
- data/third_party/upb/upb/mini_table.h +0 -36
- data/third_party/zlib/gzclose.c +0 -25
- data/third_party/zlib/gzlib.c +0 -639
- data/third_party/zlib/gzread.c +0 -650
- data/third_party/zlib/gzwrite.c +0 -677
@@ -17,28 +17,37 @@
|
|
17
17
|
//
|
18
18
|
#include <grpc/support/port_platform.h>
|
19
19
|
|
20
|
-
#include <memory>
|
21
|
-
#include <string>
|
22
|
-
|
23
|
-
#include "absl/base/thread_annotations.h"
|
24
|
-
|
25
|
-
#include "src/core/lib/gprpp/sync.h"
|
26
|
-
#include "src/core/lib/iomgr/closure.h"
|
27
|
-
#include "src/core/lib/iomgr/error.h"
|
28
|
-
#include "src/core/lib/iomgr/iomgr_fwd.h"
|
29
20
|
#include "src/core/lib/iomgr/port.h"
|
21
|
+
|
30
22
|
#if GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_ARES_EV_DRIVER)
|
31
23
|
|
32
|
-
|
24
|
+
// IWYU pragma: no_include <ares_build.h>
|
25
|
+
|
33
26
|
#include <sys/ioctl.h>
|
27
|
+
#include <sys/socket.h>
|
28
|
+
#include <sys/uio.h>
|
29
|
+
#include <unistd.h>
|
30
|
+
|
31
|
+
#include <memory>
|
32
|
+
#include <string>
|
33
|
+
#include <unordered_set>
|
34
|
+
#include <utility>
|
34
35
|
|
35
36
|
#include <ares.h>
|
36
37
|
|
38
|
+
#include "absl/base/thread_annotations.h"
|
37
39
|
#include "absl/strings/str_cat.h"
|
38
40
|
|
41
|
+
#include <grpc/support/log.h>
|
42
|
+
|
39
43
|
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"
|
40
44
|
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
|
45
|
+
#include "src/core/lib/gprpp/sync.h"
|
46
|
+
#include "src/core/lib/iomgr/closure.h"
|
47
|
+
#include "src/core/lib/iomgr/error.h"
|
41
48
|
#include "src/core/lib/iomgr/ev_posix.h"
|
49
|
+
#include "src/core/lib/iomgr/iomgr_fwd.h"
|
50
|
+
#include "src/core/lib/iomgr/socket_utils_posix.h"
|
42
51
|
|
43
52
|
namespace grpc_core {
|
44
53
|
|
@@ -98,12 +107,94 @@ class GrpcPolledFdPosix : public GrpcPolledFd {
|
|
98
107
|
|
99
108
|
class GrpcPolledFdFactoryPosix : public GrpcPolledFdFactory {
|
100
109
|
public:
|
110
|
+
~GrpcPolledFdFactoryPosix() override {
|
111
|
+
for (auto& fd : owned_fds_) {
|
112
|
+
close(fd);
|
113
|
+
}
|
114
|
+
}
|
115
|
+
|
101
116
|
GrpcPolledFd* NewGrpcPolledFdLocked(
|
102
117
|
ares_socket_t as, grpc_pollset_set* driver_pollset_set) override {
|
118
|
+
auto insert_result = owned_fds_.insert(as);
|
119
|
+
GPR_ASSERT(insert_result.second);
|
103
120
|
return new GrpcPolledFdPosix(as, driver_pollset_set);
|
104
121
|
}
|
105
122
|
|
106
|
-
void ConfigureAresChannelLocked(ares_channel
|
123
|
+
void ConfigureAresChannelLocked(ares_channel channel) override {
|
124
|
+
ares_set_socket_functions(channel, &kSockFuncs, this);
|
125
|
+
ares_set_socket_configure_callback(
|
126
|
+
channel, &GrpcPolledFdFactoryPosix::ConfigureSocket, nullptr);
|
127
|
+
}
|
128
|
+
|
129
|
+
private:
|
130
|
+
/// Overridden socket API for c-ares
|
131
|
+
static ares_socket_t Socket(int af, int type, int protocol,
|
132
|
+
void* /*user_data*/) {
|
133
|
+
return socket(af, type, protocol);
|
134
|
+
}
|
135
|
+
|
136
|
+
/// Overridden connect API for c-ares
|
137
|
+
static int Connect(ares_socket_t as, const struct sockaddr* target,
|
138
|
+
ares_socklen_t target_len, void* /*user_data*/) {
|
139
|
+
return connect(as, target, target_len);
|
140
|
+
}
|
141
|
+
|
142
|
+
/// Overridden writev API for c-ares
|
143
|
+
static ares_ssize_t WriteV(ares_socket_t as, const struct iovec* iov,
|
144
|
+
int iovec_count, void* /*user_data*/) {
|
145
|
+
return writev(as, iov, iovec_count);
|
146
|
+
}
|
147
|
+
|
148
|
+
/// Overridden recvfrom API for c-ares
|
149
|
+
static ares_ssize_t RecvFrom(ares_socket_t as, void* data, size_t data_len,
|
150
|
+
int flags, struct sockaddr* from,
|
151
|
+
ares_socklen_t* from_len, void* /*user_data*/) {
|
152
|
+
return recvfrom(as, data, data_len, flags, from, from_len);
|
153
|
+
}
|
154
|
+
|
155
|
+
/// Overridden close API for c-ares
|
156
|
+
static int Close(ares_socket_t as, void* user_data) {
|
157
|
+
GrpcPolledFdFactoryPosix* self =
|
158
|
+
static_cast<GrpcPolledFdFactoryPosix*>(user_data);
|
159
|
+
if (self->owned_fds_.find(as) == self->owned_fds_.end()) {
|
160
|
+
// c-ares owns this fd, grpc has never seen it
|
161
|
+
return close(as);
|
162
|
+
}
|
163
|
+
return 0;
|
164
|
+
}
|
165
|
+
|
166
|
+
/// Because we're using socket API overrides, c-ares won't
|
167
|
+
/// perform its typical configuration on the socket. See
|
168
|
+
/// https://github.com/c-ares/c-ares/blob/bad62225b7f6b278b92e8e85a255600b629ef517/src/lib/ares_process.c#L1018.
|
169
|
+
/// So we use the configure socket callback override and copy default
|
170
|
+
/// settings that c-ares would normally apply on posix platforms:
|
171
|
+
/// - non-blocking
|
172
|
+
/// - cloexec flag
|
173
|
+
/// - disable nagle */
|
174
|
+
static int ConfigureSocket(ares_socket_t fd, int type, void* /*user_data*/) {
|
175
|
+
grpc_error_handle err;
|
176
|
+
err = grpc_set_socket_nonblocking(fd, true);
|
177
|
+
if (!err.ok()) return -1;
|
178
|
+
err = grpc_set_socket_cloexec(fd, true);
|
179
|
+
if (!err.ok()) return -1;
|
180
|
+
if (type == SOCK_STREAM) {
|
181
|
+
err = grpc_set_socket_low_latency(fd, true);
|
182
|
+
if (!err.ok()) return -1;
|
183
|
+
}
|
184
|
+
return 0;
|
185
|
+
}
|
186
|
+
|
187
|
+
const struct ares_socket_functions kSockFuncs = {
|
188
|
+
&GrpcPolledFdFactoryPosix::Socket /* socket */,
|
189
|
+
&GrpcPolledFdFactoryPosix::Close /* close */,
|
190
|
+
&GrpcPolledFdFactoryPosix::Connect /* connect */,
|
191
|
+
&GrpcPolledFdFactoryPosix::RecvFrom /* recvfrom */,
|
192
|
+
&GrpcPolledFdFactoryPosix::WriteV /* writev */,
|
193
|
+
};
|
194
|
+
|
195
|
+
// fds that are used/owned by grpc - we (grpc) will close them rather than
|
196
|
+
// c-ares
|
197
|
+
std::unordered_set<ares_socket_t> owned_fds_;
|
107
198
|
};
|
108
199
|
|
109
200
|
std::unique_ptr<GrpcPolledFdFactory> NewGrpcPolledFdFactory(Mutex* /* mu */) {
|
@@ -24,7 +24,7 @@
|
|
24
24
|
|
25
25
|
#include "absl/strings/string_view.h"
|
26
26
|
|
27
|
-
#include <grpc/
|
27
|
+
#include <grpc/impl/channel_arg_names.h>
|
28
28
|
|
29
29
|
#include "src/core/lib/gprpp/status_helper.h"
|
30
30
|
#include "src/core/lib/iomgr/sockaddr.h"
|
@@ -510,11 +510,13 @@ void grpc_ares_ev_driver_start_locked(grpc_ares_ev_driver* ev_driver)
|
|
510
510
|
&ev_driver->on_ares_backup_poll_alarm_locked);
|
511
511
|
}
|
512
512
|
|
513
|
-
static void noop_inject_channel_config(ares_channel /*channel*/) {}
|
513
|
+
static void noop_inject_channel_config(ares_channel* /*channel*/) {}
|
514
514
|
|
515
|
-
void (*grpc_ares_test_only_inject_config)(ares_channel channel) =
|
515
|
+
void (*grpc_ares_test_only_inject_config)(ares_channel* channel) =
|
516
516
|
noop_inject_channel_config;
|
517
517
|
|
518
|
+
bool g_grpc_ares_test_only_force_tcp = false;
|
519
|
+
|
518
520
|
grpc_error_handle grpc_ares_ev_driver_create_locked(
|
519
521
|
grpc_ares_ev_driver** ev_driver, grpc_pollset_set* pollset_set,
|
520
522
|
int query_timeout_ms, grpc_ares_request* request)
|
@@ -523,8 +525,11 @@ grpc_error_handle grpc_ares_ev_driver_create_locked(
|
|
523
525
|
ares_options opts;
|
524
526
|
memset(&opts, 0, sizeof(opts));
|
525
527
|
opts.flags |= ARES_FLAG_STAYOPEN;
|
528
|
+
if (g_grpc_ares_test_only_force_tcp) {
|
529
|
+
opts.flags |= ARES_FLAG_USEVC;
|
530
|
+
}
|
526
531
|
int status = ares_init_options(&(*ev_driver)->channel, &opts, ARES_OPT_FLAGS);
|
527
|
-
grpc_ares_test_only_inject_config((*ev_driver)->channel);
|
532
|
+
grpc_ares_test_only_inject_config(&(*ev_driver)->channel);
|
528
533
|
GRPC_CARES_TRACE_LOG("request:%p grpc_ares_ev_driver_create_locked", request);
|
529
534
|
if (status != ARES_SUCCESS) {
|
530
535
|
grpc_error_handle err = GRPC_ERROR_CREATE(absl::StrCat(
|
@@ -131,6 +131,9 @@ void grpc_cares_wrapper_address_sorting_sort(
|
|
131
131
|
const grpc_ares_request* request, grpc_core::ServerAddressList* addresses);
|
132
132
|
|
133
133
|
// Exposed in this header for C-core tests only
|
134
|
-
extern void (*grpc_ares_test_only_inject_config)(ares_channel channel);
|
134
|
+
extern void (*grpc_ares_test_only_inject_config)(ares_channel* channel);
|
135
|
+
|
136
|
+
// Exposed in this header for C-core tests only
|
137
|
+
extern bool g_grpc_ares_test_only_force_tcp;
|
135
138
|
|
136
139
|
#endif // GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_WRAPPER_H
|
@@ -32,6 +32,12 @@
|
|
32
32
|
namespace grpc_core {
|
33
33
|
|
34
34
|
void RegisterDnsResolver(CoreConfiguration::Builder* builder) {
|
35
|
+
#ifdef GRPC_IOS_EVENT_ENGINE_CLIENT
|
36
|
+
gpr_log(GPR_DEBUG, "Using EventEngine dns resolver");
|
37
|
+
builder->resolver_registry()->RegisterResolverFactory(
|
38
|
+
std::make_unique<EventEngineClientChannelDNSResolverFactory>());
|
39
|
+
return;
|
40
|
+
#endif
|
35
41
|
if (IsEventEngineDnsEnabled()) {
|
36
42
|
gpr_log(GPR_DEBUG, "Using EventEngine dns resolver");
|
37
43
|
builder->resolver_registry()->RegisterResolverFactory(
|
@@ -22,7 +22,6 @@
|
|
22
22
|
#include <chrono>
|
23
23
|
#include <memory>
|
24
24
|
#include <string>
|
25
|
-
#include <type_traits>
|
26
25
|
#include <utility>
|
27
26
|
#include <vector>
|
28
27
|
|
@@ -36,7 +35,7 @@
|
|
36
35
|
#include "absl/types/optional.h"
|
37
36
|
|
38
37
|
#include <grpc/event_engine/event_engine.h>
|
39
|
-
#include <grpc/
|
38
|
+
#include <grpc/impl/channel_arg_names.h>
|
40
39
|
#include <grpc/support/log.h>
|
41
40
|
|
42
41
|
#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h"
|
@@ -51,6 +50,7 @@
|
|
51
50
|
#include "src/core/lib/gprpp/sync.h"
|
52
51
|
#include "src/core/lib/gprpp/time.h"
|
53
52
|
#include "src/core/lib/gprpp/validation_errors.h"
|
53
|
+
#include "src/core/lib/iomgr/exec_ctx.h"
|
54
54
|
#include "src/core/lib/iomgr/resolve_address.h"
|
55
55
|
#include "src/core/lib/resolver/resolver.h"
|
56
56
|
#include "src/core/lib/resolver/resolver_factory.h"
|
@@ -231,8 +231,12 @@ EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper::
|
|
231
231
|
is_hostname_inflight_ = true;
|
232
232
|
event_engine_resolver_->LookupHostname(
|
233
233
|
[self = Ref(DEBUG_LOCATION, "OnHostnameResolved")](
|
234
|
-
absl::StatusOr<std::vector<EventEngine::ResolvedAddress>>
|
234
|
+
absl::StatusOr<std::vector<EventEngine::ResolvedAddress>>
|
235
|
+
addresses) mutable {
|
236
|
+
ApplicationCallbackExecCtx callback_exec_ctx;
|
237
|
+
ExecCtx exec_ctx;
|
235
238
|
self->OnHostnameResolved(std::move(addresses));
|
239
|
+
self.reset();
|
236
240
|
},
|
237
241
|
resolver_->name_to_resolve(), kDefaultSecurePort);
|
238
242
|
if (resolver_->enable_srv_queries_) {
|
@@ -243,8 +247,13 @@ EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper::
|
|
243
247
|
event_engine_resolver_->LookupSRV(
|
244
248
|
[self = Ref(DEBUG_LOCATION, "OnSRVResolved")](
|
245
249
|
absl::StatusOr<std::vector<EventEngine::DNSResolver::SRVRecord>>
|
246
|
-
srv_records) {
|
247
|
-
|
250
|
+
srv_records) mutable {
|
251
|
+
ApplicationCallbackExecCtx callback_exec_ctx;
|
252
|
+
ExecCtx exec_ctx;
|
253
|
+
self->OnSRVResolved(std::move(srv_records));
|
254
|
+
self.reset();
|
255
|
+
},
|
256
|
+
absl::StrCat("_grpclb._tcp.", resolver_->name_to_resolve()));
|
248
257
|
}
|
249
258
|
if (resolver_->request_service_config_) {
|
250
259
|
GRPC_EVENT_ENGINE_RESOLVER_TRACE(
|
@@ -253,8 +262,11 @@ EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper::
|
|
253
262
|
is_txt_inflight_ = true;
|
254
263
|
event_engine_resolver_->LookupTXT(
|
255
264
|
[self = Ref(DEBUG_LOCATION, "OnTXTResolved")](
|
256
|
-
absl::StatusOr<std::vector<std::string>> service_config) {
|
265
|
+
absl::StatusOr<std::vector<std::string>> service_config) mutable {
|
266
|
+
ApplicationCallbackExecCtx callback_exec_ctx;
|
267
|
+
ExecCtx exec_ctx;
|
257
268
|
self->OnTXTResolved(std::move(service_config));
|
269
|
+
self.reset();
|
258
270
|
},
|
259
271
|
absl::StrCat("_grpc_config.", resolver_->name_to_resolve()));
|
260
272
|
}
|
@@ -263,8 +275,12 @@ EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper::
|
|
263
275
|
? EventEngine::Duration::max()
|
264
276
|
: resolver_->query_timeout_ms_;
|
265
277
|
timeout_handle_ = resolver_->event_engine_->RunAfter(
|
266
|
-
timeout,
|
267
|
-
|
278
|
+
timeout, [self = Ref(DEBUG_LOCATION, "OnTimeout")]() mutable {
|
279
|
+
ApplicationCallbackExecCtx callback_exec_ctx;
|
280
|
+
ExecCtx exec_ctx;
|
281
|
+
self->OnTimeout();
|
282
|
+
self.reset();
|
283
|
+
});
|
268
284
|
}
|
269
285
|
|
270
286
|
EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper::
|
@@ -300,10 +316,11 @@ void EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper::
|
|
300
316
|
void EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper::
|
301
317
|
OnHostnameResolved(absl::StatusOr<std::vector<EventEngine::ResolvedAddress>>
|
302
318
|
new_addresses) {
|
303
|
-
ValidationErrors::ScopedField field(&errors_, "hostname lookup");
|
304
319
|
absl::optional<Resolver::Result> result;
|
305
320
|
{
|
306
321
|
MutexLock lock(&on_resolved_mu_);
|
322
|
+
// Make sure field destroys before cleanup.
|
323
|
+
ValidationErrors::ScopedField field(&errors_, "hostname lookup");
|
307
324
|
if (orphaned_) return;
|
308
325
|
is_hostname_inflight_ = false;
|
309
326
|
if (!new_addresses.ok()) {
|
@@ -325,7 +342,6 @@ void EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper::
|
|
325
342
|
OnSRVResolved(
|
326
343
|
absl::StatusOr<std::vector<EventEngine::DNSResolver::SRVRecord>>
|
327
344
|
srv_records) {
|
328
|
-
ValidationErrors::ScopedField field(&errors_, "srv lookup");
|
329
345
|
absl::optional<Resolver::Result> result;
|
330
346
|
auto cleanup = absl::MakeCleanup([&]() {
|
331
347
|
if (result.has_value()) {
|
@@ -333,6 +349,8 @@ void EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper::
|
|
333
349
|
}
|
334
350
|
});
|
335
351
|
MutexLock lock(&on_resolved_mu_);
|
352
|
+
// Make sure field destroys before cleanup.
|
353
|
+
ValidationErrors::ScopedField field(&errors_, "srv lookup");
|
336
354
|
if (orphaned_) return;
|
337
355
|
is_srv_inflight_ = false;
|
338
356
|
if (!srv_records.ok()) {
|
@@ -359,12 +377,15 @@ void EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper::
|
|
359
377
|
resolver_.get(), srv_record.host.c_str(), srv_record.port);
|
360
378
|
++number_of_balancer_hostnames_initiated_;
|
361
379
|
event_engine_resolver_->LookupHostname(
|
362
|
-
[host =
|
380
|
+
[host = srv_record.host,
|
363
381
|
self = Ref(DEBUG_LOCATION, "OnBalancerHostnamesResolved")](
|
364
382
|
absl::StatusOr<std::vector<EventEngine::ResolvedAddress>>
|
365
383
|
new_balancer_addresses) mutable {
|
384
|
+
ApplicationCallbackExecCtx callback_exec_ctx;
|
385
|
+
ExecCtx exec_ctx;
|
366
386
|
self->OnBalancerHostnamesResolved(std::move(host),
|
367
387
|
std::move(new_balancer_addresses));
|
388
|
+
self.reset();
|
368
389
|
},
|
369
390
|
srv_record.host, std::to_string(srv_record.port));
|
370
391
|
}
|
@@ -375,8 +396,6 @@ void EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper::
|
|
375
396
|
std::string authority,
|
376
397
|
absl::StatusOr<std::vector<EventEngine::ResolvedAddress>>
|
377
398
|
new_balancer_addresses) {
|
378
|
-
ValidationErrors::ScopedField field(
|
379
|
-
&errors_, absl::StrCat("balancer lookup for ", authority));
|
380
399
|
absl::optional<Resolver::Result> result;
|
381
400
|
auto cleanup = absl::MakeCleanup([&]() {
|
382
401
|
if (result.has_value()) {
|
@@ -384,6 +403,9 @@ void EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper::
|
|
384
403
|
}
|
385
404
|
});
|
386
405
|
MutexLock lock(&on_resolved_mu_);
|
406
|
+
// Make sure field destroys before cleanup.
|
407
|
+
ValidationErrors::ScopedField field(
|
408
|
+
&errors_, absl::StrCat("balancer lookup for ", authority));
|
387
409
|
if (orphaned_) return;
|
388
410
|
++number_of_balancer_hostnames_resolved_;
|
389
411
|
if (!new_balancer_addresses.ok()) {
|
@@ -405,10 +427,11 @@ void EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper::
|
|
405
427
|
|
406
428
|
void EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper::
|
407
429
|
OnTXTResolved(absl::StatusOr<std::vector<std::string>> service_config) {
|
408
|
-
ValidationErrors::ScopedField field(&errors_, "txt lookup");
|
409
430
|
absl::optional<Resolver::Result> result;
|
410
431
|
{
|
411
432
|
MutexLock lock(&on_resolved_mu_);
|
433
|
+
// Make sure field destroys before cleanup.
|
434
|
+
ValidationErrors::ScopedField field(&errors_, "txt lookup");
|
412
435
|
if (orphaned_) return;
|
413
436
|
GPR_ASSERT(is_txt_inflight_);
|
414
437
|
is_txt_inflight_ = false;
|
@@ -424,8 +447,12 @@ void EventEngineClientChannelDNSResolver::EventEngineDNSRequestWrapper::
|
|
424
447
|
s, kServiceConfigAttributePrefix);
|
425
448
|
});
|
426
449
|
if (result != service_config->end()) {
|
450
|
+
// Found a service config record.
|
427
451
|
service_config_json_ =
|
428
452
|
result->substr(kServiceConfigAttributePrefix.size());
|
453
|
+
GRPC_EVENT_ENGINE_RESOLVER_TRACE(
|
454
|
+
"DNSResolver::%p found service config: %s",
|
455
|
+
event_engine_resolver_.get(), service_config_json_->c_str());
|
429
456
|
} else {
|
430
457
|
service_config_json_ = absl::UnavailableError(absl::StrCat(
|
431
458
|
"failed to find attribute prefix: ", kServiceConfigAttributePrefix,
|
@@ -159,7 +159,7 @@ void PollingResolver::OnRequestCompleteLocked(Result result) {
|
|
159
159
|
if (GPR_UNLIKELY(tracer_ != nullptr && tracer_->enabled())) {
|
160
160
|
gpr_log(GPR_INFO,
|
161
161
|
"[polling resolver %p] returning result: "
|
162
|
-
"addresses=%s, service_config=%s",
|
162
|
+
"addresses=%s, service_config=%s, resolution_note=%s",
|
163
163
|
this,
|
164
164
|
result.addresses.ok()
|
165
165
|
? absl::StrCat("<", result.addresses->size(), " addresses>")
|
@@ -170,7 +170,8 @@ void PollingResolver::OnRequestCompleteLocked(Result result) {
|
|
170
170
|
? "<null>"
|
171
171
|
: std::string((*result.service_config)->json_string())
|
172
172
|
.c_str())
|
173
|
-
: result.service_config.status().ToString().c_str()
|
173
|
+
: result.service_config.status().ToString().c_str(),
|
174
|
+
result.resolution_note.c_str());
|
174
175
|
}
|
175
176
|
GPR_ASSERT(result.result_health_callback == nullptr);
|
176
177
|
RefCountedPtr<PollingResolver> self =
|
@@ -33,7 +33,7 @@
|
|
33
33
|
#include "absl/strings/string_view.h"
|
34
34
|
#include "absl/types/optional.h"
|
35
35
|
|
36
|
-
#include <grpc/
|
36
|
+
#include <grpc/impl/channel_arg_names.h>
|
37
37
|
#include <grpc/slice.h>
|
38
38
|
#include <grpc/status.h>
|
39
39
|
#include <grpc/support/log.h>
|
@@ -367,8 +367,10 @@ void Subchannel::ConnectivityStateWatcherList::NotifyLocked(
|
|
367
367
|
grpc_connectivity_state state, const absl::Status& status) {
|
368
368
|
for (const auto& p : watchers_) {
|
369
369
|
subchannel_->work_serializer_.Schedule(
|
370
|
-
[watcher = p.second->Ref(), state, status]() {
|
371
|
-
watcher
|
370
|
+
[watcher = p.second->Ref(), state, status]() mutable {
|
371
|
+
auto* watcher_ptr = watcher.get();
|
372
|
+
watcher_ptr->OnConnectivityStateChange(std::move(watcher), state,
|
373
|
+
status);
|
372
374
|
},
|
373
375
|
DEBUG_LOCATION);
|
374
376
|
}
|
@@ -527,8 +529,10 @@ void Subchannel::WatchConnectivityState(
|
|
527
529
|
grpc_pollset_set_add_pollset_set(pollset_set_, interested_parties);
|
528
530
|
}
|
529
531
|
work_serializer_.Schedule(
|
530
|
-
[watcher = watcher->Ref(), state = state_, status = status_]() {
|
531
|
-
watcher
|
532
|
+
[watcher = watcher->Ref(), state = state_, status = status_]() mutable {
|
533
|
+
auto* watcher_ptr = watcher.get();
|
534
|
+
watcher_ptr->OnConnectivityStateChange(std::move(watcher), state,
|
535
|
+
status);
|
532
536
|
},
|
533
537
|
DEBUG_LOCATION);
|
534
538
|
watcher_list_.AddWatcherLocked(std::move(watcher));
|
@@ -173,8 +173,14 @@ class Subchannel : public DualRefCounted<Subchannel> {
|
|
173
173
|
// Invoked whenever the subchannel's connectivity state changes.
|
174
174
|
// There will be only one invocation of this method on a given watcher
|
175
175
|
// instance at any given time.
|
176
|
-
|
177
|
-
|
176
|
+
// A ref to the watcher is passed in here so that the implementation
|
177
|
+
// can unref it in the appropriate synchronization context (e.g.,
|
178
|
+
// inside a WorkSerializer).
|
179
|
+
// TODO(roth): Figure out a cleaner way to guarantee that the ref is
|
180
|
+
// released in the right context.
|
181
|
+
virtual void OnConnectivityStateChange(
|
182
|
+
RefCountedPtr<ConnectivityStateWatcherInterface> self,
|
183
|
+
grpc_connectivity_state state, const absl::Status& status) = 0;
|
178
184
|
|
179
185
|
virtual grpc_pollset_set* interested_parties() = 0;
|
180
186
|
};
|
@@ -29,7 +29,7 @@
|
|
29
29
|
#include "absl/strings/string_view.h"
|
30
30
|
#include "absl/types/optional.h"
|
31
31
|
|
32
|
-
#include <grpc/
|
32
|
+
#include <grpc/impl/channel_arg_names.h>
|
33
33
|
|
34
34
|
#include "src/core/lib/channel/channel_stack.h"
|
35
35
|
#include "src/core/lib/channel/channel_stack_builder.h"
|
@@ -215,12 +215,11 @@ struct RbacConfig {
|
|
215
215
|
Rules(Rules&&) = default;
|
216
216
|
Rules& operator=(Rules&&) = default;
|
217
217
|
|
218
|
-
Rbac TakeAsRbac(
|
218
|
+
Rbac TakeAsRbac();
|
219
219
|
static const JsonLoaderInterface* JsonLoader(const JsonArgs&);
|
220
220
|
void JsonPostLoad(const Json&, const JsonArgs&, ValidationErrors* errors);
|
221
221
|
};
|
222
222
|
|
223
|
-
std::string name;
|
224
223
|
absl::optional<Rules> rules;
|
225
224
|
|
226
225
|
Rbac TakeAsRbac();
|
@@ -773,9 +772,8 @@ void RbacConfig::RbacPolicy::Rules::AuditLogger::JsonPostLoad(
|
|
773
772
|
// RbacConfig::RbacPolicy::Rules
|
774
773
|
//
|
775
774
|
|
776
|
-
Rbac RbacConfig::RbacPolicy::Rules::TakeAsRbac(
|
775
|
+
Rbac RbacConfig::RbacPolicy::Rules::TakeAsRbac() {
|
777
776
|
Rbac rbac;
|
778
|
-
rbac.name = std::move(name);
|
779
777
|
rbac.action = static_cast<Rbac::Action>(action);
|
780
778
|
rbac.audit_condition = audit_condition;
|
781
779
|
for (auto& p : policies) {
|
@@ -849,15 +847,14 @@ Rbac RbacConfig::RbacPolicy::TakeAsRbac() {
|
|
849
847
|
if (!rules.has_value()) {
|
850
848
|
// No enforcing to be applied. An empty deny policy with an empty map
|
851
849
|
// is equivalent to no enforcing.
|
852
|
-
return Rbac(
|
850
|
+
return Rbac("", Rbac::Action::kDeny, {});
|
853
851
|
}
|
854
|
-
return rules->TakeAsRbac(
|
852
|
+
return rules->TakeAsRbac();
|
855
853
|
}
|
856
854
|
|
857
855
|
const JsonLoaderInterface* RbacConfig::RbacPolicy::JsonLoader(const JsonArgs&) {
|
858
856
|
static const auto* loader = JsonObjectLoader<RbacPolicy>()
|
859
857
|
.OptionalField("rules", &RbacPolicy::rules)
|
860
|
-
.Field("filter_name", &RbacPolicy::name)
|
861
858
|
.Finish();
|
862
859
|
return loader;
|
863
860
|
}
|