Reland global config changes (#32661)

<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->

---------

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
pull/32732/head
Craig Tiller 2 years ago committed by GitHub
parent a363b6c001
commit 175ccc3a90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 56
      BUILD
  2. 120
      CMakeLists.txt
  3. 17
      Makefile
  4. 53
      build_autogenerated.yaml
  5. 18
      config.m4
  6. 17
      config.w32
  7. 18
      gRPC-C++.podspec
  8. 24
      gRPC-Core.podspec
  9. 38
      grpc.gemspec
  10. 10
      grpc.gyp
  11. 38
      package.xml
  12. 16
      src/core/BUILD
  13. 13
      src/core/ext/filters/client_channel/backup_poller.cc
  14. 3
      src/core/ext/filters/client_channel/backup_poller.h
  15. 20
      src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
  16. 30
      src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc
  17. 29
      src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h
  18. 10
      src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
  19. 151
      src/core/lib/config/config_vars.cc
  20. 127
      src/core/lib/config/config_vars.h
  21. 113
      src/core/lib/config/config_vars.yaml
  22. 51
      src/core/lib/config/config_vars_non_generated.cc
  23. 66
      src/core/lib/config/load_config.cc
  24. 49
      src/core/lib/config/load_config.h
  25. 11
      src/core/lib/debug/trace.cc
  26. 5
      src/core/lib/debug/trace.h
  27. 4
      src/core/lib/event_engine/posix_engine/ev_poll_posix.cc
  28. 12
      src/core/lib/event_engine/posix_engine/event_poller_posix_default.cc
  29. 13
      src/core/lib/experiments/config.cc
  30. 43
      src/core/lib/gpr/log.cc
  31. 14
      src/core/lib/gprpp/fork.cc
  32. 93
      src/core/lib/gprpp/global_config.h
  33. 29
      src/core/lib/gprpp/global_config_custom.h
  34. 140
      src/core/lib/gprpp/global_config_env.cc
  35. 133
      src/core/lib/gprpp/global_config_env.h
  36. 40
      src/core/lib/gprpp/global_config_generic.h
  37. 66
      src/core/lib/iomgr/ev_posix.cc
  38. 3
      src/core/lib/iomgr/ev_posix.h
  39. 12
      src/core/lib/iomgr/iomgr.cc
  40. 1
      src/core/lib/iomgr/tcp_posix.cc
  41. 14
      src/core/lib/security/security_connector/load_system_roots_supported.cc
  42. 36
      src/core/lib/security/security_connector/ssl_utils.cc
  43. 32
      src/core/lib/security/security_connector/ssl_utils_config.cc
  44. 29
      src/core/lib/security/security_connector/ssl_utils_config.h
  45. 1
      src/core/tsi/alts/frame_protector/alts_frame_protector.cc
  46. 7
      src/objective-c/tests/CronetTests/CoreCronetEnd2EndTests.mm
  47. 5
      src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi
  48. 4
      src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi
  49. 15
      src/python/grpcio/grpc_core_dependencies.py
  50. 1
      src/python/grpcio_tests/tests_py3_only/unit/_simple_stubs_test.py
  51. 5
      test/core/bad_ssl/bad_ssl_test.cc
  52. 9
      test/core/client_channel/resolvers/dns_resolver_test.cc
  53. 17
      test/core/end2end/BUILD
  54. 10
      test/core/end2end/fixtures/h2_full+trace.cc
  55. 12
      test/core/end2end/fixtures/h2_sockpair+trace.cc
  56. 11
      test/core/end2end/fixtures/h2_ssl_cred_reload_tls12.cc
  57. 11
      test/core/end2end/fixtures/h2_ssl_cred_reload_tls13.cc
  58. 11
      test/core/end2end/fixtures/h2_ssl_proxy.cc
  59. 11
      test/core/end2end/fixtures/h2_ssl_tls12.cc
  60. 11
      test/core/end2end/fixtures/h2_ssl_tls13.cc
  61. 10
      test/core/end2end/fixtures/h2_tls_certwatch_async_tls1_3.cc
  62. 10
      test/core/end2end/fixtures/h2_tls_certwatch_sync_tls1_2.cc
  63. 10
      test/core/end2end/fixtures/h2_tls_simple.cc
  64. 10
      test/core/end2end/fixtures/h2_tls_static_async_tls1_3.cc
  65. 8
      test/core/end2end/h2_ssl_cert_test.cc
  66. 9
      test/core/end2end/h2_ssl_session_reuse_test.cc
  67. 10
      test/core/end2end/h2_tls_peer_property_external_verifier_test.cc
  68. 16
      test/core/end2end/tests/keepalive_timeout.cc
  69. 11
      test/core/event_engine/posix/event_poller_posix_test.cc
  70. 11
      test/core/event_engine/posix/posix_endpoint_test.cc
  71. 31
      test/core/gprpp/BUILD
  72. 127
      test/core/gprpp/global_config_env_test.cc
  73. 61
      test/core/gprpp/global_config_test.cc
  74. 15
      test/core/http/httpcli_test_util.cc
  75. 1
      test/core/iomgr/buffer_list_test.cc
  76. 19
      test/core/iomgr/resolve_address_posix_test.cc
  77. 6
      test/core/iomgr/resolve_address_test.cc
  78. 6
      test/core/security/grpc_tls_credentials_options_test.cc
  79. 28
      test/core/security/security_connector_test.cc
  80. 6
      test/core/security/tls_security_connector_test.cc
  81. 9
      test/core/transport/chttp2/remove_stream_from_stalled_lists_test.cc
  82. 8
      test/cpp/end2end/async_end2end_test.cc
  83. 7
      test/cpp/end2end/client_lb_end2end_test.cc
  84. 10
      test/cpp/end2end/end2end_test.cc
  85. 5
      test/cpp/end2end/grpclb_end2end_test.cc
  86. 5
      test/cpp/end2end/rls_end2end_test.cc
  87. 5
      test/cpp/end2end/server_load_reporting_end2end_test.cc
  88. 5
      test/cpp/end2end/service_config_end2end_test.cc
  89. 5
      test/cpp/end2end/xds/xds_cluster_end2end_test.cc
  90. 5
      test/cpp/end2end/xds/xds_cluster_type_end2end_test.cc
  91. 5
      test/cpp/end2end/xds/xds_core_end2end_test.cc
  92. 5
      test/cpp/end2end/xds/xds_csds_end2end_test.cc
  93. 5
      test/cpp/end2end/xds/xds_end2end_test.cc
  94. 5
      test/cpp/end2end/xds/xds_fault_injection_end2end_test.cc
  95. 5
      test/cpp/end2end/xds/xds_outlier_detection_end2end_test.cc
  96. 5
      test/cpp/end2end/xds/xds_override_host_end2end_test.cc
  97. 5
      test/cpp/end2end/xds/xds_ring_hash_end2end_test.cc
  98. 5
      test/cpp/end2end/xds/xds_rls_end2end_test.cc
  99. 5
      test/cpp/end2end/xds/xds_routing_end2end_test.cc
  100. 5
      test/cpp/end2end/xds/xds_wrr_end2end_test.cc
  101. Some files were not shown because too many files have changed in this diff Show More

56
BUILD

@ -670,7 +670,6 @@ grpc_cc_library(
"//src/core:lib/gpr/wrap_memcpy.cc",
"//src/core:lib/gprpp/crash.cc",
"//src/core:lib/gprpp/fork.cc",
"//src/core:lib/gprpp/global_config_env.cc",
"//src/core:lib/gprpp/host_port.cc",
"//src/core:lib/gprpp/mpscq.cc",
"//src/core:lib/gprpp/posix/stat.cc",
@ -686,10 +685,6 @@ grpc_cc_library(
"//src/core:lib/gpr/tmpfile.h",
"//src/core:lib/gprpp/crash.h",
"//src/core:lib/gprpp/fork.h",
"//src/core:lib/gprpp/global_config.h",
"//src/core:lib/gprpp/global_config_custom.h",
"//src/core:lib/gprpp/global_config_env.h",
"//src/core:lib/gprpp/global_config_generic.h",
"//src/core:lib/gprpp/host_port.h",
"//src/core:lib/gprpp/memory.h",
"//src/core:lib/gprpp/mpscq.h",
@ -719,6 +714,7 @@ grpc_cc_library(
],
visibility = ["@grpc:public"],
deps = [
"config_vars",
"debug_location",
"//src/core:construct_destruct",
"//src/core:env",
@ -1446,6 +1442,7 @@ grpc_cc_library(
deps = [
"channel_stack_builder",
"config",
"config_vars",
"cpp_impl_of",
"debug_location",
"exec_ctx",
@ -2297,14 +2294,56 @@ grpc_cc_library(
name = "grpc_trace",
srcs = ["//src/core:lib/debug/trace.cc"],
hdrs = ["//src/core:lib/debug/trace.h"],
external_deps = ["absl/strings"],
language = "c++",
visibility = ["@grpc:trace"],
deps = [
"config_vars",
"gpr",
"grpc_public_hdrs",
],
)
grpc_cc_library(
name = "load_config",
srcs = [
"//src/core:lib/config/load_config.cc",
],
hdrs = [
"//src/core:lib/config/load_config.h",
],
external_deps = [
"absl/flags:flag",
"absl/flags:marshalling",
"absl/strings",
"absl/types:optional",
],
deps = [
"gpr_platform",
"//src/core:env",
],
)
grpc_cc_library(
name = "config_vars",
srcs = [
"//src/core:lib/config/config_vars.cc",
"//src/core:lib/config/config_vars_non_generated.cc",
],
hdrs = [
"//src/core:lib/config/config_vars.h",
],
external_deps = [
"absl/flags:flag",
"absl/strings",
"absl/types:optional",
],
deps = [
"gpr_platform",
"load_config",
],
)
grpc_cc_library(
name = "config",
srcs = [
@ -2821,6 +2860,7 @@ grpc_cc_library(
"backoff",
"channel_stack_builder",
"config",
"config_vars",
"debug_location",
"exec_ctx",
"gpr",
@ -2915,6 +2955,7 @@ grpc_cc_library(
deps = [
"backoff",
"config",
"config_vars",
"debug_location",
"exec_ctx",
"gpr",
@ -2934,7 +2975,6 @@ grpc_cc_library(
"//src/core:closure",
"//src/core:error",
"//src/core:event_engine_common",
"//src/core:grpc_resolver_dns_selection",
"//src/core:grpc_service_config",
"//src/core:grpc_sockaddr",
"//src/core:iomgr_fwd",
@ -3135,6 +3175,7 @@ grpc_cc_library(
language = "c++",
visibility = ["@grpc:public"],
deps = [
"config_vars",
"gpr",
"grpc_base",
"grpc_security_base",
@ -3257,14 +3298,12 @@ grpc_cc_library(
name = "tsi_ssl_credentials",
srcs = [
"//src/core:lib/security/security_connector/ssl_utils.cc",
"//src/core:lib/security/security_connector/ssl_utils_config.cc",
"//src/core:tsi/ssl/key_logging/ssl_key_logging.cc",
"//src/core:tsi/ssl_transport_security.cc",
"//src/core:tsi/ssl_transport_security_utils.cc",
],
hdrs = [
"//src/core:lib/security/security_connector/ssl_utils.h",
"//src/core:lib/security/security_connector/ssl_utils_config.h",
"//src/core:tsi/ssl/key_logging/ssl_key_logging.h",
"//src/core:tsi/ssl_transport_security.h",
"//src/core:tsi/ssl_transport_security_utils.h",
@ -3279,6 +3318,7 @@ grpc_cc_library(
language = "c++",
visibility = ["@grpc:public"],
deps = [
"config_vars",
"gpr",
"grpc_base",
"grpc_credentials_util",

120
CMakeLists.txt generated

@ -139,6 +139,16 @@ set(gRPC_ABSL_USED_TARGETS
absl_exponential_biased
absl_fast_type_id
absl_fixed_array
absl_flags
absl_flags_commandlineflag
absl_flags_commandlineflag_internal
absl_flags_config
absl_flags_internal
absl_flags_marshalling
absl_flags_path_util
absl_flags_private_handle_accessor
absl_flags_program_name
absl_flags_reflection
absl_flat_hash_map
absl_flat_hash_set
absl_function_ref
@ -967,10 +977,6 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_cxx fuzzing_event_engine_test)
endif()
add_dependencies(buildtests_cxx generic_end2end_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx global_config_env_test)
endif()
add_dependencies(buildtests_cxx global_config_test)
add_dependencies(buildtests_cxx google_c2p_resolver_test)
add_dependencies(buildtests_cxx google_mesh_ca_certificate_provider_factory_test)
add_dependencies(buildtests_cxx graceful_shutdown_test)
@ -1560,6 +1566,9 @@ target_link_libraries(end2end_tests
endif()
add_library(gpr
src/core/lib/config/config_vars.cc
src/core/lib/config/config_vars_non_generated.cc
src/core/lib/config/load_config.cc
src/core/lib/event_engine/thread_local.cc
src/core/lib/gpr/alloc.cc
src/core/lib/gpr/android/log.cc
@ -1591,7 +1600,6 @@ add_library(gpr
src/core/lib/gprpp/crash.cc
src/core/lib/gprpp/examine_stack.cc
src/core/lib/gprpp/fork.cc
src/core/lib/gprpp/global_config_env.cc
src/core/lib/gprpp/host_port.cc
src/core/lib/gprpp/linux/env.cc
src/core/lib/gprpp/mpscq.cc
@ -1643,6 +1651,8 @@ target_link_libraries(gpr
${_gRPC_ALLTARGETS_LIBRARIES}
absl::base
absl::core_headers
absl::flags
absl::flags_marshalling
absl::any_invocable
absl::memory
absl::random_random
@ -1764,7 +1774,6 @@ add_library(grpc
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc
src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc
src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc
@ -2384,7 +2393,6 @@ add_library(grpc
src/core/lib/security/security_connector/security_connector.cc
src/core/lib/security/security_connector/ssl/ssl_security_connector.cc
src/core/lib/security/security_connector/ssl_utils.cc
src/core/lib/security/security_connector/ssl_utils_config.cc
src/core/lib/security/security_connector/tls/tls_security_connector.cc
src/core/lib/security/transport/client_auth_filter.cc
src/core/lib/security/transport/secure_endpoint.cc
@ -2781,7 +2789,6 @@ add_library(grpc_unsecure
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc
src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc
src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
src/core/ext/filters/client_channel/resolver/polling_resolver.cc
@ -4061,7 +4068,6 @@ target_link_libraries(grpc++_test_util
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ZLIB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flags
grpc++
grpc_test_util
)
@ -11796,82 +11802,6 @@ target_link_libraries(generic_end2end_test
)
endif()
if(gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_executable(global_config_env_test
test/core/gprpp/global_config_env_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
target_compile_features(global_config_env_test PUBLIC cxx_std_14)
target_include_directories(global_config_env_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
${_gRPC_RE2_INCLUDE_DIR}
${_gRPC_SSL_INCLUDE_DIR}
${_gRPC_UPB_GENERATED_DIR}
${_gRPC_UPB_GRPC_GENERATED_DIR}
${_gRPC_UPB_INCLUDE_DIR}
${_gRPC_XXHASH_INCLUDE_DIR}
${_gRPC_ZLIB_INCLUDE_DIR}
third_party/googletest/googletest/include
third_party/googletest/googletest
third_party/googletest/googlemock/include
third_party/googletest/googlemock
${_gRPC_PROTO_GENS_DIR}
)
target_link_libraries(global_config_env_test
${_gRPC_BASELIB_LIBRARIES}
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ZLIB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
)
endif()
endif()
if(gRPC_BUILD_TESTS)
add_executable(global_config_test
test/core/gprpp/global_config_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
target_compile_features(global_config_test PUBLIC cxx_std_14)
target_include_directories(global_config_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
${_gRPC_RE2_INCLUDE_DIR}
${_gRPC_SSL_INCLUDE_DIR}
${_gRPC_UPB_GENERATED_DIR}
${_gRPC_UPB_GRPC_GENERATED_DIR}
${_gRPC_UPB_INCLUDE_DIR}
${_gRPC_XXHASH_INCLUDE_DIR}
${_gRPC_ZLIB_INCLUDE_DIR}
third_party/googletest/googletest/include
third_party/googletest/googletest
third_party/googletest/googlemock/include
third_party/googletest/googlemock
${_gRPC_PROTO_GENS_DIR}
)
target_link_libraries(global_config_test
${_gRPC_BASELIB_LIBRARIES}
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ZLIB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
)
endif()
if(gRPC_BUILD_TESTS)
@ -12270,7 +12200,6 @@ target_link_libraries(grpc_cli
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ZLIB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flags
grpc++
grpc++_test_config
)
@ -17409,7 +17338,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ZLIB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flags
absl::flags_parse
grpc_test_util
)
@ -17513,7 +17441,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ZLIB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flags
absl::flags_parse
grpc_test_util
)
@ -23405,7 +23332,6 @@ target_link_libraries(xds_common_types_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ZLIB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flags
grpc++
grpc_test_util
)
@ -24396,7 +24322,6 @@ target_link_libraries(xds_http_filters_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ZLIB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flags
grpc++
grpc_test_util
)
@ -24465,7 +24390,6 @@ target_link_libraries(xds_interop_client
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ZLIB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flags
grpc++_reflection
grpcpp_channelz
grpc_test_util
@ -24541,7 +24465,6 @@ target_link_libraries(xds_interop_server
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ZLIB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flags
grpc++_reflection
grpcpp_channelz
grpc_test_util
@ -24651,7 +24574,6 @@ target_link_libraries(xds_lb_policy_registry_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ZLIB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flags
grpc++
grpc_test_util
)
@ -24787,7 +24709,6 @@ target_link_libraries(xds_listener_resource_type_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ZLIB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flags
grpc++
grpc_test_util
)
@ -25679,7 +25600,6 @@ target_link_libraries(xds_route_config_resource_type_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ZLIB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flags
grpc++
grpc_test_util
)
@ -26100,7 +26020,7 @@ generate_pkgconfig(
"gpr"
"gRPC platform support library"
"${gRPC_CORE_VERSION}"
"absl_any_invocable absl_base absl_cord absl_core_headers absl_memory absl_optional absl_random_random absl_status absl_str_format absl_strings absl_synchronization absl_time absl_variant"
"absl_any_invocable absl_base absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_memory absl_optional absl_random_random absl_status absl_str_format absl_strings absl_synchronization absl_time absl_variant"
""
"-lgpr"
""
@ -26111,7 +26031,7 @@ generate_pkgconfig(
"gRPC"
"high performance general RPC framework"
"${gRPC_CORE_VERSION}"
"gpr absl_any_invocable absl_base absl_bind_front absl_cleanup absl_cord absl_core_headers absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_optional absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant"
"gpr absl_any_invocable absl_base absl_bind_front absl_cleanup absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_optional absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant"
"openssl re2 libcares zlib"
"-lgrpc"
"-laddress_sorting -lupb"
@ -26122,7 +26042,7 @@ generate_pkgconfig(
"gRPC unsecure"
"high performance general RPC framework without SSL"
"${gRPC_CORE_VERSION}"
"gpr absl_any_invocable absl_base absl_bind_front absl_cleanup absl_cord absl_core_headers absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_optional absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant"
"gpr absl_any_invocable absl_base absl_bind_front absl_cleanup absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_optional absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant"
"re2 libcares zlib"
"-lgrpc_unsecure"
"-laddress_sorting -lupb"
@ -26133,7 +26053,7 @@ generate_pkgconfig(
"gRPC++"
"C++ wrapper for gRPC"
"${gRPC_CPP_VERSION}"
"grpc absl_any_invocable absl_base absl_bind_front absl_cleanup absl_cord absl_core_headers absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_optional absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant"
"grpc absl_any_invocable absl_base absl_bind_front absl_cleanup absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_optional absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant"
""
"-lgrpc++"
""
@ -26144,7 +26064,7 @@ generate_pkgconfig(
"gRPC++ unsecure"
"C++ wrapper for gRPC without SSL"
"${gRPC_CPP_VERSION}"
"grpc_unsecure absl_any_invocable absl_base absl_bind_front absl_cleanup absl_cord absl_core_headers absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_optional absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant"
"grpc_unsecure absl_any_invocable absl_base absl_bind_front absl_cleanup absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_optional absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant"
""
"-lgrpc++_unsecure"
""

17
Makefile generated

@ -840,6 +840,9 @@ endif
# start of build recipe for library "gpr" (generated by makelib(lib) template function)
LIBGPR_SRC = \
src/core/lib/config/config_vars.cc \
src/core/lib/config/config_vars_non_generated.cc \
src/core/lib/config/load_config.cc \
src/core/lib/event_engine/thread_local.cc \
src/core/lib/gpr/alloc.cc \
src/core/lib/gpr/android/log.cc \
@ -871,7 +874,6 @@ LIBGPR_SRC = \
src/core/lib/gprpp/crash.cc \
src/core/lib/gprpp/examine_stack.cc \
src/core/lib/gprpp/fork.cc \
src/core/lib/gprpp/global_config_env.cc \
src/core/lib/gprpp/host_port.cc \
src/core/lib/gprpp/linux/env.cc \
src/core/lib/gprpp/mpscq.cc \
@ -1008,7 +1010,6 @@ LIBGRPC_SRC = \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc \
src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc \
src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc \
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \
src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc \
@ -1628,7 +1629,6 @@ LIBGRPC_SRC = \
src/core/lib/security/security_connector/security_connector.cc \
src/core/lib/security/security_connector/ssl/ssl_security_connector.cc \
src/core/lib/security/security_connector/ssl_utils.cc \
src/core/lib/security/security_connector/ssl_utils_config.cc \
src/core/lib/security/security_connector/tls/tls_security_connector.cc \
src/core/lib/security/transport/client_auth_filter.cc \
src/core/lib/security/transport/secure_endpoint.cc \
@ -1879,7 +1879,6 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc \
src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc \
src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc \
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \
src/core/ext/filters/client_channel/resolver/polling_resolver.cc \
@ -2867,6 +2866,15 @@ LIBGRPC_ABSEIL_SRC = \
third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc \
third_party/abseil-cpp/absl/debugging/stacktrace.cc \
third_party/abseil-cpp/absl/debugging/symbolize.cc \
third_party/abseil-cpp/absl/flags/commandlineflag.cc \
third_party/abseil-cpp/absl/flags/flag.cc \
third_party/abseil-cpp/absl/flags/internal/commandlineflag.cc \
third_party/abseil-cpp/absl/flags/internal/flag.cc \
third_party/abseil-cpp/absl/flags/internal/private_handle_accessor.cc \
third_party/abseil-cpp/absl/flags/internal/program_name.cc \
third_party/abseil-cpp/absl/flags/marshalling.cc \
third_party/abseil-cpp/absl/flags/reflection.cc \
third_party/abseil-cpp/absl/flags/usage_config.cc \
third_party/abseil-cpp/absl/hash/internal/city.cc \
third_party/abseil-cpp/absl/hash/internal/hash.cc \
third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc \
@ -3342,7 +3350,6 @@ src/core/lib/security/security_connector/alts/alts_security_connector.cc: $(OPEN
src/core/lib/security/security_connector/local/local_security_connector.cc: $(OPENSSL_DEP)
src/core/lib/security/security_connector/ssl/ssl_security_connector.cc: $(OPENSSL_DEP)
src/core/lib/security/security_connector/ssl_utils.cc: $(OPENSSL_DEP)
src/core/lib/security/security_connector/ssl_utils_config.cc: $(OPENSSL_DEP)
src/core/lib/security/security_connector/tls/tls_security_connector.cc: $(OPENSSL_DEP)
src/core/plugin_registry/grpc_plugin_registry_extra.cc: $(OPENSSL_DEP)
src/core/tsi/alts/crypt/aes_gcm.cc: $(OPENSSL_DEP)

@ -177,6 +177,8 @@ libs:
- include/grpc/support/thd_id.h
- include/grpc/support/time.h
headers:
- src/core/lib/config/config_vars.h
- src/core/lib/config/load_config.h
- src/core/lib/event_engine/thread_local.h
- src/core/lib/gpr/alloc.h
- src/core/lib/gpr/string.h
@ -189,10 +191,6 @@ libs:
- src/core/lib/gprpp/env.h
- src/core/lib/gprpp/examine_stack.h
- src/core/lib/gprpp/fork.h
- src/core/lib/gprpp/global_config.h
- src/core/lib/gprpp/global_config_custom.h
- src/core/lib/gprpp/global_config_env.h
- src/core/lib/gprpp/global_config_generic.h
- src/core/lib/gprpp/host_port.h
- src/core/lib/gprpp/memory.h
- src/core/lib/gprpp/mpscq.h
@ -204,6 +202,9 @@ libs:
- src/core/lib/gprpp/thd.h
- src/core/lib/gprpp/time_util.h
src:
- src/core/lib/config/config_vars.cc
- src/core/lib/config/config_vars_non_generated.cc
- src/core/lib/config/load_config.cc
- src/core/lib/event_engine/thread_local.cc
- src/core/lib/gpr/alloc.cc
- src/core/lib/gpr/android/log.cc
@ -235,7 +236,6 @@ libs:
- src/core/lib/gprpp/crash.cc
- src/core/lib/gprpp/examine_stack.cc
- src/core/lib/gprpp/fork.cc
- src/core/lib/gprpp/global_config_env.cc
- src/core/lib/gprpp/host_port.cc
- src/core/lib/gprpp/linux/env.cc
- src/core/lib/gprpp/mpscq.cc
@ -251,6 +251,8 @@ libs:
deps:
- absl/base:base
- absl/base:core_headers
- absl/flags:flag
- absl/flags:marshalling
- absl/functional:any_invocable
- absl/memory:memory
- absl/random:random
@ -371,7 +373,6 @@ libs:
- src/core/ext/filters/client_channel/local_subchannel_pool.h
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
- src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h
- src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h
- src/core/ext/filters/client_channel/resolver/polling_resolver.h
- src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h
@ -1029,7 +1030,6 @@ libs:
- src/core/lib/security/security_connector/security_connector.h
- src/core/lib/security/security_connector/ssl/ssl_security_connector.h
- src/core/lib/security/security_connector/ssl_utils.h
- src/core/lib/security/security_connector/ssl_utils_config.h
- src/core/lib/security/security_connector/tls/tls_security_connector.h
- src/core/lib/security/transport/auth_filters.h
- src/core/lib/security/transport/secure_endpoint.h
@ -1162,7 +1162,6 @@ libs:
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc
- src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc
- src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
- src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
- src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc
@ -1782,7 +1781,6 @@ libs:
- src/core/lib/security/security_connector/security_connector.cc
- src/core/lib/security/security_connector/ssl/ssl_security_connector.cc
- src/core/lib/security/security_connector/ssl_utils.cc
- src/core/lib/security/security_connector/ssl_utils_config.cc
- src/core/lib/security/security_connector/tls/tls_security_connector.cc
- src/core/lib/security/transport/client_auth_filter.cc
- src/core/lib/security/transport/secure_endpoint.cc
@ -2049,7 +2047,6 @@ libs:
- src/core/ext/filters/client_channel/local_subchannel_pool.h
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
- src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h
- src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h
- src/core/ext/filters/client_channel/resolver/polling_resolver.h
- src/core/ext/filters/client_channel/retry_filter.h
@ -2449,7 +2446,6 @@ libs:
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc
- src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc
- src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
- src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
- src/core/ext/filters/client_channel/resolver/polling_resolver.cc
@ -3254,7 +3250,6 @@ libs:
- test/cpp/util/subprocess.cc
- test/cpp/util/test_credentials_provider.cc
deps:
- absl/flags:flag
- grpc++
- grpc_test_util
- name: grpc++_unsecure
@ -7935,30 +7930,6 @@ targets:
- test/cpp/end2end/generic_end2end_test.cc
deps:
- grpc++_test_util
- name: global_config_env_test
gtest: true
build: test
language: c++
headers: []
src:
- test/core/gprpp/global_config_env_test.cc
deps:
- grpc_test_util
platforms:
- linux
- posix
- mac
uses_polling: false
- name: global_config_test
gtest: true
build: test
language: c++
headers: []
src:
- test/core/gprpp/global_config_test.cc
deps:
- grpc_test_util
uses_polling: false
- name: google_c2p_resolver_test
gtest: true
build: test
@ -8144,7 +8115,6 @@ targets:
- test/cpp/util/proto_reflection_descriptor_database.cc
- test/cpp/util/service_describer.cc
deps:
- absl/flags:flag
- grpc++
- grpc++_test_config
- name: grpc_completion_queue_test
@ -10396,7 +10366,6 @@ targets:
- test/core/util/subprocess_windows.cc
- test/core/util/tracer_util.cc
deps:
- absl/flags:flag
- absl/flags:parse
- grpc_test_util
args:
@ -10475,7 +10444,6 @@ targets:
- test/core/util/subprocess_windows.cc
- test/core/util/tracer_util.cc
deps:
- absl/flags:flag
- absl/flags:parse
- grpc_test_util
args:
@ -13017,7 +12985,6 @@ targets:
- test/cpp/util/proto_reflection_descriptor_database.cc
- test/cpp/util/service_describer.cc
deps:
- absl/flags:flag
- grpc++
- grpc_test_util
uses_polling: false
@ -13354,7 +13321,6 @@ targets:
- test/cpp/util/proto_reflection_descriptor_database.cc
- test/cpp/util/service_describer.cc
deps:
- absl/flags:flag
- grpc++
- grpc_test_util
uses_polling: false
@ -13376,7 +13342,6 @@ targets:
- src/cpp/server/csds/csds.cc
- test/cpp/interop/xds_interop_client.cc
deps:
- absl/flags:flag
- grpc++_reflection
- grpcpp_channelz
- grpc_test_util
@ -13402,7 +13367,6 @@ targets:
- test/cpp/end2end/test_health_check_service_impl.cc
- test/cpp/interop/xds_interop_server.cc
deps:
- absl/flags:flag
- grpc++_reflection
- grpcpp_channelz
- grpc_test_util
@ -13443,7 +13407,6 @@ targets:
- test/cpp/util/proto_reflection_descriptor_database.cc
- test/cpp/util/service_describer.cc
deps:
- absl/flags:flag
- grpc++
- grpc_test_util
uses_polling: false
@ -13489,7 +13452,6 @@ targets:
- test/cpp/util/proto_reflection_descriptor_database.cc
- test/cpp/util/service_describer.cc
deps:
- absl/flags:flag
- grpc++
- grpc_test_util
uses_polling: false
@ -13780,7 +13742,6 @@ targets:
- test/cpp/util/proto_reflection_descriptor_database.cc
- test/cpp/util/service_describer.cc
deps:
- absl/flags:flag
- grpc++
- grpc_test_util
uses_polling: false

18
config.m4 generated

@ -89,7 +89,6 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc \
src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc \
src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc \
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc \
src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc \
@ -502,7 +501,10 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/compression/compression.cc \
src/core/lib/compression/compression_internal.cc \
src/core/lib/compression/message_compress.cc \
src/core/lib/config/config_vars.cc \
src/core/lib/config/config_vars_non_generated.cc \
src/core/lib/config/core_configuration.cc \
src/core/lib/config/load_config.cc \
src/core/lib/debug/event_log.cc \
src/core/lib/debug/histogram_view.cc \
src/core/lib/debug/stats.cc \
@ -578,7 +580,6 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/gprpp/crash.cc \
src/core/lib/gprpp/examine_stack.cc \
src/core/lib/gprpp/fork.cc \
src/core/lib/gprpp/global_config_env.cc \
src/core/lib/gprpp/host_port.cc \
src/core/lib/gprpp/linux/env.cc \
src/core/lib/gprpp/load_file.cc \
@ -753,7 +754,6 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/security/security_connector/security_connector.cc \
src/core/lib/security/security_connector/ssl/ssl_security_connector.cc \
src/core/lib/security/security_connector/ssl_utils.cc \
src/core/lib/security/security_connector/ssl_utils_config.cc \
src/core/lib/security/security_connector/tls/tls_security_connector.cc \
src/core/lib/security/transport/client_auth_filter.cc \
src/core/lib/security/transport/secure_endpoint.cc \
@ -876,6 +876,15 @@ if test "$PHP_GRPC" != "no"; then
third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc \
third_party/abseil-cpp/absl/debugging/stacktrace.cc \
third_party/abseil-cpp/absl/debugging/symbolize.cc \
third_party/abseil-cpp/absl/flags/commandlineflag.cc \
third_party/abseil-cpp/absl/flags/flag.cc \
third_party/abseil-cpp/absl/flags/internal/commandlineflag.cc \
third_party/abseil-cpp/absl/flags/internal/flag.cc \
third_party/abseil-cpp/absl/flags/internal/private_handle_accessor.cc \
third_party/abseil-cpp/absl/flags/internal/program_name.cc \
third_party/abseil-cpp/absl/flags/marshalling.cc \
third_party/abseil-cpp/absl/flags/reflection.cc \
third_party/abseil-cpp/absl/flags/usage_config.cc \
third_party/abseil-cpp/absl/hash/internal/city.cc \
third_party/abseil-cpp/absl/hash/internal/hash.cc \
third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc \
@ -1288,7 +1297,6 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/xds)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/binder)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/dns)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/dns/c_ares)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/dns/native)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/fake)
@ -1488,6 +1496,8 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/crc/internal)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/debugging)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/debugging/internal)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/flags)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/flags/internal)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/hash/internal)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/numeric)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/abseil-cpp/absl/profiling/internal)

17
config.w32 generated

@ -55,7 +55,6 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\grpc_ares_wrapper.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\grpc_ares_wrapper_posix.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\dns\\c_ares\\grpc_ares_wrapper_windows.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\dns\\dns_resolver_selection.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\dns\\native\\dns_resolver.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\fake\\fake_resolver.cc " +
"src\\core\\ext\\filters\\client_channel\\resolver\\google_c2p\\google_c2p_resolver.cc " +
@ -468,7 +467,10 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\compression\\compression.cc " +
"src\\core\\lib\\compression\\compression_internal.cc " +
"src\\core\\lib\\compression\\message_compress.cc " +
"src\\core\\lib\\config\\config_vars.cc " +
"src\\core\\lib\\config\\config_vars_non_generated.cc " +
"src\\core\\lib\\config\\core_configuration.cc " +
"src\\core\\lib\\config\\load_config.cc " +
"src\\core\\lib\\debug\\event_log.cc " +
"src\\core\\lib\\debug\\histogram_view.cc " +
"src\\core\\lib\\debug\\stats.cc " +
@ -544,7 +546,6 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\gprpp\\crash.cc " +
"src\\core\\lib\\gprpp\\examine_stack.cc " +
"src\\core\\lib\\gprpp\\fork.cc " +
"src\\core\\lib\\gprpp\\global_config_env.cc " +
"src\\core\\lib\\gprpp\\host_port.cc " +
"src\\core\\lib\\gprpp\\linux\\env.cc " +
"src\\core\\lib\\gprpp\\load_file.cc " +
@ -719,7 +720,6 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\security\\security_connector\\security_connector.cc " +
"src\\core\\lib\\security\\security_connector\\ssl\\ssl_security_connector.cc " +
"src\\core\\lib\\security\\security_connector\\ssl_utils.cc " +
"src\\core\\lib\\security\\security_connector\\ssl_utils_config.cc " +
"src\\core\\lib\\security\\security_connector\\tls\\tls_security_connector.cc " +
"src\\core\\lib\\security\\transport\\client_auth_filter.cc " +
"src\\core\\lib\\security\\transport\\secure_endpoint.cc " +
@ -842,6 +842,15 @@ if (PHP_GRPC != "no") {
"third_party\\abseil-cpp\\absl\\debugging\\internal\\vdso_support.cc " +
"third_party\\abseil-cpp\\absl\\debugging\\stacktrace.cc " +
"third_party\\abseil-cpp\\absl\\debugging\\symbolize.cc " +
"third_party\\abseil-cpp\\absl\\flags\\commandlineflag.cc " +
"third_party\\abseil-cpp\\absl\\flags\\flag.cc " +
"third_party\\abseil-cpp\\absl\\flags\\internal\\commandlineflag.cc " +
"third_party\\abseil-cpp\\absl\\flags\\internal\\flag.cc " +
"third_party\\abseil-cpp\\absl\\flags\\internal\\private_handle_accessor.cc " +
"third_party\\abseil-cpp\\absl\\flags\\internal\\program_name.cc " +
"third_party\\abseil-cpp\\absl\\flags\\marshalling.cc " +
"third_party\\abseil-cpp\\absl\\flags\\reflection.cc " +
"third_party\\abseil-cpp\\absl\\flags\\usage_config.cc " +
"third_party\\abseil-cpp\\absl\\hash\\internal\\city.cc " +
"third_party\\abseil-cpp\\absl\\hash\\internal\\hash.cc " +
"third_party\\abseil-cpp\\absl\\hash\\internal\\low_level_hash.cc " +
@ -1629,6 +1638,8 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\crc\\internal");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\debugging");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\debugging\\internal");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\flags");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\flags\\internal");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\hash");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\hash\\internal");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\third_party\\abseil-cpp\\absl\\numeric");

18
gRPC-C++.podspec generated

@ -220,6 +220,8 @@ Pod::Spec.new do |s|
ss.dependency 'abseil/container/flat_hash_map', abseil_version
ss.dependency 'abseil/container/flat_hash_set', abseil_version
ss.dependency 'abseil/container/inlined_vector', abseil_version
ss.dependency 'abseil/flags/flag', abseil_version
ss.dependency 'abseil/flags/marshalling', abseil_version
ss.dependency 'abseil/functional/any_invocable', abseil_version
ss.dependency 'abseil/functional/bind_front', abseil_version
ss.dependency 'abseil/functional/function_ref', abseil_version
@ -276,7 +278,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/local_subchannel_pool.h',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h',
'src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h',
'src/core/ext/filters/client_channel/resolver/polling_resolver.h',
'src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h',
@ -729,7 +730,9 @@ Pod::Spec.new do |s|
'src/core/lib/channel/status_util.h',
'src/core/lib/compression/compression_internal.h',
'src/core/lib/compression/message_compress.h',
'src/core/lib/config/config_vars.h',
'src/core/lib/config/core_configuration.h',
'src/core/lib/config/load_config.h',
'src/core/lib/debug/event_log.h',
'src/core/lib/debug/histogram_view.h',
'src/core/lib/debug/stats.h',
@ -797,10 +800,6 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/env.h',
'src/core/lib/gprpp/examine_stack.h',
'src/core/lib/gprpp/fork.h',
'src/core/lib/gprpp/global_config.h',
'src/core/lib/gprpp/global_config_custom.h',
'src/core/lib/gprpp/global_config_env.h',
'src/core/lib/gprpp/global_config_generic.h',
'src/core/lib/gprpp/host_port.h',
'src/core/lib/gprpp/load_file.h',
'src/core/lib/gprpp/manual_constructor.h',
@ -998,7 +997,6 @@ Pod::Spec.new do |s|
'src/core/lib/security/security_connector/security_connector.h',
'src/core/lib/security/security_connector/ssl/ssl_security_connector.h',
'src/core/lib/security/security_connector/ssl_utils.h',
'src/core/lib/security/security_connector/ssl_utils_config.h',
'src/core/lib/security/security_connector/tls/tls_security_connector.h',
'src/core/lib/security/transport/auth_filters.h',
'src/core/lib/security/transport/secure_endpoint.h',
@ -1235,7 +1233,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/local_subchannel_pool.h',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h',
'src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h',
'src/core/ext/filters/client_channel/resolver/polling_resolver.h',
'src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h',
@ -1670,7 +1667,9 @@ Pod::Spec.new do |s|
'src/core/lib/channel/status_util.h',
'src/core/lib/compression/compression_internal.h',
'src/core/lib/compression/message_compress.h',
'src/core/lib/config/config_vars.h',
'src/core/lib/config/core_configuration.h',
'src/core/lib/config/load_config.h',
'src/core/lib/debug/event_log.h',
'src/core/lib/debug/histogram_view.h',
'src/core/lib/debug/stats.h',
@ -1738,10 +1737,6 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/env.h',
'src/core/lib/gprpp/examine_stack.h',
'src/core/lib/gprpp/fork.h',
'src/core/lib/gprpp/global_config.h',
'src/core/lib/gprpp/global_config_custom.h',
'src/core/lib/gprpp/global_config_env.h',
'src/core/lib/gprpp/global_config_generic.h',
'src/core/lib/gprpp/host_port.h',
'src/core/lib/gprpp/load_file.h',
'src/core/lib/gprpp/manual_constructor.h',
@ -1939,7 +1934,6 @@ Pod::Spec.new do |s|
'src/core/lib/security/security_connector/security_connector.h',
'src/core/lib/security/security_connector/ssl/ssl_security_connector.h',
'src/core/lib/security/security_connector/ssl_utils.h',
'src/core/lib/security/security_connector/ssl_utils_config.h',
'src/core/lib/security/security_connector/tls/tls_security_connector.h',
'src/core/lib/security/transport/auth_filters.h',
'src/core/lib/security/transport/secure_endpoint.h',

24
gRPC-Core.podspec generated

@ -186,6 +186,8 @@ Pod::Spec.new do |s|
ss.dependency 'abseil/container/flat_hash_map', abseil_version
ss.dependency 'abseil/container/flat_hash_set', abseil_version
ss.dependency 'abseil/container/inlined_vector', abseil_version
ss.dependency 'abseil/flags/flag', abseil_version
ss.dependency 'abseil/flags/marshalling', abseil_version
ss.dependency 'abseil/functional/any_invocable', abseil_version
ss.dependency 'abseil/functional/bind_front', abseil_version
ss.dependency 'abseil/functional/function_ref', abseil_version
@ -292,8 +294,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc',
'src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc',
'src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h',
'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h',
@ -1120,8 +1120,13 @@ Pod::Spec.new do |s|
'src/core/lib/compression/compression_internal.h',
'src/core/lib/compression/message_compress.cc',
'src/core/lib/compression/message_compress.h',
'src/core/lib/config/config_vars.cc',
'src/core/lib/config/config_vars.h',
'src/core/lib/config/config_vars_non_generated.cc',
'src/core/lib/config/core_configuration.cc',
'src/core/lib/config/core_configuration.h',
'src/core/lib/config/load_config.cc',
'src/core/lib/config/load_config.h',
'src/core/lib/debug/event_log.cc',
'src/core/lib/debug/event_log.h',
'src/core/lib/debug/histogram_view.cc',
@ -1264,11 +1269,6 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/examine_stack.h',
'src/core/lib/gprpp/fork.cc',
'src/core/lib/gprpp/fork.h',
'src/core/lib/gprpp/global_config.h',
'src/core/lib/gprpp/global_config_custom.h',
'src/core/lib/gprpp/global_config_env.cc',
'src/core/lib/gprpp/global_config_env.h',
'src/core/lib/gprpp/global_config_generic.h',
'src/core/lib/gprpp/host_port.cc',
'src/core/lib/gprpp/host_port.h',
'src/core/lib/gprpp/linux/env.cc',
@ -1640,8 +1640,6 @@ Pod::Spec.new do |s|
'src/core/lib/security/security_connector/ssl/ssl_security_connector.h',
'src/core/lib/security/security_connector/ssl_utils.cc',
'src/core/lib/security/security_connector/ssl_utils.h',
'src/core/lib/security/security_connector/ssl_utils_config.cc',
'src/core/lib/security/security_connector/ssl_utils_config.h',
'src/core/lib/security/security_connector/tls/tls_security_connector.cc',
'src/core/lib/security/security_connector/tls/tls_security_connector.h',
'src/core/lib/security/transport/auth_filters.h',
@ -1945,7 +1943,6 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/local_subchannel_pool.h',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h',
'src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h',
'src/core/ext/filters/client_channel/resolver/polling_resolver.h',
'src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h',
@ -2360,7 +2357,9 @@ Pod::Spec.new do |s|
'src/core/lib/channel/status_util.h',
'src/core/lib/compression/compression_internal.h',
'src/core/lib/compression/message_compress.h',
'src/core/lib/config/config_vars.h',
'src/core/lib/config/core_configuration.h',
'src/core/lib/config/load_config.h',
'src/core/lib/debug/event_log.h',
'src/core/lib/debug/histogram_view.h',
'src/core/lib/debug/stats.h',
@ -2428,10 +2427,6 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/env.h',
'src/core/lib/gprpp/examine_stack.h',
'src/core/lib/gprpp/fork.h',
'src/core/lib/gprpp/global_config.h',
'src/core/lib/gprpp/global_config_custom.h',
'src/core/lib/gprpp/global_config_env.h',
'src/core/lib/gprpp/global_config_generic.h',
'src/core/lib/gprpp/host_port.h',
'src/core/lib/gprpp/load_file.h',
'src/core/lib/gprpp/manual_constructor.h',
@ -2629,7 +2624,6 @@ Pod::Spec.new do |s|
'src/core/lib/security/security_connector/security_connector.h',
'src/core/lib/security/security_connector/ssl/ssl_security_connector.h',
'src/core/lib/security/security_connector/ssl_utils.h',
'src/core/lib/security/security_connector/ssl_utils_config.h',
'src/core/lib/security/security_connector/tls/tls_security_connector.h',
'src/core/lib/security/transport/auth_filters.h',
'src/core/lib/security/transport/secure_endpoint.h',

38
grpc.gemspec generated

@ -201,8 +201,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h )
s.files += %w( src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc )
s.files += %w( src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h )
@ -1029,8 +1027,13 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/compression/compression_internal.h )
s.files += %w( src/core/lib/compression/message_compress.cc )
s.files += %w( src/core/lib/compression/message_compress.h )
s.files += %w( src/core/lib/config/config_vars.cc )
s.files += %w( src/core/lib/config/config_vars.h )
s.files += %w( src/core/lib/config/config_vars_non_generated.cc )
s.files += %w( src/core/lib/config/core_configuration.cc )
s.files += %w( src/core/lib/config/core_configuration.h )
s.files += %w( src/core/lib/config/load_config.cc )
s.files += %w( src/core/lib/config/load_config.h )
s.files += %w( src/core/lib/debug/event_log.cc )
s.files += %w( src/core/lib/debug/event_log.h )
s.files += %w( src/core/lib/debug/histogram_view.cc )
@ -1173,11 +1176,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/gprpp/examine_stack.h )
s.files += %w( src/core/lib/gprpp/fork.cc )
s.files += %w( src/core/lib/gprpp/fork.h )
s.files += %w( src/core/lib/gprpp/global_config.h )
s.files += %w( src/core/lib/gprpp/global_config_custom.h )
s.files += %w( src/core/lib/gprpp/global_config_env.cc )
s.files += %w( src/core/lib/gprpp/global_config_env.h )
s.files += %w( src/core/lib/gprpp/global_config_generic.h )
s.files += %w( src/core/lib/gprpp/host_port.cc )
s.files += %w( src/core/lib/gprpp/host_port.h )
s.files += %w( src/core/lib/gprpp/linux/env.cc )
@ -1549,8 +1547,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/security/security_connector/ssl/ssl_security_connector.h )
s.files += %w( src/core/lib/security/security_connector/ssl_utils.cc )
s.files += %w( src/core/lib/security/security_connector/ssl_utils.h )
s.files += %w( src/core/lib/security/security_connector/ssl_utils_config.cc )
s.files += %w( src/core/lib/security/security_connector/ssl_utils_config.h )
s.files += %w( src/core/lib/security/security_connector/tls/tls_security_connector.cc )
s.files += %w( src/core/lib/security/security_connector/tls/tls_security_connector.h )
s.files += %w( src/core/lib/security/transport/auth_filters.h )
@ -1843,6 +1839,30 @@ Gem::Specification.new do |s|
s.files += %w( third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc )
s.files += %w( third_party/abseil-cpp/absl/debugging/symbolize_unimplemented.inc )
s.files += %w( third_party/abseil-cpp/absl/debugging/symbolize_win32.inc )
s.files += %w( third_party/abseil-cpp/absl/flags/commandlineflag.cc )
s.files += %w( third_party/abseil-cpp/absl/flags/commandlineflag.h )
s.files += %w( third_party/abseil-cpp/absl/flags/config.h )
s.files += %w( third_party/abseil-cpp/absl/flags/declare.h )
s.files += %w( third_party/abseil-cpp/absl/flags/flag.cc )
s.files += %w( third_party/abseil-cpp/absl/flags/flag.h )
s.files += %w( third_party/abseil-cpp/absl/flags/internal/commandlineflag.cc )
s.files += %w( third_party/abseil-cpp/absl/flags/internal/commandlineflag.h )
s.files += %w( third_party/abseil-cpp/absl/flags/internal/flag.cc )
s.files += %w( third_party/abseil-cpp/absl/flags/internal/flag.h )
s.files += %w( third_party/abseil-cpp/absl/flags/internal/flag_msvc.inc )
s.files += %w( third_party/abseil-cpp/absl/flags/internal/path_util.h )
s.files += %w( third_party/abseil-cpp/absl/flags/internal/private_handle_accessor.cc )
s.files += %w( third_party/abseil-cpp/absl/flags/internal/private_handle_accessor.h )
s.files += %w( third_party/abseil-cpp/absl/flags/internal/program_name.cc )
s.files += %w( third_party/abseil-cpp/absl/flags/internal/program_name.h )
s.files += %w( third_party/abseil-cpp/absl/flags/internal/registry.h )
s.files += %w( third_party/abseil-cpp/absl/flags/internal/sequence_lock.h )
s.files += %w( third_party/abseil-cpp/absl/flags/marshalling.cc )
s.files += %w( third_party/abseil-cpp/absl/flags/marshalling.h )
s.files += %w( third_party/abseil-cpp/absl/flags/reflection.cc )
s.files += %w( third_party/abseil-cpp/absl/flags/reflection.h )
s.files += %w( third_party/abseil-cpp/absl/flags/usage_config.cc )
s.files += %w( third_party/abseil-cpp/absl/flags/usage_config.h )
s.files += %w( third_party/abseil-cpp/absl/functional/any_invocable.h )
s.files += %w( third_party/abseil-cpp/absl/functional/bind_front.h )
s.files += %w( third_party/abseil-cpp/absl/functional/function_ref.h )

10
grpc.gyp generated

@ -293,6 +293,8 @@
'dependencies': [
'absl/base:base',
'absl/base:core_headers',
'absl/flags:flag',
'absl/flags:marshalling',
'absl/functional:any_invocable',
'absl/memory:memory',
'absl/random:random',
@ -306,6 +308,9 @@
'absl/types:variant',
],
'sources': [
'src/core/lib/config/config_vars.cc',
'src/core/lib/config/config_vars_non_generated.cc',
'src/core/lib/config/load_config.cc',
'src/core/lib/event_engine/thread_local.cc',
'src/core/lib/gpr/alloc.cc',
'src/core/lib/gpr/android/log.cc',
@ -337,7 +342,6 @@
'src/core/lib/gprpp/crash.cc',
'src/core/lib/gprpp/examine_stack.cc',
'src/core/lib/gprpp/fork.cc',
'src/core/lib/gprpp/global_config_env.cc',
'src/core/lib/gprpp/host_port.cc',
'src/core/lib/gprpp/linux/env.cc',
'src/core/lib/gprpp/mpscq.cc',
@ -421,7 +425,6 @@
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc',
'src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc',
'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc',
'src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc',
@ -1041,7 +1044,6 @@
'src/core/lib/security/security_connector/security_connector.cc',
'src/core/lib/security/security_connector/ssl/ssl_security_connector.cc',
'src/core/lib/security/security_connector/ssl_utils.cc',
'src/core/lib/security/security_connector/ssl_utils_config.cc',
'src/core/lib/security/security_connector/tls/tls_security_connector.cc',
'src/core/lib/security/transport/client_auth_filter.cc',
'src/core/lib/security/transport/secure_endpoint.cc',
@ -1233,7 +1235,6 @@
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc',
'src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc',
'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc',
'src/core/ext/filters/client_channel/resolver/polling_resolver.cc',
@ -1718,7 +1719,6 @@
'target_name': 'grpc++_test_util',
'type': 'static_library',
'dependencies': [
'absl/flags:flag',
'grpc++',
'grpc_test_util',
],

38
package.xml generated

@ -183,8 +183,6 @@
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h" role="src" />
@ -1011,8 +1009,13 @@
<file baseinstalldir="/" name="src/core/lib/compression/compression_internal.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/compression/message_compress.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/compression/message_compress.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/config/config_vars.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/config/config_vars.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/config/config_vars_non_generated.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/config/core_configuration.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/config/core_configuration.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/config/load_config.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/config/load_config.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/debug/event_log.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/debug/event_log.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/debug/histogram_view.cc" role="src" />
@ -1155,11 +1158,6 @@
<file baseinstalldir="/" name="src/core/lib/gprpp/examine_stack.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/fork.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/fork.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/global_config.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/global_config_custom.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/global_config_env.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/global_config_env.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/global_config_generic.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/host_port.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/host_port.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/linux/env.cc" role="src" />
@ -1531,8 +1529,6 @@
<file baseinstalldir="/" name="src/core/lib/security/security_connector/ssl/ssl_security_connector.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/security_connector/ssl_utils.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/security_connector/ssl_utils.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/security_connector/ssl_utils_config.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/security_connector/ssl_utils_config.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/security_connector/tls/tls_security_connector.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/security_connector/tls/tls_security_connector.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/transport/auth_filters.h" role="src" />
@ -1847,6 +1843,30 @@
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/symbolize_unimplemented.inc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/debugging/symbolize_win32.inc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/flags/commandlineflag.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/flags/commandlineflag.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/flags/config.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/flags/declare.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/flags/flag.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/flags/flag.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/flags/internal/commandlineflag.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/flags/internal/commandlineflag.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/flags/internal/flag.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/flags/internal/flag.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/flags/internal/flag_msvc.inc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/flags/internal/path_util.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/flags/internal/private_handle_accessor.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/flags/internal/private_handle_accessor.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/flags/internal/program_name.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/flags/internal/program_name.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/flags/internal/registry.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/flags/internal/sequence_lock.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/flags/marshalling.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/flags/marshalling.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/flags/reflection.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/flags/reflection.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/flags/usage_config.cc" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/flags/usage_config.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/functional/any_invocable.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/functional/bind_front.h" role="src" />
<file baseinstalldir="/" name="third_party/abseil-cpp/absl/functional/function_ref.h" role="src" />

@ -116,6 +116,7 @@ grpc_cc_library(
language = "c++",
deps = [
"no_destruct",
"//:config_vars",
"//:gpr",
],
)
@ -1726,6 +1727,7 @@ grpc_cc_library(
"posix_event_engine_event_poller",
"posix_event_engine_poller_posix_epoll1",
"posix_event_engine_poller_posix_poll",
"//:config_vars",
"//:gpr",
],
)
@ -4850,18 +4852,6 @@ grpc_cc_library(
],
)
grpc_cc_library(
name = "grpc_resolver_dns_selection",
srcs = [
"ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc",
],
hdrs = [
"ext/filters/client_channel/resolver/dns/dns_resolver_selection.h",
],
language = "c++",
deps = ["//:gpr"],
)
grpc_cc_library(
name = "grpc_resolver_dns_native",
srcs = [
@ -4877,12 +4867,12 @@ grpc_cc_library(
language = "c++",
deps = [
"channel_args",
"grpc_resolver_dns_selection",
"polling_resolver",
"resolved_address",
"time",
"//:backoff",
"//:config",
"//:config_vars",
"//:debug_location",
"//:gpr",
"//:grpc_base",

@ -28,7 +28,7 @@
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include "src/core/lib/gprpp/global_config.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/iomgr/closure.h"
@ -61,19 +61,10 @@ static backup_poller* g_poller = nullptr; // guarded by g_poller_mu
static grpc_core::Duration g_poll_interval =
grpc_core::Duration::Milliseconds(DEFAULT_POLL_INTERVAL_MS);
GPR_GLOBAL_CONFIG_DEFINE_INT32(
grpc_client_channel_backup_poll_interval_ms, DEFAULT_POLL_INTERVAL_MS,
"Declares the interval in ms between two backup polls on client channels. "
"These polls are run in the timer thread so that gRPC can process "
"connection failures while there is no active polling thread. "
"They help reconnect disconnected client channels (mostly due to "
"idleness), so that the next RPC on this channel won't fail. Set to 0 to "
"turn off the backup polls.");
void grpc_client_channel_global_init_backup_polling() {
gpr_mu_init(&g_poller_mu);
int32_t poll_interval_ms =
GPR_GLOBAL_CONFIG_GET(grpc_client_channel_backup_poll_interval_ms);
grpc_core::ConfigVars::Get().ClientChannelBackupPollIntervalMs();
if (poll_interval_ms < 0) {
gpr_log(GPR_ERROR,
"Invalid GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS: %d, "

@ -21,11 +21,8 @@
#include <grpc/support/port_platform.h>
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/iomgr/iomgr_fwd.h"
GPR_GLOBAL_CONFIG_DECLARE_INT32(grpc_client_channel_backup_poll_interval_ms);
// Initializes backup polling.
void grpc_client_channel_global_init_backup_polling();

@ -30,6 +30,7 @@
#include "absl/base/thread_annotations.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/match.h"
#include "absl/strings/string_view.h"
#include "absl/strings/strip.h"
#include "absl/types/optional.h"
@ -42,8 +43,6 @@
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/status_helper.h"
@ -62,7 +61,6 @@
#if GRPC_ARES == 1
#include <stdio.h>
#include <string.h>
#include <address_sorting/address_sorting.h>
@ -71,12 +69,11 @@
#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h"
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
#include "src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h"
#include "src/core/ext/filters/client_channel/resolver/polling_resolver.h"
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/event_engine/handle_containers.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/iomgr/gethostname.h"
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/json/json.h"
@ -812,19 +809,12 @@ class AresDNSResolver : public DNSResolver {
intptr_t aba_token_ ABSL_GUARDED_BY(mu_) = 0;
};
bool ShouldUseAres(const char* resolver_env) {
return resolver_env == nullptr || strlen(resolver_env) == 0 ||
gpr_stricmp(resolver_env, "ares") == 0;
bool ShouldUseAres(absl::string_view resolver_env) {
return resolver_env.empty() || absl::EqualsIgnoreCase(resolver_env, "ares");
}
bool UseAresDnsResolver() {
static const bool result = []() {
UniquePtr<char> resolver = GPR_GLOBAL_CONFIG_GET(grpc_dns_resolver);
bool result = ShouldUseAres(resolver.get());
if (result) gpr_log(GPR_DEBUG, "Using ares dns resolver");
return result;
}();
return result;
return ShouldUseAres(ConfigVars::Get().DnsResolver());
}
} // namespace

@ -1,30 +0,0 @@
//
// Copyright 2019 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// This is similar to the sockaddr resolver, except that it supports a
// bunch of query args that are useful for dependency injection in tests.
#include <grpc/support/port_platform.h>
#include "src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h"
#include "src/core/lib/gprpp/global_config.h"
GPR_GLOBAL_CONFIG_DEFINE_STRING(
grpc_dns_resolver, "",
"Declares which DNS resolver to use. The default is ares if gRPC is built "
"with c-ares support. Otherwise, the value of this environment variable is "
"ignored.")

@ -1,29 +0,0 @@
//
//
// Copyright 2019 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//
#ifndef GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_DNS_RESOLVER_SELECTION_H
#define GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_DNS_RESOLVER_SELECTION_H
#include <grpc/support/port_platform.h>
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/gprpp/memory.h"
GPR_GLOBAL_CONFIG_DECLARE_STRING(grpc_dns_resolver);
#endif // GRPC_SRC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_DNS_RESOLVER_SELECTION_H

@ -25,6 +25,7 @@
#include "absl/functional/bind_front.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/match.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "absl/strings/strip.h"
@ -33,16 +34,13 @@
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include "src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h"
#include "src/core/ext/filters/client_channel/resolver/polling_resolver.h"
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/time.h"
@ -181,9 +179,7 @@ class NativeClientChannelDNSResolverFactory : public ResolverFactory {
} // namespace
void RegisterNativeDnsResolver(CoreConfiguration::Builder* builder) {
static const char* const resolver =
GPR_GLOBAL_CONFIG_GET(grpc_dns_resolver).release();
if (gpr_stricmp(resolver, "native") == 0) {
if (absl::EqualsIgnoreCase(ConfigVars::Get().DnsResolver(), "native")) {
gpr_log(GPR_DEBUG, "Using native dns resolver");
builder->resolver_registry()->RegisterResolverFactory(
std::make_unique<NativeClientChannelDNSResolverFactory>());

@ -0,0 +1,151 @@
// Copyright 2023 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Automatically generated by tools/codegen/core/gen_config_vars.py
//
#include <grpc/support/port_platform.h>
#include "src/core/lib/config/config_vars.h"
#include "absl/flags/flag.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_cat.h"
#include "src/core/lib/config/load_config.h"
#ifndef GPR_DEFAULT_LOG_VERBOSITY_STRING
#define GPR_DEFAULT_LOG_VERBOSITY_STRING "ERROR"
#endif // !GPR_DEFAULT_LOG_VERBOSITY_STRING
#ifdef GRPC_ENABLE_FORK_SUPPORT
#define GRPC_ENABLE_FORK_SUPPORT_DEFAULT true
#else
#define GRPC_ENABLE_FORK_SUPPORT_DEFAULT false
#endif // GRPC_ENABLE_FORK_SUPPORT
ABSL_FLAG(absl::optional<std::string>, grpc_experiments, absl::nullopt,
"A comma separated list of currently active experiments. Experiments "
"may be prefixed with a '-' to disable them.");
ABSL_FLAG(absl::optional<int32_t>, grpc_client_channel_backup_poll_interval_ms,
absl::nullopt,
"Declares the interval in ms between two backup polls on client "
"channels. These polls are run in the timer thread so that gRPC can "
"process connection failures while there is no active polling "
"thread. They help reconnect disconnected client channels (mostly "
"due to idleness), so that the next RPC on this channel won't fail. "
"Set to 0 to turn off the backup polls.");
ABSL_FLAG(absl::optional<std::string>, grpc_dns_resolver, absl::nullopt,
"Declares which DNS resolver to use. The default is ares if gRPC is "
"built with c-ares support. Otherwise, the value of this environment "
"variable is ignored.");
ABSL_FLAG(absl::optional<std::string>, grpc_trace, absl::nullopt,
"A comma separated list of tracers that provide additional insight "
"into how gRPC C core is processing requests via debug logs.");
ABSL_FLAG(absl::optional<std::string>, grpc_verbosity, absl::nullopt,
"Default gRPC logging verbosity");
ABSL_FLAG(absl::optional<std::string>, grpc_stacktrace_minloglevel,
absl::nullopt,
"Messages logged at the same or higher level than this will print "
"stacktrace");
ABSL_FLAG(absl::optional<bool>, grpc_enable_fork_support, absl::nullopt,
"Enable fork support");
ABSL_FLAG(absl::optional<std::string>, grpc_poll_strategy, absl::nullopt,
"Declares which polling engines to try when starting gRPC. This is a "
"comma-separated list of engines, which are tried in priority order "
"first -> last.");
ABSL_FLAG(absl::optional<bool>, grpc_abort_on_leaks, absl::nullopt,
"A debugging aid to cause a call to abort() when gRPC objects are "
"leaked past grpc_shutdown()");
ABSL_FLAG(absl::optional<std::string>, grpc_system_ssl_roots_dir, absl::nullopt,
"Custom directory to SSL Roots");
ABSL_FLAG(absl::optional<std::string>, grpc_default_ssl_roots_file_path,
absl::nullopt, "Path to the default SSL roots file.");
ABSL_FLAG(absl::optional<bool>, grpc_not_use_system_ssl_roots, absl::nullopt,
"Disable loading system root certificates.");
ABSL_FLAG(absl::optional<std::string>, grpc_ssl_cipher_suites, absl::nullopt,
"A colon separated list of cipher suites to use with OpenSSL");
namespace grpc_core {
ConfigVars::ConfigVars(const Overrides& overrides)
: client_channel_backup_poll_interval_ms_(
LoadConfig(FLAGS_grpc_client_channel_backup_poll_interval_ms,
"GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS",
overrides.client_channel_backup_poll_interval_ms, 5000)),
enable_fork_support_(LoadConfig(
FLAGS_grpc_enable_fork_support, "GRPC_ENABLE_FORK_SUPPORT",
overrides.enable_fork_support, GRPC_ENABLE_FORK_SUPPORT_DEFAULT)),
abort_on_leaks_(LoadConfig(FLAGS_grpc_abort_on_leaks,
"GRPC_ABORT_ON_LEAKS",
overrides.abort_on_leaks, false)),
not_use_system_ssl_roots_(LoadConfig(
FLAGS_grpc_not_use_system_ssl_roots, "GRPC_NOT_USE_SYSTEM_SSL_ROOTS",
overrides.not_use_system_ssl_roots, false)),
experiments_(LoadConfig(FLAGS_grpc_experiments, "GRPC_EXPERIMENTS",
overrides.experiments, "")),
dns_resolver_(LoadConfig(FLAGS_grpc_dns_resolver, "GRPC_DNS_RESOLVER",
overrides.dns_resolver, "")),
trace_(LoadConfig(FLAGS_grpc_trace, "GRPC_TRACE", overrides.trace, "")),
verbosity_(LoadConfig(FLAGS_grpc_verbosity, "GRPC_VERBOSITY",
overrides.verbosity,
GPR_DEFAULT_LOG_VERBOSITY_STRING)),
stacktrace_minloglevel_(LoadConfig(FLAGS_grpc_stacktrace_minloglevel,
"GRPC_STACKTRACE_MINLOGLEVEL",
overrides.stacktrace_minloglevel, "")),
poll_strategy_(LoadConfig(FLAGS_grpc_poll_strategy, "GRPC_POLL_STRATEGY",
overrides.poll_strategy, "all")),
ssl_cipher_suites_(LoadConfig(
FLAGS_grpc_ssl_cipher_suites, "GRPC_SSL_CIPHER_SUITES",
overrides.ssl_cipher_suites,
"TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_"
"SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:"
"ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384")),
override_system_ssl_roots_dir_(overrides.system_ssl_roots_dir),
override_default_ssl_roots_file_path_(
overrides.default_ssl_roots_file_path) {}
std::string ConfigVars::SystemSslRootsDir() const {
return LoadConfig(FLAGS_grpc_system_ssl_roots_dir,
"GRPC_SYSTEM_SSL_ROOTS_DIR", override_system_ssl_roots_dir_,
"");
}
std::string ConfigVars::DefaultSslRootsFilePath() const {
return LoadConfig(FLAGS_grpc_default_ssl_roots_file_path,
"GRPC_DEFAULT_SSL_ROOTS_FILE_PATH",
override_default_ssl_roots_file_path_, "");
}
std::string ConfigVars::ToString() const {
return absl::StrCat(
"experiments: ", "\"", absl::CEscape(Experiments()), "\"",
", client_channel_backup_poll_interval_ms: ",
ClientChannelBackupPollIntervalMs(), ", dns_resolver: ", "\"",
absl::CEscape(DnsResolver()), "\"", ", trace: ", "\"",
absl::CEscape(Trace()), "\"", ", verbosity: ", "\"",
absl::CEscape(Verbosity()), "\"", ", stacktrace_minloglevel: ", "\"",
absl::CEscape(StacktraceMinloglevel()), "\"",
", enable_fork_support: ", EnableForkSupport() ? "true" : "false",
", poll_strategy: ", "\"", absl::CEscape(PollStrategy()), "\"",
", abort_on_leaks: ", AbortOnLeaks() ? "true" : "false",
", system_ssl_roots_dir: ", "\"", absl::CEscape(SystemSslRootsDir()),
"\"", ", default_ssl_roots_file_path: ", "\"",
absl::CEscape(DefaultSslRootsFilePath()), "\"",
", not_use_system_ssl_roots: ", NotUseSystemSslRoots() ? "true" : "false",
", ssl_cipher_suites: ", "\"", absl::CEscape(SslCipherSuites()), "\"");
}
} // namespace grpc_core

@ -0,0 +1,127 @@
// Copyright 2023 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Automatically generated by tools/codegen/core/gen_config_vars.py
//
#ifndef GRPC_SRC_CORE_LIB_CONFIG_CONFIG_VARS_H
#define GRPC_SRC_CORE_LIB_CONFIG_CONFIG_VARS_H
#include <grpc/support/port_platform.h>
#include <stdint.h>
#include <atomic>
#include <string>
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
namespace grpc_core {
class ConfigVars {
public:
struct Overrides {
absl::optional<int32_t> client_channel_backup_poll_interval_ms;
absl::optional<bool> enable_fork_support;
absl::optional<bool> abort_on_leaks;
absl::optional<bool> not_use_system_ssl_roots;
absl::optional<std::string> experiments;
absl::optional<std::string> dns_resolver;
absl::optional<std::string> trace;
absl::optional<std::string> verbosity;
absl::optional<std::string> stacktrace_minloglevel;
absl::optional<std::string> poll_strategy;
absl::optional<std::string> system_ssl_roots_dir;
absl::optional<std::string> default_ssl_roots_file_path;
absl::optional<std::string> ssl_cipher_suites;
};
ConfigVars(const ConfigVars&) = delete;
ConfigVars& operator=(const ConfigVars&) = delete;
// Get the core configuration; if it does not exist, create it.
static const ConfigVars& Get() {
auto* p = config_vars_.load(std::memory_order_acquire);
if (p != nullptr) return *p;
return Load();
}
static void SetOverrides(const Overrides& overrides);
// Drop the config vars. Users must ensure no other threads are
// accessing the configuration.
static void Reset();
std::string ToString() const;
// A comma separated list of currently active experiments. Experiments may be
// prefixed with a '-' to disable them.
absl::string_view Experiments() const { return experiments_; }
// Declares the interval in ms between two backup polls on client channels.
// These polls are run in the timer thread so that gRPC can process connection
// failures while there is no active polling thread. They help reconnect
// disconnected client channels (mostly due to idleness), so that the next RPC
// on this channel won't fail. Set to 0 to turn off the backup polls.
int32_t ClientChannelBackupPollIntervalMs() const {
return client_channel_backup_poll_interval_ms_;
}
// Declares which DNS resolver to use. The default is ares if gRPC is built
// with c-ares support. Otherwise, the value of this environment variable is
// ignored.
absl::string_view DnsResolver() const { return dns_resolver_; }
// A comma separated list of tracers that provide additional insight into how
// gRPC C core is processing requests via debug logs.
absl::string_view Trace() const { return trace_; }
// Default gRPC logging verbosity
absl::string_view Verbosity() const { return verbosity_; }
// Messages logged at the same or higher level than this will print stacktrace
absl::string_view StacktraceMinloglevel() const {
return stacktrace_minloglevel_;
}
// Enable fork support
bool EnableForkSupport() const { return enable_fork_support_; }
// Declares which polling engines to try when starting gRPC. This is a
// comma-separated list of engines, which are tried in priority order first ->
// last.
absl::string_view PollStrategy() const { return poll_strategy_; }
// A debugging aid to cause a call to abort() when gRPC objects are leaked
// past grpc_shutdown()
bool AbortOnLeaks() const { return abort_on_leaks_; }
// Custom directory to SSL Roots
std::string SystemSslRootsDir() const;
// Path to the default SSL roots file.
std::string DefaultSslRootsFilePath() const;
// Disable loading system root certificates.
bool NotUseSystemSslRoots() const { return not_use_system_ssl_roots_; }
// A colon separated list of cipher suites to use with OpenSSL
absl::string_view SslCipherSuites() const { return ssl_cipher_suites_; }
private:
explicit ConfigVars(const Overrides& overrides);
static const ConfigVars& Load();
static std::atomic<ConfigVars*> config_vars_;
int32_t client_channel_backup_poll_interval_ms_;
bool enable_fork_support_;
bool abort_on_leaks_;
bool not_use_system_ssl_roots_;
std::string experiments_;
std::string dns_resolver_;
std::string trace_;
std::string verbosity_;
std::string stacktrace_minloglevel_;
std::string poll_strategy_;
std::string ssl_cipher_suites_;
absl::optional<std::string> override_system_ssl_roots_dir_;
absl::optional<std::string> override_default_ssl_roots_file_path_;
};
} // namespace grpc_core
#endif // GRPC_SRC_CORE_LIB_CONFIG_CONFIG_VARS_H

@ -0,0 +1,113 @@
# Copyright 2022 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# File format:
# Each config var gets a name, and a type (one of string, int, bool).
# A default value is provided. Defaults prefixed by '$' are read as expressions,
# otherwise they're assumed literals.
# A description field must be present.
# Optionally, a force-load-on-access: true flag can be added to force checking
# the environment variables every time the value is queried, to match legacy
# behavior for some environment variables.
- name: experiments
type: string
description:
A comma separated list of currently active experiments. Experiments may be
prefixed with a '-' to disable them.
default:
- name: client_channel_backup_poll_interval_ms
type: int
default: 5000
description:
Declares the interval in ms between two backup polls on client channels.
These polls are run in the timer thread so that gRPC can process
connection failures while there is no active polling thread.
They help reconnect disconnected client channels (mostly due to
idleness), so that the next RPC on this channel won't fail. Set to 0 to
turn off the backup polls.
- name: dns_resolver
default:
type: string
description:
Declares which DNS resolver to use. The default is ares if gRPC is built
with c-ares support. Otherwise, the value of this environment variable is
ignored.
- name: trace
type: string
default:
description:
A comma separated list of tracers that provide additional insight into
how gRPC C core is processing requests via debug logs.
- name: verbosity
type: string
prelude: |
#ifndef GPR_DEFAULT_LOG_VERBOSITY_STRING
#define GPR_DEFAULT_LOG_VERBOSITY_STRING "ERROR"
#endif // !GPR_DEFAULT_LOG_VERBOSITY_STRING
default: $GPR_DEFAULT_LOG_VERBOSITY_STRING
description:
Default gRPC logging verbosity
- name: stacktrace_minloglevel
type: string
default:
description:
Messages logged at the same or higher level than this will print stacktrace
- name: enable_fork_support
type: bool
description: Enable fork support
prelude: |
#ifdef GRPC_ENABLE_FORK_SUPPORT
#define GRPC_ENABLE_FORK_SUPPORT_DEFAULT true
#else
#define GRPC_ENABLE_FORK_SUPPORT_DEFAULT false
#endif // GRPC_ENABLE_FORK_SUPPORT
default: $GRPC_ENABLE_FORK_SUPPORT_DEFAULT
- name: poll_strategy
type: string
description:
Declares which polling engines to try when starting gRPC.
This is a comma-separated list of engines, which are tried in priority
order first -> last.
default: all
- name: abort_on_leaks
type: bool
default: false
description:
A debugging aid to cause a call to abort() when gRPC objects are leaked
past grpc_shutdown()
- name: system_ssl_roots_dir
type: string
default:
description: Custom directory to SSL Roots
force-load-on-access: true
- name: default_ssl_roots_file_path
type: string
default:
description: Path to the default SSL roots file.
force-load-on-access: true
- name: not_use_system_ssl_roots
type: bool
default: false
description: Disable loading system root certificates.
- name: ssl_cipher_suites
type: string
description: A colon separated list of cipher suites to use with OpenSSL
default: "TLS_AES_128_GCM_SHA256:\
TLS_AES_256_GCM_SHA384:\
TLS_CHACHA20_POLY1305_SHA256:\
ECDHE-ECDSA-AES128-GCM-SHA256:\
ECDHE-ECDSA-AES256-GCM-SHA384:\
ECDHE-RSA-AES128-GCM-SHA256:\
ECDHE-RSA-AES256-GCM-SHA384"

@ -0,0 +1,51 @@
// Copyright 2022 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <grpc/support/port_platform.h>
#include <stdint.h>
#include <atomic>
#include <string>
#include "src/core/lib/config/config_vars.h"
namespace grpc_core {
std::atomic<ConfigVars*> ConfigVars::config_vars_{nullptr};
const ConfigVars& ConfigVars::Load() {
// Called from get, so we know there's no existing config vars.
// We might race for them though.
auto vars = new ConfigVars({});
ConfigVars* expected = nullptr;
if (!config_vars_.compare_exchange_strong(expected, vars,
std::memory_order_acq_rel,
std::memory_order_acquire)) {
delete vars;
return *expected;
}
return *vars;
}
void ConfigVars::Reset() {
delete config_vars_.exchange(nullptr, std::memory_order_acq_rel);
}
void ConfigVars::SetOverrides(const Overrides& overrides) {
delete config_vars_.exchange(new ConfigVars(overrides),
std::memory_order_acq_rel);
}
} // namespace grpc_core

@ -0,0 +1,66 @@
// Copyright 2022 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <grpc/support/port_platform.h>
#include "src/core/lib/config/load_config.h"
#include <stdio.h>
#include "absl/flags/marshalling.h"
#include "absl/strings/numbers.h"
#include "absl/types/optional.h"
#include "src/core/lib/gprpp/env.h"
namespace grpc_core {
namespace {
absl::optional<std::string> LoadEnv(absl::string_view environment_variable) {
return GetEnv(std::string(environment_variable).c_str());
}
} // namespace
std::string LoadConfigFromEnv(absl::string_view environment_variable,
const char* default_value) {
return LoadEnv(environment_variable).value_or(default_value);
}
int32_t LoadConfigFromEnv(absl::string_view environment_variable,
int32_t default_value) {
auto env = LoadEnv(environment_variable);
if (env.has_value()) {
int32_t out;
if (absl::SimpleAtoi(*env, &out)) return out;
fprintf(stderr, "Error reading int from %s: '%s' is not a number",
std::string(environment_variable).c_str(), env->c_str());
}
return default_value;
}
bool LoadConfigFromEnv(absl::string_view environment_variable,
bool default_value) {
auto env = LoadEnv(environment_variable);
if (env.has_value()) {
bool out;
std::string error;
if (absl::ParseFlag(env->c_str(), &out, &error)) return out;
fprintf(stderr, "Error reading bool from %s: '%s' is not a bool: %s",
std::string(environment_variable).c_str(), env->c_str(),
error.c_str());
}
return default_value;
}
} // namespace grpc_core

@ -0,0 +1,49 @@
// Copyright 2022 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef GRPC_SRC_CORE_LIB_CONFIG_LOAD_CONFIG_H
#define GRPC_SRC_CORE_LIB_CONFIG_LOAD_CONFIG_H
#include <grpc/support/port_platform.h>
#include <stdint.h>
#include <string>
#include "absl/flags/flag.h"
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
namespace grpc_core {
std::string LoadConfigFromEnv(absl::string_view environment_variable,
const char* default_value);
int32_t LoadConfigFromEnv(absl::string_view environment_variable,
int32_t default_value);
bool LoadConfigFromEnv(absl::string_view environment_variable,
bool default_value);
template <typename T, typename D>
T LoadConfig(const absl::Flag<absl::optional<T>>& flag,
absl::string_view environment_variable,
const absl::optional<T>& override, D default_value) {
if (override.has_value()) return *override;
auto from_flag = absl::GetFlag(flag);
if (from_flag.has_value()) return std::move(*from_flag);
return LoadConfigFromEnv(environment_variable, default_value);
}
} // namespace grpc_core
#endif // GRPC_SRC_CORE_LIB_CONFIG_LOAD_CONFIG_H

@ -22,16 +22,16 @@
#include <string.h>
#include <string>
#include <type_traits>
#include "absl/strings/string_view.h"
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
GPR_GLOBAL_CONFIG_DEFINE_STRING(
grpc_trace, "",
"A comma separated list of tracers that provide additional insight into "
"how gRPC C core is processing requests via debug logs.");
#include "src/core/lib/config/config_vars.h"
int grpc_tracer_set_enabled(const char* name, int enabled);
@ -144,8 +144,7 @@ void grpc_tracer_init(const char* env_var_name) {
}
void grpc_tracer_init() {
grpc_core::UniquePtr<char> value = GPR_GLOBAL_CONFIG_GET(grpc_trace);
parse(value.get());
parse(std::string(grpc_core::ConfigVars::Get().Trace()).c_str());
}
int grpc_tracer_set_enabled(const char* name, int enabled) {

@ -23,11 +23,6 @@
#include <atomic>
#include "src/core/lib/gprpp/global_config.h"
#include "src/core/lib/gprpp/memory.h"
GPR_GLOBAL_CONFIG_DECLARE_STRING(grpc_trace);
// TODO(veblush): Remove this deprecated function once codes depending on this
// function are updated in the internal repo.
void grpc_tracer_init(const char* env_var_name);

@ -40,7 +40,6 @@
#include "src/core/lib/event_engine/posix_engine/event_poller.h"
#include "src/core/lib/event_engine/posix_engine/posix_engine_closure.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/iomgr/port.h"
#ifdef GRPC_POSIX_SOCKET_EV_POLL
@ -58,14 +57,11 @@
#include "src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.h"
#include "src/core/lib/event_engine/time_util.h"
#include "src/core/lib/gprpp/fork.h"
#include "src/core/lib/gprpp/global_config.h"
#include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/gprpp/strerror.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/gprpp/time.h"
GPR_GLOBAL_CONFIG_DECLARE_STRING(grpc_poll_strategy);
static const intptr_t kClosureNotReady = 0;
static const intptr_t kClosureReady = 1;
static const int kPollinCheck = POLLIN | POLLHUP | POLLERR;

@ -17,17 +17,12 @@
#include "absl/strings/str_split.h"
#include "absl/strings/string_view.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h"
#include "src/core/lib/event_engine/posix_engine/ev_poll_posix.h"
#include "src/core/lib/event_engine/posix_engine/event_poller.h"
#include "src/core/lib/gprpp/global_config.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/iomgr/port.h"
#ifdef GRPC_POSIX_SOCKET_TCP
GPR_GLOBAL_CONFIG_DECLARE_STRING(grpc_poll_strategy);
#endif
namespace grpc_event_engine {
namespace experimental {
@ -41,10 +36,9 @@ bool PollStrategyMatches(absl::string_view strategy, absl::string_view want) {
} // namespace
PosixEventPoller* MakeDefaultPoller(Scheduler* scheduler) {
static const char* poll_strategy =
GPR_GLOBAL_CONFIG_GET(grpc_poll_strategy).release();
PosixEventPoller* poller = nullptr;
auto strings = absl::StrSplit(poll_strategy, ',');
auto strings =
absl::StrSplit(grpc_core::ConfigVars::Get().PollStrategy(), ',');
for (auto it = strings.begin(); it != strings.end() && poller == nullptr;
it++) {
if (PollStrategyMatches(*it, "epoll1")) {

@ -29,17 +29,12 @@
#include <grpc/support/log.h>
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/experiments/experiments.h"
#include "src/core/lib/gprpp/crash.h" // IWYU pragma: keep
#include "src/core/lib/gprpp/global_config.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/no_destruct.h"
#ifndef GRPC_EXPERIMENTS_ARE_FINAL
GPR_GLOBAL_CONFIG_DEFINE_STRING(
grpc_experiments, "",
"List of grpc experiments to enable (or with a '-' prefix to disable).");
namespace grpc_core {
namespace {
@ -66,11 +61,9 @@ GPR_ATTRIBUTE_NOINLINE Experiments LoadExperimentsFromConfigVariable() {
experiments.enabled[i] = g_forced_experiments[i].value;
}
}
// Get the global config.
auto experiments_str = GPR_GLOBAL_CONFIG_GET(grpc_experiments);
// For each comma-separated experiment in the global config:
for (auto experiment :
absl::StrSplit(absl::string_view(experiments_str.get()), ',')) {
for (auto experiment : absl::StrSplit(
absl::string_view(ConfigVars::Get().Experiments()), ',')) {
// Strip whitespace.
experiment = absl::StripAsciiWhitespace(experiment);
// Handle ",," without crashing.

@ -21,27 +21,21 @@
#include <stdio.h>
#include <string.h>
#include "absl/strings/match.h"
#include "absl/strings/str_cat.h"
#include <grpc/support/alloc.h>
#include <grpc/support/atm.h>
#include <grpc/support/log.h>
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/global_config.h"
#ifndef GPR_DEFAULT_LOG_VERBOSITY_STRING
#define GPR_DEFAULT_LOG_VERBOSITY_STRING "ERROR"
#endif // !GPR_DEFAULT_LOG_VERBOSITY_STRING
GPR_GLOBAL_CONFIG_DEFINE_STRING(grpc_verbosity,
GPR_DEFAULT_LOG_VERBOSITY_STRING,
"Default gRPC logging verbosity")
GPR_GLOBAL_CONFIG_DEFINE_STRING(grpc_stacktrace_minloglevel, "",
"Messages logged at the same or higher level "
"than this will print stacktrace")
static constexpr gpr_atm GPR_LOG_SEVERITY_UNSET = GPR_LOG_SEVERITY_ERROR + 10;
static constexpr gpr_atm GPR_LOG_SEVERITY_NONE = GPR_LOG_SEVERITY_ERROR + 11;
@ -106,42 +100,35 @@ void gpr_set_log_verbosity(gpr_log_severity min_severity_to_print) {
(gpr_atm)min_severity_to_print);
}
static gpr_atm parse_log_severity(const char* str, gpr_atm error_value) {
if (gpr_stricmp(str, "DEBUG") == 0) {
return GPR_LOG_SEVERITY_DEBUG;
} else if (gpr_stricmp(str, "INFO") == 0) {
return GPR_LOG_SEVERITY_INFO;
} else if (gpr_stricmp(str, "ERROR") == 0) {
return GPR_LOG_SEVERITY_ERROR;
} else if (gpr_stricmp(str, "NONE") == 0) {
return GPR_LOG_SEVERITY_NONE;
} else {
return error_value;
}
static gpr_atm parse_log_severity(absl::string_view str, gpr_atm error_value) {
if (absl::EqualsIgnoreCase(str, "DEBUG")) return GPR_LOG_SEVERITY_DEBUG;
if (absl::EqualsIgnoreCase(str, "INFO")) return GPR_LOG_SEVERITY_INFO;
if (absl::EqualsIgnoreCase(str, "ERROR")) return GPR_LOG_SEVERITY_ERROR;
if (absl::EqualsIgnoreCase(str, "NONE")) return GPR_LOG_SEVERITY_NONE;
return error_value;
}
void gpr_log_verbosity_init() {
// init verbosity when it hasn't been set
if ((gpr_atm_no_barrier_load(&g_min_severity_to_print)) ==
GPR_LOG_SEVERITY_UNSET) {
grpc_core::UniquePtr<char> verbosity =
GPR_GLOBAL_CONFIG_GET(grpc_verbosity);
auto verbosity = grpc_core::ConfigVars::Get().Verbosity();
gpr_atm min_severity_to_print = GPR_LOG_SEVERITY_ERROR;
if (strlen(verbosity.get()) > 0) {
if (!verbosity.empty()) {
min_severity_to_print =
parse_log_severity(verbosity.get(), min_severity_to_print);
parse_log_severity(verbosity, min_severity_to_print);
}
gpr_atm_no_barrier_store(&g_min_severity_to_print, min_severity_to_print);
}
// init stacktrace_minloglevel when it hasn't been set
if ((gpr_atm_no_barrier_load(&g_min_severity_to_print_stacktrace)) ==
GPR_LOG_SEVERITY_UNSET) {
grpc_core::UniquePtr<char> stacktrace_minloglevel =
GPR_GLOBAL_CONFIG_GET(grpc_stacktrace_minloglevel);
auto stacktrace_minloglevel =
grpc_core::ConfigVars::Get().StacktraceMinloglevel();
gpr_atm min_severity_to_print_stacktrace = GPR_LOG_SEVERITY_NONE;
if (strlen(stacktrace_minloglevel.get()) > 0) {
if (!stacktrace_minloglevel.empty()) {
min_severity_to_print_stacktrace = parse_log_severity(
stacktrace_minloglevel.get(), min_severity_to_print_stacktrace);
stacktrace_minloglevel, min_severity_to_print_stacktrace);
}
gpr_atm_no_barrier_store(&g_min_severity_to_print_stacktrace,
min_severity_to_print_stacktrace);

@ -24,8 +24,8 @@
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/event_engine/thread_local.h"
#include "src/core/lib/gprpp/global_config_env.h"
#include "src/core/lib/gprpp/no_destruct.h"
//
@ -33,16 +33,6 @@
// AROUND VERY SPECIFIC USE CASES.
//
#ifdef GRPC_ENABLE_FORK_SUPPORT
#define GRPC_ENABLE_FORK_SUPPORT_DEFAULT true
#else
#define GRPC_ENABLE_FORK_SUPPORT_DEFAULT false
#endif // GRPC_ENABLE_FORK_SUPPORT
GPR_GLOBAL_CONFIG_DEFINE_BOOL(grpc_enable_fork_support,
GRPC_ENABLE_FORK_SUPPORT_DEFAULT,
"Enable fork support");
namespace grpc_core {
namespace {
// The exec_ctx_count has 2 modes, blocked and unblocked.
@ -176,7 +166,7 @@ class ThreadState {
void Fork::GlobalInit() {
if (!override_enabled_) {
support_enabled_.store(GPR_GLOBAL_CONFIG_GET(grpc_enable_fork_support),
support_enabled_.store(ConfigVars::Get().EnableForkSupport(),
std::memory_order_relaxed);
}
}

@ -1,93 +0,0 @@
//
//
// Copyright 2019 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//
#ifndef GRPC_SRC_CORE_LIB_GPRPP_GLOBAL_CONFIG_H
#define GRPC_SRC_CORE_LIB_GPRPP_GLOBAL_CONFIG_H
#include <grpc/support/port_platform.h>
// --------------------------------------------------------------------
// How to use global configuration variables:
//
// Defining config variables of a specified type:
// GPR_GLOBAL_CONFIG_DEFINE_*TYPE*(name, default_value, help);
//
// Supported TYPEs: BOOL, INT32, STRING
//
// It's recommended to use lowercase letters for 'name' like
// regular variables. The builtin configuration system uses
// environment variable and the name is converted to uppercase
// when looking up the value. For example,
// GPR_GLOBAL_CONFIG_DEFINE(grpc_latency) looks up the value with the
// name, "GRPC_LATENCY".
//
// The variable initially has the specified 'default_value'
// which must be an expression convertible to 'Type'.
// 'default_value' may be evaluated 0 or more times,
// and at an unspecified time; keep it
// simple and usually free of side-effects.
//
// GPR_GLOBAL_CONFIG_DEFINE_*TYPE* should not be called in a C++ header.
// It should be called at the top-level (outside any namespaces)
// in a .cc file.
//
// Getting the variables:
// GPR_GLOBAL_CONFIG_GET(name)
//
// If error happens during getting variables, error messages will
// be logged and default value will be returned.
//
// Setting the variables with new value:
// GPR_GLOBAL_CONFIG_SET(name, new_value)
//
// Declaring config variables for other modules to access:
// GPR_GLOBAL_CONFIG_DECLARE_*TYPE*(name)
//
// * Caveat for setting global configs at runtime
//
// Setting global configs at runtime multiple times is safe but it doesn't
// mean that it will have a valid effect on the module depending configs.
// In unit tests, it may be unpredictable to set different global configs
// between test cases because grpc init and shutdown can ignore changes.
// It's considered safe to set global configs before the first call to
// grpc_init().
// --------------------------------------------------------------------
// How to customize the global configuration system:
//
// How to read and write configuration value can be customized.
// Builtin system uses environment variables but it can be extended to
// support command-line flag, file, etc.
//
// To customize it, following macros should be redefined.
//
// GPR_GLOBAL_CONFIG_DEFINE_BOOL
// GPR_GLOBAL_CONFIG_DEFINE_INT32
// GPR_GLOBAL_CONFIG_DEFINE_STRING
//
// These macros should define functions for getting and setting variable.
// For example, GPR_GLOBAL_CONFIG_DEFINE_BOOL(test, ...) would define two
// functions.
//
// bool gpr_global_config_get_test();
// void gpr_global_config_set_test(bool value);
#include "src/core/lib/gprpp/global_config_custom.h" // IWYU pragma: export
#include "src/core/lib/gprpp/global_config_env.h" // IWYU pragma: export
#endif // GRPC_SRC_CORE_LIB_GPRPP_GLOBAL_CONFIG_H

@ -1,29 +0,0 @@
//
//
// Copyright 2019 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//
#ifndef GRPC_SRC_CORE_LIB_GPRPP_GLOBAL_CONFIG_CUSTOM_H
#define GRPC_SRC_CORE_LIB_GPRPP_GLOBAL_CONFIG_CUSTOM_H
// This is a placeholder for custom global configuration implementation.
// To use the custom one, please define following macros here.
//
// GPR_GLOBAL_CONFIG_DEFINE_BOOL
// GPR_GLOBAL_CONFIG_DEFINE_INT32
// GPR_GLOBAL_CONFIG_DEFINE_STRING
#endif // GRPC_SRC_CORE_LIB_GPRPP_GLOBAL_CONFIG_CUSTOM_H

@ -1,140 +0,0 @@
//
//
// Copyright 2019 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//
#include <grpc/support/port_platform.h>
#include "src/core/lib/gprpp/global_config_env.h"
#include <ctype.h>
#include <stdlib.h>
#include <initializer_list>
#include <memory>
#include <string>
#include <type_traits>
#include "absl/strings/str_format.h"
#include "absl/types/optional.h"
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/env.h"
namespace grpc_core {
namespace {
void DefaultGlobalConfigEnvErrorFunction(const char* error_message) {
gpr_log(GPR_ERROR, "%s", error_message);
}
GlobalConfigEnvErrorFunctionType g_global_config_env_error_func =
DefaultGlobalConfigEnvErrorFunction;
void LogParsingError(const char* name, const char* value) {
std::string error_message = absl::StrFormat(
"Illegal value '%s' specified for environment variable '%s'", value,
name);
(*g_global_config_env_error_func)(error_message.c_str());
}
} // namespace
void SetGlobalConfigEnvErrorFunction(GlobalConfigEnvErrorFunctionType func) {
g_global_config_env_error_func = func;
}
UniquePtr<char> GlobalConfigEnv::GetValue() {
auto env = GetEnv(GetName());
return UniquePtr<char>(env.has_value() ? gpr_strdup(env.value().c_str())
: nullptr);
}
void GlobalConfigEnv::SetValue(const char* value) { SetEnv(GetName(), value); }
void GlobalConfigEnv::Unset() { UnsetEnv(GetName()); }
char* GlobalConfigEnv::GetName() {
// This makes sure that name_ is in a canonical form having uppercase
// letters. This is okay to be called serveral times.
for (char* c = name_; *c != 0; ++c) {
*c = toupper(*c);
}
return name_;
}
static_assert(std::is_trivially_destructible<GlobalConfigEnvBool>::value,
"GlobalConfigEnvBool needs to be trivially destructible.");
bool GlobalConfigEnvBool::Get() {
UniquePtr<char> str = GetValue();
if (str == nullptr) {
return default_value_;
}
// parsing given value string.
bool result = false;
if (!gpr_parse_bool_value(str.get(), &result)) {
LogParsingError(GetName(), str.get());
result = default_value_;
}
return result;
}
void GlobalConfigEnvBool::Set(bool value) {
SetValue(value ? "true" : "false");
}
static_assert(std::is_trivially_destructible<GlobalConfigEnvInt32>::value,
"GlobalConfigEnvInt32 needs to be trivially destructible.");
int32_t GlobalConfigEnvInt32::Get() {
UniquePtr<char> str = GetValue();
if (str == nullptr) {
return default_value_;
}
// parsing given value string.
char* end = str.get();
long result = strtol(str.get(), &end, 10);
if (*end != 0) {
LogParsingError(GetName(), str.get());
result = default_value_;
}
return static_cast<int32_t>(result);
}
void GlobalConfigEnvInt32::Set(int32_t value) {
char buffer[GPR_LTOA_MIN_BUFSIZE];
gpr_ltoa(value, buffer);
SetValue(buffer);
}
static_assert(std::is_trivially_destructible<GlobalConfigEnvString>::value,
"GlobalConfigEnvString needs to be trivially destructible.");
UniquePtr<char> GlobalConfigEnvString::Get() {
UniquePtr<char> str = GetValue();
if (str == nullptr) {
return UniquePtr<char>(gpr_strdup(default_value_));
}
return str;
}
void GlobalConfigEnvString::Set(const char* value) { SetValue(value); }
} // namespace grpc_core

@ -1,133 +0,0 @@
//
//
// Copyright 2019 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//
#ifndef GRPC_SRC_CORE_LIB_GPRPP_GLOBAL_CONFIG_ENV_H
#define GRPC_SRC_CORE_LIB_GPRPP_GLOBAL_CONFIG_ENV_H
#include <grpc/support/port_platform.h>
#include <stdint.h>
#include "src/core/lib/gprpp/global_config_generic.h" // IWYU pragma: export
#include "src/core/lib/gprpp/memory.h"
namespace grpc_core {
typedef void (*GlobalConfigEnvErrorFunctionType)(const char* error_message);
//
// Set global_config_env_error_function which is called when config system
// encounters errors such as parsing error. What the default function does
// is logging error message.
//
void SetGlobalConfigEnvErrorFunction(GlobalConfigEnvErrorFunctionType func);
// Base class for all classes to access environment variables.
class GlobalConfigEnv {
protected:
// `name` should be writable and alive after constructor is called.
constexpr explicit GlobalConfigEnv(char* name) : name_(name) {}
public:
// Returns the value of `name` variable.
UniquePtr<char> GetValue();
// Sets the value of `name` variable.
void SetValue(const char* value);
// Unsets `name` variable.
void Unset();
protected:
char* GetName();
private:
char* name_;
};
class GlobalConfigEnvBool : public GlobalConfigEnv {
public:
constexpr GlobalConfigEnvBool(char* name, bool default_value)
: GlobalConfigEnv(name), default_value_(default_value) {}
bool Get();
void Set(bool value);
private:
bool default_value_;
};
class GlobalConfigEnvInt32 : public GlobalConfigEnv {
public:
constexpr GlobalConfigEnvInt32(char* name, int32_t default_value)
: GlobalConfigEnv(name), default_value_(default_value) {}
int32_t Get();
void Set(int32_t value);
private:
int32_t default_value_;
};
class GlobalConfigEnvString : public GlobalConfigEnv {
public:
constexpr GlobalConfigEnvString(char* name, const char* default_value)
: GlobalConfigEnv(name), default_value_(default_value) {}
UniquePtr<char> Get();
void Set(const char* value);
private:
const char* default_value_;
};
} // namespace grpc_core
// Macros for defining global config instances using environment variables.
// This defines a GlobalConfig*Type* instance with arguments for
// mutable variable name and default value.
// Mutable name (g_env_str_##name) is here for having an array
// for the canonical name without dynamic allocation.
// `help` argument is ignored for this implementation.
#define GPR_GLOBAL_CONFIG_DEFINE_BOOL(name, default_value, help) \
static char g_env_str_##name[] = #name; \
static ::grpc_core::GlobalConfigEnvBool g_env_##name(g_env_str_##name, \
default_value); \
bool gpr_global_config_get_##name() { return g_env_##name.Get(); } \
void gpr_global_config_set_##name(bool value) { g_env_##name.Set(value); }
#define GPR_GLOBAL_CONFIG_DEFINE_INT32(name, default_value, help) \
static char g_env_str_##name[] = #name; \
static ::grpc_core::GlobalConfigEnvInt32 g_env_##name(g_env_str_##name, \
default_value); \
int32_t gpr_global_config_get_##name() { return g_env_##name.Get(); } \
void gpr_global_config_set_##name(int32_t value) { g_env_##name.Set(value); }
#define GPR_GLOBAL_CONFIG_DEFINE_STRING(name, default_value, help) \
static char g_env_str_##name[] = #name; \
static ::grpc_core::GlobalConfigEnvString g_env_##name(g_env_str_##name, \
default_value); \
::grpc_core::UniquePtr<char> gpr_global_config_get_##name() { \
return g_env_##name.Get(); \
} \
void gpr_global_config_set_##name(const char* value) { \
g_env_##name.Set(value); \
}
#endif // GRPC_SRC_CORE_LIB_GPRPP_GLOBAL_CONFIG_ENV_H

@ -1,40 +0,0 @@
//
//
// Copyright 2019 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//
#ifndef GRPC_SRC_CORE_LIB_GPRPP_GLOBAL_CONFIG_GENERIC_H
#define GRPC_SRC_CORE_LIB_GPRPP_GLOBAL_CONFIG_GENERIC_H
#include <grpc/support/port_platform.h>
#define GPR_GLOBAL_CONFIG_GET(name) gpr_global_config_get_##name()
#define GPR_GLOBAL_CONFIG_SET(name, value) gpr_global_config_set_##name(value)
#define GPR_GLOBAL_CONFIG_DECLARE_BOOL(name) \
extern bool gpr_global_config_get_##name(); \
extern void gpr_global_config_set_##name(bool value)
#define GPR_GLOBAL_CONFIG_DECLARE_INT32(name) \
extern int32_t gpr_global_config_get_##name(); \
extern void gpr_global_config_set_##name(int32_t value)
#define GPR_GLOBAL_CONFIG_DECLARE_STRING(name) \
extern grpc_core::UniquePtr<char> gpr_global_config_get_##name(); \
extern void gpr_global_config_set_##name(const char* value)
#endif // GRPC_SRC_CORE_LIB_GPRPP_GLOBAL_CONFIG_GENERIC_H

@ -27,26 +27,21 @@
#include <string.h>
#include "absl/strings/str_format.h"
#include "absl/strings/str_split.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/global_config.h"
#include "src/core/lib/iomgr/ev_epoll1_linux.h"
#include "src/core/lib/iomgr/ev_poll_posix.h"
#include "src/core/lib/iomgr/ev_posix.h"
#include "src/core/lib/iomgr/internal_errqueue.h"
GPR_GLOBAL_CONFIG_DEFINE_STRING(
grpc_poll_strategy, "all",
"Declares which polling engines to try when starting gRPC. "
"This is a comma-separated list of engines, which are tried in priority "
"order first -> last.")
grpc_core::DebugOnlyTraceFlag grpc_polling_trace(
false, "polling"); // Disabled by default
@ -106,40 +101,14 @@ static const grpc_event_engine_vtable* g_vtables[] = {
nullptr,
};
static void add(const char* beg, const char* end, char*** ss, size_t* ns) {
size_t n = *ns;
size_t np = n + 1;
char* s;
size_t len;
GPR_ASSERT(end >= beg);
len = static_cast<size_t>(end - beg);
s = static_cast<char*>(gpr_malloc(len + 1));
memcpy(s, beg, len);
s[len] = 0;
*ss = static_cast<char**>(gpr_realloc(*ss, sizeof(char**) * np));
(*ss)[n] = s;
*ns = np;
}
static void split(const char* s, char*** ss, size_t* ns) {
const char* c = strchr(s, ',');
if (c == nullptr) {
add(s, s + strlen(s), ss, ns);
} else {
add(s, c, ss, ns);
split(c + 1, ss, ns);
}
}
static bool is(const char* want, const char* have) {
return 0 == strcmp(want, "all") || 0 == strcmp(want, have);
static bool is(absl::string_view want, absl::string_view have) {
return want == "all" || want == have;
}
static void try_engine(const char* engine) {
static void try_engine(absl::string_view engine) {
for (size_t i = 0; i < GPR_ARRAY_SIZE(g_vtables); i++) {
if (g_vtables[i] != nullptr && is(engine, g_vtables[i]->name) &&
g_vtables[i]->check_engine_available(
0 == strcmp(engine, g_vtables[i]->name))) {
g_vtables[i]->check_engine_available(engine == g_vtables[i]->name)) {
g_event_engine = g_vtables[i];
gpr_log(GPR_DEBUG, "Using polling engine: %s", g_event_engine->name);
return;
@ -173,25 +142,16 @@ const char* grpc_get_poll_strategy_name() { return g_event_engine->name; }
void grpc_event_engine_init(void) {
gpr_once_init(&g_choose_engine, []() {
grpc_core::UniquePtr<char> value =
GPR_GLOBAL_CONFIG_GET(grpc_poll_strategy);
char** strings = nullptr;
size_t nstrings = 0;
split(value.get(), &strings, &nstrings);
for (size_t i = 0; g_event_engine == nullptr && i < nstrings; i++) {
try_engine(strings[i]);
}
for (size_t i = 0; i < nstrings; i++) {
gpr_free(strings[i]);
auto value = grpc_core::ConfigVars::Get().PollStrategy();
for (auto trial : absl::StrSplit(value, ',')) {
try_engine(trial);
if (g_event_engine != nullptr) return;
}
gpr_free(strings);
if (g_event_engine == nullptr) {
grpc_core::Crash(absl::StrFormat(
"No event engine could be initialized from %s", value.get()));
grpc_core::Crash(
absl::StrFormat("No event engine could be initialized from %s",
std::string(value).c_str()));
}
});
g_event_engine->init_engine();

@ -24,14 +24,11 @@
#include <poll.h>
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/global_config.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/pollset.h"
#include "src/core/lib/iomgr/pollset_set.h"
#include "src/core/lib/iomgr/wakeup_fd_posix.h"
GPR_GLOBAL_CONFIG_DECLARE_STRING(grpc_poll_strategy);
extern grpc_core::DebugOnlyTraceFlag grpc_fd_trace; // Disabled by default
extern grpc_core::DebugOnlyTraceFlag grpc_polling_trace; // Disabled by default

@ -29,10 +29,10 @@
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/global_config.h"
#include "src/core/lib/gprpp/thd.h"
#include "src/core/lib/iomgr/buffer_list.h"
#include "src/core/lib/iomgr/exec_ctx.h"
@ -42,15 +42,10 @@
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/iomgr/timer_manager.h"
GPR_GLOBAL_CONFIG_DEFINE_BOOL(grpc_abort_on_leaks, false,
"A debugging aid to cause a call to abort() when "
"gRPC objects are leaked past grpc_shutdown()");
static gpr_mu g_mu;
static gpr_cv g_rcv;
static int g_shutdown;
static grpc_iomgr_object g_root_object;
static bool g_grpc_abort_on_leaks;
void grpc_iomgr_init() {
grpc_core::ExecCtx exec_ctx;
@ -65,7 +60,6 @@ void grpc_iomgr_init() {
g_root_object.name = const_cast<char*>("root");
grpc_iomgr_platform_init();
grpc_timer_list_init();
g_grpc_abort_on_leaks = GPR_GLOBAL_CONFIG_GET(grpc_abort_on_leaks);
}
void grpc_iomgr_start() { grpc_timer_manager_init(); }
@ -198,4 +192,6 @@ void grpc_iomgr_unregister_object(grpc_iomgr_object* obj) {
gpr_free(obj->name);
}
bool grpc_iomgr_abort_on_leaks(void) { return g_grpc_abort_on_leaks; }
bool grpc_iomgr_abort_on_leaks(void) {
return grpc_core::ConfigVars::Get().AbortOnLeaks();
}

@ -20,7 +20,6 @@
#include <grpc/impl/grpc_types.h>
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/port.h"

@ -19,6 +19,7 @@
#include <grpc/support/port_platform.h>
#include <algorithm>
#include <string>
#include <vector>
#if defined(GPR_LINUX) || defined(GPR_ANDROID) || defined(GPR_FREEBSD) || \
@ -27,7 +28,6 @@
#include <dirent.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <unistd.h>
@ -35,17 +35,13 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/global_config.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/load_file.h"
#include "src/core/lib/security/security_connector/load_system_roots.h"
#include "src/core/lib/security/security_connector/load_system_roots_supported.h"
GPR_GLOBAL_CONFIG_DEFINE_STRING(grpc_system_ssl_roots_dir, "",
"Custom directory to SSL Roots");
namespace grpc_core {
namespace {
@ -150,9 +146,9 @@ grpc_slice CreateRootCertsBundle(const char* certs_directory) {
grpc_slice LoadSystemRootCerts() {
grpc_slice result = grpc_empty_slice();
// Prioritize user-specified custom directory if flag is set.
UniquePtr<char> custom_dir = GPR_GLOBAL_CONFIG_GET(grpc_system_ssl_roots_dir);
if (strlen(custom_dir.get()) > 0) {
result = CreateRootCertsBundle(custom_dir.get());
auto custom_dir = ConfigVars::Get().SystemSslRootsDir();
if (!custom_dir.empty()) {
result = CreateRootCertsBundle(std::string(custom_dir).c_str());
}
// If the custom directory is empty/invalid/not specified, fallback to
// distribution-specific directory.

@ -32,19 +32,18 @@
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include "src/core/ext/transport/chttp2/alpn/alpn.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/global_config.h"
#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/load_file.h"
#include "src/core/lib/security/context/security_context.h"
#include "src/core/lib/security/security_connector/load_system_roots.h"
#include "src/core/lib/security/security_connector/ssl_utils_config.h"
#include "src/core/tsi/ssl_transport_security.h"
#include "src/core/tsi/transport_security.h"
@ -76,22 +75,9 @@ void grpc_set_ssl_roots_override_callback(grpc_ssl_roots_override_callback cb) {
static gpr_once cipher_suites_once = GPR_ONCE_INIT;
static const char* cipher_suites = nullptr;
// All cipher suites for default are compliant with HTTP2.
GPR_GLOBAL_CONFIG_DEFINE_STRING(
grpc_ssl_cipher_suites,
"TLS_AES_128_GCM_SHA256:"
"TLS_AES_256_GCM_SHA384:"
"TLS_CHACHA20_POLY1305_SHA256:"
"ECDHE-ECDSA-AES128-GCM-SHA256:"
"ECDHE-ECDSA-AES256-GCM-SHA384:"
"ECDHE-RSA-AES128-GCM-SHA256:"
"ECDHE-RSA-AES256-GCM-SHA384",
"A colon separated list of cipher suites to use with OpenSSL")
static void init_cipher_suites(void) {
grpc_core::UniquePtr<char> value =
GPR_GLOBAL_CONFIG_GET(grpc_ssl_cipher_suites);
cipher_suites = value.release();
cipher_suites = gpr_strdup(
std::string(grpc_core::ConfigVars::Get().SslCipherSuites()).c_str());
}
// --- Util ---
@ -573,14 +559,13 @@ const char* DefaultSslRootStore::GetPemRootCerts() {
grpc_slice DefaultSslRootStore::ComputePemRootCerts() {
grpc_slice result = grpc_empty_slice();
const bool not_use_system_roots =
GPR_GLOBAL_CONFIG_GET(grpc_not_use_system_ssl_roots);
// First try to load the roots from the configuration.
UniquePtr<char> default_root_certs_path =
GPR_GLOBAL_CONFIG_GET(grpc_default_ssl_roots_file_path);
if (strlen(default_root_certs_path.get()) > 0) {
auto default_root_certs_path = ConfigVars::Get().DefaultSslRootsFilePath();
if (!default_root_certs_path.empty()) {
GRPC_LOG_IF_ERROR(
"load_file", grpc_load_file(default_root_certs_path.get(), 1, &result));
"load_file",
grpc_load_file(std::string(default_root_certs_path).c_str(), 1,
&result));
}
// Try overridden roots if needed.
grpc_ssl_roots_override_result ovrd_res = GRPC_SSL_ROOTS_OVERRIDE_FAIL;
@ -596,7 +581,8 @@ grpc_slice DefaultSslRootStore::ComputePemRootCerts() {
gpr_free(pem_root_certs);
}
// Try loading roots from OS trust store if flag is enabled.
if (GRPC_SLICE_IS_EMPTY(result) && !not_use_system_roots) {
if (GRPC_SLICE_IS_EMPTY(result) &&
!ConfigVars::Get().NotUseSystemSslRoots()) {
result = LoadSystemRootCerts();
}
// Fallback to roots manually shipped with gRPC.

@ -1,32 +0,0 @@
//
//
// Copyright 2019 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//
#include <grpc/support/port_platform.h>
#include "src/core/lib/security/security_connector/ssl_utils_config.h"
/// Config variable that points to the default SSL roots file. This file
/// must be a PEM encoded file with all the roots such as the one that can be
/// downloaded from https://pki.google.com/roots.pem.
GPR_GLOBAL_CONFIG_DEFINE_STRING(grpc_default_ssl_roots_file_path, "",
"Path to the default SSL roots file.");
/// Config variable used as a flag to enable/disable loading system root
/// certificates from the OS trust store.
GPR_GLOBAL_CONFIG_DEFINE_BOOL(grpc_not_use_system_ssl_roots, false,
"Disable loading system root certificates.");

@ -1,29 +0,0 @@
//
//
// Copyright 2019 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//
#ifndef GRPC_SRC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_SSL_UTILS_CONFIG_H
#define GRPC_SRC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_SSL_UTILS_CONFIG_H
#include <grpc/support/port_platform.h>
#include "src/core/lib/gprpp/global_config.h"
#include "src/core/lib/gprpp/memory.h"
GPR_GLOBAL_CONFIG_DECLARE_STRING(grpc_default_ssl_roots_file_path);
GPR_GLOBAL_CONFIG_DECLARE_BOOL(grpc_not_use_system_ssl_roots);
#endif // GRPC_SRC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_SSL_UTILS_CONFIG_H

@ -30,6 +30,7 @@
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/tsi/alts/crypt/gsec.h"
#include "src/core/tsi/alts/frame_protector/alts_crypter.h"
#include "src/core/tsi/alts/frame_protector/frame_handler.h"

@ -38,11 +38,12 @@
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/tmpfile.h"
#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/security/security_connector/ssl_utils_config.h"
#include "test/core/end2end/data/ssl_test_data.h"
#include "test/core/end2end/fixtures/secure_fixture.h"
#include "test/core/util/port.h"
@ -119,7 +120,9 @@ static char *roots_filename;
GPR_ASSERT(roots_file != nullptr);
GPR_ASSERT(fwrite(test_root_cert, 1, roots_size, roots_file) == roots_size);
fclose(roots_file);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, roots_filename);
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = roots_filename;
grpc_core::ConfigVars::SetOverrides(overrides);
grpc_init();

@ -727,3 +727,8 @@ cdef extern from "grpc/grpc_security_constants.h":
ctypedef enum grpc_local_connect_type:
UDS
LOCAL_TCP
cdef extern from "src/core/lib/config/config_vars.h" namespace "grpc_core":
cdef cppclass ConfigVars:
@staticmethod
void Reset()

@ -195,3 +195,7 @@ def compression_algorithm_name(grpc_compression_algorithm algorithm):
grpc_compression_algorithm_name(algorithm, &name)
# Let Cython do the right thing with string casting
return name
def reset_grpc_config_vars():
ConfigVars.Reset()

@ -64,7 +64,6 @@ CORE_SOURCE_FILES = [
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc',
'src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc',
'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc',
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc',
'src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc',
@ -477,7 +476,10 @@ CORE_SOURCE_FILES = [
'src/core/lib/compression/compression.cc',
'src/core/lib/compression/compression_internal.cc',
'src/core/lib/compression/message_compress.cc',
'src/core/lib/config/config_vars.cc',
'src/core/lib/config/config_vars_non_generated.cc',
'src/core/lib/config/core_configuration.cc',
'src/core/lib/config/load_config.cc',
'src/core/lib/debug/event_log.cc',
'src/core/lib/debug/histogram_view.cc',
'src/core/lib/debug/stats.cc',
@ -553,7 +555,6 @@ CORE_SOURCE_FILES = [
'src/core/lib/gprpp/crash.cc',
'src/core/lib/gprpp/examine_stack.cc',
'src/core/lib/gprpp/fork.cc',
'src/core/lib/gprpp/global_config_env.cc',
'src/core/lib/gprpp/host_port.cc',
'src/core/lib/gprpp/linux/env.cc',
'src/core/lib/gprpp/load_file.cc',
@ -728,7 +729,6 @@ CORE_SOURCE_FILES = [
'src/core/lib/security/security_connector/security_connector.cc',
'src/core/lib/security/security_connector/ssl/ssl_security_connector.cc',
'src/core/lib/security/security_connector/ssl_utils.cc',
'src/core/lib/security/security_connector/ssl_utils_config.cc',
'src/core/lib/security/security_connector/tls/tls_security_connector.cc',
'src/core/lib/security/transport/client_auth_filter.cc',
'src/core/lib/security/transport/secure_endpoint.cc',
@ -841,6 +841,15 @@ CORE_SOURCE_FILES = [
'third_party/abseil-cpp/absl/debugging/internal/vdso_support.cc',
'third_party/abseil-cpp/absl/debugging/stacktrace.cc',
'third_party/abseil-cpp/absl/debugging/symbolize.cc',
'third_party/abseil-cpp/absl/flags/commandlineflag.cc',
'third_party/abseil-cpp/absl/flags/flag.cc',
'third_party/abseil-cpp/absl/flags/internal/commandlineflag.cc',
'third_party/abseil-cpp/absl/flags/internal/flag.cc',
'third_party/abseil-cpp/absl/flags/internal/private_handle_accessor.cc',
'third_party/abseil-cpp/absl/flags/internal/program_name.cc',
'third_party/abseil-cpp/absl/flags/marshalling.cc',
'third_party/abseil-cpp/absl/flags/reflection.cc',
'third_party/abseil-cpp/absl/flags/usage_config.cc',
'third_party/abseil-cpp/absl/hash/internal/city.cc',
'third_party/abseil-cpp/absl/hash/internal/hash.cc',
'third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc',

@ -62,6 +62,7 @@ _BLACK_HOLE = "/test/BlackHole"
@contextlib.contextmanager
def _env(key: str, value: str):
os.environ[key] = value
grpc._cython.cygrpc.reset_grpc_config_vars()
yield
del os.environ[key]

@ -31,9 +31,8 @@
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/gprpp/env.h"
#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/security/security_connector/ssl_utils_config.h"
#include "test/core/end2end/cq_verifier.h"
#include "test/core/util/port.h"
#include "test/core/util/subprocess.h"
@ -137,7 +136,7 @@ int main(int argc, char** argv) {
strcpy(root, ".");
}
if (argc == 2) {
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, argv[1]);
grpc_core::SetEnv("GRPC_DEFAULT_SSL_ROOTS_FILE_PATH", argv[1]);
}
// figure out our test name
tmp = lunder - 1;

@ -27,13 +27,10 @@
#include <grpc/support/log.h>
#include "src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/event_engine/default_event_engine.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/work_serializer.h"
#include "src/core/lib/iomgr/exec_ctx.h"
@ -101,9 +98,7 @@ TEST(DnsResolverTest, MainTest) {
test_succeeds(dns, "dns:10.2.1.1:1234");
test_succeeds(dns, "dns:www.google.com");
test_succeeds(dns, "dns:///www.google.com");
grpc_core::UniquePtr<char> resolver =
GPR_GLOBAL_CONFIG_GET(grpc_dns_resolver);
if (gpr_stricmp(resolver.get(), "native") == 0) {
if (grpc_core::ConfigVars::Get().DnsResolver() == "native") {
test_fails(dns, "dns://8.8.8.8/8.8.8.8:8888");
} else {
test_succeeds(dns, "dns://8.8.8.8/8.8.8.8:8888");

@ -276,6 +276,7 @@ grpc_cc_test(
"h2_ssl_cert_test.cc",
],
external_deps = [
"absl/types:optional",
"gtest",
"libcrypto",
],
@ -284,11 +285,11 @@ grpc_cc_test(
"cq_verifier",
"fixture_support",
"ssl_test_data",
"//:config_vars",
"//:gpr",
"//:grpc",
"//:grpc_public_hdrs",
"//:grpc_security_base",
"//:tsi_ssl_credentials",
"//src/core:channel_args",
"//test/core/util:grpc_test_util",
],
@ -304,15 +305,18 @@ grpc_cc_test(
"//src/core/tsi/test_creds:server1.key",
"//src/core/tsi/test_creds:server1.pem",
],
external_deps = ["gtest"],
external_deps = [
"absl/types:optional",
"gtest",
],
language = "C++",
deps = [
"cq_verifier",
"//:config_vars",
"//:exec_ctx",
"//:gpr",
"//:grpc",
"//:grpc_public_hdrs",
"//:tsi_ssl_credentials",
"//src/core:channel_args",
"//src/core:error",
"//src/core:useful",
@ -330,15 +334,18 @@ grpc_cc_test(
"//src/core/tsi/test_creds:server1.key",
"//src/core/tsi/test_creds:server1.pem",
],
external_deps = ["gtest"],
external_deps = [
"absl/types:optional",
"gtest",
],
language = "C++",
deps = [
"cq_verifier",
"//:config_vars",
"//:exec_ctx",
"//:gpr",
"//:grpc",
"//:grpc_public_hdrs",
"//:tsi_ssl_credentials",
"//src/core:channel_args",
"//src/core:error",
"//src/core:useful",

@ -18,6 +18,8 @@
#include <grpc/support/port_platform.h>
#include "absl/types/optional.h"
#include <grpc/grpc.h>
#include "src/core/lib/channel/channel_args.h"
@ -29,11 +31,11 @@
#include <functional>
#include <memory>
#include <string>
#include <grpc/support/log.h>
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/config/config_vars.h"
#include "test/core/end2end/end2end_tests.h"
#include "test/core/end2end/fixtures/secure_fixture.h"
#include "test/core/util/test_config.h"
@ -56,7 +58,9 @@ int main(int argc, char** argv) {
// force tracing on, with a value to force many
// code paths in trace.c to be taken
GPR_GLOBAL_CONFIG_SET(grpc_trace, "doesnt-exist,http,all");
grpc_core::ConfigVars::Overrides overrides;
overrides.trace = "doesnt-exist,http,all";
grpc_core::ConfigVars::SetOverrides(overrides);
#ifdef GRPC_POSIX_SOCKET
g_fixture_slowdown_factor = isatty(STDOUT_FILENO) ? 10 : 1;

@ -18,13 +18,15 @@
#include <functional>
#include <memory>
#include <string>
#include "absl/types/optional.h"
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/iomgr/port.h"
#include "test/core/end2end/end2end_tests.h"
#include "test/core/end2end/fixtures/sockpair_fixture.h"
@ -46,8 +48,10 @@ int main(int argc, char** argv) {
size_t i;
// force tracing on, with a value to force many
// code paths in trace.c to be taken
GPR_GLOBAL_CONFIG_SET(grpc_trace, "doesnt-exist,http,all");
// code paths in trace.cc to be taken
grpc_core::ConfigVars::Overrides overrides;
overrides.trace = "doesnt-exist,http,all";
grpc_core::ConfigVars::SetOverrides(overrides);
#ifdef GRPC_POSIX_SOCKET
g_fixture_slowdown_factor = isatty(STDOUT_FILENO) ? 10 : 1;

@ -20,13 +20,15 @@
#include <functional>
#include <memory>
#include <string>
#include "absl/types/optional.h"
#include <grpc/grpc.h>
#include <grpc/grpc_security_constants.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/security/security_connector/ssl_utils_config.h"
#include "src/core/lib/config/config_vars.h"
#include "test/core/end2end/end2end_tests.h"
#include "test/core/end2end/fixtures/h2_ssl_cred_reload_fixture.h"
#include "test/core/util/test_config.h"
@ -50,8 +52,9 @@ int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(&argc, argv);
grpc_end2end_tests_pre_init();
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path,
SslCredReloadFixture::CaCertPath());
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = SslCredReloadFixture::CaCertPath();
grpc_core::ConfigVars::SetOverrides(overrides);
grpc_init();

@ -20,13 +20,15 @@
#include <functional>
#include <memory>
#include <string>
#include "absl/types/optional.h"
#include <grpc/grpc.h>
#include <grpc/grpc_security_constants.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/security/security_connector/ssl_utils_config.h"
#include "src/core/lib/config/config_vars.h"
#include "test/core/end2end/end2end_tests.h"
#include "test/core/end2end/fixtures/h2_ssl_cred_reload_fixture.h"
#include "test/core/util/test_config.h"
@ -50,8 +52,9 @@ int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(&argc, argv);
grpc_end2end_tests_pre_init();
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path,
SslCredReloadFixture::CaCertPath());
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = SslCredReloadFixture::CaCertPath();
grpc_core::ConfigVars::SetOverrides(overrides);
grpc_init();

@ -20,6 +20,9 @@
#include <functional>
#include <memory>
#include <string>
#include "absl/types/optional.h"
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
@ -28,11 +31,10 @@
#include <grpc/support/log.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/load_file.h"
#include "src/core/lib/security/security_connector/ssl_utils_config.h"
#include "test/core/end2end/end2end_tests.h"
#include "test/core/end2end/fixtures/proxy.h"
#include "test/core/util/test_config.h"
@ -169,7 +171,10 @@ int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(&argc, argv);
grpc_end2end_tests_pre_init();
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, CA_CERT_PATH);
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = CA_CERT_PATH;
grpc_core::ConfigVars::SetOverrides(overrides);
grpc_init();

@ -20,13 +20,15 @@
#include <functional>
#include <memory>
#include <string>
#include "absl/types/optional.h"
#include <grpc/grpc.h>
#include <grpc/grpc_security_constants.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/security/security_connector/ssl_utils_config.h"
#include "src/core/lib/config/config_vars.h"
#include "test/core/end2end/end2end_tests.h"
#include "test/core/end2end/fixtures/h2_ssl_tls_common.h"
#include "test/core/util/test_config.h"
@ -48,8 +50,9 @@ int main(int argc, char** argv) {
size_t i;
grpc::testing::TestEnvironment env(&argc, argv);
grpc_end2end_tests_pre_init();
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path,
SslTlsFixture::CaCertPath());
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = SslTlsFixture::CaCertPath();
grpc_core::ConfigVars::SetOverrides(overrides);
grpc_init();

@ -20,13 +20,15 @@
#include <functional>
#include <memory>
#include <string>
#include "absl/types/optional.h"
#include <grpc/grpc.h>
#include <grpc/grpc_security_constants.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/security/security_connector/ssl_utils_config.h"
#include "src/core/lib/config/config_vars.h"
#include "test/core/end2end/end2end_tests.h"
#include "test/core/end2end/fixtures/h2_ssl_tls_common.h"
#include "test/core/util/test_config.h"
@ -48,8 +50,9 @@ int main(int argc, char** argv) {
size_t i;
grpc::testing::TestEnvironment env(&argc, argv);
grpc_end2end_tests_pre_init();
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path,
SslTlsFixture::CaCertPath());
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = SslTlsFixture::CaCertPath();
grpc_core::ConfigVars::SetOverrides(overrides);
grpc_init();

@ -18,12 +18,14 @@
#include <functional>
#include <memory>
#include <string>
#include "absl/types/optional.h"
#include <grpc/grpc.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/security/security_connector/ssl_utils_config.h"
#include "src/core/lib/config/config_vars.h"
#include "test/core/end2end/end2end_tests.h"
#include "test/core/end2end/fixtures/h2_tls_common.h"
#include "test/core/util/test_config.h"
@ -46,7 +48,9 @@ static CoreTestConfiguration config = {
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(&argc, argv);
grpc_end2end_tests_pre_init();
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, CA_CERT_PATH);
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = CA_CERT_PATH;
grpc_core::ConfigVars::SetOverrides(overrides);
grpc_init();
grpc_end2end_tests(argc, argv, config);
grpc_shutdown();

@ -18,12 +18,14 @@
#include <functional>
#include <memory>
#include <string>
#include "absl/types/optional.h"
#include <grpc/grpc.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/security/security_connector/ssl_utils_config.h"
#include "src/core/lib/config/config_vars.h"
#include "test/core/end2end/end2end_tests.h"
#include "test/core/end2end/fixtures/h2_tls_common.h"
#include "test/core/util/test_config.h"
@ -46,7 +48,9 @@ static CoreTestConfiguration config = {
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(&argc, argv);
grpc_end2end_tests_pre_init();
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, CA_CERT_PATH);
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = CA_CERT_PATH;
grpc_core::ConfigVars::SetOverrides(overrides);
grpc_init();
grpc_end2end_tests(argc, argv, config);
grpc_shutdown();

@ -18,12 +18,14 @@
#include <functional>
#include <memory>
#include <string>
#include "absl/types/optional.h"
#include <grpc/grpc.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/security/security_connector/ssl_utils_config.h"
#include "src/core/lib/config/config_vars.h"
#include "test/core/end2end/end2end_tests.h"
#include "test/core/end2end/fixtures/h2_tls_common.h"
#include "test/core/util/test_config.h"
@ -46,7 +48,9 @@ static CoreTestConfiguration config = {
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(&argc, argv);
grpc_end2end_tests_pre_init();
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, CA_CERT_PATH);
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = CA_CERT_PATH;
grpc_core::ConfigVars::SetOverrides(overrides);
grpc_init();
grpc_end2end_tests(argc, argv, config);
grpc_shutdown();

@ -18,12 +18,14 @@
#include <functional>
#include <memory>
#include <string>
#include "absl/types/optional.h"
#include <grpc/grpc.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/security/security_connector/ssl_utils_config.h"
#include "src/core/lib/config/config_vars.h"
#include "test/core/end2end/end2end_tests.h"
#include "test/core/end2end/fixtures/h2_tls_common.h"
#include "test/core/util/test_config.h"
@ -46,7 +48,9 @@ static CoreTestConfiguration config = {
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(&argc, argv);
grpc_end2end_tests_pre_init();
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, CA_CERT_PATH);
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = CA_CERT_PATH;
grpc_core::ConfigVars::SetOverrides(overrides);
grpc_init();
grpc_end2end_tests(argc, argv, config);
grpc_shutdown();

@ -25,6 +25,7 @@
#include <openssl/crypto.h>
#include "absl/types/optional.h"
#include "gtest/gtest.h"
#include <grpc/grpc.h>
@ -38,9 +39,8 @@
#include <grpc/support/time.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gpr/tmpfile.h"
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/security/security_connector/ssl_utils_config.h"
#include "test/core/end2end/cq_verifier.h"
#include "test/core/end2end/data/ssl_test_data.h"
#include "test/core/end2end/end2end_tests.h"
@ -276,7 +276,9 @@ int main(int argc, char** argv) {
GPR_ASSERT(roots_file != nullptr);
GPR_ASSERT(fwrite(test_root_cert, 1, roots_size, roots_file) == roots_size);
fclose(roots_file);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, roots_filename);
grpc_core::ConfigVars::Overrides config_overrides;
config_overrides.default_ssl_roots_file_path = roots_filename;
grpc_core::ConfigVars::SetOverrides(config_overrides);
grpc_init();
::testing::InitGoogleTest(&argc, argv);

@ -22,6 +22,8 @@
#include <gtest/gtest.h>
#include "absl/types/optional.h"
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpc/grpc_security_constants.h>
@ -32,13 +34,12 @@
#include <grpc/support/time.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/load_file.h"
#include "src/core/lib/security/security_connector/ssl_utils_config.h"
#include "test/core/end2end/cq_verifier.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
@ -291,7 +292,9 @@ TEST(H2SessionReuseTest, SingleReuse) {
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(&argc, argv);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, CA_CERT_PATH);
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = CA_CERT_PATH;
grpc_core::ConfigVars::SetOverrides(overrides);
grpc_init();
::testing::InitGoogleTest(&argc, argv);

@ -22,6 +22,8 @@
#include <gtest/gtest.h>
#include "absl/types/optional.h"
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpc/grpc_security_constants.h>
@ -32,13 +34,12 @@
#include <grpc/support/time.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/load_file.h"
#include "src/core/lib/security/security_connector/ssl_utils_config.h"
#include "test/core/end2end/cq_verifier.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
@ -323,8 +324,9 @@ TEST(H2TlsPeerPropertyExternalVerifier, PeerPropertyExternalVerifierTest) {
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(&argc, argv);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, CA_CERT_PATH);
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = CA_CERT_PATH;
grpc_core::ConfigVars::SetOverrides(overrides);
grpc_init();
::testing::InitGoogleTest(&argc, argv);
int ret = RUN_ALL_TESTS();

@ -21,6 +21,8 @@
#include <functional>
#include <memory>
#include "absl/strings/string_view.h"
#include <grpc/byte_buffer.h>
#include <grpc/grpc.h>
#include <grpc/impl/propagation_bits.h>
@ -31,18 +33,13 @@
#include "src/core/ext/transport/chttp2/transport/frame_ping.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/iomgr/port.h"
#include "test/core/end2end/cq_verifier.h"
#include "test/core/end2end/end2end_tests.h"
#include "test/core/util/test_config.h"
#ifdef GRPC_POSIX_SOCKET
#include "src/core/lib/iomgr/ev_posix.h"
#endif // GRPC_POSIX_SOCKET
static std::unique_ptr<CoreTestFixture> begin_test(
const CoreTestConfiguration& config, const char* test_name,
grpc_channel_args* client_args, grpc_channel_args* server_args) {
@ -132,11 +129,8 @@ static void test_keepalive_timeout(const CoreTestConfiguration& config) {
// that the keepalive ping is never sent.
static void test_read_delays_keepalive(const CoreTestConfiguration& config) {
#ifdef GRPC_POSIX_SOCKET
grpc_core::UniquePtr<char> poller = GPR_GLOBAL_CONFIG_GET(grpc_poll_strategy);
// It is hard to get the timing right for the polling engine poll.
if ((0 == strcmp(poller.get(), "poll"))) {
return;
}
/* It is hard to get the timing right for the polling engine poll. */
if (grpc_core::ConfigVars::Get().PollStrategy() == "poll") return;
#endif // GRPC_POSIX_SOCKET
const int kPingIntervalMS = 100;
grpc_arg keepalive_arg_elems[3];

@ -33,10 +33,10 @@
#include <grpc/grpc.h>
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/event_engine/poller.h"
#include "src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.h"
#include "src/core/lib/event_engine/posix_engine/wakeup_fd_posix.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/port.h"
@ -67,14 +67,11 @@
#include "src/core/lib/event_engine/posix_engine/posix_engine_closure.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/dual_ref_counted.h"
#include "src/core/lib/gprpp/global_config.h"
#include "src/core/lib/gprpp/notification.h"
#include "src/core/lib/gprpp/strerror.h"
#include "test/core/event_engine/posix/posix_engine_test_utils.h"
#include "test/core/util/port.h"
GPR_GLOBAL_CONFIG_DECLARE_STRING(grpc_poll_strategy);
static gpr_mu g_mu;
static grpc_event_engine::experimental::PosixEventPoller* g_event_poller =
nullptr;
@ -713,10 +710,8 @@ TEST_F(EventPollerTest, TestMultipleHandles) {
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
gpr_mu_init(&g_mu);
grpc_core::UniquePtr<char> poll_strategy =
GPR_GLOBAL_CONFIG_GET(grpc_poll_strategy);
GPR_GLOBAL_CONFIG_GET(grpc_poll_strategy);
auto strings = absl::StrSplit(poll_strategy.get(), ',');
auto poll_strategy = grpc_core::ConfigVars::Get().PollStrategy();
auto strings = absl::StrSplit(poll_strategy, ',');
if (std::find(strings.begin(), strings.end(), "none") != strings.end()) {
// Skip the test entirely if poll strategy is none.
return 0;

@ -34,6 +34,7 @@
#include <grpc/grpc.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/event_engine/channel_args_endpoint_config.h"
#include "src/core/lib/event_engine/poller.h"
#include "src/core/lib/event_engine/posix_engine/event_poller.h"
@ -43,8 +44,6 @@
#include "src/core/lib/event_engine/posix_engine/tcp_socket_utils.h"
#include "src/core/lib/event_engine/tcp_socket_utils.h"
#include "src/core/lib/gprpp/dual_ref_counted.h"
#include "src/core/lib/gprpp/global_config.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/notification.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/resource_quota/resource_quota.h"
@ -53,8 +52,6 @@
#include "test/core/event_engine/test_suite/posix/oracle_event_engine_posix.h"
#include "test/core/util/port.h"
GPR_GLOBAL_CONFIG_DECLARE_STRING(grpc_poll_strategy);
namespace grpc_event_engine {
namespace experimental {
@ -335,10 +332,8 @@ INSTANTIATE_TEST_SUITE_P(PosixEndpoint, PosixEndpointTest,
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
grpc_core::UniquePtr<char> poll_strategy =
GPR_GLOBAL_CONFIG_GET(grpc_poll_strategy);
GPR_GLOBAL_CONFIG_GET(grpc_poll_strategy);
auto strings = absl::StrSplit(poll_strategy.get(), ',');
auto poll_strategy = grpc_core::ConfigVars::Get().PollStrategy();
auto strings = absl::StrSplit(poll_strategy, ',');
if (std::find(strings.begin(), strings.end(), "none") != strings.end()) {
// Skip the test entirely if poll strategy is none.
return 0;

@ -54,37 +54,6 @@ grpc_cc_test(
],
)
grpc_cc_test(
name = "global_config_test",
srcs = ["global_config_test.cc"],
external_deps = [
"gtest",
],
language = "C++",
uses_event_engine = False,
uses_polling = False,
deps = [
"//:gpr",
"//test/core/util:grpc_test_util",
],
)
grpc_cc_test(
name = "global_config_env_test",
srcs = ["global_config_env_test.cc"],
external_deps = [
"gtest",
],
language = "C++",
tags = ["no_windows"], # TODO(jtattermusch): fix the failure on windows
uses_event_engine = False,
uses_polling = False,
deps = [
"//:gpr",
"//test/core/util:grpc_test_util",
],
)
grpc_cc_test(
name = "bitset_test",
srcs = ["bitset_test.cc"],

@ -1,127 +0,0 @@
//
//
// Copyright 2019 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//
#include "src/core/lib/gprpp/global_config_env.h"
#include <string.h>
#include "gtest/gtest.h"
#include "src/core/lib/gprpp/env.h"
#include "src/core/lib/gprpp/memory.h"
namespace {
bool g_config_error_function_called;
void ClearConfigErrorCalled() { g_config_error_function_called = false; }
bool IsConfigErrorCalled() { return g_config_error_function_called; }
// This function is for preventing the program from invoking
// an error handler due to configuration error and
// make test routines know whether there is error.
void FakeConfigErrorFunction(const char* /*error_message*/) {
g_config_error_function_called = true;
}
class GlobalConfigEnvTest : public ::testing::Test {
protected:
void SetUp() override { ClearConfigErrorCalled(); }
void TearDown() override { EXPECT_FALSE(IsConfigErrorCalled()); }
};
} // namespace
GPR_GLOBAL_CONFIG_DEFINE_BOOL(bool_var, true, "");
GPR_GLOBAL_CONFIG_DEFINE_INT32(int32_var, 1234, "");
GPR_GLOBAL_CONFIG_DEFINE_STRING(string_var, "Apple", "");
TEST_F(GlobalConfigEnvTest, BoolWithEnvTest) {
const char* bool_var_name = "BOOL_VAR";
grpc_core::UnsetEnv(bool_var_name);
EXPECT_TRUE(GPR_GLOBAL_CONFIG_GET(bool_var));
grpc_core::SetEnv(bool_var_name, "true");
EXPECT_TRUE(GPR_GLOBAL_CONFIG_GET(bool_var));
grpc_core::SetEnv(bool_var_name, "false");
EXPECT_FALSE(GPR_GLOBAL_CONFIG_GET(bool_var));
EXPECT_FALSE(IsConfigErrorCalled());
grpc_core::SetEnv(bool_var_name, "");
GPR_GLOBAL_CONFIG_GET(bool_var);
EXPECT_TRUE(IsConfigErrorCalled());
ClearConfigErrorCalled();
grpc_core::SetEnv(bool_var_name, "!");
GPR_GLOBAL_CONFIG_GET(bool_var);
EXPECT_TRUE(IsConfigErrorCalled());
ClearConfigErrorCalled();
}
TEST_F(GlobalConfigEnvTest, Int32WithEnvTest) {
const char* int32_var_name = "INT32_VAR";
grpc_core::UnsetEnv(int32_var_name);
EXPECT_EQ(1234, GPR_GLOBAL_CONFIG_GET(int32_var));
grpc_core::SetEnv(int32_var_name, "0");
EXPECT_EQ(0, GPR_GLOBAL_CONFIG_GET(int32_var));
grpc_core::SetEnv(int32_var_name, "-123456789");
EXPECT_EQ(-123456789, GPR_GLOBAL_CONFIG_GET(int32_var));
grpc_core::SetEnv(int32_var_name, "123456789");
EXPECT_EQ(123456789, GPR_GLOBAL_CONFIG_GET(int32_var));
EXPECT_FALSE(IsConfigErrorCalled());
grpc_core::SetEnv(int32_var_name, "-1AB");
GPR_GLOBAL_CONFIG_GET(int32_var);
EXPECT_TRUE(IsConfigErrorCalled());
ClearConfigErrorCalled();
}
TEST_F(GlobalConfigEnvTest, StringWithEnvTest) {
const char* string_var_name = "STRING_VAR";
grpc_core::UniquePtr<char> value;
grpc_core::UnsetEnv(string_var_name);
value = GPR_GLOBAL_CONFIG_GET(string_var);
EXPECT_EQ(0, strcmp(value.get(), "Apple"));
grpc_core::SetEnv(string_var_name, "Banana");
value = GPR_GLOBAL_CONFIG_GET(string_var);
EXPECT_EQ(0, strcmp(value.get(), "Banana"));
grpc_core::SetEnv(string_var_name, "");
value = GPR_GLOBAL_CONFIG_GET(string_var);
EXPECT_EQ(0, strcmp(value.get(), ""));
}
int main(int argc, char** argv) {
// Not to abort the test when parsing error happens.
grpc_core::SetGlobalConfigEnvErrorFunction(&FakeConfigErrorFunction);
::testing::InitGoogleTest(&argc, argv);
int ret = RUN_ALL_TESTS();
return ret;
}

@ -1,61 +0,0 @@
//
//
// Copyright 2019 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//
#include "src/core/lib/gprpp/global_config.h"
#include <string.h>
#include "gtest/gtest.h"
#include "src/core/lib/gprpp/memory.h"
GPR_GLOBAL_CONFIG_DECLARE_BOOL(bool_var);
GPR_GLOBAL_CONFIG_DEFINE_BOOL(bool_var, false, "");
GPR_GLOBAL_CONFIG_DEFINE_INT32(int32_var, 0, "");
GPR_GLOBAL_CONFIG_DEFINE_STRING(string_var, "", "");
TEST(GlobalConfigTest, BoolTest) {
EXPECT_FALSE(GPR_GLOBAL_CONFIG_GET(bool_var));
GPR_GLOBAL_CONFIG_SET(bool_var, true);
EXPECT_TRUE(GPR_GLOBAL_CONFIG_GET(bool_var));
}
TEST(GlobalConfigTest, Int32Test) {
EXPECT_EQ(0, GPR_GLOBAL_CONFIG_GET(int32_var));
GPR_GLOBAL_CONFIG_SET(int32_var, 1024);
EXPECT_EQ(1024, GPR_GLOBAL_CONFIG_GET(int32_var));
}
TEST(GlobalConfigTest, StringTest) {
grpc_core::UniquePtr<char> value;
value = GPR_GLOBAL_CONFIG_GET(string_var);
EXPECT_EQ(0, strcmp(value.get(), ""));
GPR_GLOBAL_CONFIG_SET(string_var, "Test");
value = GPR_GLOBAL_CONFIG_GET(string_var);
EXPECT_EQ(0, strcmp(value.get(), "Test"));
}
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
int ret = RUN_ALL_TESTS();
return ret;
}

@ -20,15 +20,18 @@
#include <string.h>
#include <string>
#include <vector>
#include "absl/strings/str_cat.h"
#include "absl/types/optional.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/security/security_connector/ssl_utils_config.h"
#include "src/core/lib/config/config_vars.h"
#include "test/core/util/port.h"
#include "test/core/util/subprocess.h"
@ -77,10 +80,10 @@ HttpRequestTestServer StartHttpRequestTestServer(int argc, char** argv,
if (use_ssl) {
args.push_back(gpr_strdup("--ssl"));
// Set the environment variable for the SSL certificate file
char* pem_file;
gpr_asprintf(&pem_file, "%s/src/core/tsi/test_creds/ca.pem", root);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, pem_file);
gpr_free(pem_file);
ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path =
absl::StrCat(root, "/src/core/tsi/test_creds/ca.pem");
ConfigVars::SetOverrides(overrides);
}
gpr_log(GPR_INFO, "starting HttpRequest test server subprocess:");
for (size_t i = 0; i < args.size(); i++) {

@ -24,7 +24,6 @@
#include <grpc/support/time.h>
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/internal_errqueue.h"

@ -34,7 +34,7 @@
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
#include "src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/crash.h"
@ -188,30 +188,21 @@ TEST(ResolveAddressUsingAresResolverPosixTest, MainTest) {
// In case that there are more than one argument on the command line,
// --resolver will always be the first one, so only parse the first argument
// (other arguments may be unknown to cl)
grpc_core::UniquePtr<char> resolver =
GPR_GLOBAL_CONFIG_GET(grpc_dns_resolver);
if (strlen(resolver.get()) != 0) {
gpr_log(GPR_INFO, "Warning: overriding resolver setting of %s",
resolver.get());
}
grpc_core::ConfigVars::Overrides overrides;
if (resolver_type == "native") {
GPR_GLOBAL_CONFIG_SET(grpc_dns_resolver, "native");
overrides.dns_resolver = "native";
} else if (resolver_type == "ares") {
GPR_GLOBAL_CONFIG_SET(grpc_dns_resolver, "ares");
overrides.dns_resolver = "ares";
} else {
gpr_log(GPR_ERROR, "--resolver was not set to ares or native");
ASSERT_TRUE(false);
}
grpc_core::ConfigVars::SetOverrides(overrides);
grpc_init();
{
grpc_core::ExecCtx exec_ctx;
test_named_and_numeric_scope_ids();
// c-ares resolver doesn't support UDS (ability for native DNS resolver
// to handle this is only expected to be used by servers, which
// unconditionally use the native DNS resolver).
grpc_core::UniquePtr<char> resolver =
GPR_GLOBAL_CONFIG_GET(grpc_dns_resolver);
}
grpc_shutdown();
}

@ -34,7 +34,7 @@
#include <grpc/support/time.h>
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
#include "src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/sync.h"
@ -548,7 +548,9 @@ int main(int argc, char** argv) {
} else {
GPR_ASSERT(0);
}
GPR_GLOBAL_CONFIG_SET(grpc_dns_resolver, g_resolver_type);
grpc_core::ConfigVars::Overrides overrides;
overrides.dns_resolver = g_resolver_type;
grpc_core::ConfigVars::SetOverrides(overrides);
::testing::InitGoogleTest(&argc, argv);
grpc::testing::TestEnvironment env(&argc, argv);
const auto result = RUN_ALL_TESTS();

@ -25,11 +25,11 @@
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gpr/tmpfile.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/iomgr/load_file.h"
#include "src/core/lib/security/credentials/tls/tls_credentials.h"
#include "src/core/lib/security/security_connector/ssl_utils_config.h"
#include "src/core/lib/security/security_connector/tls/tls_security_connector.h"
#include "test/core/util/test_config.h"
#include "test/core/util/tls_utils.h"
@ -568,7 +568,9 @@ TEST_F(GrpcTlsCredentialsOptionsTest,
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(&argc, argv);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, CA_CERT_PATH);
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = CA_CERT_PATH;
grpc_core::ConfigVars::SetOverrides(overrides);
::testing::InitGoogleTest(&argc, argv);
grpc_init();
int ret = RUN_ALL_TESTS();

@ -28,13 +28,13 @@
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/tmpfile.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/security/context/security_context.h"
#include "src/core/lib/security/security_connector/ssl_utils.h"
#include "src/core/lib/security/security_connector/ssl_utils_config.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/tsi/ssl_transport_security.h"
#include "src/core/tsi/transport_security.h"
@ -664,9 +664,12 @@ static void test_default_ssl_roots(void) {
fwrite(roots_for_env_var, 1, strlen(roots_for_env_var), roots_env_var_file);
fclose(roots_env_var_file);
// First let's get the root through the override: set the env to an invalid
// value.
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, "");
grpc_core::ConfigVars::Overrides overrides;
// First let's get the root through the override: override the config to an
// invalid value.
overrides.default_ssl_roots_file_path = "";
grpc_core::ConfigVars::SetOverrides(overrides);
grpc_set_ssl_roots_override_callback(override_roots_success);
grpc_slice roots =
grpc_core::TestDefaultSslRootStore::ComputePemRootCertsForTesting();
@ -675,19 +678,21 @@ static void test_default_ssl_roots(void) {
ASSERT_STREQ(roots_contents, roots_for_override_api);
gpr_free(roots_contents);
// Now let's set the env var: We should get the contents pointed value
// instead.
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path,
roots_env_var_file_path);
// Now let's set the config: We should get the contents pointed value
// instead
overrides.default_ssl_roots_file_path = roots_env_var_file_path;
grpc_core::ConfigVars::SetOverrides(overrides);
roots = grpc_core::TestDefaultSslRootStore::ComputePemRootCertsForTesting();
roots_contents = grpc_slice_to_c_string(roots);
grpc_slice_unref(roots);
ASSERT_STREQ(roots_contents, roots_for_env_var);
gpr_free(roots_contents);
// Now reset the env var. We should fall back to the value overridden using
// Now reset the config. We should fall back to the value overridden using
// the api.
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, "");
overrides.default_ssl_roots_file_path = "";
grpc_core::ConfigVars::SetOverrides(overrides);
grpc_set_ssl_roots_override_callback(override_roots_success);
roots = grpc_core::TestDefaultSslRootStore::ComputePemRootCertsForTesting();
roots_contents = grpc_slice_to_c_string(roots);
grpc_slice_unref(roots);
@ -696,7 +701,8 @@ static void test_default_ssl_roots(void) {
// Now setup a permanent failure for the overridden roots and we should get
// an empty slice.
GPR_GLOBAL_CONFIG_SET(grpc_not_use_system_ssl_roots, true);
overrides.not_use_system_ssl_roots = true;
grpc_core::ConfigVars::SetOverrides(overrides);
grpc_set_ssl_roots_override_callback(override_roots_permanent_failure);
roots = grpc_core::TestDefaultSslRootStore::ComputePemRootCertsForTesting();
ASSERT_TRUE(GRPC_SLICE_IS_EMPTY(roots));

@ -29,6 +29,7 @@
#include <grpc/support/string_util.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/unique_type_name.h"
#include "src/core/lib/iomgr/load_file.h"
@ -36,7 +37,6 @@
#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h"
#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h"
#include "src/core/lib/security/credentials/tls/tls_credentials.h"
#include "src/core/lib/security/security_connector/ssl_utils_config.h"
#include "src/core/tsi/transport_security.h"
#include "test/core/util/test_config.h"
#include "test/core/util/tls_utils.h"
@ -1169,7 +1169,9 @@ TEST_F(TlsSecurityConnectorTest,
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(&argc, argv);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, CA_CERT_PATH);
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = CA_CERT_PATH;
grpc_core::ConfigVars::SetOverrides(overrides);
::testing::InitGoogleTest(&argc, argv);
grpc_init();
int ret = RUN_ALL_TESTS();

@ -29,6 +29,8 @@
#include <gtest/gtest.h>
#include "absl/types/optional.h"
#include <grpc/byte_buffer.h>
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
@ -38,10 +40,9 @@
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include "src/core/ext/filters/client_channel/backup_poller.h"
#include "src/core/ext/transport/chttp2/transport/flow_control.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/gprpp/sync.h"
#include "test/core/util/port.h"
@ -355,7 +356,9 @@ int main(int argc, char** argv) {
// Make sure that we will have an active poller on all client-side fd's that
// are capable of sending settings frames with window updates etc., even in
// the case that we don't have an active RPC operation on the fd.
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
grpc_core::chttp2::g_test_only_transport_target_window_estimates_mocker =
new TransportTargetWindowEstimatesMocker();
grpc::testing::TestEnvironment env(&argc, argv);

@ -37,6 +37,7 @@
#include <grpcpp/server_context.h>
#include "src/core/ext/filters/client_channel/backup_poller.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/iomgr/port.h"
@ -447,8 +448,7 @@ TEST_P(AsyncEnd2endTest, ReconnectChannel) {
#ifdef GRPC_POSIX_SOCKET_EV
// It needs 2 pollset_works to reconnect the channel with polling engine
// "poll"
grpc_core::UniquePtr<char> poller = GPR_GLOBAL_CONFIG_GET(grpc_poll_strategy);
if (0 == strcmp(poller.get(), "poll")) {
if (grpc_core::ConfigVars::Get().PollStrategy() == "poll") {
poller_slowdown_factor = 2;
}
#endif // GRPC_POSIX_SOCKET_EV
@ -1971,7 +1971,9 @@ INSTANTIATE_TEST_SUITE_P(AsyncEnd2endServerTryCancel,
int main(int argc, char** argv) {
// Change the backup poll interval from 5s to 100ms to speed up the
// ReconnectChannel test
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 100);
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 100;
grpc_core::ConfigVars::SetOverrides(overrides);
grpc::testing::TestEnvironment env(&argc, argv);
::testing::InitGoogleTest(&argc, argv);
int ret = RUN_ALL_TESTS();

@ -55,6 +55,7 @@
#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/env.h"
@ -3180,14 +3181,16 @@ TEST_P(WeightedRoundRobinParamTest, Basic) {
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
grpc::testing::TestEnvironment env(&argc, argv);
// Make the backup poller poll very frequently in order to pick up
// updates from all the subchannels's FDs.
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");
#endif
grpc::testing::TestEnvironment env(&argc, argv);
grpc_init();
grpc::testing::ConnectionAttemptInjector::Init();
const auto result = RUN_ALL_TESTS();

@ -42,6 +42,7 @@
#include <grpcpp/test/channel_test_peer.h>
#include "src/core/ext/filters/client_channel/backup_poller.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/env.h"
#include "src/core/lib/iomgr/iomgr.h"
@ -909,8 +910,7 @@ TEST_P(End2endTest, ReconnectChannel) {
// It needs 2 pollset_works to reconnect the channel with polling engine
// "poll"
#ifdef GRPC_POSIX_SOCKET_EV
grpc_core::UniquePtr<char> poller = GPR_GLOBAL_CONFIG_GET(grpc_poll_strategy);
if (0 == strcmp(poller.get(), "poll")) {
if (grpc_core::ConfigVars::Get().PollStrategy() == "poll") {
poller_slowdown_factor = 2;
}
#endif // GRPC_POSIX_SOCKET_EV
@ -2246,8 +2246,10 @@ std::vector<TestScenario> CreateTestScenarios(bool use_proxy,
std::vector<TestScenario> scenarios;
std::vector<std::string> credentials_types;
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms,
kClientChannelBackupPollIntervalMs);
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms =
kClientChannelBackupPollIntervalMs;
grpc_core::ConfigVars::SetOverrides(overrides);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -46,6 +46,7 @@
#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/env.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
@ -375,7 +376,9 @@ class GrpclbEnd2endTest : public ::testing::Test {
static void SetUpTestSuite() {
// Make the backup poller poll very frequently in order to pick up
// updates from all the subchannels's FDs.
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -43,6 +43,7 @@
#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gprpp/env.h"
#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/gprpp/time.h"
@ -158,7 +159,9 @@ class FakeResolverResponseGeneratorWrapper {
class RlsEnd2endTest : public ::testing::Test {
protected:
static void SetUpTestSuite() {
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
grpc_core::CoreConfiguration::RegisterBuilder(
grpc_core::RegisterFixedAddressLoadBalancingPolicy);
grpc_init();

@ -31,6 +31,7 @@
#include <grpcpp/server_builder.h>
#include "src/core/ext/filters/client_channel/backup_poller.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/proto/grpc/lb/v1/load_reporter.grpc.pb.h"
#include "src/proto/grpc/testing/echo.grpc.pb.h"
@ -203,6 +204,8 @@ int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
// Make the backup poller poll very frequently in order to pick up
// updates from all the subchannels's FDs.
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
grpc_core::ConfigVars::Overrides config_overrides;
config_overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(config_overrides);
return RUN_ALL_TESTS();
}

@ -50,6 +50,7 @@
#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
@ -124,7 +125,9 @@ class ServiceConfigEnd2endTest : public ::testing::Test {
static void SetUpTestSuite() {
// Make the backup poller poll very frequently in order to pick up
// updates from all the subchannels's FDs.
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
}
void SetUp() override {

@ -25,6 +25,7 @@
#include "src/core/ext/filters/client_channel/backup_poller.h"
#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/config/config_vars.h"
#include "test/cpp/end2end/connection_attempt_injector.h"
#include "test/cpp/end2end/xds/xds_end2end_test_lib.h"
@ -1726,7 +1727,9 @@ int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
// Make the backup poller poll very frequently in order to pick up
// updates from all the subchannels's FDs.
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -27,6 +27,7 @@
#include "src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h"
#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gprpp/env.h"
#include "src/core/lib/resolver/server_address.h"
#include "src/proto/grpc/testing/xds/v3/aggregate_cluster.grpc.pb.h"
@ -663,7 +664,9 @@ int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
// Make the backup poller poll very frequently in order to pick up
// updates from all the subchannels's FDs.
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -23,6 +23,7 @@
#include "absl/strings/str_cat.h"
#include "src/core/ext/filters/client_channel/backup_poller.h"
#include "src/core/lib/config/config_vars.h"
#include "test/core/util/scoped_env_var.h"
#include "test/cpp/end2end/xds/xds_end2end_test_lib.h"
@ -1366,7 +1367,9 @@ int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
// Make the backup poller poll very frequently in order to pick up
// updates from all the subchannels's FDs.
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -27,6 +27,7 @@
#include <grpcpp/security/credentials.h>
#include "src/core/ext/filters/client_channel/backup_poller.h"
#include "src/core/lib/config/config_vars.h"
#include "src/cpp/client/secure_credentials.h"
#include "src/proto/grpc/testing/xds/v3/cluster.grpc.pb.h"
#include "src/proto/grpc/testing/xds/v3/endpoint.grpc.pb.h"
@ -714,7 +715,9 @@ int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
// Make the backup poller poll very frequently in order to pick up
// updates from all the subchannels's FDs.
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -68,6 +68,7 @@
#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/time_precise.h"
@ -2951,7 +2952,9 @@ int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
// Make the backup poller poll very frequently in order to pick up
// updates from all the subchannels's FDs.
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -20,6 +20,7 @@
#include <gtest/gtest.h>
#include "src/core/ext/filters/client_channel/backup_poller.h"
#include "src/core/lib/config/config_vars.h"
#include "src/proto/grpc/testing/xds/v3/cluster.grpc.pb.h"
#include "src/proto/grpc/testing/xds/v3/fault.grpc.pb.h"
#include "src/proto/grpc/testing/xds/v3/http_connection_manager.grpc.pb.h"
@ -568,7 +569,9 @@ int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
// Make the backup poller poll very frequently in order to pick up
// updates from all the subchannels's FDs.
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -21,6 +21,7 @@
#include <gtest/gtest.h>
#include "src/core/ext/filters/client_channel/backup_poller.h"
#include "src/core/lib/config/config_vars.h"
#include "src/proto/grpc/testing/xds/v3/cluster.grpc.pb.h"
#include "src/proto/grpc/testing/xds/v3/fault.grpc.pb.h"
#include "src/proto/grpc/testing/xds/v3/outlier_detection.grpc.pb.h"
@ -1122,7 +1123,9 @@ int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
// Make the backup poller poll very frequently in order to pick up
// updates from all the subchannels's FDs.
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -25,6 +25,7 @@
#include "absl/strings/str_split.h"
#include "src/core/ext/filters/client_channel/backup_poller.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gprpp/match.h"
#include "src/proto/grpc/testing/xds/v3/cluster.grpc.pb.h"
#include "src/proto/grpc/testing/xds/v3/outlier_detection.grpc.pb.h"
@ -277,7 +278,9 @@ int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
// Make the backup poller poll very frequently in order to pick up
// updates from all the subchannels's FDs.
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -28,6 +28,7 @@
#include "src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h"
#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gprpp/env.h"
#include "src/proto/grpc/testing/xds/v3/aggregate_cluster.grpc.pb.h"
#include "src/proto/grpc/testing/xds/v3/cluster.grpc.pb.h"
@ -1165,7 +1166,9 @@ int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
// Make the backup poller poll very frequently in order to pick up
// updates from all the subchannels's FDs.
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -22,6 +22,7 @@
#include "absl/strings/str_cat.h"
#include "src/core/ext/filters/client_channel/backup_poller.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gprpp/env.h"
#include "src/proto/grpc/lookup/v1/rls.grpc.pb.h"
#include "src/proto/grpc/lookup/v1/rls.pb.h"
@ -208,7 +209,9 @@ int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
// Make the backup poller poll very frequently in order to pick up
// updates from all the subchannels's FDs.
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -21,6 +21,7 @@
#include <gtest/gtest.h>
#include "src/core/ext/filters/client_channel/backup_poller.h"
#include "src/core/lib/config/config_vars.h"
#include "src/proto/grpc/testing/xds/v3/fault.grpc.pb.h"
#include "src/proto/grpc/testing/xds/v3/router.grpc.pb.h"
#include "test/cpp/end2end/xds/xds_end2end_test_lib.h"
@ -2401,7 +2402,9 @@ int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
// Make the backup poller poll very frequently in order to pick up
// updates from all the subchannels's FDs.
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -26,6 +26,7 @@
#include <grpcpp/ext/server_metric_recorder.h>
#include "src/core/ext/filters/client_channel/backup_poller.h"
#include "src/core/lib/config/config_vars.h"
#include "src/proto/grpc/testing/xds/v3/client_side_weighted_round_robin.grpc.pb.h"
#include "src/proto/grpc/testing/xds/v3/wrr_locality.grpc.pb.h"
#include "test/core/util/scoped_env_var.h"
@ -104,7 +105,9 @@ int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
// Make the backup poller poll very frequently in order to pick up
// updates from all the subchannels's FDs.
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save