Revert "[config] Move global config alongside core configuration" (#32659)

Reverts grpc/grpc#30788

(it breaks grpc_objc_bazel_test (see
https://github.com/grpc/grpc/pull/30788#issuecomment-1476372187) and
also seems to be breaking some other internal stuff).
pull/32663/head^2
Jan Tattermusch 2 years ago committed by GitHub
parent 5873ba96dc
commit 0c1797cd9f
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. 4
      src/android/test/interop/app/src/main/cpp/grpc-interop.cc
  13. 16
      src/core/BUILD
  14. 13
      src/core/ext/filters/client_channel/backup_poller.cc
  15. 3
      src/core/ext/filters/client_channel/backup_poller.h
  16. 20
      src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
  17. 30
      src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc
  18. 29
      src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h
  19. 10
      src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
  20. 137
      src/core/lib/config/config_vars.cc
  21. 129
      src/core/lib/config/config_vars.h
  22. 102
      src/core/lib/config/config_vars.yaml
  23. 51
      src/core/lib/config/config_vars_non_generated.cc
  24. 70
      src/core/lib/config/load_config.cc
  25. 46
      src/core/lib/config/load_config.h
  26. 11
      src/core/lib/debug/trace.cc
  27. 5
      src/core/lib/debug/trace.h
  28. 4
      src/core/lib/event_engine/posix_engine/ev_poll_posix.cc
  29. 12
      src/core/lib/event_engine/posix_engine/event_poller_posix_default.cc
  30. 13
      src/core/lib/experiments/config.cc
  31. 43
      src/core/lib/gpr/log.cc
  32. 14
      src/core/lib/gprpp/fork.cc
  33. 93
      src/core/lib/gprpp/global_config.h
  34. 29
      src/core/lib/gprpp/global_config_custom.h
  35. 140
      src/core/lib/gprpp/global_config_env.cc
  36. 133
      src/core/lib/gprpp/global_config_env.h
  37. 40
      src/core/lib/gprpp/global_config_generic.h
  38. 66
      src/core/lib/iomgr/ev_posix.cc
  39. 3
      src/core/lib/iomgr/ev_posix.h
  40. 12
      src/core/lib/iomgr/iomgr.cc
  41. 1
      src/core/lib/iomgr/tcp_posix.cc
  42. 16
      src/core/lib/security/security_connector/load_system_roots_supported.cc
  43. 36
      src/core/lib/security/security_connector/ssl_utils.cc
  44. 32
      src/core/lib/security/security_connector/ssl_utils_config.cc
  45. 29
      src/core/lib/security/security_connector/ssl_utils_config.h
  46. 1
      src/core/tsi/alts/frame_protector/alts_frame_protector.cc
  47. 2
      src/objective-c/tests/CronetTests/CoreCronetEnd2EndTests.mm
  48. 5
      src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi
  49. 4
      src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi
  50. 15
      src/python/grpcio/grpc_core_dependencies.py
  51. 1
      src/python/grpcio_tests/tests_py3_only/unit/_simple_stubs_test.py
  52. 5
      test/core/bad_ssl/bad_ssl_test.cc
  53. 9
      test/core/client_channel/resolvers/dns_resolver_test.cc
  54. 17
      test/core/end2end/BUILD
  55. 10
      test/core/end2end/fixtures/h2_full+trace.cc
  56. 12
      test/core/end2end/fixtures/h2_sockpair+trace.cc
  57. 11
      test/core/end2end/fixtures/h2_ssl_cred_reload_tls12.cc
  58. 11
      test/core/end2end/fixtures/h2_ssl_cred_reload_tls13.cc
  59. 11
      test/core/end2end/fixtures/h2_ssl_proxy.cc
  60. 11
      test/core/end2end/fixtures/h2_ssl_tls12.cc
  61. 11
      test/core/end2end/fixtures/h2_ssl_tls13.cc
  62. 10
      test/core/end2end/fixtures/h2_tls_certwatch_async_tls1_3.cc
  63. 10
      test/core/end2end/fixtures/h2_tls_certwatch_sync_tls1_2.cc
  64. 10
      test/core/end2end/fixtures/h2_tls_simple.cc
  65. 10
      test/core/end2end/fixtures/h2_tls_static_async_tls1_3.cc
  66. 8
      test/core/end2end/h2_ssl_cert_test.cc
  67. 9
      test/core/end2end/h2_ssl_session_reuse_test.cc
  68. 10
      test/core/end2end/h2_tls_peer_property_external_verifier_test.cc
  69. 16
      test/core/end2end/tests/keepalive_timeout.cc
  70. 11
      test/core/event_engine/posix/event_poller_posix_test.cc
  71. 11
      test/core/event_engine/posix/posix_endpoint_test.cc
  72. 31
      test/core/gprpp/BUILD
  73. 127
      test/core/gprpp/global_config_env_test.cc
  74. 61
      test/core/gprpp/global_config_test.cc
  75. 15
      test/core/http/httpcli_test_util.cc
  76. 1
      test/core/iomgr/buffer_list_test.cc
  77. 19
      test/core/iomgr/resolve_address_posix_test.cc
  78. 6
      test/core/iomgr/resolve_address_test.cc
  79. 6
      test/core/security/grpc_tls_credentials_options_test.cc
  80. 28
      test/core/security/security_connector_test.cc
  81. 6
      test/core/security/tls_security_connector_test.cc
  82. 9
      test/core/transport/chttp2/remove_stream_from_stalled_lists_test.cc
  83. 8
      test/cpp/end2end/async_end2end_test.cc
  84. 7
      test/cpp/end2end/client_lb_end2end_test.cc
  85. 10
      test/cpp/end2end/end2end_test.cc
  86. 5
      test/cpp/end2end/grpclb_end2end_test.cc
  87. 5
      test/cpp/end2end/rls_end2end_test.cc
  88. 5
      test/cpp/end2end/server_load_reporting_end2end_test.cc
  89. 5
      test/cpp/end2end/service_config_end2end_test.cc
  90. 5
      test/cpp/end2end/xds/xds_cluster_end2end_test.cc
  91. 5
      test/cpp/end2end/xds/xds_cluster_type_end2end_test.cc
  92. 5
      test/cpp/end2end/xds/xds_core_end2end_test.cc
  93. 5
      test/cpp/end2end/xds/xds_csds_end2end_test.cc
  94. 5
      test/cpp/end2end/xds/xds_end2end_test.cc
  95. 5
      test/cpp/end2end/xds/xds_fault_injection_end2end_test.cc
  96. 5
      test/cpp/end2end/xds/xds_outlier_detection_end2end_test.cc
  97. 5
      test/cpp/end2end/xds/xds_override_host_end2end_test.cc
  98. 5
      test/cpp/end2end/xds/xds_ring_hash_end2end_test.cc
  99. 5
      test/cpp/end2end/xds/xds_rls_end2end_test.cc
  100. 5
      test/cpp/end2end/xds/xds_routing_end2end_test.cc
  101. Some files were not shown because too many files have changed in this diff Show More

56
BUILD

@ -668,6 +668,7 @@ 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",
@ -683,6 +684,10 @@ 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",
@ -711,7 +716,6 @@ grpc_cc_library(
],
visibility = ["@grpc:public"],
deps = [
"config_vars",
"debug_location",
"//src/core:construct_destruct",
"//src/core:env",
@ -1437,7 +1441,6 @@ grpc_cc_library(
deps = [
"channel_stack_builder",
"config",
"config_vars",
"cpp_impl_of",
"debug_location",
"exec_ctx",
@ -2278,56 +2281,14 @@ 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 = [
@ -2843,7 +2804,6 @@ grpc_cc_library(
"backoff",
"channel_stack_builder",
"config",
"config_vars",
"debug_location",
"exec_ctx",
"gpr",
@ -2938,7 +2898,6 @@ grpc_cc_library(
deps = [
"backoff",
"config",
"config_vars",
"debug_location",
"exec_ctx",
"gpr",
@ -2958,6 +2917,7 @@ 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",
@ -3158,7 +3118,6 @@ grpc_cc_library(
language = "c++",
visibility = ["@grpc:public"],
deps = [
"config_vars",
"gpr",
"grpc_base",
"grpc_security_base",
@ -3281,12 +3240,14 @@ 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",
@ -3301,7 +3262,6 @@ grpc_cc_library(
language = "c++",
visibility = ["@grpc:public"],
deps = [
"config_vars",
"gpr",
"grpc_base",
"grpc_credentials_util",

120
CMakeLists.txt generated

@ -139,16 +139,6 @@ 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
@ -977,6 +967,10 @@ 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)
@ -1562,9 +1556,6 @@ 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
@ -1596,6 +1587,7 @@ 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
@ -1647,8 +1639,6 @@ target_link_libraries(gpr
${_gRPC_ALLTARGETS_LIBRARIES}
absl::base
absl::core_headers
absl::flags
absl::flags_marshalling
absl::memory
absl::random_random
absl::status
@ -1769,6 +1759,7 @@ 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
@ -2386,6 +2377,7 @@ 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
@ -2782,6 +2774,7 @@ 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
@ -4058,6 +4051,7 @@ target_link_libraries(grpc++_test_util
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ZLIB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flags
grpc++
grpc_test_util
)
@ -11791,6 +11785,82 @@ 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)
@ -12189,6 +12259,7 @@ target_link_libraries(grpc_cli
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ZLIB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flags
grpc++
grpc++_test_config
)
@ -17337,6 +17408,7 @@ 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
)
@ -17440,6 +17512,7 @@ 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
)
@ -23250,6 +23323,7 @@ target_link_libraries(xds_common_types_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ZLIB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flags
grpc++
grpc_test_util
)
@ -24240,6 +24314,7 @@ target_link_libraries(xds_http_filters_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ZLIB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flags
grpc++
grpc_test_util
)
@ -24308,6 +24383,7 @@ target_link_libraries(xds_interop_client
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ZLIB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flags
grpc++_reflection
grpcpp_channelz
grpc_test_util
@ -24383,6 +24459,7 @@ target_link_libraries(xds_interop_server
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ZLIB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flags
grpc++_reflection
grpcpp_channelz
grpc_test_util
@ -24492,6 +24569,7 @@ target_link_libraries(xds_lb_policy_registry_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ZLIB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flags
grpc++
grpc_test_util
)
@ -24627,6 +24705,7 @@ target_link_libraries(xds_listener_resource_type_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ZLIB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flags
grpc++
grpc_test_util
)
@ -25518,6 +25597,7 @@ target_link_libraries(xds_route_config_resource_type_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ZLIB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
absl::flags
grpc++
grpc_test_util
)
@ -25938,7 +26018,7 @@ generate_pkgconfig(
"gpr"
"gRPC platform support library"
"${gRPC_CORE_VERSION}"
"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"
"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"
""
"-lgpr"
""
@ -25949,7 +26029,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_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"
"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"
"openssl re2 libcares zlib"
"-lgrpc"
"-laddress_sorting -lupb"
@ -25960,7 +26040,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_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"
"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"
"re2 libcares zlib"
"-lgrpc_unsecure"
"-laddress_sorting -lupb"
@ -25971,7 +26051,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_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"
"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"
""
"-lgrpc++"
""
@ -25982,7 +26062,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_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"
"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"
""
"-lgrpc++_unsecure"
""

17
Makefile generated

@ -840,9 +840,6 @@ 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 \
@ -874,6 +871,7 @@ 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 \
@ -1010,6 +1008,7 @@ 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 \
@ -1627,6 +1626,7 @@ 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 \
@ -1876,6 +1876,7 @@ 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 \
@ -2860,15 +2861,6 @@ 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 \
@ -3344,6 +3336,7 @@ 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,8 +177,6 @@ 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
@ -191,6 +189,10 @@ 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
@ -202,9 +204,6 @@ 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
@ -236,6 +235,7 @@ 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,8 +251,6 @@ libs:
deps:
- absl/base:base
- absl/base:core_headers
- absl/flags:flag
- absl/flags:marshalling
- absl/memory:memory
- absl/random:random
- absl/status:status
@ -372,6 +370,7 @@ 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
@ -1026,6 +1025,7 @@ 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
@ -1157,6 +1157,7 @@ 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
@ -1774,6 +1775,7 @@ 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
@ -2040,6 +2042,7 @@ 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
@ -2435,6 +2438,7 @@ 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
@ -3235,6 +3239,7 @@ libs:
- test/cpp/util/subprocess.cc
- test/cpp/util/test_credentials_provider.cc
deps:
- absl/flags:flag
- grpc++
- grpc_test_util
- name: grpc++_unsecure
@ -7900,6 +7905,30 @@ 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
@ -8085,6 +8114,7 @@ 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
@ -10367,6 +10397,7 @@ targets:
- test/core/util/subprocess_windows.cc
- test/core/util/tracer_util.cc
deps:
- absl/flags:flag
- absl/flags:parse
- grpc_test_util
args:
@ -10445,6 +10476,7 @@ targets:
- test/core/util/subprocess_windows.cc
- test/core/util/tracer_util.cc
deps:
- absl/flags:flag
- absl/flags:parse
- grpc_test_util
args:
@ -12947,6 +12979,7 @@ 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
@ -13283,6 +13316,7 @@ 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
@ -13304,6 +13338,7 @@ 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
@ -13329,6 +13364,7 @@ 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
@ -13369,6 +13405,7 @@ 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
@ -13414,6 +13451,7 @@ 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
@ -13704,6 +13742,7 @@ 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,6 +89,7 @@ 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 \
@ -500,10 +501,7 @@ 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 \
@ -579,6 +577,7 @@ 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 \
@ -752,6 +751,7 @@ 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 \
@ -873,15 +873,6 @@ 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 \
@ -1294,6 +1285,7 @@ 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)
@ -1493,8 +1485,6 @@ 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,6 +55,7 @@ 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 " +
@ -466,10 +467,7 @@ 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 " +
@ -545,6 +543,7 @@ 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 " +
@ -718,6 +717,7 @@ 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 " +
@ -839,15 +839,6 @@ 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 " +
@ -1635,8 +1626,6 @@ 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,8 +220,6 @@ 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
@ -278,6 +276,7 @@ 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,9 +728,7 @@ 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',
@ -798,6 +795,10 @@ 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',
@ -994,6 +995,7 @@ 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',
@ -1227,6 +1229,7 @@ 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',
@ -1660,9 +1663,7 @@ 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',
@ -1729,6 +1730,10 @@ 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',
@ -1925,6 +1930,7 @@ 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,8 +186,6 @@ 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
@ -294,6 +292,8 @@ 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',
@ -1118,13 +1118,8 @@ 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',
@ -1266,6 +1261,11 @@ 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',
@ -1635,6 +1635,8 @@ 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',
@ -1936,6 +1938,7 @@ 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',
@ -2349,9 +2352,7 @@ 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',
@ -2418,6 +2419,10 @@ 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',
@ -2614,6 +2619,7 @@ 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,6 +201,8 @@ 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 )
@ -1025,13 +1027,8 @@ 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,6 +1170,11 @@ 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 )
@ -1542,6 +1544,8 @@ 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 )
@ -1832,30 +1836,6 @@ 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,8 +293,6 @@
'dependencies': [
'absl/base:base',
'absl/base:core_headers',
'absl/flags:flag',
'absl/flags:marshalling',
'absl/memory:memory',
'absl/random:random',
'absl/status:status',
@ -307,9 +305,6 @@
'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',
@ -341,6 +336,7 @@
'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',
@ -425,6 +421,7 @@
'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',
@ -1042,6 +1039,7 @@
'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,6 +1231,7 @@
'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',
@ -1713,6 +1712,7 @@
'target_name': 'grpc++_test_util',
'type': 'static_library',
'dependencies': [
'absl/flags:flag',
'grpc++',
'grpc_test_util',
],

38
package.xml generated

@ -183,6 +183,8 @@
<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" />
@ -1007,13 +1009,8 @@
<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,6 +1152,11 @@
<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" />
@ -1524,6 +1526,8 @@
<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" />
@ -1836,30 +1840,6 @@
<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" />

@ -16,10 +16,10 @@
*
*/
#include <jni.h>
#include <grpcpp/grpcpp.h>
#include <jni.h>
#include "src/core/lib/security/security_connector/ssl_utils_config.h"
#include "test/cpp/interop/interop_client.h"
std::shared_ptr<grpc::testing::InteropClient> GetClient(const char* host,

@ -116,7 +116,6 @@ grpc_cc_library(
language = "c++",
deps = [
"no_destruct",
"//:config_vars",
"//:gpr",
],
)
@ -1731,7 +1730,6 @@ grpc_cc_library(
"posix_event_engine_event_poller",
"posix_event_engine_poller_posix_epoll1",
"posix_event_engine_poller_posix_poll",
"//:config_vars",
"//:gpr",
],
)
@ -4851,6 +4849,18 @@ 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 = [
@ -4866,12 +4876,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/config/config_vars.h"
#include "src/core/lib/gprpp/global_config.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/iomgr/closure.h"
@ -61,10 +61,19 @@ 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 =
grpc_core::ConfigVars::Get().ClientChannelBackupPollIntervalMs();
GPR_GLOBAL_CONFIG_GET(grpc_client_channel_backup_poll_interval_ms);
if (poll_interval_ms < 0) {
gpr_log(GPR_ERROR,
"Invalid GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS: %d, "

@ -21,8 +21,11 @@
#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,7 +30,6 @@
#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,6 +41,8 @@
#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"
@ -60,6 +61,7 @@
#if GRPC_ARES == 1
#include <stdio.h>
#include <string.h>
#include <address_sorting/address_sorting.h>
@ -68,11 +70,12 @@
#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"
@ -808,12 +811,19 @@ class AresDNSResolver : public DNSResolver {
intptr_t aba_token_ ABSL_GUARDED_BY(mu_) = 0;
};
bool ShouldUseAres(absl::string_view resolver_env) {
return resolver_env.empty() || absl::EqualsIgnoreCase(resolver_env, "ares");
bool ShouldUseAres(const char* resolver_env) {
return resolver_env == nullptr || strlen(resolver_env) == 0 ||
gpr_stricmp(resolver_env, "ares") == 0;
}
bool UseAresDnsResolver() {
return ShouldUseAres(ConfigVars::Get().DnsResolver());
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;
}
} // namespace

@ -0,0 +1,30 @@
//
// 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.")

@ -0,0 +1,29 @@
//
//
// 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,7 +25,6 @@
#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"
@ -34,13 +33,16 @@
#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"
@ -179,7 +181,9 @@ class NativeClientChannelDNSResolverFactory : public ResolverFactory {
} // namespace
void RegisterNativeDnsResolver(CoreConfiguration::Builder* builder) {
if (absl::EqualsIgnoreCase(ConfigVars::Get().DnsResolver(), "native")) {
static const char* const resolver =
GPR_GLOBAL_CONFIG_GET(grpc_dns_resolver).release();
if (gpr_stricmp(resolver, "native") == 0) {
gpr_log(GPR_DEBUG, "Using native dns resolver");
builder->resolver_registry()->RegisterResolverFactory(
std::make_unique<NativeClientChannelDNSResolverFactory>());

@ -1,137 +0,0 @@
// 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,
overrides.client_channel_backup_poll_interval_ms, 5000)),
enable_fork_support_(LoadConfig(FLAGS_grpc_enable_fork_support,
overrides.enable_fork_support,
GRPC_ENABLE_FORK_SUPPORT_DEFAULT)),
abort_on_leaks_(LoadConfig(FLAGS_grpc_abort_on_leaks,
overrides.abort_on_leaks, false)),
not_use_system_ssl_roots_(LoadConfig(FLAGS_grpc_not_use_system_ssl_roots,
overrides.not_use_system_ssl_roots,
false)),
experiments_(
LoadConfig(FLAGS_grpc_experiments, overrides.experiments, "")),
dns_resolver_(
LoadConfig(FLAGS_grpc_dns_resolver, overrides.dns_resolver, "")),
trace_(LoadConfig(FLAGS_grpc_trace, overrides.trace, "")),
verbosity_(LoadConfig(FLAGS_grpc_verbosity, overrides.verbosity,
GPR_DEFAULT_LOG_VERBOSITY_STRING)),
stacktrace_minloglevel_(LoadConfig(FLAGS_grpc_stacktrace_minloglevel,
overrides.stacktrace_minloglevel, "")),
poll_strategy_(
LoadConfig(FLAGS_grpc_poll_strategy, overrides.poll_strategy, "all")),
system_ssl_roots_dir_(LoadConfig(FLAGS_grpc_system_ssl_roots_dir,
overrides.system_ssl_roots_dir, "")),
default_ssl_roots_file_path_(
LoadConfig(FLAGS_grpc_default_ssl_roots_file_path,
overrides.default_ssl_roots_file_path, "")),
ssl_cipher_suites_(LoadConfig(
FLAGS_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")) {}
std::string ConfigVars::ToString() const {
return absl::StrCat(
"experiments: ", "\"", absl::CEscape(experiments_), "\"",
", client_channel_backup_poll_interval_ms: ",
client_channel_backup_poll_interval_ms_, ", dns_resolver: ", "\"",
absl::CEscape(dns_resolver_), "\"", ", trace: ", "\"",
absl::CEscape(trace_), "\"", ", verbosity: ", "\"",
absl::CEscape(verbosity_), "\"", ", stacktrace_minloglevel: ", "\"",
absl::CEscape(stacktrace_minloglevel_), "\"",
", enable_fork_support: ", enable_fork_support_ ? "true" : "false",
", poll_strategy: ", "\"", absl::CEscape(poll_strategy_), "\"",
", abort_on_leaks: ", abort_on_leaks_ ? "true" : "false",
", system_ssl_roots_dir: ", "\"", absl::CEscape(system_ssl_roots_dir_),
"\"", ", default_ssl_roots_file_path: ", "\"",
absl::CEscape(default_ssl_roots_file_path_), "\"",
", not_use_system_ssl_roots: ",
not_use_system_ssl_roots_ ? "true" : "false",
", ssl_cipher_suites: ", "\"", absl::CEscape(ssl_cipher_suites_), "\"");
}
} // namespace grpc_core

@ -1,129 +0,0 @@
// 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
absl::string_view SystemSslRootsDir() const { return system_ssl_roots_dir_; }
// Path to the default SSL roots file.
absl::string_view DefaultSslRootsFilePath() const {
return default_ssl_roots_file_path_;
}
// 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 system_ssl_roots_dir_;
std::string default_ssl_roots_file_path_;
std::string ssl_cipher_suites_;
};
} // namespace grpc_core
#endif // GRPC_SRC_CORE_LIB_CONFIG_CONFIG_VARS_H

@ -1,102 +0,0 @@
# 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.
- 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
- name: default_ssl_roots_file_path
type: string
default:
description: Path to the default SSL roots file.
- 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"

@ -1,51 +0,0 @@
// 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

@ -1,70 +0,0 @@
// 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/ascii.h"
#include "absl/strings/numbers.h"
#include "absl/strings/str_cat.h"
#include "absl/types/optional.h"
#include "src/core/lib/gprpp/env.h"
namespace grpc_core {
namespace {
std::string EnvironmentVarFromVarName(absl::string_view var_name) {
return absl::StrCat(absl::AsciiStrToUpper(var_name));
}
absl::optional<std::string> LoadEnv(absl::string_view var_name) {
return GetEnv(EnvironmentVarFromVarName(var_name).c_str());
}
} // namespace
std::string LoadConfigFromEnv(absl::string_view var_name,
const char* default_value) {
return LoadEnv(var_name).value_or(default_value);
}
int32_t LoadConfigFromEnv(absl::string_view var_name, int32_t default_value) {
auto env = LoadEnv(var_name);
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",
EnvironmentVarFromVarName(var_name).c_str(), env->c_str());
}
return default_value;
}
bool LoadConfigFromEnv(absl::string_view var_name, bool default_value) {
auto env = LoadEnv(var_name);
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",
EnvironmentVarFromVarName(var_name).c_str(), env->c_str(),
error.c_str());
}
return default_value;
}
} // namespace grpc_core

@ -1,46 +0,0 @@
// 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 var_name,
const char* default_value);
int32_t LoadConfigFromEnv(absl::string_view var_name, int32_t default_value);
bool LoadConfigFromEnv(absl::string_view var_name, bool default_value);
template <typename T, typename D>
T LoadConfig(const absl::Flag<absl::optional<T>>& flag,
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(flag.Name(), 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>
#include "src/core/lib/config/config_vars.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.");
int grpc_tracer_set_enabled(const char* name, int enabled);
@ -144,7 +144,8 @@ void grpc_tracer_init(const char* env_var_name) {
}
void grpc_tracer_init() {
parse(std::string(grpc_core::ConfigVars::Get().Trace()).c_str());
grpc_core::UniquePtr<char> value = GPR_GLOBAL_CONFIG_GET(grpc_trace);
parse(value.get());
}
int grpc_tracer_set_enabled(const char* name, int enabled) {

@ -23,6 +23,11 @@
#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,6 +40,7 @@
#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
@ -57,11 +58,14 @@
#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,12 +17,17 @@
#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 {
@ -36,9 +41,10 @@ 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(grpc_core::ConfigVars::Get().PollStrategy(), ',');
auto strings = absl::StrSplit(poll_strategy, ',');
for (auto it = strings.begin(); it != strings.end() && poller == nullptr;
it++) {
if (PollStrategyMatches(*it, "epoll1")) {

@ -29,12 +29,17 @@
#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 {
@ -61,9 +66,11 @@ 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(ConfigVars::Get().Experiments()), ',')) {
for (auto experiment :
absl::StrSplit(absl::string_view(experiments_str.get()), ',')) {
// Strip whitespace.
experiment = absl::StripAsciiWhitespace(experiment);
// Handle ",," without crashing.

@ -21,21 +21,27 @@
#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;
@ -100,35 +106,42 @@ void gpr_set_log_verbosity(gpr_log_severity min_severity_to_print) {
(gpr_atm)min_severity_to_print);
}
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;
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;
}
}
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) {
auto verbosity = grpc_core::ConfigVars::Get().Verbosity();
grpc_core::UniquePtr<char> verbosity =
GPR_GLOBAL_CONFIG_GET(grpc_verbosity);
gpr_atm min_severity_to_print = GPR_LOG_SEVERITY_ERROR;
if (!verbosity.empty()) {
if (strlen(verbosity.get()) > 0) {
min_severity_to_print =
parse_log_severity(verbosity, min_severity_to_print);
parse_log_severity(verbosity.get(), 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) {
auto stacktrace_minloglevel =
grpc_core::ConfigVars::Get().StacktraceMinloglevel();
grpc_core::UniquePtr<char> stacktrace_minloglevel =
GPR_GLOBAL_CONFIG_GET(grpc_stacktrace_minloglevel);
gpr_atm min_severity_to_print_stacktrace = GPR_LOG_SEVERITY_NONE;
if (!stacktrace_minloglevel.empty()) {
if (strlen(stacktrace_minloglevel.get()) > 0) {
min_severity_to_print_stacktrace = parse_log_severity(
stacktrace_minloglevel, min_severity_to_print_stacktrace);
stacktrace_minloglevel.get(), 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,6 +33,16 @@
// 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.
@ -166,7 +176,7 @@ class ThreadState {
void Fork::GlobalInit() {
if (!override_enabled_) {
support_enabled_.store(ConfigVars::Get().EnableForkSupport(),
support_enabled_.store(GPR_GLOBAL_CONFIG_GET(grpc_enable_fork_support),
std::memory_order_relaxed);
}
}

@ -0,0 +1,93 @@
//
//
// 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

@ -0,0 +1,29 @@
//
//
// 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

@ -0,0 +1,140 @@
//
//
// 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

@ -0,0 +1,133 @@
//
//
// 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

@ -0,0 +1,40 @@
//
//
// 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,21 +27,26 @@
#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
@ -101,14 +106,40 @@ static const grpc_event_engine_vtable* g_vtables[] = {
nullptr,
};
static bool is(absl::string_view want, absl::string_view have) {
return want == "all" || want == have;
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 void try_engine(absl::string_view engine) {
static void try_engine(const char* 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(engine == g_vtables[i]->name)) {
g_vtables[i]->check_engine_available(
0 == strcmp(engine, g_vtables[i]->name))) {
g_event_engine = g_vtables[i];
gpr_log(GPR_DEBUG, "Using polling engine: %s", g_event_engine->name);
return;
@ -142,16 +173,25 @@ const char* grpc_get_poll_strategy_name() { return g_event_engine->name; }
void grpc_event_engine_init(void) {
gpr_once_init(&g_choose_engine, []() {
auto value = grpc_core::ConfigVars::Get().PollStrategy();
for (auto trial : absl::StrSplit(value, ',')) {
try_engine(trial);
if (g_event_engine != nullptr) return;
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]);
}
gpr_free(strings);
if (g_event_engine == nullptr) {
grpc_core::Crash(
absl::StrFormat("No event engine could be initialized from %s",
std::string(value).c_str()));
grpc_core::Crash(absl::StrFormat(
"No event engine could be initialized from %s", value.get()));
}
});
g_event_engine->init_engine();

@ -24,11 +24,14 @@
#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,10 +42,15 @@
#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;
@ -60,6 +65,7 @@ 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(); }
@ -192,6 +198,4 @@ void grpc_iomgr_unregister_object(grpc_iomgr_object* obj) {
gpr_free(obj->name);
}
bool grpc_iomgr_abort_on_leaks(void) {
return grpc_core::ConfigVars::Get().AbortOnLeaks();
}
bool grpc_iomgr_abort_on_leaks(void) { return g_grpc_abort_on_leaks; }

@ -20,6 +20,7 @@
#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,17 +19,15 @@
#include <grpc/support/port_platform.h>
#include <algorithm>
#include <string>
#include <vector>
#include "absl/strings/string_view.h"
#if defined(GPR_LINUX) || defined(GPR_ANDROID) || defined(GPR_FREEBSD) || \
defined(GPR_APPLE)
#include <dirent.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <unistd.h>
@ -37,13 +35,17 @@
#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 {
@ -148,9 +150,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.
auto custom_dir = ConfigVars::Get().SystemSslRootsDir();
if (!custom_dir.empty()) {
result = CreateRootCertsBundle(std::string(custom_dir).c_str());
UniquePtr<char> custom_dir = GPR_GLOBAL_CONFIG_GET(grpc_system_ssl_roots_dir);
if (strlen(custom_dir.get()) > 0) {
result = CreateRootCertsBundle(custom_dir.get());
}
// If the custom directory is empty/invalid/not specified, fallback to
// distribution-specific directory.

@ -32,18 +32,19 @@
#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"
@ -75,9 +76,22 @@ 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) {
cipher_suites = gpr_strdup(
std::string(grpc_core::ConfigVars::Get().SslCipherSuites()).c_str());
grpc_core::UniquePtr<char> value =
GPR_GLOBAL_CONFIG_GET(grpc_ssl_cipher_suites);
cipher_suites = value.release();
}
// --- Util ---
@ -559,13 +573,14 @@ 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.
auto default_root_certs_path = ConfigVars::Get().DefaultSslRootsFilePath();
if (!default_root_certs_path.empty()) {
UniquePtr<char> default_root_certs_path =
GPR_GLOBAL_CONFIG_GET(grpc_default_ssl_roots_file_path);
if (strlen(default_root_certs_path.get()) > 0) {
GRPC_LOG_IF_ERROR(
"load_file",
grpc_load_file(std::string(default_root_certs_path).c_str(), 1,
&result));
"load_file", grpc_load_file(default_root_certs_path.get(), 1, &result));
}
// Try overridden roots if needed.
grpc_ssl_roots_override_result ovrd_res = GRPC_SSL_ROOTS_OVERRIDE_FAIL;
@ -581,8 +596,7 @@ 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) &&
!ConfigVars::Get().NotUseSystemSslRoots()) {
if (GRPC_SLICE_IS_EMPTY(result) && !not_use_system_roots) {
result = LoadSystemRootCerts();
}
// Fallback to roots manually shipped with gRPC.

@ -0,0 +1,32 @@
//
//
// 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.");

@ -0,0 +1,29 @@
//
//
// 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,7 +30,6 @@
#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"

@ -42,7 +42,7 @@
#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"

@ -727,8 +727,3 @@ 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,7 +195,3 @@ 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,6 +64,7 @@ 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',
@ -475,10 +476,7 @@ 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',
@ -554,6 +552,7 @@ 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',
@ -727,6 +726,7 @@ 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',
@ -838,15 +838,6 @@ 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,7 +62,6 @@ _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,8 +31,9 @@
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
#include "src/core/lib/gprpp/env.h"
#include "src/core/lib/gprpp/global_config_generic.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"
@ -136,7 +137,7 @@ int main(int argc, char** argv) {
strcpy(root, ".");
}
if (argc == 2) {
grpc_core::SetEnv("GRPC_DEFAULT_SSL_ROOTS_FILE_PATH", argv[1]);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, argv[1]);
}
// figure out our test name
tmp = lunder - 1;

@ -27,10 +27,13 @@
#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"
@ -98,7 +101,9 @@ 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");
if (grpc_core::ConfigVars::Get().DnsResolver() == "native") {
grpc_core::UniquePtr<char> resolver =
GPR_GLOBAL_CONFIG_GET(grpc_dns_resolver);
if (gpr_stricmp(resolver.get(), "native") == 0) {
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,7 +276,6 @@ grpc_cc_test(
"h2_ssl_cert_test.cc",
],
external_deps = [
"absl/types:optional",
"gtest",
"libcrypto",
],
@ -285,11 +284,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",
],
@ -305,18 +304,15 @@ grpc_cc_test(
"//src/core/tsi/test_creds:server1.key",
"//src/core/tsi/test_creds:server1.pem",
],
external_deps = [
"absl/types:optional",
"gtest",
],
external_deps = ["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",
@ -334,18 +330,15 @@ grpc_cc_test(
"//src/core/tsi/test_creds:server1.key",
"//src/core/tsi/test_creds:server1.pem",
],
external_deps = [
"absl/types:optional",
"gtest",
],
external_deps = ["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,8 +18,6 @@
#include <grpc/support/port_platform.h>
#include "absl/types/optional.h"
#include <grpc/grpc.h>
#include "src/core/lib/channel/channel_args.h"
@ -31,11 +29,11 @@
#include <functional>
#include <memory>
#include <string>
#include <grpc/support/log.h>
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/global_config_generic.h"
#include "test/core/end2end/end2end_tests.h"
#include "test/core/end2end/fixtures/secure_fixture.h"
#include "test/core/util/test_config.h"
@ -58,9 +56,7 @@ int main(int argc, char** argv) {
// force tracing on, with a value to force many
// code paths in trace.c to be taken
grpc_core::ConfigVars::Overrides overrides;
overrides.trace = "doesnt-exist,http,all";
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_trace, "doesnt-exist,http,all");
#ifdef GRPC_POSIX_SOCKET
g_fixture_slowdown_factor = isatty(STDOUT_FILENO) ? 10 : 1;

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

@ -20,15 +20,13 @@
#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/config/config_vars.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/end2end_tests.h"
#include "test/core/end2end/fixtures/h2_ssl_cred_reload_fixture.h"
#include "test/core/util/test_config.h"
@ -52,9 +50,8 @@ int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(&argc, argv);
grpc_end2end_tests_pre_init();
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = SslCredReloadFixture::CaCertPath();
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path,
SslCredReloadFixture::CaCertPath());
grpc_init();

@ -20,15 +20,13 @@
#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/config/config_vars.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/end2end_tests.h"
#include "test/core/end2end/fixtures/h2_ssl_cred_reload_fixture.h"
#include "test/core/util/test_config.h"
@ -52,9 +50,8 @@ int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(&argc, argv);
grpc_end2end_tests_pre_init();
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = SslCredReloadFixture::CaCertPath();
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path,
SslCredReloadFixture::CaCertPath());
grpc_init();

@ -20,9 +20,6 @@
#include <functional>
#include <memory>
#include <string>
#include "absl/types/optional.h"
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
@ -31,10 +28,11 @@
#include <grpc/support/log.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/config/config_vars.h"
#include "src/core/lib/gprpp/global_config_generic.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"
@ -171,10 +169,7 @@ int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(&argc, argv);
grpc_end2end_tests_pre_init();
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = CA_CERT_PATH;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, CA_CERT_PATH);
grpc_init();

@ -20,15 +20,13 @@
#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/config/config_vars.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/end2end_tests.h"
#include "test/core/end2end/fixtures/h2_ssl_tls_common.h"
#include "test/core/util/test_config.h"
@ -50,9 +48,8 @@ int main(int argc, char** argv) {
size_t i;
grpc::testing::TestEnvironment env(&argc, argv);
grpc_end2end_tests_pre_init();
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = SslTlsFixture::CaCertPath();
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path,
SslTlsFixture::CaCertPath());
grpc_init();

@ -20,15 +20,13 @@
#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/config/config_vars.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/end2end_tests.h"
#include "test/core/end2end/fixtures/h2_ssl_tls_common.h"
#include "test/core/util/test_config.h"
@ -50,9 +48,8 @@ int main(int argc, char** argv) {
size_t i;
grpc::testing::TestEnvironment env(&argc, argv);
grpc_end2end_tests_pre_init();
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = SslTlsFixture::CaCertPath();
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path,
SslTlsFixture::CaCertPath());
grpc_init();

@ -18,14 +18,12 @@
#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/config/config_vars.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/end2end_tests.h"
#include "test/core/end2end/fixtures/h2_tls_common.h"
#include "test/core/util/test_config.h"
@ -48,9 +46,7 @@ static CoreTestConfiguration config = {
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(&argc, argv);
grpc_end2end_tests_pre_init();
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = CA_CERT_PATH;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, CA_CERT_PATH);
grpc_init();
grpc_end2end_tests(argc, argv, config);
grpc_shutdown();

@ -18,14 +18,12 @@
#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/config/config_vars.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/end2end_tests.h"
#include "test/core/end2end/fixtures/h2_tls_common.h"
#include "test/core/util/test_config.h"
@ -48,9 +46,7 @@ static CoreTestConfiguration config = {
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(&argc, argv);
grpc_end2end_tests_pre_init();
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = CA_CERT_PATH;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, CA_CERT_PATH);
grpc_init();
grpc_end2end_tests(argc, argv, config);
grpc_shutdown();

@ -18,14 +18,12 @@
#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/config/config_vars.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/end2end_tests.h"
#include "test/core/end2end/fixtures/h2_tls_common.h"
#include "test/core/util/test_config.h"
@ -48,9 +46,7 @@ static CoreTestConfiguration config = {
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(&argc, argv);
grpc_end2end_tests_pre_init();
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = CA_CERT_PATH;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, CA_CERT_PATH);
grpc_init();
grpc_end2end_tests(argc, argv, config);
grpc_shutdown();

@ -18,14 +18,12 @@
#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/config/config_vars.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/end2end_tests.h"
#include "test/core/end2end/fixtures/h2_tls_common.h"
#include "test/core/util/test_config.h"
@ -48,9 +46,7 @@ static CoreTestConfiguration config = {
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(&argc, argv);
grpc_end2end_tests_pre_init();
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = CA_CERT_PATH;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, CA_CERT_PATH);
grpc_init();
grpc_end2end_tests(argc, argv, config);
grpc_shutdown();

@ -25,7 +25,6 @@
#include <openssl/crypto.h>
#include "absl/types/optional.h"
#include "gtest/gtest.h"
#include <grpc/grpc.h>
@ -39,8 +38,9 @@
#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,9 +276,7 @@ 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);
grpc_core::ConfigVars::Overrides config_overrides;
config_overrides.default_ssl_roots_file_path = roots_filename;
grpc_core::ConfigVars::SetOverrides(config_overrides);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, roots_filename);
grpc_init();
::testing::InitGoogleTest(&argc, argv);

@ -22,8 +22,6 @@
#include <gtest/gtest.h>
#include "absl/types/optional.h"
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpc/grpc_security_constants.h>
@ -34,12 +32,13 @@
#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"
@ -292,9 +291,7 @@ TEST(H2SessionReuseTest, SingleReuse) {
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(&argc, argv);
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = CA_CERT_PATH;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, CA_CERT_PATH);
grpc_init();
::testing::InitGoogleTest(&argc, argv);

@ -22,8 +22,6 @@
#include <gtest/gtest.h>
#include "absl/types/optional.h"
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpc/grpc_security_constants.h>
@ -34,12 +32,13 @@
#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"
@ -324,9 +323,8 @@ TEST(H2TlsPeerPropertyExternalVerifier, PeerPropertyExternalVerifierTest) {
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(&argc, argv);
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = CA_CERT_PATH;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, CA_CERT_PATH);
grpc_init();
::testing::InitGoogleTest(&argc, argv);
int ret = RUN_ALL_TESTS();

@ -21,8 +21,6 @@
#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>
@ -33,13 +31,18 @@
#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) {
@ -129,8 +132,11 @@ 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
/* It is hard to get the timing right for the polling engine poll. */
if (grpc_core::ConfigVars::Get().PollStrategy() == "poll") return;
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;
}
#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,11 +67,14 @@
#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;
@ -710,8 +713,10 @@ TEST_F(EventPollerTest, TestMultipleHandles) {
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
gpr_mu_init(&g_mu);
auto poll_strategy = grpc_core::ConfigVars::Get().PollStrategy();
auto strings = absl::StrSplit(poll_strategy, ',');
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(), ',');
if (std::find(strings.begin(), strings.end(), "none") != strings.end()) {
// Skip the test entirely if poll strategy is none.
return 0;

@ -34,7 +34,6 @@
#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"
@ -44,6 +43,8 @@
#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"
@ -52,6 +53,8 @@
#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 {
@ -332,8 +335,10 @@ INSTANTIATE_TEST_SUITE_P(PosixEndpoint, PosixEndpointTest,
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
auto poll_strategy = grpc_core::ConfigVars::Get().PollStrategy();
auto strings = absl::StrSplit(poll_strategy, ',');
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(), ',');
if (std::find(strings.begin(), strings.end(), "none") != strings.end()) {
// Skip the test entirely if poll strategy is none.
return 0;

@ -54,6 +54,37 @@ 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"],

@ -0,0 +1,127 @@
//
//
// 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;
}

@ -0,0 +1,61 @@
//
//
// 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,18 +20,15 @@
#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/config/config_vars.h"
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/security/security_connector/ssl_utils_config.h"
#include "test/core/util/port.h"
#include "test/core/util/subprocess.h"
@ -80,10 +77,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
ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path =
absl::StrCat(root, "/src/core/tsi/test_creds/ca.pem");
ConfigVars::SetOverrides(overrides);
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);
}
gpr_log(GPR_INFO, "starting HttpRequest test server subprocess:");
for (size_t i = 0; i < args.size(); i++) {

@ -24,6 +24,7 @@
#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/lib/config/config_vars.h"
#include "src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/crash.h"
@ -188,21 +188,30 @@ 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::ConfigVars::Overrides overrides;
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());
}
if (resolver_type == "native") {
overrides.dns_resolver = "native";
GPR_GLOBAL_CONFIG_SET(grpc_dns_resolver, "native");
} else if (resolver_type == "ares") {
overrides.dns_resolver = "ares";
GPR_GLOBAL_CONFIG_SET(grpc_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/lib/config/config_vars.h"
#include "src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/sync.h"
@ -548,9 +548,7 @@ int main(int argc, char** argv) {
} else {
GPR_ASSERT(0);
}
grpc_core::ConfigVars::Overrides overrides;
overrides.dns_resolver = g_resolver_type;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_dns_resolver, g_resolver_type);
::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,9 +568,7 @@ TEST_F(GrpcTlsCredentialsOptionsTest,
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(&argc, argv);
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = CA_CERT_PATH;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, CA_CERT_PATH);
::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,12 +664,9 @@ 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);
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);
// 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_set_ssl_roots_override_callback(override_roots_success);
grpc_slice roots =
grpc_core::TestDefaultSslRootStore::ComputePemRootCertsForTesting();
@ -678,21 +675,19 @@ static void test_default_ssl_roots(void) {
ASSERT_STREQ(roots_contents, roots_for_override_api);
gpr_free(roots_contents);
// 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);
// 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);
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 config. We should fall back to the value overridden using
// Now reset the env var. We should fall back to the value overridden using
// the api.
overrides.default_ssl_roots_file_path = "";
grpc_core::ConfigVars::SetOverrides(overrides);
grpc_set_ssl_roots_override_callback(override_roots_success);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, "");
roots = grpc_core::TestDefaultSslRootStore::ComputePemRootCertsForTesting();
roots_contents = grpc_slice_to_c_string(roots);
grpc_slice_unref(roots);
@ -701,8 +696,7 @@ static void test_default_ssl_roots(void) {
// Now setup a permanent failure for the overridden roots and we should get
// an empty slice.
overrides.not_use_system_ssl_roots = true;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_not_use_system_ssl_roots, true);
grpc_set_ssl_roots_override_callback(override_roots_permanent_failure);
roots = grpc_core::TestDefaultSslRootStore::ComputePemRootCertsForTesting();
ASSERT_TRUE(GRPC_SLICE_IS_EMPTY(roots));

@ -29,7 +29,6 @@
#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"
@ -37,6 +36,7 @@
#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,9 +1169,7 @@ TEST_F(TlsSecurityConnectorTest,
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(&argc, argv);
grpc_core::ConfigVars::Overrides overrides;
overrides.default_ssl_roots_file_path = CA_CERT_PATH;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, CA_CERT_PATH);
::testing::InitGoogleTest(&argc, argv);
grpc_init();
int ret = RUN_ALL_TESTS();

@ -29,8 +29,6 @@
#include <gtest/gtest.h>
#include "absl/types/optional.h"
#include <grpc/byte_buffer.h>
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
@ -40,9 +38,10 @@
#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/config/config_vars.h"
#include "src/core/lib/gprpp/global_config_generic.h"
#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/gprpp/sync.h"
#include "test/core/util/port.h"
@ -356,9 +355,7 @@ 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.
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
grpc_core::chttp2::g_test_only_transport_target_window_estimates_mocker =
new TransportTargetWindowEstimatesMocker();
grpc::testing::TestEnvironment env(&argc, argv);

@ -37,7 +37,6 @@
#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"
@ -448,7 +447,8 @@ TEST_P(AsyncEnd2endTest, ReconnectChannel) {
#ifdef GRPC_POSIX_SOCKET_EV
// It needs 2 pollset_works to reconnect the channel with polling engine
// "poll"
if (grpc_core::ConfigVars::Get().PollStrategy() == "poll") {
grpc_core::UniquePtr<char> poller = GPR_GLOBAL_CONFIG_GET(grpc_poll_strategy);
if (0 == strcmp(poller.get(), "poll")) {
poller_slowdown_factor = 2;
}
#endif // GRPC_POSIX_SOCKET_EV
@ -1971,9 +1971,7 @@ 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
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 100;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 100);
grpc::testing::TestEnvironment env(&argc, argv);
::testing::InitGoogleTest(&argc, argv);
int ret = RUN_ALL_TESTS();

@ -55,7 +55,6 @@
#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"
@ -3062,16 +3061,14 @@ 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.
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
#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,7 +42,6 @@
#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"
@ -910,7 +909,8 @@ TEST_P(End2endTest, ReconnectChannel) {
// It needs 2 pollset_works to reconnect the channel with polling engine
// "poll"
#ifdef GRPC_POSIX_SOCKET_EV
if (grpc_core::ConfigVars::Get().PollStrategy() == "poll") {
grpc_core::UniquePtr<char> poller = GPR_GLOBAL_CONFIG_GET(grpc_poll_strategy);
if (0 == strcmp(poller.get(), "poll")) {
poller_slowdown_factor = 2;
}
#endif // GRPC_POSIX_SOCKET_EV
@ -2246,10 +2246,8 @@ std::vector<TestScenario> CreateTestScenarios(bool use_proxy,
std::vector<TestScenario> scenarios;
std::vector<std::string> credentials_types;
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms =
kClientChannelBackupPollIntervalMs;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms,
kClientChannelBackupPollIntervalMs);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -46,7 +46,6 @@
#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"
@ -376,9 +375,7 @@ 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.
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -43,7 +43,6 @@
#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"
@ -159,9 +158,7 @@ class FakeResolverResponseGeneratorWrapper {
class RlsEnd2endTest : public ::testing::Test {
protected:
static void SetUpTestSuite() {
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
grpc_core::CoreConfiguration::RegisterBuilder(
grpc_core::RegisterFixedAddressLoadBalancingPolicy);
grpc_init();

@ -31,7 +31,6 @@
#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"
@ -204,8 +203,6 @@ 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.
grpc_core::ConfigVars::Overrides config_overrides;
config_overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(config_overrides);
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
return RUN_ALL_TESTS();
}

@ -50,7 +50,6 @@
#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"
@ -125,9 +124,7 @@ 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.
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
}
void SetUp() override {

@ -25,7 +25,6 @@
#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"
@ -1727,9 +1726,7 @@ 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.
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -27,7 +27,6 @@
#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"
@ -664,9 +663,7 @@ 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.
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -23,7 +23,6 @@
#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"
@ -1367,9 +1366,7 @@ 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.
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -27,7 +27,6 @@
#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"
@ -715,9 +714,7 @@ 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.
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -68,7 +68,6 @@
#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"
@ -2952,9 +2951,7 @@ 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.
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -20,7 +20,6 @@
#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"
@ -569,9 +568,7 @@ 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.
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -21,7 +21,6 @@
#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"
@ -1123,9 +1122,7 @@ 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.
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -25,7 +25,6 @@
#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"
@ -278,9 +277,7 @@ 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.
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -28,7 +28,6 @@
#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"
@ -1166,9 +1165,7 @@ 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.
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -22,7 +22,6 @@
#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"
@ -209,9 +208,7 @@ 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.
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
#if TARGET_OS_IPHONE
// Workaround Apple CFStream bug
grpc_core::SetEnv("grpc_cfstream", "0");

@ -21,7 +21,6 @@
#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"
@ -2402,9 +2401,7 @@ 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.
grpc_core::ConfigVars::Overrides overrides;
overrides.client_channel_backup_poll_interval_ms = 1;
grpc_core::ConfigVars::SetOverrides(overrides);
GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
#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