grpc 1.71.0 → 1.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Makefile +78 -75
- data/include/grpc/event_engine/memory_request.h +3 -3
- data/include/grpc/impl/channel_arg_names.h +70 -50
- data/include/grpc/support/workaround_list.h +1 -4
- data/src/core/{lib/transport → call}/call_arena_allocator.cc +1 -1
- data/src/core/{lib/transport → call}/call_arena_allocator.h +3 -3
- data/src/core/{lib/transport → call}/call_destination.h +4 -4
- data/src/core/{lib/transport → call}/call_filters.cc +2 -2
- data/src/core/{lib/transport → call}/call_filters.h +25 -6
- data/src/core/{lib/channel → call}/call_finalization.h +3 -3
- data/src/core/{lib/transport → call}/call_spine.cc +1 -1
- data/src/core/{lib/transport → call}/call_spine.h +68 -26
- data/src/core/{lib/transport → call}/call_state.cc +1 -1
- data/src/core/{lib/transport → call}/call_state.h +3 -3
- data/src/core/{lib/surface → call}/client_call.cc +9 -7
- data/src/core/{lib/surface → call}/client_call.h +4 -4
- data/src/core/{lib/transport → call}/custom_metadata.h +3 -3
- data/src/core/{lib/transport → call}/interception_chain.cc +5 -5
- data/src/core/{lib/transport → call}/interception_chain.h +7 -7
- data/src/core/{lib/transport → call}/message.cc +1 -1
- data/src/core/{lib/transport → call}/message.h +7 -3
- data/src/core/{lib/transport → call}/metadata.cc +2 -2
- data/src/core/{lib/transport → call}/metadata.h +4 -4
- data/src/core/{lib/transport → call}/metadata_batch.cc +1 -1
- data/src/core/{lib/transport → call}/metadata_batch.h +7 -7
- data/src/core/{lib/transport → call}/metadata_compression_traits.h +3 -3
- data/src/core/{lib/transport → call}/metadata_info.cc +27 -9
- data/src/core/{lib/transport → call}/metadata_info.h +4 -4
- data/src/core/{lib/transport → call}/parsed_metadata.cc +1 -1
- data/src/core/{lib/transport → call}/parsed_metadata.h +3 -3
- data/src/core/call/request_buffer.h +3 -3
- data/src/core/call/security_context.cc +125 -0
- data/src/core/call/security_context.h +114 -0
- data/src/core/{lib/surface → call}/server_call.cc +3 -3
- data/src/core/{lib/surface → call}/server_call.h +5 -5
- data/src/core/{lib/transport → call}/simple_slice_based_metadata.h +4 -4
- data/src/core/{lib/channel → call}/status_util.cc +1 -1
- data/src/core/{lib/channel → call}/status_util.h +3 -3
- data/src/core/client_channel/client_channel.cc +24 -16
- data/src/core/client_channel/client_channel.h +4 -3
- data/src/core/client_channel/client_channel_filter.cc +10 -20
- data/src/core/client_channel/client_channel_filter.h +1 -1
- data/src/core/client_channel/client_channel_internal.h +1 -1
- data/src/core/client_channel/config_selector.h +2 -2
- data/src/core/client_channel/direct_channel.cc +2 -2
- data/src/core/client_channel/dynamic_filters.cc +0 -1
- data/src/core/client_channel/dynamic_filters.h +0 -1
- data/src/core/client_channel/lb_metadata.h +1 -1
- data/src/core/client_channel/load_balanced_call_destination.cc +1 -1
- data/src/core/client_channel/load_balanced_call_destination.h +1 -1
- data/src/core/client_channel/retry_filter_legacy_call_data.cc +43 -41
- data/src/core/client_channel/retry_filter_legacy_call_data.h +6 -6
- data/src/core/client_channel/retry_interceptor.h +1 -1
- data/src/core/client_channel/retry_service_config.cc +1 -1
- data/src/core/client_channel/retry_service_config.h +1 -1
- data/src/core/client_channel/retry_throttle.cc +30 -34
- data/src/core/client_channel/retry_throttle.h +10 -2
- data/src/core/client_channel/subchannel.cc +7 -8
- data/src/core/client_channel/subchannel.h +1 -2
- data/src/core/client_channel/subchannel_stream_client.cc +14 -11
- data/src/core/client_channel/subchannel_stream_client.h +2 -2
- data/src/core/config/core_configuration.h +2 -2
- data/src/core/credentials/call/call_credentials.h +157 -0
- data/src/core/{lib/security/credentials → credentials/call}/call_creds_util.cc +4 -4
- data/src/core/{lib/security/credentials → credentials/call}/call_creds_util.h +4 -4
- data/src/core/{lib/security/credentials/composite/composite_credentials.cc → credentials/call/composite/composite_call_credentials.cc} +4 -57
- data/src/core/credentials/call/composite/composite_call_credentials.h +82 -0
- data/src/core/{lib/security/credentials → credentials/call}/external/aws_external_account_credentials.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/call}/external/aws_external_account_credentials.h +5 -5
- data/src/core/{lib/security/credentials → credentials/call}/external/aws_request_signer.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/call}/external/aws_request_signer.h +3 -3
- data/src/core/{lib/security/credentials → credentials/call}/external/external_account_credentials.cc +6 -6
- data/src/core/{lib/security/credentials → credentials/call}/external/external_account_credentials.h +5 -5
- data/src/core/{lib/security/credentials → credentials/call}/external/file_external_account_credentials.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/call}/external/file_external_account_credentials.h +4 -4
- data/src/core/{lib/security/credentials → credentials/call}/external/url_external_account_credentials.cc +3 -2
- data/src/core/{lib/security/credentials → credentials/call}/external/url_external_account_credentials.h +4 -4
- data/src/core/{lib/security/credentials → credentials/call}/gcp_service_account_identity/gcp_service_account_identity_credentials.cc +3 -2
- data/src/core/{lib/security/credentials → credentials/call}/gcp_service_account_identity/gcp_service_account_identity_credentials.h +6 -6
- data/src/core/{lib/security/credentials → credentials/call}/iam/iam_credentials.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/call}/iam/iam_credentials.h +4 -4
- data/src/core/{lib/security/util → credentials/call}/json_util.cc +1 -1
- data/src/core/{lib/security/util → credentials/call}/json_util.h +3 -3
- data/src/core/{lib/security/credentials → credentials/call}/jwt/json_token.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/call}/jwt/json_token.h +3 -3
- data/src/core/{lib/security/credentials → credentials/call}/jwt/jwt_credentials.cc +3 -3
- data/src/core/{lib/security/credentials → credentials/call}/jwt/jwt_credentials.h +5 -5
- data/src/core/{lib/security/credentials → credentials/call}/jwt/jwt_verifier.cc +3 -2
- data/src/core/{lib/security/credentials → credentials/call}/jwt/jwt_verifier.h +3 -3
- data/src/core/{lib/security/credentials → credentials/call}/oauth2/oauth2_credentials.cc +4 -3
- data/src/core/{lib/security/credentials → credentials/call}/oauth2/oauth2_credentials.h +5 -5
- data/src/core/{lib/security/credentials → credentials/call}/plugin/plugin_credentials.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/call}/plugin/plugin_credentials.h +5 -5
- data/src/core/{lib/security/credentials → credentials/call}/token_fetcher/token_fetcher_credentials.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/call}/token_fetcher/token_fetcher_credentials.h +5 -5
- data/src/core/{lib/security/credentials → credentials/transport}/alts/alts_credentials.cc +4 -4
- data/src/core/{lib/security/credentials → credentials/transport}/alts/alts_credentials.h +5 -5
- data/src/core/{lib/security/security_connector → credentials/transport}/alts/alts_security_connector.cc +4 -4
- data/src/core/{lib/security/security_connector → credentials/transport}/alts/alts_security_connector.h +4 -4
- data/src/core/{lib/security/credentials → credentials/transport}/alts/check_gcp_environment.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/alts/check_gcp_environment.h +3 -3
- data/src/core/{lib/security/credentials → credentials/transport}/alts/check_gcp_environment_linux.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/alts/check_gcp_environment_no_op.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/alts/check_gcp_environment_windows.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/alts/grpc_alts_credentials_client_options.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/alts/grpc_alts_credentials_options.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/alts/grpc_alts_credentials_options.h +3 -3
- data/src/core/{lib/security/credentials → credentials/transport}/alts/grpc_alts_credentials_server_options.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/channel_creds_registry.h +4 -4
- data/src/core/{lib/security/credentials → credentials/transport}/channel_creds_registry_init.cc +21 -17
- data/src/core/credentials/transport/composite/composite_channel_credentials.cc +68 -0
- data/src/core/{lib/security/credentials/composite/composite_credentials.h → credentials/transport/composite/composite_channel_credentials.h} +6 -51
- data/src/core/{lib/security/credentials → credentials/transport}/fake/fake_credentials.cc +4 -26
- data/src/core/{lib/security/credentials → credentials/transport}/fake/fake_credentials.h +5 -37
- data/src/core/{lib/security/security_connector → credentials/transport}/fake/fake_security_connector.cc +4 -4
- data/src/core/{lib/security/security_connector → credentials/transport}/fake/fake_security_connector.h +4 -4
- data/src/core/{lib/security/credentials → credentials/transport}/google_default/credentials_generic.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/transport}/google_default/google_default_credentials.cc +31 -19
- data/src/core/{lib/security/credentials → credentials/transport}/google_default/google_default_credentials.h +5 -5
- data/src/core/{lib/security/credentials → credentials/transport}/insecure/insecure_credentials.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/transport}/insecure/insecure_credentials.h +5 -5
- data/src/core/{lib/security/security_connector → credentials/transport}/insecure/insecure_security_connector.cc +2 -2
- data/src/core/{lib/security/security_connector → credentials/transport}/insecure/insecure_security_connector.h +5 -5
- data/src/core/{lib/security/credentials → credentials/transport}/local/local_credentials.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/transport}/local/local_credentials.h +5 -5
- data/src/core/{lib/security/security_connector → credentials/transport}/local/local_security_connector.cc +4 -4
- data/src/core/{lib/security/security_connector → credentials/transport}/local/local_security_connector.h +4 -4
- data/src/core/{lib/security/security_connector → credentials/transport}/security_connector.cc +2 -2
- data/src/core/{lib/security/security_connector → credentials/transport}/security_connector.h +3 -3
- data/src/core/{lib/security/credentials → credentials/transport}/ssl/ssl_credentials.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/transport}/ssl/ssl_credentials.h +6 -6
- data/src/core/{lib/security/security_connector → credentials/transport}/ssl/ssl_security_connector.cc +5 -5
- data/src/core/{lib/security/security_connector → credentials/transport}/ssl/ssl_security_connector.h +4 -4
- data/src/core/{lib/security/certificate_provider → credentials/transport/tls}/certificate_provider_factory.h +3 -3
- data/src/core/{lib/security/certificate_provider → credentials/transport/tls}/certificate_provider_registry.cc +1 -1
- data/src/core/{lib/security/certificate_provider → credentials/transport/tls}/certificate_provider_registry.h +4 -4
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_distributor.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_distributor.h +4 -4
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_match.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_provider.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_provider.h +5 -5
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_verifier.cc +2 -2
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_verifier.h +3 -3
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_credentials_options.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_credentials_options.h +7 -7
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_crl_provider.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_crl_provider.h +3 -3
- data/src/core/{lib/security/security_connector → credentials/transport/tls}/load_system_roots.h +3 -3
- data/src/core/{lib/security/security_connector → credentials/transport/tls}/load_system_roots_fallback.cc +1 -1
- data/src/core/{lib/security/security_connector → credentials/transport/tls}/load_system_roots_supported.cc +2 -2
- data/src/core/{lib/security/security_connector → credentials/transport/tls}/load_system_roots_supported.h +3 -3
- data/src/core/{lib/security/security_connector → credentials/transport/tls}/load_system_roots_windows.cc +1 -1
- data/src/core/{lib/security/security_connector → credentials/transport/tls}/ssl_utils.cc +3 -3
- data/src/core/{lib/security/security_connector → credentials/transport/tls}/ssl_utils.h +4 -4
- data/src/core/{lib/security/credentials → credentials/transport}/tls/tls_credentials.cc +4 -4
- data/src/core/{lib/security/credentials → credentials/transport}/tls/tls_credentials.h +5 -5
- data/src/core/{lib/security/security_connector → credentials/transport}/tls/tls_security_connector.cc +6 -6
- data/src/core/{lib/security/security_connector → credentials/transport}/tls/tls_security_connector.h +6 -6
- data/src/core/{lib/security/credentials → credentials/transport}/tls/tls_utils.cc +1 -1
- data/src/core/{lib/security/credentials → credentials/transport}/tls/tls_utils.h +3 -3
- data/src/core/{lib/security/credentials/credentials.cc → credentials/transport/transport_credentials.cc} +1 -3
- data/src/core/{lib/security/credentials/credentials.h → credentials/transport/transport_credentials.h} +5 -121
- data/src/core/{lib/security/credentials → credentials/transport}/xds/xds_credentials.cc +5 -5
- data/src/core/{lib/security/credentials → credentials/transport}/xds/xds_credentials.h +6 -6
- data/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +1 -1
- data/src/core/ext/filters/channel_idle/legacy_channel_idle_filter.cc +8 -5
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +2 -2
- data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.cc +1 -1
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.cc +2 -2
- data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.h +1 -1
- data/src/core/ext/filters/http/client/http_client_filter.h +1 -1
- data/src/core/ext/filters/http/client_authority_filter.cc +2 -2
- data/src/core/ext/filters/http/message_compress/compression_filter.cc +1 -1
- data/src/core/ext/filters/http/message_compress/compression_filter.h +1 -1
- 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 -1
- data/src/core/ext/filters/rbac/rbac_filter.cc +2 -2
- data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +1 -1
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +3 -3
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +8 -5
- data/src/core/ext/transport/chttp2/server/chttp2_server.h +5 -1
- data/src/core/ext/transport/chttp2/transport/call_tracer_wrapper.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/call_tracer_wrapper.h +1 -3
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +58 -57
- data/src/core/ext/transport/chttp2/transport/context_list_entry.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame.cc +89 -68
- data/src/core/ext/transport/chttp2/transport/frame.h +37 -1
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +6 -3
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +4 -2
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +2 -2
- data/src/core/ext/transport/chttp2/transport/hpack_parse_result.h +1 -1
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +1 -1
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +2 -2
- data/src/core/ext/transport/chttp2/transport/http2_settings.cc +10 -8
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +2 -2
- data/src/core/ext/transport/chttp2/transport/http2_status.h +52 -0
- data/src/core/ext/transport/chttp2/transport/internal.h +11 -14
- data/src/core/ext/transport/chttp2/transport/parsing.cc +36 -23
- data/src/core/ext/transport/chttp2/transport/writing.cc +15 -14
- data/src/core/ext/transport/inproc/inproc_transport.cc +1 -1
- data/src/core/ext/transport/inproc/legacy_inproc_transport.cc +1 -1
- data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb.h +65 -65
- data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb_minitable.c +28 -28
- data/src/core/ext/upb-gen/envoy/admin/v3/config_dump_shared.upb.h +14 -14
- data/src/core/ext/upb-gen/envoy/admin/v3/config_dump_shared.upb_minitable.c +6 -6
- data/src/core/ext/upb-gen/envoy/admin/v3/metrics.upb.h +6 -6
- data/src/core/ext/upb-gen/envoy/admin/v3/metrics.upb_minitable.c +4 -4
- data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb.h +133 -133
- data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb_minitable.c +71 -71
- data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb.h +26 -26
- data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb_minitable.c +7 -7
- data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb.h +216 -218
- data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb_minitable.c +66 -66
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb.h +27 -27
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb_minitable.c +9 -9
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb.h +326 -328
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.c +103 -103
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb.h +58 -58
- data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb_minitable.c +14 -14
- data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb.h +22 -24
- data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb.h +29 -29
- data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb_minitable.c +16 -16
- data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb.h +186 -192
- data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb_minitable.c +54 -54
- data/src/core/ext/upb-gen/envoy/config/core/v3/config_source.upb.h +54 -54
- data/src/core/ext/upb-gen/envoy/config/core/v3/config_source.upb_minitable.c +21 -21
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb.h +59 -61
- data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb_minitable.c +15 -15
- data/src/core/ext/upb-gen/envoy/config/core/v3/health_check.upb.h +100 -100
- data/src/core/ext/upb-gen/envoy/config/core/v3/health_check.upb_minitable.c +34 -34
- data/src/core/ext/upb-gen/envoy/config/core/v3/http_uri.upb.h +12 -12
- data/src/core/ext/upb-gen/envoy/config/core/v3/http_uri.upb_minitable.c +5 -5
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb.h +118 -118
- data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.c +39 -39
- data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb.h +19 -19
- data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb_minitable.c +9 -9
- data/src/core/ext/upb-gen/envoy/config/core/v3/substitution_format_string.upb.h +27 -27
- data/src/core/ext/upb-gen/envoy/config/core/v3/substitution_format_string.upb_minitable.c +10 -10
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint.upb.h +12 -14
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint.upb_minitable.c +2 -2
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb.h +41 -41
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.c +16 -16
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/load_report.upb.h +24 -24
- data/src/core/ext/upb-gen/envoy/config/endpoint/v3/load_report.upb_minitable.c +9 -9
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb.h +139 -139
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.c +46 -46
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener_components.upb.h +61 -61
- data/src/core/ext/upb-gen/envoy/config/listener/v3/listener_components.upb_minitable.c +20 -20
- data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb.h +3 -3
- data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb_minitable.c +1 -1
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb.h +6 -6
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb_minitable.c +4 -4
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb.h +33 -33
- data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb_minitable.c +14 -14
- data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb.h +12 -14
- data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb_minitable.c +2 -2
- data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb.h +52 -54
- data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb_minitable.c +10 -10
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb.h +620 -626
- data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.c +215 -215
- data/src/core/ext/upb-gen/envoy/config/route/v3/scoped_route.upb.h +13 -13
- data/src/core/ext/upb-gen/envoy/config/route/v3/scoped_route.upb_minitable.c +4 -4
- data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb.h +3 -3
- data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb_minitable.c +2 -2
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb.h +7 -7
- data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/envoy/config/trace/v3/skywalking.upb.h +15 -15
- data/src/core/ext/upb-gen/envoy/config/trace/v3/skywalking.upb_minitable.c +7 -7
- data/src/core/ext/upb-gen/envoy/config/trace/v3/xray.upb.h +7 -7
- data/src/core/ext/upb-gen/envoy/config/trace/v3/xray.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb.h +16 -16
- data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb_minitable.c +10 -10
- data/src/core/ext/upb-gen/envoy/data/accesslog/v3/accesslog.upb.h +306 -312
- data/src/core/ext/upb-gen/envoy/data/accesslog/v3/accesslog.upb_minitable.c +96 -96
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb.h +61 -61
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.c +27 -27
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h +19 -19
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c +6 -6
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +25 -25
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c +9 -9
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb.h +34 -34
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb_minitable.c +9 -9
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h +3 -3
- data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.c +2 -2
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +294 -294
- data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.c +105 -105
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +3 -3
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.c +1 -1
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h +23 -23
- data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb_minitable.c +8 -8
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb.h +84 -84
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb_minitable.c +28 -28
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +87 -87
- data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls.upb_minitable.c +31 -31
- data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb.h +24 -24
- data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb_minitable.c +5 -5
- data/src/core/ext/upb-gen/envoy/service/discovery/v3/discovery.upb.h +130 -132
- data/src/core/ext/upb-gen/envoy/service/discovery/v3/discovery.upb_minitable.c +43 -43
- data/src/core/ext/upb-gen/envoy/service/load_stats/v3/lrs.upb.h +6 -6
- data/src/core/ext/upb-gen/envoy/service/load_stats/v3/lrs.upb_minitable.c +2 -2
- data/src/core/ext/upb-gen/envoy/service/status/v3/csds.upb.h +60 -60
- data/src/core/ext/upb-gen/envoy/service/status/v3/csds.upb_minitable.c +26 -26
- data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb.h +7 -7
- data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/metadata.upb.h +6 -6
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/metadata.upb_minitable.c +2 -2
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/regex.upb.h +7 -7
- data/src/core/ext/upb-gen/envoy/type/matcher/v3/regex.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb.h +11 -11
- data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb_minitable.c +4 -4
- data/src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.upb.h +85 -89
- data/src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.upb_minitable.c +20 -20
- data/src/core/ext/upb-gen/google/api/expr/v1alpha1/syntax.upb.h +80 -83
- data/src/core/ext/upb-gen/google/api/expr/v1alpha1/syntax.upb_minitable.c +27 -27
- data/src/core/ext/upb-gen/google/api/http.upb.h +51 -51
- data/src/core/ext/upb-gen/google/api/http.upb_minitable.c +22 -22
- data/src/core/ext/upb-gen/google/protobuf/descriptor.upb.h +327 -301
- data/src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.c +97 -85
- data/src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.h +1 -0
- data/src/core/ext/upb-gen/google/protobuf/struct.upb.h +9 -11
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/altscontext.upb.h +9 -10
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb.h +110 -113
- data/src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb_minitable.c +25 -25
- data/src/core/ext/upb-gen/src/proto/grpc/lb/v1/load_balancer.upb.h +6 -6
- data/src/core/ext/upb-gen/src/proto/grpc/lb/v1/load_balancer.upb_minitable.c +4 -4
- data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls.upb.h +21 -22
- data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls_config.upb.h +70 -72
- data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls_config.upb_minitable.c +17 -17
- data/src/core/ext/upb-gen/validate/validate.upb.h +368 -368
- data/src/core/ext/upb-gen/validate/validate.upb_minitable.c +117 -117
- data/src/core/ext/upb-gen/xds/core/v3/context_params.upb.h +9 -10
- data/src/core/ext/upb-gen/xds/core/v3/resource.upb.h +7 -7
- data/src/core/ext/upb-gen/xds/core/v3/resource.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/xds/core/v3/resource_locator.upb.h +12 -12
- data/src/core/ext/upb-gen/xds/core/v3/resource_locator.upb_minitable.c +2 -2
- data/src/core/ext/upb-gen/xds/data/orca/v3/orca_load_report.upb.h +27 -30
- data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb.h +7 -7
- data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb_minitable.c +3 -3
- data/src/core/ext/upb-gen/xds/type/matcher/v3/ip.upb.h +3 -3
- data/src/core/ext/upb-gen/xds/type/matcher/v3/ip.upb_minitable.c +1 -1
- data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb.h +22 -24
- data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb_minitable.c +3 -3
- data/src/core/ext/upbdefs-gen/google/protobuf/descriptor.upbdefs.c +98 -87
- data/src/core/{lib/security/transport → filter/auth}/auth_filters.h +8 -7
- data/src/core/{lib/security/transport → filter/auth}/client_auth_filter.cc +7 -6
- data/src/core/{lib/security/transport → filter/auth}/server_auth_filter.cc +5 -4
- data/src/core/handshaker/handshaker.cc +0 -8
- data/src/core/handshaker/security/security_handshaker.cc +1 -1
- data/src/core/handshaker/security/security_handshaker.h +1 -1
- data/src/core/lib/channel/channel_args.h +49 -30
- data/src/core/lib/channel/channel_stack.h +1 -2
- data/src/core/lib/channel/channel_stack_builder_impl.cc +1 -1
- data/src/core/lib/channel/connected_channel.cc +2 -2
- data/src/core/lib/channel/promise_based_filter.h +3 -3
- data/src/core/lib/debug/trace_flags.cc +2 -4
- data/src/core/lib/debug/trace_flags.h +1 -2
- data/src/core/lib/event_engine/default_event_engine_factory.cc +6 -6
- data/src/core/lib/event_engine/default_event_engine_factory.h +1 -1
- data/src/core/lib/event_engine/extensions/iomgr_compatible.h +39 -0
- data/src/core/lib/event_engine/extensions/supports_win_sockets.h +48 -0
- data/src/core/lib/event_engine/extensions/tcp_trace.h +1 -1
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +0 -2
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +1 -3
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +26 -0
- data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.h +4 -0
- data/src/core/lib/event_engine/posix_engine/set_socket_dualstack.cc +64 -0
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +0 -11
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.cc +10 -2
- data/src/core/lib/event_engine/shim.cc +9 -16
- data/src/core/lib/event_engine/shim.h +11 -0
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +15 -7
- data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h +2 -1
- data/src/core/lib/event_engine/windows/win_socket.cc +11 -0
- data/src/core/lib/event_engine/windows/win_socket.h +3 -0
- data/src/core/lib/event_engine/windows/windows_endpoint.cc +5 -10
- data/src/core/lib/event_engine/windows/windows_engine.cc +42 -0
- data/src/core/lib/event_engine/windows/windows_engine.h +8 -2
- data/src/core/lib/event_engine/windows/windows_listener.cc +5 -6
- data/src/core/lib/event_engine/windows/windows_listener.h +9 -4
- data/src/core/lib/experiments/experiments.cc +174 -21
- data/src/core/lib/experiments/experiments.h +70 -13
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +43 -16
- data/src/core/lib/iomgr/endpoint_pair_windows.cc +43 -8
- data/src/core/lib/iomgr/error.cc +27 -43
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +13 -1
- data/src/core/lib/iomgr/ev_poll_posix.cc +13 -0
- data/src/core/lib/iomgr/polling_entity.cc +2 -7
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +1 -0
- data/src/core/lib/iomgr/socket_utils_posix.cc +22 -11
- data/src/core/lib/iomgr/socket_utils_posix.h +12 -2
- data/src/core/lib/iomgr/tcp_client_cfstream.cc +8 -9
- data/src/core/lib/iomgr/tcp_client_posix.cc +11 -15
- data/src/core/lib/iomgr/tcp_client_posix.h +1 -1
- data/src/core/lib/iomgr/tcp_posix.cc +58 -31
- data/src/core/lib/iomgr/tcp_posix.h +10 -2
- data/src/core/lib/iomgr/tcp_server_posix.cc +9 -1
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +1 -4
- data/src/core/lib/iomgr/tcp_server_windows.cc +27 -16
- data/src/core/lib/iomgr/wakeup_fd_pipe.cc +10 -2
- data/src/core/lib/promise/all_ok.h +31 -0
- data/src/core/lib/promise/loop.h +8 -5
- data/src/core/lib/promise/map.h +65 -2
- data/src/core/lib/promise/party.h +5 -1
- data/src/core/lib/promise/poll.h +22 -20
- data/src/core/lib/promise/promise.h +2 -2
- data/src/core/lib/promise/status_flag.h +23 -11
- data/src/core/lib/security/authorization/evaluate_args.cc +1 -1
- data/src/core/lib/security/authorization/evaluate_args.h +1 -1
- data/src/core/lib/security/authorization/grpc_server_authz_filter.cc +1 -1
- data/src/core/lib/security/authorization/grpc_server_authz_filter.h +1 -1
- data/src/core/lib/slice/slice.h +6 -0
- data/src/core/lib/surface/call.cc +20 -18
- data/src/core/lib/surface/call_utils.cc +3 -3
- data/src/core/lib/surface/call_utils.h +3 -3
- data/src/core/lib/surface/channel.h +2 -2
- data/src/core/lib/surface/channel_init.h +2 -2
- data/src/core/lib/surface/completion_queue.cc +77 -17
- data/src/core/lib/surface/filter_stack_call.cc +40 -27
- data/src/core/lib/surface/filter_stack_call.h +1 -1
- data/src/core/lib/surface/init.cc +2 -3
- data/src/core/lib/surface/lame_client.cc +1 -1
- data/src/core/lib/surface/legacy_channel.cc +27 -23
- data/src/core/lib/surface/legacy_channel.h +1 -1
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/error_utils.cc +65 -11
- data/src/core/lib/transport/error_utils.h +2 -2
- data/src/core/lib/transport/status_conversion.cc +16 -14
- data/src/core/lib/transport/status_conversion.h +5 -4
- data/src/core/lib/transport/transport.h +5 -5
- data/src/core/lib/transport/transport_op_string.cc +1 -1
- data/src/core/load_balancing/delegating_helper.h +1 -1
- data/src/core/load_balancing/grpclb/client_load_reporting_filter.cc +1 -1
- data/src/core/load_balancing/grpclb/grpclb.cc +1 -2
- data/src/core/load_balancing/pick_first/pick_first.cc +0 -955
- data/src/core/load_balancing/rls/rls.cc +31 -37
- data/src/core/load_balancing/weighted_target/weighted_target.cc +1 -1
- data/src/core/load_balancing/xds/cds.cc +3 -10
- data/src/core/load_balancing/xds/xds_cluster_impl.cc +1 -1
- data/src/core/plugin_registry/grpc_plugin_registry.cc +2 -0
- data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +0 -2
- data/src/core/resolver/dns/c_ares/dns_resolver_ares.cc +1 -3
- data/src/core/resolver/dns/c_ares/grpc_ares_wrapper.h +4 -0
- data/src/core/resolver/google_c2p/google_c2p_resolver.cc +1 -1
- data/src/core/resolver/xds/xds_dependency_manager.cc +8 -3
- data/src/core/resolver/xds/xds_resolver.cc +2 -2
- data/src/core/server/server.cc +7 -4
- data/src/core/server/server.h +1 -1
- data/src/core/server/server_call_tracer_filter.cc +1 -1
- data/src/core/server/server_config_selector.h +1 -1
- data/src/core/server/server_config_selector_filter.cc +1 -1
- data/src/core/server/xds_server_config_fetcher.cc +5 -5
- data/src/core/service_config/service_config_channel_arg_filter.cc +1 -1
- data/src/core/telemetry/call_tracer.cc +2 -4
- data/src/core/telemetry/call_tracer.h +3 -3
- data/src/core/telemetry/metrics.cc +30 -12
- data/src/core/telemetry/metrics.h +15 -3
- data/src/core/telemetry/stats_data.cc +75 -2
- data/src/core/telemetry/stats_data.h +46 -4
- data/src/core/telemetry/tcp_tracer.h +90 -84
- data/src/core/{lib/security/context/security_context.cc → transport/auth_context.cc} +1 -96
- data/src/core/{lib/security/context/security_context.h → transport/auth_context.h} +6 -76
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +1 -1
- data/src/core/tsi/ssl_transport_security.cc +1 -1
- data/src/core/util/check_class_size.h +48 -0
- data/src/core/util/gcp_metadata_query.cc +1 -1
- data/src/core/util/http_client/httpcli.cc +3 -3
- data/src/core/util/http_client/httpcli_security_connector.cc +3 -3
- data/src/core/util/load_file.cc +26 -14
- data/src/core/util/status_helper.cc +86 -63
- data/src/core/util/status_helper.h +9 -26
- data/src/core/xds/grpc/certificate_provider_store.cc +1 -1
- data/src/core/xds/grpc/certificate_provider_store.h +3 -3
- data/src/core/xds/grpc/file_watcher_certificate_provider_factory.cc +3 -3
- data/src/core/xds/grpc/file_watcher_certificate_provider_factory.h +1 -1
- data/src/core/xds/grpc/xds_bootstrap_grpc.cc +10 -7
- data/src/core/xds/grpc/xds_certificate_provider.cc +1 -1
- data/src/core/xds/grpc/xds_certificate_provider.h +2 -2
- data/src/core/xds/grpc/xds_client_grpc.cc +7 -6
- data/src/core/xds/grpc/xds_client_grpc.h +4 -2
- data/src/core/xds/grpc/xds_cluster.h +3 -3
- data/src/core/xds/grpc/xds_cluster_parser.cc +3 -2
- data/src/core/xds/grpc/xds_http_fault_filter.cc +1 -1
- data/src/core/xds/grpc/xds_http_filter.h +1 -1
- data/src/core/xds/grpc/xds_http_filter_registry.h +1 -1
- data/src/core/xds/grpc/xds_route_config.h +1 -1
- data/src/core/xds/grpc/xds_route_config_parser.cc +1 -1
- data/src/core/xds/grpc/xds_route_config_parser.h +1 -1
- data/src/core/xds/grpc/xds_routing.h +1 -1
- data/src/core/xds/grpc/xds_server_grpc.cc +60 -48
- data/src/core/xds/grpc/xds_server_grpc.h +23 -13
- data/src/core/xds/grpc/xds_server_grpc_interface.h +2 -2
- data/src/core/xds/grpc/xds_transport_grpc.cc +5 -5
- data/src/core/xds/grpc/xds_transport_grpc.h +5 -3
- data/src/core/xds/xds_client/lrs_client.cc +6 -5
- data/src/core/xds/xds_client/lrs_client.h +7 -7
- data/src/core/xds/xds_client/xds_bootstrap.h +16 -1
- data/src/core/xds/xds_client/xds_client.cc +25 -23
- data/src/core/xds/xds_client/xds_client.h +3 -1
- data/src/core/xds/xds_client/xds_resource_type.h +1 -2
- data/src/core/xds/xds_client/xds_transport.h +1 -1
- data/src/ruby/ext/grpc/extconf.rb +1 -1
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_apple.cc +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_fuchsia.cc +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_linux.cc +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_openbsd.cc +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_sysreg.cc +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_win.cc +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_freebsd.cc +0 -1
- data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_linux.cc +0 -1
- data/third_party/boringssl-with-bazel/src/crypto/crypto.cc +0 -2
- data/third_party/boringssl-with-bazel/src/crypto/internal.h +20 -3
- data/third_party/boringssl-with-bazel/src/include/openssl/arm_arch.h +3 -25
- data/third_party/boringssl-with-bazel/src/ssl/extensions.cc +3 -7
- data/third_party/boringssl-with-bazel/src/ssl/handshake_client.cc +1 -1
- data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +1 -1
- data/third_party/boringssl-with-bazel/src/ssl/internal.h +13 -6
- data/third_party/boringssl-with-bazel/src/ssl/ssl_credential.cc +2 -1
- data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +1 -1
- data/third_party/boringssl-with-bazel/src/ssl/tls13_server.cc +1 -1
- data/third_party/upb/upb/base/internal/log2.h +3 -1
- data/third_party/upb/upb/base/string_view.h +10 -0
- data/third_party/upb/upb/hash/common.c +5 -1
- data/third_party/upb/upb/json/decode.c +2 -2
- data/third_party/upb/upb/json/decode.h +0 -1
- data/third_party/upb/upb/mem/alloc.h +5 -0
- data/third_party/upb/upb/mem/arena.c +296 -142
- data/third_party/upb/upb/mem/arena.h +47 -11
- data/third_party/upb/upb/mem/arena.hpp +4 -20
- data/third_party/upb/upb/mem/internal/arena.h +4 -6
- data/third_party/upb/upb/message/accessors.h +41 -0
- data/third_party/upb/upb/message/compat.c +11 -14
- data/third_party/upb/upb/message/compat.h +4 -3
- data/third_party/upb/upb/message/copy.c +35 -30
- data/third_party/upb/upb/message/internal/accessors.h +139 -10
- data/third_party/upb/upb/message/internal/extension.c +28 -25
- data/third_party/upb/upb/message/internal/extension.h +21 -5
- data/third_party/upb/upb/message/internal/iterator.c +58 -0
- data/third_party/upb/upb/message/internal/iterator.h +29 -0
- data/third_party/upb/upb/message/internal/map.h +2 -3
- data/third_party/upb/upb/message/internal/map_sorter.h +3 -2
- data/third_party/upb/upb/message/internal/message.c +48 -29
- data/third_party/upb/upb/message/internal/message.h +154 -24
- data/third_party/upb/upb/message/map_sorter.c +20 -8
- data/third_party/upb/upb/message/message.c +90 -38
- data/third_party/upb/upb/message/message.h +58 -2
- data/third_party/upb/upb/message/value.h +9 -0
- data/third_party/upb/upb/mini_descriptor/build_enum.c +1 -1
- data/third_party/upb/upb/mini_descriptor/decode.c +97 -136
- data/third_party/upb/upb/mini_descriptor/decode.h +4 -3
- data/third_party/upb/upb/mini_descriptor/internal/encode.hpp +1 -1
- data/third_party/upb/upb/mini_table/extension_registry.c +24 -12
- data/third_party/upb/upb/mini_table/extension_registry.h +13 -6
- data/third_party/upb/upb/mini_table/message.c +21 -13
- data/third_party/upb/upb/port/atomic.h +134 -7
- data/third_party/upb/upb/port/def.inc +140 -38
- data/third_party/upb/upb/port/undef.inc +11 -1
- data/third_party/upb/upb/reflection/def.hpp +5 -1
- data/third_party/upb/upb/reflection/def_pool.c +10 -3
- data/third_party/upb/upb/reflection/descriptor_bootstrap.h +1 -1
- data/third_party/upb/upb/reflection/file_def.c +12 -5
- data/third_party/upb/upb/reflection/internal/def_builder.c +1 -1
- data/third_party/upb/upb/reflection/internal/upb_edition_defaults.h +1 -1
- data/third_party/upb/upb/reflection/message.c +19 -16
- data/third_party/upb/upb/reflection/message.h +3 -1
- data/third_party/upb/upb/text/encode.c +1 -13
- data/third_party/upb/upb/text/internal/encode.c +25 -6
- data/third_party/upb/upb/text/internal/encode.h +4 -0
- data/third_party/upb/upb/wire/decode.c +60 -45
- data/third_party/upb/upb/wire/decode.h +4 -2
- data/third_party/upb/upb/wire/encode.c +77 -42
- data/third_party/upb/upb/wire/encode.h +2 -0
- data/third_party/upb/upb/wire/eps_copy_input_stream.h +18 -20
- data/third_party/upb/upb/wire/internal/decoder.h +4 -11
- data/third_party/utf8_range/utf8_range.c +15 -275
- data/third_party/utf8_range/utf8_range_neon.inc +117 -0
- data/third_party/utf8_range/utf8_range_sse.inc +272 -0
- data/third_party/zlib/deflate.c +40 -15
- data/third_party/zlib/deflate.h +33 -2
- data/third_party/zlib/gzguts.h +2 -6
- data/third_party/zlib/inflate.c +1 -1
- data/third_party/zlib/inftrees.c +3 -3
- data/third_party/zlib/inftrees.h +2 -2
- data/third_party/zlib/trees.c +18 -4
- data/third_party/zlib/zconf.h +1 -9
- data/third_party/zlib/zlib.h +12 -12
- data/third_party/zlib/zutil.h +4 -25
- metadata +155 -145
- data/include/grpc/grpc_cronet.h +0 -37
- data/src/core/lib/transport/http2_errors.h +0 -43
- data/third_party/upb/upb/message/internal/compare_unknown.c +0 -289
- data/third_party/upb/upb/message/internal/compare_unknown.h +0 -49
@@ -1106,958 +1106,6 @@ void PickFirst::SubchannelList::MaybeFinishHappyEyeballsPass() {
|
|
1106
1106
|
}
|
1107
1107
|
}
|
1108
1108
|
|
1109
|
-
// TODO(roth): Remove this when the pick_first_new experiment is removed.
|
1110
|
-
class OldPickFirst final : public LoadBalancingPolicy {
|
1111
|
-
public:
|
1112
|
-
explicit OldPickFirst(Args args);
|
1113
|
-
|
1114
|
-
absl::string_view name() const override { return kPickFirst; }
|
1115
|
-
|
1116
|
-
absl::Status UpdateLocked(UpdateArgs args) override;
|
1117
|
-
void ExitIdleLocked() override;
|
1118
|
-
void ResetBackoffLocked() override;
|
1119
|
-
|
1120
|
-
private:
|
1121
|
-
~OldPickFirst() override;
|
1122
|
-
|
1123
|
-
class SubchannelList final : public InternallyRefCounted<SubchannelList> {
|
1124
|
-
public:
|
1125
|
-
class SubchannelData final {
|
1126
|
-
public:
|
1127
|
-
SubchannelData(SubchannelList* subchannel_list, size_t index,
|
1128
|
-
RefCountedPtr<SubchannelInterface> subchannel);
|
1129
|
-
|
1130
|
-
SubchannelInterface* subchannel() const { return subchannel_.get(); }
|
1131
|
-
std::optional<grpc_connectivity_state> connectivity_state() const {
|
1132
|
-
return connectivity_state_;
|
1133
|
-
}
|
1134
|
-
const absl::Status& connectivity_status() const {
|
1135
|
-
return connectivity_status_;
|
1136
|
-
}
|
1137
|
-
|
1138
|
-
// Resets the connection backoff.
|
1139
|
-
void ResetBackoffLocked() {
|
1140
|
-
if (subchannel_ != nullptr) subchannel_->ResetBackoff();
|
1141
|
-
}
|
1142
|
-
|
1143
|
-
void RequestConnection() { subchannel_->RequestConnection(); }
|
1144
|
-
|
1145
|
-
// Requests a connection attempt to start on this subchannel,
|
1146
|
-
// with appropriate Connection Attempt Delay.
|
1147
|
-
// Used only during the Happy Eyeballs pass.
|
1148
|
-
void RequestConnectionWithTimer();
|
1149
|
-
|
1150
|
-
// Cancels any pending connectivity watch and unrefs the subchannel.
|
1151
|
-
void ShutdownLocked();
|
1152
|
-
|
1153
|
-
bool seen_transient_failure() const { return seen_transient_failure_; }
|
1154
|
-
void set_seen_transient_failure() { seen_transient_failure_ = true; }
|
1155
|
-
|
1156
|
-
private:
|
1157
|
-
// Watcher for subchannel connectivity state.
|
1158
|
-
class Watcher final
|
1159
|
-
: public SubchannelInterface::ConnectivityStateWatcherInterface {
|
1160
|
-
public:
|
1161
|
-
Watcher(RefCountedPtr<SubchannelList> subchannel_list, size_t index)
|
1162
|
-
: subchannel_list_(std::move(subchannel_list)), index_(index) {}
|
1163
|
-
|
1164
|
-
~Watcher() override {
|
1165
|
-
subchannel_list_.reset(DEBUG_LOCATION, "Watcher dtor");
|
1166
|
-
}
|
1167
|
-
|
1168
|
-
void OnConnectivityStateChange(grpc_connectivity_state new_state,
|
1169
|
-
absl::Status status) override {
|
1170
|
-
subchannel_list_->subchannels_[index_].OnConnectivityStateChange(
|
1171
|
-
new_state, std::move(status));
|
1172
|
-
}
|
1173
|
-
|
1174
|
-
grpc_pollset_set* interested_parties() override {
|
1175
|
-
return subchannel_list_->policy_->interested_parties();
|
1176
|
-
}
|
1177
|
-
|
1178
|
-
private:
|
1179
|
-
RefCountedPtr<SubchannelList> subchannel_list_;
|
1180
|
-
const size_t index_;
|
1181
|
-
};
|
1182
|
-
|
1183
|
-
// This method will be invoked once soon after instantiation to report
|
1184
|
-
// the current connectivity state, and it will then be invoked again
|
1185
|
-
// whenever the connectivity state changes.
|
1186
|
-
void OnConnectivityStateChange(grpc_connectivity_state new_state,
|
1187
|
-
absl::Status status);
|
1188
|
-
|
1189
|
-
// Processes the connectivity change to READY for an unselected
|
1190
|
-
// subchannel.
|
1191
|
-
void ProcessUnselectedReadyLocked();
|
1192
|
-
|
1193
|
-
// Backpointer to owning subchannel list. Not owned.
|
1194
|
-
SubchannelList* subchannel_list_;
|
1195
|
-
const size_t index_;
|
1196
|
-
// The subchannel.
|
1197
|
-
RefCountedPtr<SubchannelInterface> subchannel_;
|
1198
|
-
// Will be non-null when the subchannel's state is being watched.
|
1199
|
-
SubchannelInterface::ConnectivityStateWatcherInterface* pending_watcher_ =
|
1200
|
-
nullptr;
|
1201
|
-
// Data updated by the watcher.
|
1202
|
-
std::optional<grpc_connectivity_state> connectivity_state_;
|
1203
|
-
absl::Status connectivity_status_;
|
1204
|
-
bool seen_transient_failure_ = false;
|
1205
|
-
};
|
1206
|
-
|
1207
|
-
SubchannelList(RefCountedPtr<OldPickFirst> policy,
|
1208
|
-
EndpointAddressesIterator* addresses,
|
1209
|
-
const ChannelArgs& args, absl::string_view resolution_note);
|
1210
|
-
|
1211
|
-
~SubchannelList() override;
|
1212
|
-
|
1213
|
-
// The number of subchannels in the list.
|
1214
|
-
size_t size() const { return subchannels_.size(); }
|
1215
|
-
|
1216
|
-
// Resets connection backoff of all subchannels.
|
1217
|
-
void ResetBackoffLocked();
|
1218
|
-
|
1219
|
-
void Orphan() override;
|
1220
|
-
|
1221
|
-
bool IsHappyEyeballsPassComplete() const {
|
1222
|
-
// Checking attempting_index_ here is just an optimization -- if
|
1223
|
-
// we haven't actually tried all subchannels yet, then we don't
|
1224
|
-
// need to iterate.
|
1225
|
-
if (attempting_index_ < size()) return false;
|
1226
|
-
for (const SubchannelData& sd : subchannels_) {
|
1227
|
-
if (!sd.seen_transient_failure()) return false;
|
1228
|
-
}
|
1229
|
-
return true;
|
1230
|
-
}
|
1231
|
-
|
1232
|
-
void ReportTransientFailure(absl::Status status);
|
1233
|
-
|
1234
|
-
private:
|
1235
|
-
// Returns true if all subchannels have seen their initial
|
1236
|
-
// connectivity state notifications.
|
1237
|
-
bool AllSubchannelsSeenInitialState() const {
|
1238
|
-
return num_subchannels_seen_initial_notification_ == size();
|
1239
|
-
}
|
1240
|
-
|
1241
|
-
// Looks through subchannels_ starting from attempting_index_ to
|
1242
|
-
// find the first one not currently in TRANSIENT_FAILURE, then
|
1243
|
-
// triggers a connection attempt for that subchannel. If there are
|
1244
|
-
// no more subchannels not in TRANSIENT_FAILURE, calls
|
1245
|
-
// MaybeFinishHappyEyeballsPass().
|
1246
|
-
void StartConnectingNextSubchannel();
|
1247
|
-
|
1248
|
-
// Checks to see if the initial Happy Eyeballs pass is complete --
|
1249
|
-
// i.e., all subchannels have seen TRANSIENT_FAILURE state at least once.
|
1250
|
-
// If so, transitions to a mode where we try to connect to all subchannels
|
1251
|
-
// in parallel and returns true.
|
1252
|
-
void MaybeFinishHappyEyeballsPass();
|
1253
|
-
|
1254
|
-
// Backpointer to owning policy.
|
1255
|
-
RefCountedPtr<OldPickFirst> policy_;
|
1256
|
-
|
1257
|
-
ChannelArgs args_;
|
1258
|
-
std::string resolution_note_;
|
1259
|
-
|
1260
|
-
// The list of subchannels.
|
1261
|
-
std::vector<SubchannelData> subchannels_;
|
1262
|
-
|
1263
|
-
// Is this list shutting down? This may be true due to the shutdown of the
|
1264
|
-
// policy itself or because a newer update has arrived while this one hadn't
|
1265
|
-
// finished processing.
|
1266
|
-
bool shutting_down_ = false;
|
1267
|
-
|
1268
|
-
size_t num_subchannels_seen_initial_notification_ = 0;
|
1269
|
-
|
1270
|
-
// The index into subchannels_ to which we are currently attempting
|
1271
|
-
// to connect during the initial Happy Eyeballs pass. Once the
|
1272
|
-
// initial pass is over, this will be equal to size().
|
1273
|
-
size_t attempting_index_ = 0;
|
1274
|
-
// Happy Eyeballs timer handle.
|
1275
|
-
std::optional<grpc_event_engine::experimental::EventEngine::TaskHandle>
|
1276
|
-
timer_handle_;
|
1277
|
-
|
1278
|
-
// After the initial Happy Eyeballs pass, the number of failures
|
1279
|
-
// we've seen. Every size() failures, we trigger re-resolution.
|
1280
|
-
size_t num_failures_ = 0;
|
1281
|
-
|
1282
|
-
// The status from the last subchannel that reported TRANSIENT_FAILURE.
|
1283
|
-
absl::Status last_failure_;
|
1284
|
-
};
|
1285
|
-
|
1286
|
-
class HealthWatcher final
|
1287
|
-
: public SubchannelInterface::ConnectivityStateWatcherInterface {
|
1288
|
-
public:
|
1289
|
-
HealthWatcher(RefCountedPtr<OldPickFirst> policy,
|
1290
|
-
absl::string_view resolution_note)
|
1291
|
-
: policy_(std::move(policy)), resolution_note_(resolution_note) {}
|
1292
|
-
|
1293
|
-
~HealthWatcher() override {
|
1294
|
-
policy_.reset(DEBUG_LOCATION, "HealthWatcher dtor");
|
1295
|
-
}
|
1296
|
-
|
1297
|
-
void OnConnectivityStateChange(grpc_connectivity_state new_state,
|
1298
|
-
absl::Status status) override;
|
1299
|
-
|
1300
|
-
grpc_pollset_set* interested_parties() override {
|
1301
|
-
return policy_->interested_parties();
|
1302
|
-
}
|
1303
|
-
|
1304
|
-
private:
|
1305
|
-
RefCountedPtr<OldPickFirst> policy_;
|
1306
|
-
std::string resolution_note_;
|
1307
|
-
};
|
1308
|
-
|
1309
|
-
class Picker final : public SubchannelPicker {
|
1310
|
-
public:
|
1311
|
-
explicit Picker(RefCountedPtr<SubchannelInterface> subchannel)
|
1312
|
-
: subchannel_(std::move(subchannel)) {}
|
1313
|
-
|
1314
|
-
PickResult Pick(PickArgs /*args*/) override {
|
1315
|
-
return PickResult::Complete(subchannel_);
|
1316
|
-
}
|
1317
|
-
|
1318
|
-
private:
|
1319
|
-
RefCountedPtr<SubchannelInterface> subchannel_;
|
1320
|
-
};
|
1321
|
-
|
1322
|
-
void ShutdownLocked() override;
|
1323
|
-
|
1324
|
-
void UpdateState(grpc_connectivity_state state, const absl::Status& status,
|
1325
|
-
RefCountedPtr<SubchannelPicker> picker);
|
1326
|
-
|
1327
|
-
void AttemptToConnectUsingLatestUpdateArgsLocked();
|
1328
|
-
|
1329
|
-
void UnsetSelectedSubchannel();
|
1330
|
-
|
1331
|
-
// When ExitIdleLocked() is called, we create a subchannel_list_ and start
|
1332
|
-
// trying to connect, but we don't actually change state_ until the first
|
1333
|
-
// subchannel reports CONNECTING. So in order to know if we're really
|
1334
|
-
// idle, we need to check both state_ and subchannel_list_.
|
1335
|
-
bool IsIdle() const {
|
1336
|
-
return state_ == GRPC_CHANNEL_IDLE && subchannel_list_ == nullptr;
|
1337
|
-
}
|
1338
|
-
|
1339
|
-
// Whether we should enable health watching.
|
1340
|
-
const bool enable_health_watch_;
|
1341
|
-
// Whether we should omit our status message prefix.
|
1342
|
-
const bool omit_status_message_prefix_;
|
1343
|
-
// Connection Attempt Delay for Happy Eyeballs.
|
1344
|
-
const Duration connection_attempt_delay_;
|
1345
|
-
|
1346
|
-
// Lateset update args.
|
1347
|
-
UpdateArgs latest_update_args_;
|
1348
|
-
// All our subchannels.
|
1349
|
-
OrphanablePtr<SubchannelList> subchannel_list_;
|
1350
|
-
// Latest pending subchannel list.
|
1351
|
-
OrphanablePtr<SubchannelList> latest_pending_subchannel_list_;
|
1352
|
-
// Selected subchannel in subchannel_list_.
|
1353
|
-
SubchannelList::SubchannelData* selected_ = nullptr;
|
1354
|
-
// Health watcher for the selected subchannel.
|
1355
|
-
SubchannelInterface::ConnectivityStateWatcherInterface* health_watcher_ =
|
1356
|
-
nullptr;
|
1357
|
-
SubchannelInterface::DataWatcherInterface* health_data_watcher_ = nullptr;
|
1358
|
-
// Current connectivity state.
|
1359
|
-
grpc_connectivity_state state_ = GRPC_CHANNEL_CONNECTING;
|
1360
|
-
// Are we shut down?
|
1361
|
-
bool shutdown_ = false;
|
1362
|
-
// Random bit generator used for shuffling addresses if configured
|
1363
|
-
absl::BitGen bit_gen_;
|
1364
|
-
};
|
1365
|
-
|
1366
|
-
OldPickFirst::OldPickFirst(Args args)
|
1367
|
-
: LoadBalancingPolicy(std::move(args)),
|
1368
|
-
enable_health_watch_(
|
1369
|
-
channel_args()
|
1370
|
-
.GetBool(GRPC_ARG_INTERNAL_PICK_FIRST_ENABLE_HEALTH_CHECKING)
|
1371
|
-
.value_or(false)),
|
1372
|
-
omit_status_message_prefix_(
|
1373
|
-
channel_args()
|
1374
|
-
.GetBool(GRPC_ARG_INTERNAL_PICK_FIRST_OMIT_STATUS_MESSAGE_PREFIX)
|
1375
|
-
.value_or(false)),
|
1376
|
-
connection_attempt_delay_(Duration::Milliseconds(
|
1377
|
-
Clamp(channel_args()
|
1378
|
-
.GetInt(GRPC_ARG_HAPPY_EYEBALLS_CONNECTION_ATTEMPT_DELAY_MS)
|
1379
|
-
.value_or(250),
|
1380
|
-
100, 2000))) {
|
1381
|
-
GRPC_TRACE_LOG(pick_first, INFO) << "Pick First " << this << " created.";
|
1382
|
-
}
|
1383
|
-
|
1384
|
-
OldPickFirst::~OldPickFirst() {
|
1385
|
-
GRPC_TRACE_LOG(pick_first, INFO) << "Destroying Pick First " << this;
|
1386
|
-
CHECK(subchannel_list_ == nullptr);
|
1387
|
-
CHECK(latest_pending_subchannel_list_ == nullptr);
|
1388
|
-
}
|
1389
|
-
|
1390
|
-
void OldPickFirst::ShutdownLocked() {
|
1391
|
-
GRPC_TRACE_LOG(pick_first, INFO) << "Pick First " << this << " Shutting down";
|
1392
|
-
shutdown_ = true;
|
1393
|
-
UnsetSelectedSubchannel();
|
1394
|
-
subchannel_list_.reset();
|
1395
|
-
latest_pending_subchannel_list_.reset();
|
1396
|
-
}
|
1397
|
-
|
1398
|
-
void OldPickFirst::ExitIdleLocked() {
|
1399
|
-
if (shutdown_) return;
|
1400
|
-
if (IsIdle()) {
|
1401
|
-
GRPC_TRACE_LOG(pick_first, INFO)
|
1402
|
-
<< "Pick First " << this << " exiting idle";
|
1403
|
-
AttemptToConnectUsingLatestUpdateArgsLocked();
|
1404
|
-
}
|
1405
|
-
}
|
1406
|
-
|
1407
|
-
void OldPickFirst::ResetBackoffLocked() {
|
1408
|
-
if (subchannel_list_ != nullptr) subchannel_list_->ResetBackoffLocked();
|
1409
|
-
if (latest_pending_subchannel_list_ != nullptr) {
|
1410
|
-
latest_pending_subchannel_list_->ResetBackoffLocked();
|
1411
|
-
}
|
1412
|
-
}
|
1413
|
-
|
1414
|
-
void OldPickFirst::AttemptToConnectUsingLatestUpdateArgsLocked() {
|
1415
|
-
// Create a subchannel list from latest_update_args_.
|
1416
|
-
EndpointAddressesIterator* addresses = nullptr;
|
1417
|
-
if (latest_update_args_.addresses.ok()) {
|
1418
|
-
addresses = latest_update_args_.addresses->get();
|
1419
|
-
}
|
1420
|
-
// Replace latest_pending_subchannel_list_.
|
1421
|
-
if (GRPC_TRACE_FLAG_ENABLED(pick_first) &&
|
1422
|
-
latest_pending_subchannel_list_ != nullptr) {
|
1423
|
-
LOG(INFO) << "[PF " << this
|
1424
|
-
<< "] Shutting down previous pending subchannel list "
|
1425
|
-
<< latest_pending_subchannel_list_.get();
|
1426
|
-
}
|
1427
|
-
latest_pending_subchannel_list_ = MakeOrphanable<SubchannelList>(
|
1428
|
-
RefAsSubclass<OldPickFirst>(), addresses, latest_update_args_.args,
|
1429
|
-
latest_update_args_.resolution_note);
|
1430
|
-
// Empty update or no valid subchannels. Put the channel in
|
1431
|
-
// TRANSIENT_FAILURE and request re-resolution.
|
1432
|
-
if (latest_pending_subchannel_list_->size() == 0) {
|
1433
|
-
channel_control_helper()->RequestReresolution();
|
1434
|
-
absl::Status status = latest_update_args_.addresses.ok()
|
1435
|
-
? absl::UnavailableError("empty address list")
|
1436
|
-
: latest_update_args_.addresses.status();
|
1437
|
-
latest_pending_subchannel_list_->ReportTransientFailure(std::move(status));
|
1438
|
-
}
|
1439
|
-
// If the new update is empty or we don't yet have a selected subchannel in
|
1440
|
-
// the current list, replace the current subchannel list immediately.
|
1441
|
-
if (latest_pending_subchannel_list_->size() == 0 || selected_ == nullptr) {
|
1442
|
-
UnsetSelectedSubchannel();
|
1443
|
-
if (GRPC_TRACE_FLAG_ENABLED(pick_first) && subchannel_list_ != nullptr) {
|
1444
|
-
LOG(INFO) << "[PF " << this << "] Shutting down previous subchannel list "
|
1445
|
-
<< subchannel_list_.get();
|
1446
|
-
}
|
1447
|
-
subchannel_list_ = std::move(latest_pending_subchannel_list_);
|
1448
|
-
}
|
1449
|
-
}
|
1450
|
-
|
1451
|
-
absl::Status OldPickFirst::UpdateLocked(UpdateArgs args) {
|
1452
|
-
if (GRPC_TRACE_FLAG_ENABLED(pick_first)) {
|
1453
|
-
if (args.addresses.ok()) {
|
1454
|
-
LOG(INFO) << "Pick First " << this << " received update";
|
1455
|
-
} else {
|
1456
|
-
LOG(INFO) << "Pick First " << this
|
1457
|
-
<< " received update with address error: "
|
1458
|
-
<< args.addresses.status();
|
1459
|
-
}
|
1460
|
-
}
|
1461
|
-
// Set return status based on the address list.
|
1462
|
-
absl::Status status;
|
1463
|
-
if (!args.addresses.ok()) {
|
1464
|
-
status = args.addresses.status();
|
1465
|
-
} else {
|
1466
|
-
EndpointAddressesList endpoints;
|
1467
|
-
(*args.addresses)->ForEach([&](const EndpointAddresses& endpoint) {
|
1468
|
-
endpoints.push_back(endpoint);
|
1469
|
-
});
|
1470
|
-
if (endpoints.empty()) {
|
1471
|
-
status = absl::UnavailableError("address list must not be empty");
|
1472
|
-
} else {
|
1473
|
-
// Shuffle the list if needed.
|
1474
|
-
auto config = static_cast<PickFirstConfig*>(args.config.get());
|
1475
|
-
if (config->shuffle_addresses()) {
|
1476
|
-
absl::c_shuffle(endpoints, bit_gen_);
|
1477
|
-
}
|
1478
|
-
// Flatten the list so that we have one address per endpoint.
|
1479
|
-
// While we're iterating, also determine the desired address family
|
1480
|
-
// order and the index of the first element of each family, for use in
|
1481
|
-
// the interleaving below.
|
1482
|
-
std::set<absl::string_view> address_families;
|
1483
|
-
std::vector<AddressFamilyIterator> address_family_order;
|
1484
|
-
EndpointAddressesList flattened_endpoints;
|
1485
|
-
for (const auto& endpoint : endpoints) {
|
1486
|
-
for (const auto& address : endpoint.addresses()) {
|
1487
|
-
flattened_endpoints.emplace_back(address, endpoint.args());
|
1488
|
-
absl::string_view scheme = GetAddressFamily(address);
|
1489
|
-
bool inserted = address_families.insert(scheme).second;
|
1490
|
-
if (inserted) {
|
1491
|
-
address_family_order.emplace_back(scheme,
|
1492
|
-
flattened_endpoints.size() - 1);
|
1493
|
-
}
|
1494
|
-
}
|
1495
|
-
}
|
1496
|
-
endpoints = std::move(flattened_endpoints);
|
1497
|
-
// Interleave addresses as per RFC-8305 section 4.
|
1498
|
-
EndpointAddressesList interleaved_endpoints;
|
1499
|
-
interleaved_endpoints.reserve(endpoints.size());
|
1500
|
-
std::vector<bool> endpoints_moved(endpoints.size());
|
1501
|
-
size_t scheme_index = 0;
|
1502
|
-
for (size_t i = 0; i < endpoints.size(); ++i) {
|
1503
|
-
EndpointAddresses* endpoint;
|
1504
|
-
do {
|
1505
|
-
auto& iterator = address_family_order[scheme_index++ %
|
1506
|
-
address_family_order.size()];
|
1507
|
-
endpoint = iterator.Next(endpoints, &endpoints_moved);
|
1508
|
-
} while (endpoint == nullptr);
|
1509
|
-
interleaved_endpoints.emplace_back(std::move(*endpoint));
|
1510
|
-
}
|
1511
|
-
endpoints = std::move(interleaved_endpoints);
|
1512
|
-
args.addresses =
|
1513
|
-
std::make_shared<EndpointAddressesListIterator>(std::move(endpoints));
|
1514
|
-
}
|
1515
|
-
}
|
1516
|
-
// If the update contains a resolver error and we have a previous update
|
1517
|
-
// that was not a resolver error, keep using the previous addresses.
|
1518
|
-
if (!args.addresses.ok() && latest_update_args_.config != nullptr) {
|
1519
|
-
args.addresses = std::move(latest_update_args_.addresses);
|
1520
|
-
}
|
1521
|
-
// Update latest_update_args_.
|
1522
|
-
latest_update_args_ = std::move(args);
|
1523
|
-
// If we are not in idle, start connection attempt immediately.
|
1524
|
-
// Otherwise, we defer the attempt into ExitIdleLocked().
|
1525
|
-
if (!IsIdle()) {
|
1526
|
-
AttemptToConnectUsingLatestUpdateArgsLocked();
|
1527
|
-
}
|
1528
|
-
return status;
|
1529
|
-
}
|
1530
|
-
|
1531
|
-
void OldPickFirst::UpdateState(grpc_connectivity_state state,
|
1532
|
-
const absl::Status& status,
|
1533
|
-
RefCountedPtr<SubchannelPicker> picker) {
|
1534
|
-
state_ = state;
|
1535
|
-
channel_control_helper()->UpdateState(state, status, std::move(picker));
|
1536
|
-
}
|
1537
|
-
|
1538
|
-
void OldPickFirst::UnsetSelectedSubchannel() {
|
1539
|
-
if (selected_ != nullptr && health_data_watcher_ != nullptr) {
|
1540
|
-
selected_->subchannel()->CancelDataWatcher(health_data_watcher_);
|
1541
|
-
}
|
1542
|
-
selected_ = nullptr;
|
1543
|
-
health_watcher_ = nullptr;
|
1544
|
-
health_data_watcher_ = nullptr;
|
1545
|
-
}
|
1546
|
-
|
1547
|
-
//
|
1548
|
-
// OldPickFirst::HealthWatcher
|
1549
|
-
//
|
1550
|
-
|
1551
|
-
void OldPickFirst::HealthWatcher::OnConnectivityStateChange(
|
1552
|
-
grpc_connectivity_state new_state, absl::Status status) {
|
1553
|
-
if (policy_->health_watcher_ != this) return;
|
1554
|
-
GRPC_TRACE_LOG(pick_first, INFO)
|
1555
|
-
<< "[PF " << policy_.get()
|
1556
|
-
<< "] health watch state update: " << ConnectivityStateName(new_state)
|
1557
|
-
<< " (" << status << ")";
|
1558
|
-
switch (new_state) {
|
1559
|
-
case GRPC_CHANNEL_READY:
|
1560
|
-
policy_->channel_control_helper()->UpdateState(
|
1561
|
-
GRPC_CHANNEL_READY, absl::OkStatus(),
|
1562
|
-
MakeRefCounted<Picker>(policy_->selected_->subchannel()->Ref()));
|
1563
|
-
break;
|
1564
|
-
case GRPC_CHANNEL_IDLE:
|
1565
|
-
// If the subchannel becomes disconnected, the health watcher
|
1566
|
-
// might happen to see the change before the raw connectivity
|
1567
|
-
// state watcher does. In this case, ignore it, since the raw
|
1568
|
-
// connectivity state watcher will handle it shortly.
|
1569
|
-
break;
|
1570
|
-
case GRPC_CHANNEL_CONNECTING:
|
1571
|
-
policy_->channel_control_helper()->UpdateState(
|
1572
|
-
new_state, absl::OkStatus(),
|
1573
|
-
MakeRefCounted<QueuePicker>(policy_->Ref()));
|
1574
|
-
break;
|
1575
|
-
case GRPC_CHANNEL_TRANSIENT_FAILURE: {
|
1576
|
-
std::string message = absl::StrCat("health watch: ", status.message());
|
1577
|
-
if (!resolution_note_.empty()) {
|
1578
|
-
absl::StrAppend(&message, " (", resolution_note_, ")");
|
1579
|
-
}
|
1580
|
-
policy_->channel_control_helper()->UpdateState(
|
1581
|
-
GRPC_CHANNEL_TRANSIENT_FAILURE, status,
|
1582
|
-
MakeRefCounted<TransientFailurePicker>(
|
1583
|
-
absl::UnavailableError(message)));
|
1584
|
-
break;
|
1585
|
-
}
|
1586
|
-
case GRPC_CHANNEL_SHUTDOWN:
|
1587
|
-
Crash("health watcher reported state SHUTDOWN");
|
1588
|
-
}
|
1589
|
-
}
|
1590
|
-
|
1591
|
-
//
|
1592
|
-
// OldPickFirst::SubchannelList::SubchannelData
|
1593
|
-
//
|
1594
|
-
|
1595
|
-
OldPickFirst::SubchannelList::SubchannelData::SubchannelData(
|
1596
|
-
SubchannelList* subchannel_list, size_t index,
|
1597
|
-
RefCountedPtr<SubchannelInterface> subchannel)
|
1598
|
-
: subchannel_list_(subchannel_list),
|
1599
|
-
index_(index),
|
1600
|
-
subchannel_(std::move(subchannel)) {
|
1601
|
-
GRPC_TRACE_LOG(pick_first, INFO)
|
1602
|
-
<< "[PF " << subchannel_list_->policy_.get() << "] subchannel list "
|
1603
|
-
<< subchannel_list_ << " index " << index_ << " (subchannel "
|
1604
|
-
<< subchannel_.get() << "): starting watch";
|
1605
|
-
auto watcher = std::make_unique<Watcher>(
|
1606
|
-
subchannel_list_->Ref(DEBUG_LOCATION, "Watcher"), index_);
|
1607
|
-
pending_watcher_ = watcher.get();
|
1608
|
-
subchannel_->WatchConnectivityState(std::move(watcher));
|
1609
|
-
}
|
1610
|
-
|
1611
|
-
void OldPickFirst::SubchannelList::SubchannelData::ShutdownLocked() {
|
1612
|
-
if (subchannel_ != nullptr) {
|
1613
|
-
GRPC_TRACE_LOG(pick_first, INFO)
|
1614
|
-
<< "[PF " << subchannel_list_->policy_.get() << "] subchannel list "
|
1615
|
-
<< subchannel_list_ << " index " << index_ << " of "
|
1616
|
-
<< subchannel_list_->size() << " (subchannel " << subchannel_.get()
|
1617
|
-
<< "): cancelling watch and unreffing subchannel";
|
1618
|
-
subchannel_->CancelConnectivityStateWatch(pending_watcher_);
|
1619
|
-
pending_watcher_ = nullptr;
|
1620
|
-
subchannel_.reset();
|
1621
|
-
}
|
1622
|
-
}
|
1623
|
-
|
1624
|
-
void OldPickFirst::SubchannelList::SubchannelData::OnConnectivityStateChange(
|
1625
|
-
grpc_connectivity_state new_state, absl::Status status) {
|
1626
|
-
OldPickFirst* p = subchannel_list_->policy_.get();
|
1627
|
-
GRPC_TRACE_LOG(pick_first, INFO)
|
1628
|
-
<< "[PF " << p << "] subchannel list " << subchannel_list_ << " index "
|
1629
|
-
<< index_ << " of " << subchannel_list_->size() << " (subchannel "
|
1630
|
-
<< subchannel_.get() << "): connectivity changed: old_state="
|
1631
|
-
<< (connectivity_state_.has_value()
|
1632
|
-
? ConnectivityStateName(*connectivity_state_)
|
1633
|
-
: "N/A")
|
1634
|
-
<< ", new_state=" << ConnectivityStateName(new_state)
|
1635
|
-
<< ", status=" << status
|
1636
|
-
<< ", shutting_down=" << subchannel_list_->shutting_down_
|
1637
|
-
<< ", pending_watcher=" << pending_watcher_
|
1638
|
-
<< ", seen_transient_failure=" << seen_transient_failure_
|
1639
|
-
<< ", p->selected_=" << p->selected_
|
1640
|
-
<< ", p->subchannel_list_=" << p->subchannel_list_.get()
|
1641
|
-
<< ", p->latest_pending_subchannel_list_="
|
1642
|
-
<< p->latest_pending_subchannel_list_.get();
|
1643
|
-
if (subchannel_list_->shutting_down_ || pending_watcher_ == nullptr) return;
|
1644
|
-
auto& stats_plugins = subchannel_list_->policy_->channel_control_helper()
|
1645
|
-
->GetStatsPluginGroup();
|
1646
|
-
// The notification must be for a subchannel in either the current or
|
1647
|
-
// latest pending subchannel lists.
|
1648
|
-
CHECK(subchannel_list_ == p->subchannel_list_.get() ||
|
1649
|
-
subchannel_list_ == p->latest_pending_subchannel_list_.get());
|
1650
|
-
CHECK(new_state != GRPC_CHANNEL_SHUTDOWN);
|
1651
|
-
std::optional<grpc_connectivity_state> old_state = connectivity_state_;
|
1652
|
-
connectivity_state_ = new_state;
|
1653
|
-
connectivity_status_ = std::move(status);
|
1654
|
-
// Handle updates for the currently selected subchannel.
|
1655
|
-
if (p->selected_ == this) {
|
1656
|
-
CHECK(subchannel_list_ == p->subchannel_list_.get());
|
1657
|
-
GRPC_TRACE_LOG(pick_first, INFO)
|
1658
|
-
<< "Pick First " << p << " selected subchannel connectivity changed to "
|
1659
|
-
<< ConnectivityStateName(new_state);
|
1660
|
-
// Any state change is considered to be a failure of the existing
|
1661
|
-
// connection.
|
1662
|
-
stats_plugins.AddCounter(
|
1663
|
-
kMetricDisconnections, 1,
|
1664
|
-
{subchannel_list_->policy_->channel_control_helper()->GetTarget()}, {});
|
1665
|
-
// TODO(roth): We could check the connectivity states of all the
|
1666
|
-
// subchannels here, just in case one of them happens to be READY,
|
1667
|
-
// and we could switch to that rather than going IDLE.
|
1668
|
-
// Request a re-resolution.
|
1669
|
-
// TODO(qianchengz): We may want to request re-resolution in
|
1670
|
-
// ExitIdleLocked().
|
1671
|
-
p->channel_control_helper()->RequestReresolution();
|
1672
|
-
// If there is a pending update, switch to the pending update.
|
1673
|
-
if (p->latest_pending_subchannel_list_ != nullptr) {
|
1674
|
-
GRPC_TRACE_LOG(pick_first, INFO)
|
1675
|
-
<< "Pick First " << p << " promoting pending subchannel list "
|
1676
|
-
<< p->latest_pending_subchannel_list_.get() << " to replace "
|
1677
|
-
<< p->subchannel_list_.get();
|
1678
|
-
p->UnsetSelectedSubchannel();
|
1679
|
-
p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_);
|
1680
|
-
// Set our state to that of the pending subchannel list.
|
1681
|
-
if (p->subchannel_list_->IsHappyEyeballsPassComplete()) {
|
1682
|
-
status = absl::UnavailableError(absl::StrCat(
|
1683
|
-
"selected subchannel failed; switching to pending update; "
|
1684
|
-
"last failure: ",
|
1685
|
-
p->subchannel_list_->last_failure_.ToString()));
|
1686
|
-
subchannel_list_->ReportTransientFailure(std::move(status));
|
1687
|
-
} else if (p->state_ != GRPC_CHANNEL_TRANSIENT_FAILURE) {
|
1688
|
-
p->UpdateState(GRPC_CHANNEL_CONNECTING, absl::OkStatus(),
|
1689
|
-
MakeRefCounted<QueuePicker>(nullptr));
|
1690
|
-
}
|
1691
|
-
return;
|
1692
|
-
}
|
1693
|
-
// Enter idle.
|
1694
|
-
p->UnsetSelectedSubchannel();
|
1695
|
-
p->subchannel_list_.reset();
|
1696
|
-
p->UpdateState(
|
1697
|
-
GRPC_CHANNEL_IDLE, absl::OkStatus(),
|
1698
|
-
MakeRefCounted<QueuePicker>(p->Ref(DEBUG_LOCATION, "QueuePicker")));
|
1699
|
-
return;
|
1700
|
-
}
|
1701
|
-
// If we get here, there are two possible cases:
|
1702
|
-
// 1. We do not currently have a selected subchannel, and the update is
|
1703
|
-
// for a subchannel in p->subchannel_list_ that we're trying to
|
1704
|
-
// connect to. The goal here is to find a subchannel that we can
|
1705
|
-
// select.
|
1706
|
-
// 2. We do currently have a selected subchannel, and the update is
|
1707
|
-
// for a subchannel in p->latest_pending_subchannel_list_. The
|
1708
|
-
// goal here is to find a subchannel from the update that we can
|
1709
|
-
// select in place of the current one.
|
1710
|
-
// If the subchannel is READY, use it.
|
1711
|
-
if (new_state == GRPC_CHANNEL_READY) {
|
1712
|
-
// We consider it a successful connection attempt only if the
|
1713
|
-
// previous state was CONNECTING. In particular, we don't want to
|
1714
|
-
// increment this counter if we got a new address list and found the
|
1715
|
-
// existing connection already in state READY.
|
1716
|
-
if (old_state == GRPC_CHANNEL_CONNECTING) {
|
1717
|
-
stats_plugins.AddCounter(
|
1718
|
-
kMetricConnectionAttemptsSucceeded, 1,
|
1719
|
-
{subchannel_list_->policy_->channel_control_helper()->GetTarget()},
|
1720
|
-
{});
|
1721
|
-
}
|
1722
|
-
ProcessUnselectedReadyLocked();
|
1723
|
-
return;
|
1724
|
-
}
|
1725
|
-
// Record status for TRANSIENT_FAILURE state.
|
1726
|
-
if (new_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
|
1727
|
-
subchannel_list_->last_failure_ = connectivity_status_;
|
1728
|
-
}
|
1729
|
-
// If this is the initial connectivity state update for this subchannel,
|
1730
|
-
// increment the counter in the subchannel list.
|
1731
|
-
if (!old_state.has_value()) {
|
1732
|
-
++subchannel_list_->num_subchannels_seen_initial_notification_;
|
1733
|
-
}
|
1734
|
-
// If we haven't yet seen the initial connectivity state notification
|
1735
|
-
// for all subchannels, do nothing.
|
1736
|
-
if (!subchannel_list_->AllSubchannelsSeenInitialState()) return;
|
1737
|
-
// If we're still here and this is the initial connectivity state
|
1738
|
-
// notification for this subchannel, that means it was the last one to
|
1739
|
-
// see its initial notification. Start trying to connect, starting
|
1740
|
-
// with the first subchannel.
|
1741
|
-
if (!old_state.has_value()) {
|
1742
|
-
subchannel_list_->StartConnectingNextSubchannel();
|
1743
|
-
return;
|
1744
|
-
}
|
1745
|
-
// We've already started trying to connect. Any subchannel that
|
1746
|
-
// reports TF is a connection attempt failure.
|
1747
|
-
if (new_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
|
1748
|
-
stats_plugins.AddCounter(
|
1749
|
-
kMetricConnectionAttemptsFailed, 1,
|
1750
|
-
{subchannel_list_->policy_->channel_control_helper()->GetTarget()}, {});
|
1751
|
-
}
|
1752
|
-
// Otherwise, process connectivity state change.
|
1753
|
-
switch (*connectivity_state_) {
|
1754
|
-
case GRPC_CHANNEL_TRANSIENT_FAILURE: {
|
1755
|
-
bool prev_seen_transient_failure =
|
1756
|
-
std::exchange(seen_transient_failure_, true);
|
1757
|
-
// If this is the first failure we've seen on this subchannel,
|
1758
|
-
// then we're still in the Happy Eyeballs pass.
|
1759
|
-
if (!prev_seen_transient_failure && seen_transient_failure_) {
|
1760
|
-
// If a connection attempt fails before the timer fires, then
|
1761
|
-
// cancel the timer and start connecting on the next subchannel.
|
1762
|
-
if (index_ == subchannel_list_->attempting_index_) {
|
1763
|
-
if (subchannel_list_->timer_handle_.has_value()) {
|
1764
|
-
p->channel_control_helper()->GetEventEngine()->Cancel(
|
1765
|
-
*subchannel_list_->timer_handle_);
|
1766
|
-
}
|
1767
|
-
++subchannel_list_->attempting_index_;
|
1768
|
-
subchannel_list_->StartConnectingNextSubchannel();
|
1769
|
-
} else {
|
1770
|
-
// If this was the last subchannel to fail, check if the Happy
|
1771
|
-
// Eyeballs pass is complete.
|
1772
|
-
subchannel_list_->MaybeFinishHappyEyeballsPass();
|
1773
|
-
}
|
1774
|
-
} else if (subchannel_list_->IsHappyEyeballsPassComplete()) {
|
1775
|
-
// We're done with the initial Happy Eyeballs pass and in a mode
|
1776
|
-
// where we're attempting to connect to every subchannel in
|
1777
|
-
// parallel. We count the number of failed connection attempts,
|
1778
|
-
// and when that is equal to the number of subchannels, request
|
1779
|
-
// re-resolution and report TRANSIENT_FAILURE again, so that the
|
1780
|
-
// caller has the most recent status message. Note that this
|
1781
|
-
// isn't necessarily the same as saying that we've seen one
|
1782
|
-
// failure for each subchannel in the list, because the backoff
|
1783
|
-
// state may be different in each subchannel, so we may have seen
|
1784
|
-
// one subchannel fail more than once and another subchannel not
|
1785
|
-
// fail at all. But it's a good enough heuristic.
|
1786
|
-
++subchannel_list_->num_failures_;
|
1787
|
-
if (subchannel_list_->num_failures_ % subchannel_list_->size() == 0) {
|
1788
|
-
p->channel_control_helper()->RequestReresolution();
|
1789
|
-
status = absl::UnavailableError(absl::StrCat(
|
1790
|
-
(p->omit_status_message_prefix_
|
1791
|
-
? ""
|
1792
|
-
: "failed to connect to all addresses; last error: "),
|
1793
|
-
connectivity_status_.ToString()));
|
1794
|
-
subchannel_list_->ReportTransientFailure(std::move(status));
|
1795
|
-
}
|
1796
|
-
}
|
1797
|
-
break;
|
1798
|
-
}
|
1799
|
-
case GRPC_CHANNEL_IDLE:
|
1800
|
-
// If we've finished the first Happy Eyeballs pass, then we go
|
1801
|
-
// into a mode where we immediately try to connect to every
|
1802
|
-
// subchannel in parallel.
|
1803
|
-
if (subchannel_list_->IsHappyEyeballsPassComplete()) {
|
1804
|
-
subchannel_->RequestConnection();
|
1805
|
-
}
|
1806
|
-
break;
|
1807
|
-
case GRPC_CHANNEL_CONNECTING:
|
1808
|
-
// Only update connectivity state in case 1, and only if we're not
|
1809
|
-
// already in TRANSIENT_FAILURE.
|
1810
|
-
if (subchannel_list_ == p->subchannel_list_.get() &&
|
1811
|
-
p->state_ != GRPC_CHANNEL_TRANSIENT_FAILURE) {
|
1812
|
-
p->UpdateState(GRPC_CHANNEL_CONNECTING, absl::OkStatus(),
|
1813
|
-
MakeRefCounted<QueuePicker>(nullptr));
|
1814
|
-
}
|
1815
|
-
break;
|
1816
|
-
default:
|
1817
|
-
// We handled READY above, and we should never see SHUTDOWN.
|
1818
|
-
GPR_UNREACHABLE_CODE(break);
|
1819
|
-
}
|
1820
|
-
}
|
1821
|
-
|
1822
|
-
void OldPickFirst::SubchannelList::SubchannelData::
|
1823
|
-
RequestConnectionWithTimer() {
|
1824
|
-
CHECK(connectivity_state_.has_value());
|
1825
|
-
if (connectivity_state_ == GRPC_CHANNEL_IDLE) {
|
1826
|
-
subchannel_->RequestConnection();
|
1827
|
-
} else {
|
1828
|
-
CHECK(connectivity_state_ == GRPC_CHANNEL_CONNECTING);
|
1829
|
-
}
|
1830
|
-
// If this is not the last subchannel in the list, start the timer.
|
1831
|
-
if (index_ != subchannel_list_->size() - 1) {
|
1832
|
-
OldPickFirst* p = subchannel_list_->policy_.get();
|
1833
|
-
GRPC_TRACE_LOG(pick_first, INFO)
|
1834
|
-
<< "Pick First " << p << " subchannel list " << subchannel_list_
|
1835
|
-
<< ": starting Connection Attempt Delay timer for "
|
1836
|
-
<< p->connection_attempt_delay_.millis() << "ms for index " << index_;
|
1837
|
-
subchannel_list_->timer_handle_ =
|
1838
|
-
p->channel_control_helper()->GetEventEngine()->RunAfter(
|
1839
|
-
p->connection_attempt_delay_,
|
1840
|
-
[subchannel_list =
|
1841
|
-
subchannel_list_->Ref(DEBUG_LOCATION, "timer")]() mutable {
|
1842
|
-
ExecCtx exec_ctx;
|
1843
|
-
auto* sl = subchannel_list.get();
|
1844
|
-
sl->policy_->work_serializer()->Run(
|
1845
|
-
[subchannel_list = std::move(subchannel_list)]() {
|
1846
|
-
GRPC_TRACE_LOG(pick_first, INFO)
|
1847
|
-
<< "Pick First " << subchannel_list->policy_.get()
|
1848
|
-
<< " subchannel list " << subchannel_list.get()
|
1849
|
-
<< ": Connection Attempt Delay timer fired "
|
1850
|
-
<< "(shutting_down=" << subchannel_list->shutting_down_
|
1851
|
-
<< ", selected=" << subchannel_list->policy_->selected_
|
1852
|
-
<< ")";
|
1853
|
-
if (subchannel_list->shutting_down_) return;
|
1854
|
-
if (subchannel_list->policy_->selected_ != nullptr) return;
|
1855
|
-
++subchannel_list->attempting_index_;
|
1856
|
-
subchannel_list->StartConnectingNextSubchannel();
|
1857
|
-
});
|
1858
|
-
});
|
1859
|
-
}
|
1860
|
-
}
|
1861
|
-
|
1862
|
-
void OldPickFirst::SubchannelList::SubchannelData::
|
1863
|
-
ProcessUnselectedReadyLocked() {
|
1864
|
-
OldPickFirst* p = subchannel_list_->policy_.get();
|
1865
|
-
// Cancel Happy Eyeballs timer, if any.
|
1866
|
-
if (subchannel_list_->timer_handle_.has_value()) {
|
1867
|
-
p->channel_control_helper()->GetEventEngine()->Cancel(
|
1868
|
-
*subchannel_list_->timer_handle_);
|
1869
|
-
}
|
1870
|
-
// If we get here, there are two possible cases:
|
1871
|
-
// 1. We do not currently have a selected subchannel, and the update is
|
1872
|
-
// for a subchannel in p->subchannel_list_ that we're trying to
|
1873
|
-
// connect to. The goal here is to find a subchannel that we can
|
1874
|
-
// select.
|
1875
|
-
// 2. We do currently have a selected subchannel, and the update is
|
1876
|
-
// for a subchannel in p->latest_pending_subchannel_list_. The
|
1877
|
-
// goal here is to find a subchannel from the update that we can
|
1878
|
-
// select in place of the current one.
|
1879
|
-
CHECK(subchannel_list_ == p->subchannel_list_.get() ||
|
1880
|
-
subchannel_list_ == p->latest_pending_subchannel_list_.get());
|
1881
|
-
// Case 2. Promote p->latest_pending_subchannel_list_ to p->subchannel_list_.
|
1882
|
-
if (subchannel_list_ == p->latest_pending_subchannel_list_.get()) {
|
1883
|
-
GRPC_TRACE_LOG(pick_first, INFO)
|
1884
|
-
<< "Pick First " << p << " promoting pending subchannel list "
|
1885
|
-
<< p->latest_pending_subchannel_list_.get() << " to replace "
|
1886
|
-
<< p->subchannel_list_.get();
|
1887
|
-
p->UnsetSelectedSubchannel();
|
1888
|
-
p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_);
|
1889
|
-
}
|
1890
|
-
// Cases 1 and 2.
|
1891
|
-
GRPC_TRACE_LOG(pick_first, INFO)
|
1892
|
-
<< "Pick First " << p << " selected subchannel " << subchannel_.get();
|
1893
|
-
p->selected_ = this;
|
1894
|
-
// If health checking is enabled, start the health watch, but don't
|
1895
|
-
// report a new picker -- we want to stay in CONNECTING while we wait
|
1896
|
-
// for the health status notification.
|
1897
|
-
// If health checking is NOT enabled, report READY.
|
1898
|
-
if (p->enable_health_watch_) {
|
1899
|
-
GRPC_TRACE_LOG(pick_first, INFO)
|
1900
|
-
<< "[PF " << p << "] starting health watch";
|
1901
|
-
auto watcher = std::make_unique<HealthWatcher>(
|
1902
|
-
p->RefAsSubclass<OldPickFirst>(DEBUG_LOCATION, "HealthWatcher"),
|
1903
|
-
subchannel_list_->resolution_note_);
|
1904
|
-
p->health_watcher_ = watcher.get();
|
1905
|
-
auto health_data_watcher = MakeHealthCheckWatcher(
|
1906
|
-
p->work_serializer(), subchannel_list_->args_, std::move(watcher));
|
1907
|
-
p->health_data_watcher_ = health_data_watcher.get();
|
1908
|
-
subchannel_->AddDataWatcher(std::move(health_data_watcher));
|
1909
|
-
} else {
|
1910
|
-
p->UpdateState(GRPC_CHANNEL_READY, absl::OkStatus(),
|
1911
|
-
MakeRefCounted<Picker>(subchannel()->Ref()));
|
1912
|
-
}
|
1913
|
-
// Unref all other subchannels in the list.
|
1914
|
-
for (size_t i = 0; i < subchannel_list_->size(); ++i) {
|
1915
|
-
if (i != index_) {
|
1916
|
-
subchannel_list_->subchannels_[i].ShutdownLocked();
|
1917
|
-
}
|
1918
|
-
}
|
1919
|
-
}
|
1920
|
-
|
1921
|
-
//
|
1922
|
-
// OldPickFirst::SubchannelList
|
1923
|
-
//
|
1924
|
-
|
1925
|
-
OldPickFirst::SubchannelList::SubchannelList(
|
1926
|
-
RefCountedPtr<OldPickFirst> policy, EndpointAddressesIterator* addresses,
|
1927
|
-
const ChannelArgs& args, absl::string_view resolution_note)
|
1928
|
-
: InternallyRefCounted<SubchannelList>(
|
1929
|
-
GRPC_TRACE_FLAG_ENABLED(pick_first) ? "SubchannelList" : nullptr),
|
1930
|
-
policy_(std::move(policy)),
|
1931
|
-
args_(
|
1932
|
-
args.Remove(GRPC_ARG_INTERNAL_PICK_FIRST_ENABLE_HEALTH_CHECKING)
|
1933
|
-
.Remove(GRPC_ARG_INTERNAL_PICK_FIRST_OMIT_STATUS_MESSAGE_PREFIX)),
|
1934
|
-
resolution_note_(resolution_note) {
|
1935
|
-
GRPC_TRACE_LOG(pick_first, INFO)
|
1936
|
-
<< "[PF " << policy_.get() << "] Creating subchannel list " << this
|
1937
|
-
<< " - channel args: " << args_.ToString();
|
1938
|
-
if (addresses == nullptr) return;
|
1939
|
-
// Create a subchannel for each address.
|
1940
|
-
addresses->ForEach([&](const EndpointAddresses& address) {
|
1941
|
-
CHECK_EQ(address.addresses().size(), 1u);
|
1942
|
-
RefCountedPtr<SubchannelInterface> subchannel =
|
1943
|
-
policy_->channel_control_helper()->CreateSubchannel(
|
1944
|
-
address.address(), address.args(), args_);
|
1945
|
-
if (subchannel == nullptr) {
|
1946
|
-
// Subchannel could not be created.
|
1947
|
-
GRPC_TRACE_LOG(pick_first, INFO)
|
1948
|
-
<< "[PF " << policy_.get()
|
1949
|
-
<< "] could not create subchannel for address " << address.ToString()
|
1950
|
-
<< ", ignoring";
|
1951
|
-
return;
|
1952
|
-
}
|
1953
|
-
GRPC_TRACE_LOG(pick_first, INFO)
|
1954
|
-
<< "[PF " << policy_.get() << "] subchannel list " << this << " index "
|
1955
|
-
<< subchannels_.size() << ": Created subchannel " << subchannel.get()
|
1956
|
-
<< " for address " << address.ToString();
|
1957
|
-
subchannels_.emplace_back(this, subchannels_.size(), std::move(subchannel));
|
1958
|
-
});
|
1959
|
-
}
|
1960
|
-
|
1961
|
-
OldPickFirst::SubchannelList::~SubchannelList() {
|
1962
|
-
GRPC_TRACE_LOG(pick_first, INFO)
|
1963
|
-
<< "[PF " << policy_.get() << "] Destroying subchannel_list " << this;
|
1964
|
-
}
|
1965
|
-
|
1966
|
-
void OldPickFirst::SubchannelList::Orphan() {
|
1967
|
-
GRPC_TRACE_LOG(pick_first, INFO)
|
1968
|
-
<< "[PF " << policy_.get() << "] Shutting down subchannel_list " << this;
|
1969
|
-
CHECK(!shutting_down_);
|
1970
|
-
shutting_down_ = true;
|
1971
|
-
for (auto& sd : subchannels_) {
|
1972
|
-
sd.ShutdownLocked();
|
1973
|
-
}
|
1974
|
-
if (timer_handle_.has_value()) {
|
1975
|
-
policy_->channel_control_helper()->GetEventEngine()->Cancel(*timer_handle_);
|
1976
|
-
}
|
1977
|
-
Unref();
|
1978
|
-
}
|
1979
|
-
|
1980
|
-
void OldPickFirst::SubchannelList::ResetBackoffLocked() {
|
1981
|
-
for (auto& sd : subchannels_) {
|
1982
|
-
sd.ResetBackoffLocked();
|
1983
|
-
}
|
1984
|
-
}
|
1985
|
-
|
1986
|
-
void OldPickFirst::SubchannelList::ReportTransientFailure(absl::Status status) {
|
1987
|
-
if (!resolution_note_.empty()) {
|
1988
|
-
status = absl::Status(status.code(), absl::StrCat(status.message(), " (",
|
1989
|
-
resolution_note_, ")"));
|
1990
|
-
}
|
1991
|
-
policy_->UpdateState(GRPC_CHANNEL_TRANSIENT_FAILURE, status,
|
1992
|
-
MakeRefCounted<TransientFailurePicker>(status));
|
1993
|
-
}
|
1994
|
-
|
1995
|
-
void OldPickFirst::SubchannelList::StartConnectingNextSubchannel() {
|
1996
|
-
// Find the next subchannel not in state TRANSIENT_FAILURE.
|
1997
|
-
// We skip subchannels in state TRANSIENT_FAILURE to avoid a
|
1998
|
-
// large recursion that could overflow the stack.
|
1999
|
-
for (; attempting_index_ < size(); ++attempting_index_) {
|
2000
|
-
SubchannelData* sc = &subchannels_[attempting_index_];
|
2001
|
-
CHECK(sc->connectivity_state().has_value());
|
2002
|
-
if (sc->connectivity_state() != GRPC_CHANNEL_TRANSIENT_FAILURE) {
|
2003
|
-
// Found a subchannel not in TRANSIENT_FAILURE, so trigger a
|
2004
|
-
// connection attempt.
|
2005
|
-
sc->RequestConnectionWithTimer();
|
2006
|
-
return;
|
2007
|
-
}
|
2008
|
-
sc->set_seen_transient_failure();
|
2009
|
-
}
|
2010
|
-
// If we didn't find a subchannel to request a connection on, check to
|
2011
|
-
// see if the Happy Eyeballs pass is complete.
|
2012
|
-
MaybeFinishHappyEyeballsPass();
|
2013
|
-
}
|
2014
|
-
|
2015
|
-
void OldPickFirst::SubchannelList::MaybeFinishHappyEyeballsPass() {
|
2016
|
-
// Make sure all subchannels have finished a connection attempt before
|
2017
|
-
// we consider the Happy Eyeballs pass complete.
|
2018
|
-
if (!IsHappyEyeballsPassComplete()) return;
|
2019
|
-
// We didn't find another subchannel not in state TRANSIENT_FAILURE,
|
2020
|
-
// so report TRANSIENT_FAILURE and switch to a mode in which we try to
|
2021
|
-
// connect to all addresses in parallel.
|
2022
|
-
GRPC_TRACE_LOG(pick_first, INFO)
|
2023
|
-
<< "Pick First " << policy_.get() << " subchannel list " << this
|
2024
|
-
<< " failed to connect to all subchannels";
|
2025
|
-
// In case 2, swap to the new subchannel list. This means reporting
|
2026
|
-
// TRANSIENT_FAILURE and dropping the existing (working) connection,
|
2027
|
-
// but we can't ignore what the control plane has told us.
|
2028
|
-
if (policy_->latest_pending_subchannel_list_.get() == this) {
|
2029
|
-
GRPC_TRACE_LOG(pick_first, INFO)
|
2030
|
-
<< "Pick First " << policy_.get()
|
2031
|
-
<< " promoting pending subchannel list "
|
2032
|
-
<< policy_->latest_pending_subchannel_list_.get() << " to replace "
|
2033
|
-
<< this;
|
2034
|
-
policy_->UnsetSelectedSubchannel();
|
2035
|
-
policy_->subchannel_list_ =
|
2036
|
-
std::move(policy_->latest_pending_subchannel_list_);
|
2037
|
-
}
|
2038
|
-
// If this is the current subchannel list (either because we were
|
2039
|
-
// in case 1 or because we were in case 2 and just promoted it to
|
2040
|
-
// be the current list), re-resolve and report new state.
|
2041
|
-
if (policy_->subchannel_list_.get() == this) {
|
2042
|
-
policy_->channel_control_helper()->RequestReresolution();
|
2043
|
-
absl::Status status = absl::UnavailableError(
|
2044
|
-
absl::StrCat((policy_->omit_status_message_prefix_
|
2045
|
-
? ""
|
2046
|
-
: "failed to connect to all addresses; last error: "),
|
2047
|
-
last_failure_.ToString()));
|
2048
|
-
ReportTransientFailure(std::move(status));
|
2049
|
-
}
|
2050
|
-
// We now transition into a mode where we try to connect to all
|
2051
|
-
// subchannels in parallel. For any subchannel currently in IDLE,
|
2052
|
-
// trigger a connection attempt. For any subchannel not currently in
|
2053
|
-
// IDLE, we will trigger a connection attempt when it does report IDLE.
|
2054
|
-
for (SubchannelData& sd : subchannels_) {
|
2055
|
-
if (sd.connectivity_state() == GRPC_CHANNEL_IDLE) {
|
2056
|
-
sd.RequestConnection();
|
2057
|
-
}
|
2058
|
-
}
|
2059
|
-
}
|
2060
|
-
|
2061
1109
|
//
|
2062
1110
|
// factory
|
2063
1111
|
//
|
@@ -2066,9 +1114,6 @@ class PickFirstFactory final : public LoadBalancingPolicyFactory {
|
|
2066
1114
|
public:
|
2067
1115
|
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
|
2068
1116
|
LoadBalancingPolicy::Args args) const override {
|
2069
|
-
if (!IsPickFirstNewEnabled()) {
|
2070
|
-
return MakeOrphanable<OldPickFirst>(std::move(args));
|
2071
|
-
}
|
2072
1117
|
return MakeOrphanable<PickFirst>(std::move(args));
|
2073
1118
|
}
|
2074
1119
|
|