Merge branch 'master' into tjagtap_src_core_lib_s

pull/36479/head
tanvi-jagtap 7 months ago
commit ffa7e202da
  1. 15
      BUILD
  2. 121
      CMakeLists.txt
  3. 9
      Makefile
  4. 1
      Package.swift
  5. 170
      build_autogenerated.yaml
  6. 2
      build_config.rb
  7. 2
      build_handwritten.yaml
  8. 3
      gRPC-C++.podspec
  9. 3
      gRPC-Core.podspec
  10. 1
      gRPC-ProtoRPC.podspec
  11. 1
      gRPC-RxLibrary.podspec
  12. 6
      gRPC.podspec
  13. 1
      grpc.gemspec
  14. 1
      include/grpc/module.modulemap
  15. 62
      include/grpc/passive_listener.h
  16. 27
      include/grpcpp/passive_listener.h
  17. 1
      include/grpcpp/security/server_credentials.h
  18. 28
      include/grpcpp/server_builder.h
  19. 1
      package.xml
  20. 3
      src/core/BUILD
  21. 7
      src/core/ext/transport/binder/server/binder_server.cc
  22. 7
      src/core/ext/transport/chaotic_good/server/chaotic_good_server.cc
  23. 4
      src/core/ext/transport/chaotic_good/server/chaotic_good_server.h
  24. 287
      src/core/ext/transport/chttp2/server/chttp2_server.cc
  25. 33
      src/core/ext/transport/chttp2/server/chttp2_server.h
  26. 47
      src/core/ext/transport/chttp2/transport/writing.cc
  27. 7
      src/core/lib/event_engine/extensions/supports_fd.h
  28. 33
      src/core/lib/event_engine/posix_engine/posix_engine.cc
  29. 2
      src/core/lib/event_engine/posix_engine/posix_engine.h
  30. 13
      src/core/lib/gpr/log.cc
  31. 2
      src/core/lib/surface/version.cc
  32. 29
      src/core/lib/transport/metadata_batch.h
  33. 14
      src/core/server/server.h
  34. 38
      src/cpp/ext/otel/otel_client_call_tracer.cc
  35. 3
      src/cpp/ext/otel/otel_client_call_tracer.h
  36. 60
      src/cpp/server/server_builder.cc
  37. 1
      src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec
  38. 1
      src/objective-c/!ProtoCompiler-gRPCPlugin.podspec
  39. 1
      src/objective-c/!ProtoCompiler.podspec
  40. 1
      src/objective-c/BoringSSL-GRPC.podspec
  41. 1
      src/objective-c/README.md
  42. 2
      src/objective-c/tests/version.h
  43. 2
      src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi
  44. 1
      templates/gRPC-C++.podspec.template
  45. 1
      templates/gRPC-Core.podspec.template
  46. 1
      templates/gRPC-ProtoRPC.podspec.template
  47. 1
      templates/gRPC-RxLibrary.podspec.template
  48. 6
      templates/gRPC.podspec.template
  49. 1
      templates/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec.template
  50. 1
      templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template
  51. 1
      templates/src/objective-c/!ProtoCompiler.podspec.template
  52. 1
      templates/src/objective-c/BoringSSL-GRPC.podspec.template
  53. 65
      test/core/event_engine/event_engine_test_utils.h
  54. 1
      test/core/test_util/BUILD
  55. 66
      test/core/test_util/mock_authorization_endpoint.h
  56. 101
      test/cpp/ext/csm/metadata_exchange_test.cc
  57. 3
      test/cpp/ext/otel/otel_test_library.cc
  58. 6
      test/cpp/ext/otel/otel_test_library.h
  59. 1
      test/cpp/server/BUILD
  60. 55
      test/cpp/server/server_builder_test.cc
  61. 4
      tools/buildgen/extract_metadata_from_bazel_xml.py
  62. 4
      tools/distrib/check_namespace_qualification.py
  63. 9
      tools/distrib/check_redundant_namespace_qualifiers.py
  64. 2
      tools/doxygen/Doxyfile.c++
  65. 2
      tools/doxygen/Doxyfile.c++.internal
  66. 3
      tools/doxygen/Doxyfile.core
  67. 3
      tools/doxygen/Doxyfile.core.internal
  68. 2
      tools/internal_ci/helper_scripts/prepare_build_macos_rc
  69. 24
      tools/run_tests/generated/tests.json

15
BUILD

@ -127,6 +127,11 @@ config_setting(
values = {"apple_platform_type": "tvos"},
)
config_setting(
name = "visionos",
values = {"apple_platform_type": "visionos"},
)
config_setting(
name = "watchos",
values = {"apple_platform_type": "watchos"},
@ -239,7 +244,7 @@ python_config_settings()
# This should be updated along with build_handwritten.yaml
g_stands_for = "grateful" # @unused
core_version = "40.0.0" # @unused
core_version = "41.0.0" # @unused
version = "1.64.0-dev" # @unused
@ -291,6 +296,7 @@ GRPC_PUBLIC_HDRS = [
"include/grpc/grpc_posix.h",
"include/grpc/grpc_security.h",
"include/grpc/grpc_security_constants.h",
"include/grpc/passive_listener.h",
"include/grpc/slice.h",
"include/grpc/slice_buffer.h",
"include/grpc/status.h",
@ -452,6 +458,7 @@ GRPCXX_PUBLIC_HDRS = [
"include/grpcpp/impl/service_type.h",
"include/grpcpp/impl/status.h",
"include/grpcpp/impl/sync.h",
"include/grpcpp/passive_listener.h",
"include/grpcpp/resource_quota.h",
"include/grpcpp/security/audit_logging.h",
"include/grpcpp/security/tls_crl_provider.h",
@ -781,6 +788,7 @@ grpc_cc_library(
"absl/base:log_severity",
"absl/functional:any_invocable",
"absl/log",
"absl/log:globals",
"absl/memory",
"absl/random",
"absl/status",
@ -876,7 +884,7 @@ grpc_cc_library(
grpc_cc_library(
name = "grpc_public_hdrs",
hdrs = GRPC_PUBLIC_HDRS,
hdrs = GRPC_PUBLIC_HDRS + GRPC_PUBLIC_EVENT_ENGINE_HDRS,
external_deps = [
"absl/status:statusor",
"absl/strings",
@ -2488,6 +2496,7 @@ grpc_cc_library(
"//src/core:grpc_backend_metric_provider",
"//src/core:grpc_crl_provider",
"//src/core:grpc_service_config",
"//src/core:grpc_transport_chttp2_server",
"//src/core:grpc_transport_inproc",
"//src/core:json",
"//src/core:json_reader",
@ -2546,6 +2555,7 @@ grpc_cc_library(
"grpc_security_base",
"grpc_service_config_impl",
"grpc_trace",
"grpc_transport_chttp2",
"grpc_unsecure",
"grpcpp_backend_metric_recorder",
"grpcpp_call_metric_recorder",
@ -2567,6 +2577,7 @@ grpc_cc_library(
"//src/core:grpc_backend_metric_provider",
"//src/core:grpc_insecure_credentials",
"//src/core:grpc_service_config",
"//src/core:grpc_transport_chttp2_server",
"//src/core:grpc_transport_inproc",
"//src/core:ref_counted",
"//src/core:resource_quota",

121
CMakeLists.txt generated

@ -26,8 +26,8 @@ cmake_minimum_required(VERSION 3.13)
set(PACKAGE_NAME "grpc")
set(PACKAGE_VERSION "1.64.0-dev")
set(gRPC_CORE_VERSION "40.0.0")
set(gRPC_CORE_SOVERSION "40")
set(gRPC_CORE_VERSION "41.0.0")
set(gRPC_CORE_SOVERSION "41")
set(gRPC_CPP_VERSION "1.64.0-dev")
set(gRPC_CPP_SOVERSION "1.64")
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
@ -1540,7 +1540,6 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_cxx xds_audit_logger_registry_test)
add_dependencies(buildtests_cxx xds_bootstrap_test)
add_dependencies(buildtests_cxx xds_certificate_provider_test)
add_dependencies(buildtests_cxx xds_channel_stack_modifier_test)
add_dependencies(buildtests_cxx xds_client_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx xds_cluster_end2end_test)
@ -1750,6 +1749,7 @@ target_link_libraries(gpr
absl::flags_marshalling
absl::any_invocable
absl::check
absl::log_globals
absl::log
absl::memory
absl::random_random
@ -2746,6 +2746,7 @@ foreach(_hdr
include/grpc/impl/propagation_bits.h
include/grpc/impl/slice_type.h
include/grpc/load_reporting.h
include/grpc/passive_listener.h
include/grpc/slice.h
include/grpc/slice_buffer.h
include/grpc/status.h
@ -3446,6 +3447,7 @@ foreach(_hdr
include/grpc/impl/propagation_bits.h
include/grpc/impl/slice_type.h
include/grpc/load_reporting.h
include/grpc/passive_listener.h
include/grpc/slice.h
include/grpc/slice_buffer.h
include/grpc/status.h
@ -4314,6 +4316,7 @@ foreach(_hdr
include/grpcpp/impl/service_type.h
include/grpcpp/impl/status.h
include/grpcpp/impl/sync.h
include/grpcpp/passive_listener.h
include/grpcpp/resource_quota.h
include/grpcpp/security/audit_logging.h
include/grpcpp/security/auth_context.h
@ -5054,6 +5057,7 @@ foreach(_hdr
include/grpcpp/impl/service_type.h
include/grpcpp/impl/status.h
include/grpcpp/impl/sync.h
include/grpcpp/passive_listener.h
include/grpcpp/resource_quota.h
include/grpcpp/security/audit_logging.h
include/grpcpp/security/auth_context.h
@ -5504,6 +5508,7 @@ foreach(_hdr
include/grpc/impl/propagation_bits.h
include/grpc/impl/slice_type.h
include/grpc/load_reporting.h
include/grpc/passive_listener.h
include/grpc/slice.h
include/grpc/slice_buffer.h
include/grpc/status.h
@ -26832,6 +26837,7 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_load_report.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_load_report.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/orca_load_report.grpc.pb.h
test/core/event_engine/event_engine_test_utils.cc
test/core/test_util/cmdline.cc
test/core/test_util/fuzzer_util.cc
test/core/test_util/grpc_profiler.cc
@ -33191,105 +33197,6 @@ target_link_libraries(xds_certificate_provider_test
)
endif()
if(gRPC_BUILD_TESTS)
add_executable(xds_channel_stack_modifier_test
src/core/ext/filters/logging/logging_filter.cc
src/cpp/client/call_credentials.cc
src/cpp/client/channel_cc.cc
src/cpp/client/channel_credentials.cc
src/cpp/client/client_callback.cc
src/cpp/client/client_context.cc
src/cpp/client/client_interceptor.cc
src/cpp/client/client_stats_interceptor.cc
src/cpp/client/create_channel.cc
src/cpp/client/create_channel_internal.cc
src/cpp/client/create_channel_posix.cc
src/cpp/client/insecure_credentials.cc
src/cpp/client/secure_credentials.cc
src/cpp/common/alarm.cc
src/cpp/common/auth_property_iterator.cc
src/cpp/common/channel_arguments.cc
src/cpp/common/completion_queue_cc.cc
src/cpp/common/resource_quota_cc.cc
src/cpp/common/rpc_method.cc
src/cpp/common/secure_auth_context.cc
src/cpp/common/secure_create_auth_context.cc
src/cpp/common/tls_certificate_provider.cc
src/cpp/common/tls_certificate_verifier.cc
src/cpp/common/tls_credentials_options.cc
src/cpp/common/validate_service_config.cc
src/cpp/common/version_cc.cc
src/cpp/ext/filters/census/client_filter.cc
src/cpp/ext/filters/census/context.cc
src/cpp/ext/filters/census/grpc_plugin.cc
src/cpp/ext/filters/census/measures.cc
src/cpp/ext/filters/census/rpc_encoding.cc
src/cpp/ext/filters/census/server_call_tracer.cc
src/cpp/ext/filters/census/views.cc
src/cpp/server/async_generic_service.cc
src/cpp/server/backend_metric_recorder.cc
src/cpp/server/channel_argument_option.cc
src/cpp/server/create_default_thread_pool.cc
src/cpp/server/external_connection_acceptor_impl.cc
src/cpp/server/health/default_health_check_service.cc
src/cpp/server/health/health_check_service.cc
src/cpp/server/health/health_check_service_server_builder_option.cc
src/cpp/server/insecure_server_credentials.cc
src/cpp/server/secure_server_credentials.cc
src/cpp/server/server_builder.cc
src/cpp/server/server_callback.cc
src/cpp/server/server_cc.cc
src/cpp/server/server_context.cc
src/cpp/server/server_credentials.cc
src/cpp/server/server_posix.cc
src/cpp/thread_manager/thread_manager.cc
src/cpp/util/byte_buffer_cc.cc
src/cpp/util/status.cc
src/cpp/util/string_ref.cc
src/cpp/util/time_cc.cc
test/core/server/xds_channel_stack_modifier_test.cc
)
if(WIN32 AND MSVC)
if(BUILD_SHARED_LIBS)
target_compile_definitions(xds_channel_stack_modifier_test
PRIVATE
"GPR_DLL_IMPORTS"
"GRPC_DLL_IMPORTS"
)
endif()
endif()
target_compile_features(xds_channel_stack_modifier_test PUBLIC cxx_std_14)
target_include_directories(xds_channel_stack_modifier_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(xds_channel_stack_modifier_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::endian
absl::int128
${_gRPC_PROTOBUF_LIBRARIES}
grpc_test_util
)
endif()
if(gRPC_BUILD_TESTS)
@ -37019,7 +36926,7 @@ generate_pkgconfig(
"gpr"
"gRPC platform support library"
"${gRPC_CORE_VERSION}"
"absl_any_invocable absl_base absl_check absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_log absl_log_severity absl_memory absl_optional absl_random_random absl_status absl_str_format absl_strings absl_synchronization absl_time absl_variant"
"absl_any_invocable absl_base absl_check absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_log absl_log_globals absl_log_severity absl_memory absl_optional absl_random_random absl_status absl_str_format absl_strings absl_synchronization absl_time absl_variant"
""
"-lgpr"
""
@ -37030,7 +36937,7 @@ generate_pkgconfig(
"gRPC"
"high performance general RPC framework"
"${gRPC_CORE_VERSION}"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_check absl_cleanup absl_config 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_log absl_log_severity absl_memory absl_no_destructor absl_optional absl_random_bit_gen_ref absl_random_distributions 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_algorithm_container absl_any_invocable absl_base absl_bind_front absl_check absl_cleanup absl_config 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_log absl_log_globals absl_log_severity absl_memory absl_no_destructor absl_optional absl_random_bit_gen_ref absl_random_distributions 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"
"libcares openssl re2 zlib"
"-lgrpc"
"-laddress_sorting -lupb_textformat_lib -lupb_json_lib -lupb_message_lib -lupb_mem_lib -lupb_base_lib -lutf8_range_lib"
@ -37041,7 +36948,7 @@ generate_pkgconfig(
"gRPC unsecure"
"high performance general RPC framework without SSL"
"${gRPC_CORE_VERSION}"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_check absl_cleanup absl_config 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_log absl_log_severity absl_memory absl_no_destructor absl_optional absl_random_bit_gen_ref absl_random_distributions 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_algorithm_container absl_any_invocable absl_base absl_bind_front absl_check absl_cleanup absl_config 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_log absl_log_globals absl_log_severity absl_memory absl_no_destructor absl_optional absl_random_bit_gen_ref absl_random_distributions 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"
"libcares zlib"
"-lgrpc_unsecure"
"-laddress_sorting -lupb_message_lib -lupb_mem_lib -lupb_base_lib -lutf8_range_lib"
@ -37052,7 +36959,7 @@ generate_pkgconfig(
"gRPC++"
"C++ wrapper for gRPC"
"${gRPC_CPP_VERSION}"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_check absl_cleanup absl_config 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_log absl_log_severity absl_memory absl_no_destructor absl_optional absl_random_bit_gen_ref absl_random_distributions 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 grpc"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_check absl_cleanup absl_config 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_log absl_log_globals absl_log_severity absl_memory absl_no_destructor absl_optional absl_random_bit_gen_ref absl_random_distributions 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 grpc"
"libcares openssl re2 zlib"
"-lgrpc++"
"-laddress_sorting -lupb_textformat_lib -lupb_json_lib -lupb_message_lib -lupb_mem_lib -lupb_base_lib -lutf8_range_lib"
@ -37063,7 +36970,7 @@ generate_pkgconfig(
"gRPC++ unsecure"
"C++ wrapper for gRPC without SSL"
"${gRPC_CPP_VERSION}"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_check absl_cleanup absl_config 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_log absl_log_severity absl_memory absl_no_destructor absl_optional absl_random_bit_gen_ref absl_random_distributions 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 grpc_unsecure"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_check absl_cleanup absl_config 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_log absl_log_globals absl_log_severity absl_memory absl_no_destructor absl_optional absl_random_bit_gen_ref absl_random_distributions 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 grpc_unsecure"
"libcares zlib"
"-lgrpc++_unsecure"
"-laddress_sorting -lupb_message_lib -lupb_mem_lib -lupb_base_lib -lutf8_range_lib"

9
Makefile generated

@ -367,7 +367,7 @@ E = @echo
Q = @
endif
CORE_VERSION = 40.0.0
CORE_VERSION = 41.0.0
CPP_VERSION = 1.64.0-dev
CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES))
@ -404,7 +404,7 @@ SHARED_EXT_CORE = dll
SHARED_EXT_CPP = dll
SHARED_PREFIX =
SHARED_VERSION_CORE = -40
SHARED_VERSION_CORE = -41
SHARED_VERSION_CPP = -1
else ifeq ($(SYSTEM),Darwin)
EXECUTABLE_SUFFIX =
@ -1775,6 +1775,7 @@ PUBLIC_HEADERS_C += \
include/grpc/impl/propagation_bits.h \
include/grpc/impl/slice_type.h \
include/grpc/load_reporting.h \
include/grpc/passive_listener.h \
include/grpc/slice.h \
include/grpc/slice_buffer.h \
include/grpc/status.h \
@ -1835,8 +1836,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBGRPC_
ifeq ($(SYSTEM),Darwin)
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libcares.a $(OPENSSL_MERGE_LIBS) $(ZLIB_MERGE_LIBS) $(LDLIBS_SECURE) $(LDLIBS)
else
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.40 -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libcares.a $(OPENSSL_MERGE_LIBS) $(ZLIB_MERGE_LIBS) $(LDLIBS_SECURE) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so.40
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.41 -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libcares.a $(OPENSSL_MERGE_LIBS) $(ZLIB_MERGE_LIBS) $(LDLIBS_SECURE) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so.41
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so
endif
endif

1
Package.swift generated

@ -93,6 +93,7 @@ let package = Package(
"include/grpc/impl/propagation_bits.h",
"include/grpc/impl/slice_type.h",
"include/grpc/load_reporting.h",
"include/grpc/passive_listener.h",
"include/grpc/slice.h",
"include/grpc/slice_buffer.h",
"include/grpc/status.h",

@ -130,6 +130,7 @@ libs:
- absl/flags:marshalling
- absl/functional:any_invocable
- absl/log:check
- absl/log:globals
- absl/log:log
- absl/memory:memory
- absl/random:random
@ -197,6 +198,7 @@ libs:
- include/grpc/impl/propagation_bits.h
- include/grpc/impl/slice_type.h
- include/grpc/load_reporting.h
- include/grpc/passive_listener.h
- include/grpc/slice.h
- include/grpc/slice_buffer.h
- include/grpc/status.h
@ -2181,6 +2183,7 @@ libs:
- include/grpc/impl/propagation_bits.h
- include/grpc/impl/slice_type.h
- include/grpc/load_reporting.h
- include/grpc/passive_listener.h
- include/grpc/slice.h
- include/grpc/slice_buffer.h
- include/grpc/status.h
@ -3590,7 +3593,6 @@ libs:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -3786,6 +3788,7 @@ libs:
- include/grpcpp/impl/service_type.h
- include/grpcpp/impl/status.h
- include/grpcpp/impl/sync.h
- include/grpcpp/passive_listener.h
- include/grpcpp/resource_quota.h
- include/grpcpp/security/audit_logging.h
- include/grpcpp/security/auth_context.h
@ -4013,7 +4016,6 @@ libs:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -4214,6 +4216,7 @@ libs:
- include/grpcpp/impl/service_type.h
- include/grpcpp/impl/status.h
- include/grpcpp/impl/sync.h
- include/grpcpp/passive_listener.h
- include/grpcpp/resource_quota.h
- include/grpcpp/security/audit_logging.h
- include/grpcpp/security/auth_context.h
@ -4362,6 +4365,7 @@ libs:
- include/grpc/impl/propagation_bits.h
- include/grpc/impl/slice_type.h
- include/grpc/load_reporting.h
- include/grpc/passive_listener.h
- include/grpc/slice.h
- include/grpc/slice_buffer.h
- include/grpc/status.h
@ -5116,7 +5120,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -5187,7 +5190,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -5276,7 +5278,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -5340,7 +5341,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -5531,7 +5531,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -5647,7 +5646,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -5689,7 +5687,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -5750,7 +5747,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -5886,7 +5882,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -5925,7 +5920,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -6249,7 +6243,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -7274,7 +7267,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -7492,7 +7484,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -7599,7 +7590,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -7629,7 +7619,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -8041,7 +8030,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -8097,7 +8085,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -8264,7 +8251,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -8959,7 +8945,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -9016,7 +9001,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -9048,7 +9032,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -9078,7 +9061,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -9442,7 +9424,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -10073,7 +10054,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -10303,7 +10283,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -10344,7 +10323,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -10375,7 +10353,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -10551,7 +10528,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -10621,7 +10597,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -10651,7 +10626,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -10681,7 +10655,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -10711,7 +10684,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -10741,7 +10713,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -11052,7 +11023,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -11094,7 +11064,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -11125,7 +11094,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -11156,7 +11124,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -11494,7 +11461,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -12484,7 +12450,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -12515,7 +12480,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -12989,7 +12953,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -13325,7 +13288,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -13366,7 +13328,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -13966,7 +13927,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -14197,7 +14157,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -14240,7 +14199,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -14334,7 +14292,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -14991,7 +14948,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -15245,7 +15201,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -15282,7 +15237,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -15314,7 +15268,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -15351,7 +15304,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -17731,7 +17683,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -17762,7 +17713,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -17837,12 +17787,12 @@ targets:
build: test
language: c++
headers:
- test/core/event_engine/event_engine_test_utils.h
- test/core/test_util/cmdline.h
- test/core/test_util/evaluate_args_test_util.h
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -17853,6 +17803,7 @@ targets:
- src/proto/grpc/testing/echo_messages.proto
- src/proto/grpc/testing/simple_messages.proto
- src/proto/grpc/testing/xds/v3/orca_load_report.proto
- test/core/event_engine/event_engine_test_utils.cc
- test/core/test_util/cmdline.cc
- test/core/test_util/fuzzer_util.cc
- test/core/test_util/grpc_profiler.cc
@ -17881,7 +17832,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -18071,7 +18021,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -18226,7 +18175,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -18677,7 +18625,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -18817,7 +18764,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -18977,7 +18923,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -19060,7 +19005,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -19105,7 +19049,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -19155,7 +19098,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -19189,7 +19131,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -19412,7 +19353,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -19443,7 +19383,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -19473,7 +19412,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -19861,7 +19799,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -19958,7 +19895,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -20855,7 +20791,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h
@ -20949,94 +20884,6 @@ targets:
- gtest
- grpc_test_util
uses_polling: false
- name: xds_channel_stack_modifier_test
gtest: true
build: test
language: c++
headers:
- src/core/ext/filters/logging/logging_filter.h
- src/core/ext/filters/logging/logging_sink.h
- src/cpp/client/client_stats_interceptor.h
- src/cpp/client/create_channel_internal.h
- src/cpp/client/secure_credentials.h
- src/cpp/common/secure_auth_context.h
- src/cpp/ext/filters/census/client_filter.h
- src/cpp/ext/filters/census/context.h
- src/cpp/ext/filters/census/grpc_plugin.h
- src/cpp/ext/filters/census/measures.h
- src/cpp/ext/filters/census/open_census_call_tracer.h
- src/cpp/ext/filters/census/rpc_encoding.h
- src/cpp/ext/filters/census/server_call_tracer.h
- src/cpp/server/backend_metric_recorder.h
- src/cpp/server/dynamic_thread_pool.h
- src/cpp/server/external_connection_acceptor_impl.h
- src/cpp/server/health/default_health_check_service.h
- src/cpp/server/secure_server_credentials.h
- src/cpp/server/thread_pool_interface.h
- src/cpp/thread_manager/thread_manager.h
src:
- src/core/ext/filters/logging/logging_filter.cc
- src/cpp/client/call_credentials.cc
- src/cpp/client/channel_cc.cc
- src/cpp/client/channel_credentials.cc
- src/cpp/client/client_callback.cc
- src/cpp/client/client_context.cc
- src/cpp/client/client_interceptor.cc
- src/cpp/client/client_stats_interceptor.cc
- src/cpp/client/create_channel.cc
- src/cpp/client/create_channel_internal.cc
- src/cpp/client/create_channel_posix.cc
- src/cpp/client/insecure_credentials.cc
- src/cpp/client/secure_credentials.cc
- src/cpp/common/alarm.cc
- src/cpp/common/auth_property_iterator.cc
- src/cpp/common/channel_arguments.cc
- src/cpp/common/completion_queue_cc.cc
- src/cpp/common/resource_quota_cc.cc
- src/cpp/common/rpc_method.cc
- src/cpp/common/secure_auth_context.cc
- src/cpp/common/secure_create_auth_context.cc
- src/cpp/common/tls_certificate_provider.cc
- src/cpp/common/tls_certificate_verifier.cc
- src/cpp/common/tls_credentials_options.cc
- src/cpp/common/validate_service_config.cc
- src/cpp/common/version_cc.cc
- src/cpp/ext/filters/census/client_filter.cc
- src/cpp/ext/filters/census/context.cc
- src/cpp/ext/filters/census/grpc_plugin.cc
- src/cpp/ext/filters/census/measures.cc
- src/cpp/ext/filters/census/rpc_encoding.cc
- src/cpp/ext/filters/census/server_call_tracer.cc
- src/cpp/ext/filters/census/views.cc
- src/cpp/server/async_generic_service.cc
- src/cpp/server/backend_metric_recorder.cc
- src/cpp/server/channel_argument_option.cc
- src/cpp/server/create_default_thread_pool.cc
- src/cpp/server/external_connection_acceptor_impl.cc
- src/cpp/server/health/default_health_check_service.cc
- src/cpp/server/health/health_check_service.cc
- src/cpp/server/health/health_check_service_server_builder_option.cc
- src/cpp/server/insecure_server_credentials.cc
- src/cpp/server/secure_server_credentials.cc
- src/cpp/server/server_builder.cc
- src/cpp/server/server_callback.cc
- src/cpp/server/server_cc.cc
- src/cpp/server/server_context.cc
- src/cpp/server/server_credentials.cc
- src/cpp/server/server_posix.cc
- src/cpp/thread_manager/thread_manager.cc
- src/cpp/util/byte_buffer_cc.cc
- src/cpp/util/status.cc
- src/cpp/util/string_ref.cc
- src/cpp/util/time_cc.cc
- test/core/server/xds_channel_stack_modifier_test.cc
deps:
- gtest
- absl/base:endian
- absl/numeric:int128
- protobuf
- grpc_test_util
uses_polling: false
- name: xds_client_test
gtest: true
build: test
@ -21330,7 +21177,6 @@ targets:
- test/core/test_util/fuzzer_util.h
- test/core/test_util/grpc_profiler.h
- test/core/test_util/histogram.h
- test/core/test_util/mock_authorization_endpoint.h
- test/core/test_util/mock_endpoint.h
- test/core/test_util/parse_hexstring.h
- test/core/test_util/resolve_localhost_ip46.h

@ -13,5 +13,5 @@
# limitations under the License.
module GrpcBuildConfig
CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-40.dll'
CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-41.dll'
end

@ -12,7 +12,7 @@ settings:
'#08': Use "-preN" suffixes to identify pre-release versions
'#09': Per-language overrides are possible with (eg) ruby_version tag here
'#10': See the expand_version.py for all the quirks here
core_version: 40.0.0
core_version: 41.0.0
csharp_major_version: 2
g_stands_for: grateful
protobuf_version: 3.26.1

3
gRPC-C++.podspec generated

@ -38,6 +38,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
s.requires_arc = false
@ -175,6 +176,7 @@ Pod::Spec.new do |s|
'include/grpcpp/impl/service_type.h',
'include/grpcpp/impl/status.h',
'include/grpcpp/impl/sync.h',
'include/grpcpp/passive_listener.h',
'include/grpcpp/resource_quota.h',
'include/grpcpp/security/audit_logging.h',
'include/grpcpp/security/auth_context.h',
@ -243,6 +245,7 @@ Pod::Spec.new do |s|
ss.dependency 'abseil/functional/function_ref', abseil_version
ss.dependency 'abseil/hash/hash', abseil_version
ss.dependency 'abseil/log/check', abseil_version
ss.dependency 'abseil/log/globals', abseil_version
ss.dependency 'abseil/log/log', abseil_version
ss.dependency 'abseil/memory/memory', abseil_version
ss.dependency 'abseil/meta/type_traits', abseil_version

3
gRPC-Core.podspec generated

@ -42,6 +42,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
s.requires_arc = false
@ -167,6 +168,7 @@ Pod::Spec.new do |s|
'include/grpc/impl/propagation_bits.h',
'include/grpc/impl/slice_type.h',
'include/grpc/load_reporting.h',
'include/grpc/passive_listener.h',
'include/grpc/slice.h',
'include/grpc/slice_buffer.h',
'include/grpc/status.h',
@ -215,6 +217,7 @@ Pod::Spec.new do |s|
ss.dependency 'abseil/functional/function_ref', abseil_version
ss.dependency 'abseil/hash/hash', abseil_version
ss.dependency 'abseil/log/check', abseil_version
ss.dependency 'abseil/log/globals', abseil_version
ss.dependency 'abseil/log/log', abseil_version
ss.dependency 'abseil/memory/memory', abseil_version
ss.dependency 'abseil/meta/type_traits', abseil_version

@ -37,6 +37,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
name = 'ProtoRPC'
s.module_name = name

@ -37,6 +37,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
name = 'RxLibrary'
s.module_name = name

6
gRPC.podspec generated

@ -49,6 +49,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
# Exposes the privacy manifest. Depended on by any subspecs containing
# non-interface files.
@ -83,6 +84,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
end
s.subspec 'Interface' do |ss|
@ -118,6 +120,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
end
s.subspec 'GRPCCore' do |ss|
@ -155,6 +158,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
end
s.subspec 'GRPCCoreCronet' do |ss|
@ -179,6 +183,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
end
s.subspec 'InternalTesting' do |ss|
@ -191,5 +196,6 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
end
end

1
grpc.gemspec generated

@ -99,6 +99,7 @@ Gem::Specification.new do |s|
s.files += %w( include/grpc/impl/propagation_bits.h )
s.files += %w( include/grpc/impl/slice_type.h )
s.files += %w( include/grpc/load_reporting.h )
s.files += %w( include/grpc/passive_listener.h )
s.files += %w( include/grpc/slice.h )
s.files += %w( include/grpc/slice_buffer.h )
s.files += %w( include/grpc/status.h )

@ -38,6 +38,7 @@ header "byte_buffer.h"
header "impl/propagation_bits.h"
header "impl/slice_type.h"
header "load_reporting.h"
header "passive_listener.h"
header "slice.h"
header "slice_buffer.h"
header "status.h"

@ -0,0 +1,62 @@
// Copyright 2024 The 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_PASSIVE_LISTENER_H
#define GRPC_PASSIVE_LISTENER_H
#include <memory>
#include <grpc/event_engine/event_engine.h>
#include <grpc/grpc.h>
// #include <grpc/support/port_platform.h>
namespace grpc_core {
class Server;
namespace experimental {
class PassiveListenerImpl;
/// -- EXPERIMENTAL API --
/// Interface for used for Server Endpoint injection.
class PassiveListener {
public:
virtual ~PassiveListener() = default;
/// -- EXPERIMENTAL API --
///
/// Takes an Endpoint for an established connection, and treats it as if the
/// connection had been accepted by the server.
///
/// The server must be started before endpoints can be accepted.
virtual absl::Status AcceptConnectedEndpoint(
std::unique_ptr<grpc_event_engine::experimental::EventEngine::Endpoint>
endpoint) = 0;
/// -- EXPERIMENTAL API --
///
/// Takes a connected file descriptor, and treats it as if the server had
/// accepted the connection itself.
///
/// Returns a failure status if the server's active EventEngine does not
/// support Endpoint creation from fds.
virtual absl::Status AcceptConnectedFd(int fd) = 0;
};
} // namespace experimental
} // namespace grpc_core
absl::Status grpc_server_add_passive_listener(
grpc_core::Server* server, grpc_server_credentials* credentials,
std::shared_ptr<grpc_core::experimental::PassiveListenerImpl>
passive_listener);
#endif /* GRPC_PASSIVE_LISTENER_H */

@ -0,0 +1,27 @@
// Copyright 2024 The 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 GRPCPP_PASSIVE_LISTENER_H
#define GRPCPP_PASSIVE_LISTENER_H
#include <grpc/passive_listener.h>
namespace grpc {
namespace experimental {
using grpc_core::experimental::PassiveListener;
} // namespace experimental
} // namespace grpc
#endif // GRPCPP_PASSIVE_LISTENER_H

@ -84,6 +84,7 @@ class ServerCredentials : private grpc::internal::GrpcLibrary {
// Needed for access to AddPortToServer.
friend class Server;
// Needed for access to c_creds_.
friend class ServerBuilder;
friend std::shared_ptr<ServerCredentials> grpc::XdsServerCredentials(
const std::shared_ptr<ServerCredentials>& fallback_credentials);

@ -25,13 +25,17 @@
#include <vector>
#include <grpc/compression.h>
#include <grpc/event_engine/event_engine.h>
#include <grpc/passive_listener.h>
#include <grpc/support/cpu.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/workaround_list.h>
#include <grpcpp/impl/channel_argument_option.h>
#include <grpcpp/impl/server_builder_option.h>
#include <grpcpp/impl/server_builder_plugin.h>
#include <grpcpp/passive_listener.h>
#include <grpcpp/security/authorization_policy_provider.h>
#include <grpcpp/security/server_credentials.h>
#include <grpcpp/server.h>
#include <grpcpp/support/config.h>
#include <grpcpp/support/server_interceptor.h>
@ -291,6 +295,18 @@ class ServerBuilder {
void EnableCallMetricRecording(
experimental::ServerMetricRecorder* server_metric_recorder = nullptr);
// Creates a passive listener for Server Endpoint injection.
///
/// \a PasiveListener lets applications provide pre-established connections
/// to gRPC Servers. The server will behave as if it accepted the connection
/// itself on its own listening addresses.
///
/// This can be called multiple times to create passive listeners with
/// different server credentials.
ServerBuilder& AddPassiveListener(
std::shared_ptr<grpc::ServerCredentials> creds,
std::unique_ptr<grpc::experimental::PassiveListener>& passive_listener);
private:
ServerBuilder* builder_;
};
@ -364,6 +380,17 @@ class ServerBuilder {
private:
friend class grpc::testing::ServerBuilderPluginTest;
struct UnstartedPassiveListener {
std::weak_ptr<grpc_core::experimental::PassiveListenerImpl>
passive_listener;
std::shared_ptr<grpc::ServerCredentials> credentials;
UnstartedPassiveListener(
std::weak_ptr<grpc_core::experimental::PassiveListenerImpl> listener,
std::shared_ptr<grpc::ServerCredentials> creds)
: passive_listener(std::move(listener)),
credentials(std::move(creds)) {}
};
struct SyncServerSettings {
SyncServerSettings()
: num_cqs(1), min_pollers(1), max_pollers(2), cq_timeout_msec(10000) {}
@ -388,6 +415,7 @@ class ServerBuilder {
std::vector<std::unique_ptr<grpc::ServerBuilderOption>> options_;
std::vector<std::unique_ptr<NamedService>> services_;
std::vector<Port> ports_;
std::vector<UnstartedPassiveListener> unstarted_passive_listeners_;
SyncServerSettings sync_server_settings_;

1
package.xml generated

@ -81,6 +81,7 @@
<file baseinstalldir="/" name="include/grpc/impl/propagation_bits.h" role="src" />
<file baseinstalldir="/" name="include/grpc/impl/slice_type.h" role="src" />
<file baseinstalldir="/" name="include/grpc/load_reporting.h" role="src" />
<file baseinstalldir="/" name="include/grpc/passive_listener.h" role="src" />
<file baseinstalldir="/" name="include/grpc/slice.h" role="src" />
<file baseinstalldir="/" name="include/grpc/slice_buffer.h" role="src" />
<file baseinstalldir="/" name="include/grpc/status.h" role="src" />

@ -2667,6 +2667,7 @@ grpc_cc_library(
],
"//:ios": ["cf_event_engine"],
"//:tvos": ["cf_event_engine"],
"//:visionos": ["cf_event_engine"],
"//:watchos": ["cf_event_engine"],
"//conditions:default": ["posix_event_engine"],
},
@ -6841,6 +6842,8 @@ grpc_cc_library(
"connection_quota",
"error",
"error_utils",
"event_engine_extensions",
"event_engine_query_extensions",
"grpc_insecure_credentials",
"handshaker_registry",
"iomgr_fwd",

@ -159,7 +159,7 @@ class BinderServerListener : public Server::ListenerInterface {
on_destroy_done_ = on_destroy_done;
}
void Orphan() override { delete this; }
void Orphan() override { Unref(); }
~BinderServerListener() override {
ExecCtx::Get()->Flush();
@ -239,9 +239,8 @@ bool AddBinderPort(const std::string& addr, grpc_server* server,
}
std::string conn_id = addr.substr(kBinderUriScheme.size());
Server* core_server = Server::FromC(server);
core_server->AddListener(
OrphanablePtr<Server::ListenerInterface>(new BinderServerListener(
core_server, conn_id, std::move(factory), security_policy)));
core_server->AddListener(MakeOrphanable<BinderServerListener>(
core_server, conn_id, std::move(factory), security_policy));
return true;
}

@ -102,8 +102,8 @@ absl::StatusOr<int> ChaoticGoodServerListener::Bind(
str.ok() ? str->c_str() : str.status().ToString().c_str());
}
EventEngine::Listener::AcceptCallback accept_cb =
[self = Ref()](std::unique_ptr<EventEngine::Endpoint> ep,
MemoryAllocator) {
[self = RefAsSubclass<ChaoticGoodServerListener>()](
std::unique_ptr<EventEngine::Endpoint> ep, MemoryAllocator) {
ExecCtx exec_ctx;
MutexLock lock(&self->mu_);
if (self->shutdown_) return;
@ -148,7 +148,8 @@ absl::Status ChaoticGoodServerListener::StartListening() {
ChaoticGoodServerListener::ActiveConnection::ActiveConnection(
RefCountedPtr<ChaoticGoodServerListener> listener,
std::unique_ptr<EventEngine::Endpoint> endpoint)
: memory_allocator_(listener->memory_allocator_), listener_(listener) {
: memory_allocator_(listener->memory_allocator_),
listener_(std::move(listener)) {
handshaking_state_ = MakeRefCounted<HandshakingState>(Ref());
handshaking_state_->Start(std::move(endpoint));
}

@ -49,9 +49,7 @@
namespace grpc_core {
namespace chaotic_good {
class ChaoticGoodServerListener final
: public Server::ListenerInterface,
public RefCounted<ChaoticGoodServerListener> {
class ChaoticGoodServerListener final : public Server::ListenerInterface {
public:
static absl::AnyInvocable<std::string()> DefaultConnectionIDGenerator() {
return [bitgen = absl::BitGen()]() mutable {

@ -41,6 +41,7 @@
#include <grpc/grpc.h>
#include <grpc/grpc_posix.h>
#include <grpc/impl/channel_arg_names.h>
#include <grpc/passive_listener.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@ -57,6 +58,8 @@
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/event_engine/channel_args_endpoint_config.h"
#include "src/core/lib/event_engine/extensions/supports_fd.h"
#include "src/core/lib/event_engine/query_extensions.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
@ -66,6 +69,7 @@
#include "src/core/lib/gprpp/unique_type_name.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/event_engine_shims/endpoint.h"
#include "src/core/lib/iomgr/iomgr_fwd.h"
#include "src/core/lib/iomgr/pollset_set.h"
#include "src/core/lib/iomgr/resolve_address.h"
@ -92,9 +96,11 @@
#endif // GPR_SUPPORT_CHANNELS_FROM_FD
namespace grpc_core {
namespace {
using ::grpc_event_engine::experimental::EventEngine;
using grpc_event_engine::experimental::ChannelArgsEndpointConfig;
using grpc_event_engine::experimental::EventEngine;
using grpc_event_engine::experimental::EventEngineSupportsFdExtension;
using grpc_event_engine::experimental::QueryExtension;
const char kUnixUriPrefix[] = "unix:";
const char kUnixAbstractUriPrefix[] = "unix-abstract:";
@ -111,14 +117,23 @@ class Chttp2ServerListener : public Server::ListenerInterface {
Server* server, const char* name, const ChannelArgs& args,
Chttp2ServerArgsModifier args_modifier);
static Chttp2ServerListener* CreateForPassiveListener(
Server* server, const ChannelArgs& args,
std::shared_ptr<experimental::PassiveListenerImpl> passive_listener);
// Do not instantiate directly. Use one of the factory methods above.
Chttp2ServerListener(Server* server, const ChannelArgs& args,
Chttp2ServerArgsModifier args_modifier);
Chttp2ServerArgsModifier args_modifier,
grpc_server_config_fetcher* config_fetcher,
std::shared_ptr<experimental::PassiveListenerImpl>
passive_listener = nullptr);
~Chttp2ServerListener() override;
void Start(Server* server,
const std::vector<grpc_pollset*>* pollsets) override;
void AcceptConnectedEndpoint(std::unique_ptr<EventEngine::Endpoint> endpoint);
channelz::ListenSocketNode* channelz_listen_socket_node() const override {
return channelz_listen_socket_.get();
}
@ -128,6 +143,8 @@ class Chttp2ServerListener : public Server::ListenerInterface {
void Orphan() override;
private:
friend class experimental::PassiveListenerImpl;
class ConfigFetcherWatcher
: public grpc_server_config_fetcher::WatcherInterface {
public:
@ -234,34 +251,8 @@ class Chttp2ServerListener : public Server::ListenerInterface {
static void DestroyListener(Server* /*server*/, void* arg,
grpc_closure* destroy_done);
// The interface required by RefCountedPtr<> has been manually implemented
// here to take a ref on tcp_server_ instead. Note that, the handshaker
// needs tcp_server_ to exist for the lifetime of the handshake since it's
// needed by acceptor. Sharing refs between the listener and tcp_server_ is
// just an optimization to avoid taking additional refs on the listener,
// since TcpServerShutdownComplete already holds a ref to the listener.
void IncrementRefCount() { grpc_tcp_server_ref(tcp_server_); }
void IncrementRefCount(const DebugLocation& /* location */,
const char* /* reason */) {
IncrementRefCount();
}
GRPC_MUST_USE_RESULT RefCountedPtr<Chttp2ServerListener> Ref() {
IncrementRefCount();
return RefCountedPtr<Chttp2ServerListener>(this);
}
GRPC_MUST_USE_RESULT RefCountedPtr<Chttp2ServerListener> Ref(
const DebugLocation& /* location */, const char* /* reason */) {
return Ref();
}
void Unref() { grpc_tcp_server_unref(tcp_server_); }
void Unref(const DebugLocation& /* location */, const char* /* reason */) {
Unref();
}
Server* const server_;
grpc_tcp_server* tcp_server_;
Server* const server_ = nullptr;
grpc_tcp_server* tcp_server_ = nullptr;
grpc_resolved_address resolved_address_;
Chttp2ServerArgsModifier const args_modifier_;
ConfigFetcherWatcher* config_fetcher_watcher_ = nullptr;
@ -284,6 +275,10 @@ class Chttp2ServerListener : public Server::ListenerInterface {
RefCountedPtr<channelz::ListenSocketNode> channelz_listen_socket_;
MemoryQuotaRefPtr memory_quota_;
ConnectionQuotaRefPtr connection_quota_;
grpc_server_config_fetcher* config_fetcher_ = nullptr;
// TODO(yashykt): consider using absl::variant<> to minimize memory usage for
// disjoint cases where different fields are used.
std::shared_ptr<experimental::PassiveListenerImpl> passive_listener_;
};
//
@ -380,13 +375,17 @@ Chttp2ServerListener::ActiveConnection::HandshakingState::HandshakingState(
handshake_mgr_(MakeRefCounted<HandshakeManager>()),
deadline_(GetConnectionDeadline(args)),
interested_parties_(grpc_pollset_set_create()) {
grpc_pollset_set_add_pollset(interested_parties_, accepting_pollset_);
if (accepting_pollset != nullptr) {
grpc_pollset_set_add_pollset(interested_parties_, accepting_pollset_);
}
CoreConfiguration::Get().handshaker_registry().AddHandshakers(
HANDSHAKER_SERVER, args, interested_parties_, handshake_mgr_.get());
}
Chttp2ServerListener::ActiveConnection::HandshakingState::~HandshakingState() {
grpc_pollset_set_del_pollset(interested_parties_, accepting_pollset_);
if (accepting_pollset_ != nullptr) {
grpc_pollset_set_del_pollset(interested_parties_, accepting_pollset_);
}
grpc_pollset_set_destroy(interested_parties_);
gpr_free(acceptor_);
}
@ -708,83 +707,82 @@ void Chttp2ServerListener::ActiveConnection::OnDrainGraceTimeExpiry() {
grpc_error_handle Chttp2ServerListener::Create(
Server* server, grpc_resolved_address* addr, const ChannelArgs& args,
Chttp2ServerArgsModifier args_modifier, int* port_num) {
Chttp2ServerListener* listener = nullptr;
// The bulk of this method is inside of a lambda to make cleanup
// easier without using goto.
grpc_error_handle error = [&]() {
grpc_error_handle error;
// Create Chttp2ServerListener.
listener = new Chttp2ServerListener(server, args, args_modifier);
error = grpc_tcp_server_create(
&listener->tcp_server_shutdown_complete_,
grpc_event_engine::experimental::ChannelArgsEndpointConfig(args),
OnAccept, listener, &listener->tcp_server_);
// Create Chttp2ServerListener.
OrphanablePtr<Chttp2ServerListener> listener =
MakeOrphanable<Chttp2ServerListener>(server, args, args_modifier,
server->config_fetcher());
// The tcp_server will be unreffed when the listener is orphaned, which could
// be at the end of this function if the listener was not added to the
// server's set of listeners.
grpc_error_handle error = grpc_tcp_server_create(
&listener->tcp_server_shutdown_complete_, ChannelArgsEndpointConfig(args),
OnAccept, listener.get(), &listener->tcp_server_);
if (!error.ok()) return error;
if (listener->config_fetcher_ != nullptr) {
listener->resolved_address_ = *addr;
// TODO(yashykt): Consider binding so as to be able to return the port
// number.
} else {
error = grpc_tcp_server_add_port(listener->tcp_server_, addr, port_num);
if (!error.ok()) return error;
if (server->config_fetcher() != nullptr) {
listener->resolved_address_ = *addr;
// TODO(yashykt): Consider binding so as to be able to return the port
// number.
} else {
error = grpc_tcp_server_add_port(listener->tcp_server_, addr, port_num);
if (!error.ok()) return error;
}
// Create channelz node.
if (args.GetBool(GRPC_ARG_ENABLE_CHANNELZ)
.value_or(GRPC_ENABLE_CHANNELZ_DEFAULT)) {
auto string_address = grpc_sockaddr_to_uri(addr);
if (!string_address.ok()) {
return GRPC_ERROR_CREATE(string_address.status().ToString());
}
listener->channelz_listen_socket_ =
MakeRefCounted<channelz::ListenSocketNode>(
*string_address,
absl::StrCat("chttp2 listener ", *string_address));
}
// Register with the server only upon success
server->AddListener(OrphanablePtr<Server::ListenerInterface>(listener));
return absl::OkStatus();
}();
if (!error.ok()) {
if (listener != nullptr) {
if (listener->tcp_server_ != nullptr) {
// listener is deleted when tcp_server_ is shutdown.
grpc_tcp_server_unref(listener->tcp_server_);
} else {
delete listener;
}
}
// Create channelz node.
if (args.GetBool(GRPC_ARG_ENABLE_CHANNELZ)
.value_or(GRPC_ENABLE_CHANNELZ_DEFAULT)) {
auto string_address = grpc_sockaddr_to_uri(addr);
if (!string_address.ok()) {
return GRPC_ERROR_CREATE(string_address.status().ToString());
}
listener->channelz_listen_socket_ =
MakeRefCounted<channelz::ListenSocketNode>(
*string_address, absl::StrCat("chttp2 listener ", *string_address));
}
return error;
// Register with the server only upon success
server->AddListener(std::move(listener));
return absl::OkStatus();
}
grpc_error_handle Chttp2ServerListener::CreateWithAcceptor(
Server* server, const char* name, const ChannelArgs& args,
Chttp2ServerArgsModifier args_modifier) {
Chttp2ServerListener* listener =
new Chttp2ServerListener(server, args, args_modifier);
auto listener = MakeOrphanable<Chttp2ServerListener>(
server, args, args_modifier, server->config_fetcher());
grpc_error_handle error = grpc_tcp_server_create(
&listener->tcp_server_shutdown_complete_,
grpc_event_engine::experimental::ChannelArgsEndpointConfig(args),
OnAccept, listener, &listener->tcp_server_);
if (!error.ok()) {
delete listener;
return error;
}
&listener->tcp_server_shutdown_complete_, ChannelArgsEndpointConfig(args),
OnAccept, listener.get(), &listener->tcp_server_);
if (!error.ok()) return error;
// TODO(yangg) channelz
TcpServerFdHandler** arg_val = args.GetPointer<TcpServerFdHandler*>(name);
*arg_val = grpc_tcp_server_create_fd_handler(listener->tcp_server_);
server->AddListener(OrphanablePtr<Server::ListenerInterface>(listener));
server->AddListener(std::move(listener));
return absl::OkStatus();
}
Chttp2ServerListener* Chttp2ServerListener::CreateForPassiveListener(
Server* server, const ChannelArgs& args,
std::shared_ptr<experimental::PassiveListenerImpl> passive_listener) {
// TODO(hork): figure out how to handle channelz in this case
auto listener = MakeOrphanable<Chttp2ServerListener>(
server, args, /*args_modifier=*/
[](const ChannelArgs& args, grpc_error_handle*) { return args; }, nullptr,
std::move(passive_listener));
auto listener_ptr = listener.get();
server->AddListener(std::move(listener));
return listener_ptr;
}
Chttp2ServerListener::Chttp2ServerListener(
Server* server, const ChannelArgs& args,
Chttp2ServerArgsModifier args_modifier)
Chttp2ServerArgsModifier args_modifier,
grpc_server_config_fetcher* config_fetcher,
std::shared_ptr<experimental::PassiveListenerImpl> passive_listener)
: server_(server),
args_modifier_(args_modifier),
args_(args),
memory_quota_(args.GetObject<ResourceQuota>()->memory_quota()),
connection_quota_(MakeRefCounted<ConnectionQuota>()) {
connection_quota_(MakeRefCounted<ConnectionQuota>()),
config_fetcher_(config_fetcher),
passive_listener_(std::move(passive_listener)) {
auto max_allowed_incoming_connections =
args.GetInt(GRPC_ARG_MAX_ALLOWED_INCOMING_CONNECTIONS);
if (max_allowed_incoming_connections.has_value()) {
@ -799,6 +797,9 @@ Chttp2ServerListener::~Chttp2ServerListener() {
// Flush queued work before destroying handshaker factory, since that
// may do a synchronous unref.
ExecCtx::Get()->Flush();
if (passive_listener_ != nullptr) {
passive_listener_->ListenerDestroyed();
}
if (on_destroy_done_ != nullptr) {
ExecCtx::Run(DEBUG_LOCATION, on_destroy_done_, absl::OkStatus());
ExecCtx::Get()->Flush();
@ -808,10 +809,11 @@ Chttp2ServerListener::~Chttp2ServerListener() {
// Server callback: start listening on our ports
void Chttp2ServerListener::Start(
Server* /*server*/, const std::vector<grpc_pollset*>* /* pollsets */) {
if (server_->config_fetcher() != nullptr) {
auto watcher = std::make_unique<ConfigFetcherWatcher>(Ref());
if (config_fetcher_ != nullptr) {
auto watcher = std::make_unique<ConfigFetcherWatcher>(
RefAsSubclass<Chttp2ServerListener>());
config_fetcher_watcher_ = watcher.get();
server_->config_fetcher()->StartWatch(
config_fetcher_->StartWatch(
grpc_sockaddr_to_string(&resolved_address_, false).value(),
std::move(watcher));
} else {
@ -825,7 +827,9 @@ void Chttp2ServerListener::Start(
}
void Chttp2ServerListener::StartListening() {
grpc_tcp_server_start(tcp_server_, &server_->pollsets());
if (tcp_server_ != nullptr) {
grpc_tcp_server_start(tcp_server_, &server_->pollsets());
}
}
void Chttp2ServerListener::SetOnDestroyDone(grpc_closure* on_destroy_done) {
@ -833,6 +837,12 @@ void Chttp2ServerListener::SetOnDestroyDone(grpc_closure* on_destroy_done) {
on_destroy_done_ = on_destroy_done;
}
void Chttp2ServerListener::AcceptConnectedEndpoint(
std::unique_ptr<EventEngine::Endpoint> endpoint) {
OnAccept(this, grpc_event_engine_endpoint_create(std::move(endpoint)),
/*accepting_pollset=*/nullptr, /*acceptor=*/nullptr);
}
void Chttp2ServerListener::OnAccept(void* arg, grpc_endpoint* tcp,
grpc_pollset* accepting_pollset,
grpc_tcp_server_acceptor* acceptor) {
@ -857,7 +867,7 @@ void Chttp2ServerListener::OnAccept(void* arg, grpc_endpoint* tcp,
endpoint_cleanup(error);
return;
}
if (self->server_->config_fetcher() != nullptr) {
if (self->config_fetcher_ != nullptr) {
if (connection_manager == nullptr) {
grpc_error_handle error = GRPC_ERROR_CREATE(
"No ConnectionManager configured. Closing connection.");
@ -898,7 +908,7 @@ void Chttp2ServerListener::OnAccept(void* arg, grpc_endpoint* tcp,
// heap-use-after-free issues where `Ref()` is invoked when the ref of
// tcp_server_ has already reached 0. (Ref() implementation of
// Chttp2ServerListener is grpc_tcp_server_ref().)
listener_ref = self->Ref();
listener_ref = self->RefAsSubclass<Chttp2ServerListener>();
self->connections_.emplace(connection.get(), std::move(connection));
}
}
@ -913,7 +923,7 @@ void Chttp2ServerListener::TcpServerShutdownComplete(
void* arg, grpc_error_handle /*error*/) {
Chttp2ServerListener* self = static_cast<Chttp2ServerListener*>(arg);
self->channelz_listen_socket_.reset();
delete self;
self->Unref();
}
// Server callback: destroy the tcp listener (so we don't generate further
@ -922,7 +932,8 @@ void Chttp2ServerListener::Orphan() {
// Cancel the watch before shutting down so as to avoid holding a ref to the
// listener in the watcher.
if (config_fetcher_watcher_ != nullptr) {
server_->config_fetcher()->CancelWatch(config_fetcher_watcher_);
GPR_ASSERT(config_fetcher_ != nullptr);
config_fetcher_->CancelWatch(config_fetcher_watcher_);
}
std::map<ActiveConnection*, OrphanablePtr<ActiveConnection>> connections;
grpc_tcp_server* tcp_server;
@ -940,12 +951,14 @@ void Chttp2ServerListener::Orphan() {
}
tcp_server = tcp_server_;
}
grpc_tcp_server_shutdown_listeners(tcp_server);
grpc_tcp_server_unref(tcp_server);
if (tcp_server != nullptr) {
grpc_tcp_server_shutdown_listeners(tcp_server);
grpc_tcp_server_unref(tcp_server);
} else {
Unref();
}
}
} // namespace
//
// Chttp2ServerAddPort()
//
@ -1046,6 +1059,50 @@ ChannelArgs ModifyArgsForConnection(const ChannelArgs& args,
}
} // namespace
namespace experimental {
absl::Status PassiveListenerImpl::AcceptConnectedEndpoint(
std::unique_ptr<EventEngine::Endpoint> endpoint) {
GPR_ASSERT(server_ != nullptr);
RefCountedPtr<Chttp2ServerListener> listener;
{
MutexLock lock(&mu_);
if (listener_ != nullptr) {
listener =
listener_->RefIfNonZero().TakeAsSubclass<Chttp2ServerListener>();
}
}
if (listener == nullptr) {
return absl::UnavailableError("passive listener already shut down");
}
ExecCtx exec_ctx;
listener->AcceptConnectedEndpoint(std::move(endpoint));
return absl::OkStatus();
}
absl::Status PassiveListenerImpl::AcceptConnectedFd(int fd) {
GPR_ASSERT(server_ != nullptr);
ExecCtx exec_ctx;
auto& args = server_->channel_args();
auto* supports_fd = QueryExtension<EventEngineSupportsFdExtension>(
/*engine=*/args.GetObjectRef<EventEngine>().get());
if (supports_fd == nullptr) {
return absl::UnimplementedError(
"The server's EventEngine does not support adding endpoints from "
"connected file descriptors.");
}
auto endpoint =
supports_fd->CreateEndpointFromFd(fd, ChannelArgsEndpointConfig(args));
return AcceptConnectedEndpoint(std::move(endpoint));
}
void PassiveListenerImpl::ListenerDestroyed() {
MutexLock lock(&mu_);
listener_ = nullptr;
}
} // namespace experimental
} // namespace grpc_core
int grpc_server_add_http2_port(grpc_server* server, const char* addr,
@ -1143,3 +1200,31 @@ void grpc_server_add_channel_from_fd(grpc_server* /* server */, int /* fd */,
}
#endif // GPR_SUPPORT_CHANNELS_FROM_FD
absl::Status grpc_server_add_passive_listener(
grpc_core::Server* server, grpc_server_credentials* credentials,
std::shared_ptr<grpc_core::experimental::PassiveListenerImpl>
passive_listener) {
grpc_core::ExecCtx exec_ctx;
GRPC_API_TRACE("grpc_server_add_passive_listener(server=%p, credentials=%p)",
2, (server, credentials));
// Create security context.
if (credentials == nullptr) {
return absl::UnavailableError(
"No credentials specified for passive listener");
}
auto sc = credentials->create_security_connector(grpc_core::ChannelArgs());
if (sc == nullptr) {
return absl::UnavailableError(
absl::StrCat("Unable to create secure server with credentials of type ",
credentials->type().name()));
}
auto args = server->channel_args()
.SetObject(credentials->Ref())
.SetObject(std::move(sc));
passive_listener->listener_ =
grpc_core::Chttp2ServerListener::CreateForPassiveListener(
server, args, passive_listener);
passive_listener->server_ = server->Ref();
return absl::OkStatus();
}

@ -21,6 +21,7 @@
#include <functional>
#include <grpc/passive_listener.h>
#include <grpc/support/port_platform.h>
#include "src/core/lib/channel/channel_args.h"
@ -42,6 +43,38 @@ grpc_error_handle Chttp2ServerAddPort(
Server* server, const char* addr, const ChannelArgs& args,
Chttp2ServerArgsModifier connection_args_modifier, int* port_num);
class Chttp2ServerListener;
namespace experimental {
// An implementation of the public C++ passive listener interface.
// The server builder holds a weak_ptr to one of these objects, and the
// application owns the instance.
class PassiveListenerImpl final : public PassiveListener {
public:
absl::Status AcceptConnectedEndpoint(
std::unique_ptr<grpc_event_engine::experimental::EventEngine::Endpoint>
endpoint) override ABSL_LOCKS_EXCLUDED(mu_);
absl::Status AcceptConnectedFd(GRPC_UNUSED int fd) override
ABSL_LOCKS_EXCLUDED(mu_);
void ListenerDestroyed() ABSL_LOCKS_EXCLUDED(mu_);
private:
// note: the grpc_core::Server redundant namespace qualification is
// required for older gcc versions.
friend absl::Status(::grpc_server_add_passive_listener)(
grpc_core::Server* server, grpc_server_credentials* credentials,
std::shared_ptr<grpc_core::experimental::PassiveListenerImpl>
passive_listener);
Mutex mu_;
// Data members will be populated when initialized.
RefCountedPtr<Server> server_;
Chttp2ServerListener* listener_;
};
} // namespace experimental
} // namespace grpc_core
#endif // GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_SERVER_CHTTP2_SERVER_H

@ -561,14 +561,6 @@ class StreamWriteContext {
grpc_chttp2_encode_data(s_->id, &s_->flow_controlled_buffer, 0, true,
&s_->stats.outgoing, t_->outbuf.c_slice_buffer());
} else {
if (send_status_.has_value()) {
s_->send_trailing_metadata->Set(grpc_core::HttpStatusMetadata(),
*send_status_);
}
if (send_content_type_.has_value()) {
s_->send_trailing_metadata->Set(grpc_core::ContentTypeMetadata(),
*send_content_type_);
}
t_->hpack_compressor.EncodeHeaders(
grpc_core::HPackCompressor::EncodeHeaderOptions{
s_->id, true, t_->settings.peer().allow_true_binary_metadata(),
@ -588,15 +580,39 @@ class StreamWriteContext {
bool stream_became_writable() { return stream_became_writable_; }
private:
class TrailersOnlyMetadataEncoder {
public:
explicit TrailersOnlyMetadataEncoder(grpc_metadata_batch* trailing_md)
: trailing_md_(trailing_md) {}
template <typename Which, typename Value>
void Encode(Which which, Value value) {
if (Which::kTransferOnTrailersOnly) {
trailing_md_->Set(which, value);
}
}
template <typename Which>
void Encode(Which which, const grpc_core::Slice& value) {
if (Which::kTransferOnTrailersOnly) {
trailing_md_->Set(which, value.Ref());
}
}
// Non-grpc metadata should not be transferred.
void Encode(const grpc_core::Slice&, const grpc_core::Slice&) {}
private:
grpc_metadata_batch* trailing_md_;
};
void ConvertInitialMetadataToTrailingMetadata() {
GRPC_CHTTP2_IF_TRACING(
gpr_log(GPR_INFO, "not sending initial_metadata (Trailers-Only)"));
// When sending Trailers-Only, we need to move the :status and
// content-type headers to the trailers.
send_status_ =
s_->send_initial_metadata->get(grpc_core::HttpStatusMetadata());
send_content_type_ =
s_->send_initial_metadata->get(grpc_core::ContentTypeMetadata());
// When sending Trailers-Only, we need to move metadata from headers to
// trailers.
TrailersOnlyMetadataEncoder encoder(s_->send_trailing_metadata);
s_->send_initial_metadata->Encode(&encoder);
}
void SentLastFrame() {
@ -629,9 +645,6 @@ class StreamWriteContext {
grpc_chttp2_transport* const t_;
grpc_chttp2_stream* const s_;
bool stream_became_writable_ = false;
absl::optional<uint32_t> send_status_;
absl::optional<grpc_core::ContentTypeMetadata::ValueType> send_content_type_ =
{};
};
} // namespace

@ -112,6 +112,13 @@ class EventEngineSupportsFdExtension {
int fd, const EndpointConfig& config,
MemoryAllocator memory_allocator) = 0;
/// Creates an EventEngine::Endpoint from an fd which is already assumed to be
/// connected to a remote peer. See \a CreatePosixEndpointFromFd for details.
/// This has the same behavior, but the \a memory_allocator is taken from the
/// EndpointConfig's resource quota.
virtual std::unique_ptr<EventEngine::Endpoint> CreateEndpointFromFd(
int fd, const EndpointConfig& config) = 0;
/// Called when the posix listener has accepted a new client connection.
/// \a listener_fd - The listening socket fd that accepted the new client
/// connection.

@ -25,7 +25,6 @@
#include "absl/cleanup/cleanup.h"
#include "absl/functional/any_invocable.h"
#include "absl/log/check.h"
#include "absl/status/status.h"
#include "absl/strings/match.h"
#include "absl/strings/str_cat.h"
@ -143,7 +142,7 @@ void AsyncConnect::OnWritable(absl::Status status)
absl::StatusOr<std::unique_ptr<EventEngine::Endpoint>> ep;
mu_.Lock();
CHECK_NE(fd_, nullptr);
GPR_ASSERT(fd_ != nullptr);
fd = std::exchange(fd_, nullptr);
bool connect_cancelled = connect_cancelled_;
if (fd->IsHandleShutdown() && status.ok()) {
@ -335,7 +334,7 @@ PosixEnginePollerManager::PosixEnginePollerManager(
poller_state_(PollerState::kExternal),
executor_(nullptr),
trigger_shutdown_called_(false) {
DCHECK_NE(poller_, nullptr);
GPR_DEBUG_ASSERT(poller_ != nullptr);
}
void PosixEnginePollerManager::Run(
@ -352,7 +351,7 @@ void PosixEnginePollerManager::Run(absl::AnyInvocable<void()> cb) {
}
void PosixEnginePollerManager::TriggerShutdown() {
DCHECK(trigger_shutdown_called_ == false);
GPR_DEBUG_ASSERT(trigger_shutdown_called_ == false);
trigger_shutdown_called_ = true;
// If the poller is external, dont try to shut it down. Otherwise
// set poller state to PollerState::kShuttingDown.
@ -468,7 +467,7 @@ PosixEventEngine::~PosixEventEngine() {
this, HandleToString(handle).c_str());
}
}
CHECK(GPR_LIKELY(known_handles_.empty()));
GPR_ASSERT(GPR_LIKELY(known_handles_.empty()));
}
timer_manager_->Shutdown();
#if GRPC_PLATFORM_SUPPORTS_POSIX_POLLING
@ -593,7 +592,7 @@ bool PosixEventEngine::CancelConnect(EventEngine::ConnectionHandle handle) {
auto it = shard->pending_connections.find(connection_handle);
if (it != shard->pending_connections.end()) {
ac = it->second;
CHECK_NE(ac, nullptr);
GPR_ASSERT(ac != nullptr);
// Trying to acquire ac->mu here would could cause a deadlock because
// the OnWritable method tries to acquire the two mutexes used
// here in the reverse order. But we dont need to acquire ac->mu before
@ -640,7 +639,7 @@ EventEngine::ConnectionHandle PosixEventEngine::Connect(
const EndpointConfig& args, MemoryAllocator memory_allocator,
Duration timeout) {
#if GRPC_PLATFORM_SUPPORTS_POSIX_POLLING
CHECK_NE(poller_manager_, nullptr);
GPR_ASSERT(poller_manager_ != nullptr);
PosixTcpOptions options = TcpOptionsFromEndpointConfig(args);
absl::StatusOr<PosixSocketWrapper::PosixSocketCreateResult> socket =
PosixSocketWrapper::CreateAndPrepareTcpClientSocket(options, addr);
@ -662,9 +661,9 @@ PosixEventEngine::CreatePosixEndpointFromFd(int fd,
const EndpointConfig& config,
MemoryAllocator memory_allocator) {
#if GRPC_PLATFORM_SUPPORTS_POSIX_POLLING
DCHECK_GT(fd, 0);
GPR_ASSERT(fd > 0);
PosixEventPoller* poller = poller_manager_->Poller();
DCHECK_NE(poller, nullptr);
GPR_DEBUG_ASSERT(poller != nullptr);
EventHandle* handle =
poller->CreateHandle(fd, "tcp-client", poller->CanTrackErrors());
return CreatePosixEndpoint(handle, nullptr, shared_from_this(),
@ -677,6 +676,22 @@ PosixEventEngine::CreatePosixEndpointFromFd(int fd,
#endif // GRPC_PLATFORM_SUPPORTS_POSIX_POLLING
}
std::unique_ptr<EventEngine::Endpoint> PosixEventEngine::CreateEndpointFromFd(
int fd, const EndpointConfig& config) {
auto options = TcpOptionsFromEndpointConfig(config);
MemoryAllocator allocator;
if (options.memory_allocator_factory != nullptr) {
return CreatePosixEndpointFromFd(
fd, config,
options.memory_allocator_factory->CreateMemoryAllocator(
absl::StrCat("allocator:", fd)));
}
return CreatePosixEndpointFromFd(
fd, config,
options.resource_quota->memory_quota()->CreateMemoryAllocator(
absl::StrCat("allocator:", fd)));
}
absl::StatusOr<std::unique_ptr<EventEngine::Listener>>
PosixEventEngine::CreateListener(
Listener::AcceptCallback on_accept,

@ -172,6 +172,8 @@ class PosixEventEngine final : public PosixEventEngineWithFdSupport,
std::unique_ptr<EventEngine::Endpoint> CreatePosixEndpointFromFd(
int fd, const EndpointConfig& config,
MemoryAllocator memory_allocator) override;
std::unique_ptr<EventEngine::Endpoint> CreateEndpointFromFd(
int fd, const EndpointConfig& config) override;
absl::StatusOr<std::unique_ptr<Listener>> CreateListener(
Listener::AcceptCallback on_accept,

@ -23,6 +23,7 @@
#include <stdio.h>
#include <string.h>
#include "absl/log/globals.h"
#include "absl/strings/match.h"
#include "absl/strings/str_cat.h"
@ -38,6 +39,7 @@
#define GPR_DEFAULT_LOG_VERBOSITY_STRING "ERROR"
#endif // !GPR_DEFAULT_LOG_VERBOSITY_STRING
static constexpr int g_absl_vlog_level_for_gpr_verbosity_debug = 2;
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;
@ -83,8 +85,9 @@ void gpr_default_log(gpr_log_func_args* args) {
}
switch (args->severity) {
case GPR_LOG_SEVERITY_DEBUG:
// Log DEBUG messages as VLOG(2).
VLOG(2).AtLocation(args->file, args->line) << args->message;
VLOG(g_absl_vlog_level_for_gpr_verbosity_debug)
.AtLocation(args->file, args->line)
<< args->message;
return;
case GPR_LOG_SEVERITY_INFO:
LOG(INFO).AtLocation(args->file, args->line) << args->message;
@ -145,6 +148,12 @@ void gpr_log_verbosity_init() {
parse_log_severity(verbosity, min_severity_to_print);
}
gpr_atm_no_barrier_store(&g_min_severity_to_print, min_severity_to_print);
if (grpc_core::ConfigVars::Get().AbslLogging() &&
min_severity_to_print == GPR_LOG_SEVERITY_DEBUG) {
// Matches full file paths that include a `*grpc*` folder, including
// grpcpp.
absl::SetVLogLevel("*grpc*/*", g_absl_vlog_level_for_gpr_verbosity_debug);
}
}
// init stacktrace_minloglevel when it hasn't been set
if ((gpr_atm_no_barrier_load(&g_min_severity_to_print_stacktrace)) ==

@ -22,6 +22,6 @@
#include <grpc/grpc.h>
#include <grpc/support/port_platform.h>
const char* grpc_version_string(void) { return "40.0.0"; }
const char* grpc_version_string(void) { return "41.0.0"; }
const char* grpc_g_stands_for(void) { return "grateful"; }

@ -77,6 +77,7 @@ size_t EncodedSizeOfKey(Key, const typename Key::ValueType& value) {
// should not need to.
struct GrpcTimeoutMetadata {
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = false;
using ValueType = Timestamp;
using MementoType = Duration;
using CompressionTraits = TimeoutCompressor;
@ -93,6 +94,7 @@ struct GrpcTimeoutMetadata {
// TE metadata trait.
struct TeMetadata {
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = false;
// HTTP2 says that TE can either be empty or "trailers".
// Empty means this trait is not included, "trailers" means kTrailers, and
// kInvalid is used to remember an invalid value.
@ -122,6 +124,7 @@ inline size_t EncodedSizeOfKey(TeMetadata, TeMetadata::ValueType x) {
// content-type metadata trait.
struct ContentTypeMetadata {
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = true;
// gRPC says that content-type can be application/grpc[;something]
// Core has only ever verified the prefix.
// IF we want to start verifying more, we can expand this type.
@ -150,6 +153,7 @@ struct ContentTypeMetadata {
// scheme metadata trait.
struct HttpSchemeMetadata {
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = false;
enum ValueType : uint8_t {
kHttp,
kHttps,
@ -179,6 +183,7 @@ size_t EncodedSizeOfKey(HttpSchemeMetadata, HttpSchemeMetadata::ValueType x);
// method metadata trait.
struct HttpMethodMetadata {
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = false;
enum ValueType : uint8_t {
kPost,
kGet,
@ -227,6 +232,7 @@ struct CompressionAlgorithmBasedMetadata {
// grpc-encoding metadata trait.
struct GrpcEncodingMetadata : public CompressionAlgorithmBasedMetadata {
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = false;
using CompressionTraits =
SmallIntegralValuesCompressor<GRPC_COMPRESS_ALGORITHMS_COUNT>;
static absl::string_view key() { return "grpc-encoding"; }
@ -235,6 +241,7 @@ struct GrpcEncodingMetadata : public CompressionAlgorithmBasedMetadata {
// grpc-internal-encoding-request metadata trait.
struct GrpcInternalEncodingRequest : public CompressionAlgorithmBasedMetadata {
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = false;
using CompressionTraits = NoCompressionCompressor;
static absl::string_view key() { return "grpc-internal-encoding-request"; }
};
@ -242,6 +249,7 @@ struct GrpcInternalEncodingRequest : public CompressionAlgorithmBasedMetadata {
// grpc-accept-encoding metadata trait.
struct GrpcAcceptEncodingMetadata {
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = false;
static absl::string_view key() { return "grpc-accept-encoding"; }
using ValueType = CompressionAlgorithmSet;
using MementoType = ValueType;
@ -260,6 +268,7 @@ struct GrpcAcceptEncodingMetadata {
// user-agent metadata trait.
struct UserAgentMetadata : public SimpleSliceBasedMetadata {
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = false;
using CompressionTraits = StableValueCompressor;
static absl::string_view key() { return "user-agent"; }
};
@ -267,6 +276,7 @@ struct UserAgentMetadata : public SimpleSliceBasedMetadata {
// grpc-message metadata trait.
struct GrpcMessageMetadata : public SimpleSliceBasedMetadata {
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = false;
using CompressionTraits = NoCompressionCompressor;
static absl::string_view key() { return "grpc-message"; }
};
@ -274,6 +284,7 @@ struct GrpcMessageMetadata : public SimpleSliceBasedMetadata {
// host metadata trait.
struct HostMetadata : public SimpleSliceBasedMetadata {
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = false;
using CompressionTraits = NoCompressionCompressor;
static absl::string_view key() { return "host"; }
};
@ -281,6 +292,7 @@ struct HostMetadata : public SimpleSliceBasedMetadata {
// endpoint-load-metrics-bin metadata trait.
struct EndpointLoadMetricsBinMetadata : public SimpleSliceBasedMetadata {
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = false;
using CompressionTraits = NoCompressionCompressor;
static absl::string_view key() { return "endpoint-load-metrics-bin"; }
};
@ -288,6 +300,7 @@ struct EndpointLoadMetricsBinMetadata : public SimpleSliceBasedMetadata {
// grpc-server-stats-bin metadata trait.
struct GrpcServerStatsBinMetadata : public SimpleSliceBasedMetadata {
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = false;
using CompressionTraits = NoCompressionCompressor;
static absl::string_view key() { return "grpc-server-stats-bin"; }
};
@ -295,6 +308,7 @@ struct GrpcServerStatsBinMetadata : public SimpleSliceBasedMetadata {
// grpc-trace-bin metadata trait.
struct GrpcTraceBinMetadata : public SimpleSliceBasedMetadata {
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = false;
using CompressionTraits = FrequentKeyWithNoValueCompressionCompressor;
static absl::string_view key() { return "grpc-trace-bin"; }
};
@ -302,6 +316,7 @@ struct GrpcTraceBinMetadata : public SimpleSliceBasedMetadata {
// grpc-tags-bin metadata trait.
struct GrpcTagsBinMetadata : public SimpleSliceBasedMetadata {
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = false;
using CompressionTraits = FrequentKeyWithNoValueCompressionCompressor;
static absl::string_view key() { return "grpc-tags-bin"; }
};
@ -309,6 +324,7 @@ struct GrpcTagsBinMetadata : public SimpleSliceBasedMetadata {
// XEnvoyPeerMetadata
struct XEnvoyPeerMetadata : public SimpleSliceBasedMetadata {
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = true;
using CompressionTraits = StableValueCompressor;
static absl::string_view key() { return "x-envoy-peer-metadata"; }
};
@ -316,6 +332,7 @@ struct XEnvoyPeerMetadata : public SimpleSliceBasedMetadata {
// :authority metadata trait.
struct HttpAuthorityMetadata : public SimpleSliceBasedMetadata {
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = false;
using CompressionTraits = SmallSetOfValuesCompressor;
static absl::string_view key() { return ":authority"; }
};
@ -323,6 +340,7 @@ struct HttpAuthorityMetadata : public SimpleSliceBasedMetadata {
// :path metadata trait.
struct HttpPathMetadata : public SimpleSliceBasedMetadata {
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = false;
using CompressionTraits = SmallSetOfValuesCompressor;
static absl::string_view key() { return ":path"; }
};
@ -357,6 +375,7 @@ struct SimpleIntBasedMetadata : public SimpleIntBasedMetadataBase<Int> {
struct GrpcStatusMetadata
: public SimpleIntBasedMetadata<grpc_status_code, GRPC_STATUS_UNKNOWN> {
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = false;
using CompressionTraits = SmallIntegralValuesCompressor<16>;
static absl::string_view key() { return "grpc-status"; }
};
@ -365,6 +384,7 @@ struct GrpcStatusMetadata
struct GrpcPreviousRpcAttemptsMetadata
: public SimpleIntBasedMetadata<uint32_t, 0> {
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = false;
using CompressionTraits = NoCompressionCompressor;
static absl::string_view key() { return "grpc-previous-rpc-attempts"; }
};
@ -372,6 +392,7 @@ struct GrpcPreviousRpcAttemptsMetadata
// grpc-retry-pushback-ms metadata trait.
struct GrpcRetryPushbackMsMetadata {
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = false;
static absl::string_view key() { return "grpc-retry-pushback-ms"; }
using ValueType = Duration;
using MementoType = Duration;
@ -389,6 +410,7 @@ struct GrpcRetryPushbackMsMetadata {
// TODO(ctiller): consider moving to uint16_t
struct HttpStatusMetadata : public SimpleIntBasedMetadata<uint32_t, 0> {
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = true;
using CompressionTraits = HttpStatusCompressor;
static absl::string_view key() { return ":status"; }
};
@ -399,6 +421,7 @@ class GrpcLbClientStats;
struct GrpcLbClientStatsMetadata {
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = false;
static absl::string_view key() { return "grpclb_client_stats"; }
using ValueType = GrpcLbClientStats*;
using MementoType = ValueType;
@ -423,6 +446,7 @@ inline size_t EncodedSizeOfKey(GrpcLbClientStatsMetadata,
// lb-token metadata
struct LbTokenMetadata : public SimpleSliceBasedMetadata {
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = false;
using CompressionTraits = NoCompressionCompressor;
static absl::string_view key() { return "lb-token"; }
};
@ -430,6 +454,7 @@ struct LbTokenMetadata : public SimpleSliceBasedMetadata {
// lb-cost-bin metadata
struct LbCostBinMetadata {
static constexpr bool kRepeatable = true;
static constexpr bool kTransferOnTrailersOnly = false;
static absl::string_view key() { return "lb-cost-bin"; }
struct ValueType {
double cost;
@ -451,6 +476,7 @@ struct LbCostBinMetadata {
struct GrpcStreamNetworkState {
static absl::string_view DebugKey() { return "GrpcStreamNetworkState"; }
static constexpr bool kRepeatable = false;
static constexpr bool kTransferOnTrailersOnly = false;
enum ValueType : uint8_t {
kNotSentOnWire,
kNotSeenByServer,
@ -1149,6 +1175,9 @@ MetadataValueAsSlice(typename Which::ValueType value) {
// struct GrpcXyzMetadata {
// // Can this metadata field be repeated?
// static constexpr bool kRepeatable = ...;
// // Should this metadata be transferred from server headers to trailers on
// // Trailers-Only response?
// static constexpr bool kTransferOnTrailersOnly = ...;
// // The type that's stored on MetadataBatch
// using ValueType = ...;
// // The type that's stored in compression/decompression tables

@ -39,6 +39,7 @@
#include "absl/types/optional.h"
#include <grpc/grpc.h>
#include <grpc/passive_listener.h>
#include <grpc/slice.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/time.h>
@ -74,6 +75,9 @@
"grpc.server.max_pending_requests_hard_limit"
namespace grpc_core {
namespace experimental {
class PassiveListenerImpl;
} // namespace experimental
extern TraceFlag grpc_server_channel_trace;
@ -112,7 +116,7 @@ class Server : public ServerInterface,
/// Interface for listeners.
/// Implementations must override the Orphan() method, which should stop
/// listening and initiate destruction of the listener.
class ListenerInterface : public Orphanable {
class ListenerInterface : public InternallyRefCounted<ListenerInterface> {
public:
~ListenerInterface() override = default;
@ -212,6 +216,14 @@ class Server : public ServerInterface,
void SendGoaways() ABSL_LOCKS_EXCLUDED(mu_global_, mu_call_);
private:
// note: the grpc_core::Server redundant namespace qualification is
// required for older gcc versions.
// TODO(yashykt): eliminate this friend statement as part of your upcoming
// server listener refactoring.
friend absl::Status(::grpc_server_add_passive_listener)(
grpc_core::Server* server, grpc_server_credentials* credentials,
std::shared_ptr<grpc_core::experimental::PassiveListenerImpl>
passive_listener);
struct RequestedCall;
class RequestMatcherInterface;

@ -88,17 +88,13 @@ OpenTelemetryPlugin::ClientCallTracer::CallAttemptTracer::CallAttemptTracer(
void OpenTelemetryPlugin::ClientCallTracer::CallAttemptTracer::
RecordReceivedInitialMetadata(grpc_metadata_batch* recv_initial_metadata) {
parent_->scope_config_->active_plugin_options_view().ForEach(
[&](const InternalOpenTelemetryPluginOption& plugin_option,
size_t /*index*/) {
auto* labels_injector = plugin_option.labels_injector();
if (labels_injector != nullptr) {
injected_labels_from_plugin_options_.push_back(
labels_injector->GetLabels(recv_initial_metadata));
}
return true;
},
parent_->otel_plugin_);
if (recv_initial_metadata != nullptr &&
recv_initial_metadata->get(grpc_core::GrpcTrailersOnly())
.value_or(false)) {
is_trailers_only_ = true;
return;
}
PopulateLabelInjectors(recv_initial_metadata);
}
void OpenTelemetryPlugin::ClientCallTracer::CallAttemptTracer::
@ -143,8 +139,11 @@ void OpenTelemetryPlugin::ClientCallTracer::CallAttemptTracer::
void OpenTelemetryPlugin::ClientCallTracer::CallAttemptTracer::
RecordReceivedTrailingMetadata(
absl::Status status, grpc_metadata_batch* /*recv_trailing_metadata*/,
absl::Status status, grpc_metadata_batch* recv_trailing_metadata,
const grpc_transport_stream_stats* transport_stream_stats) {
if (is_trailers_only_) {
PopulateLabelInjectors(recv_trailing_metadata);
}
std::array<std::pair<absl::string_view, absl::string_view>, 3>
additional_labels = {
{{OpenTelemetryMethodKey(), parent_->MethodForStats()},
@ -214,6 +213,21 @@ void OpenTelemetryPlugin::ClientCallTracer::CallAttemptTracer::SetOptionalLabel(
optional_labels_[static_cast<size_t>(key)] = std::move(value);
}
void OpenTelemetryPlugin::ClientCallTracer::CallAttemptTracer::
PopulateLabelInjectors(grpc_metadata_batch* metadata) {
parent_->scope_config_->active_plugin_options_view().ForEach(
[&](const InternalOpenTelemetryPluginOption& plugin_option,
size_t /*index*/) {
auto* labels_injector = plugin_option.labels_injector();
if (labels_injector != nullptr) {
injected_labels_from_plugin_options_.push_back(
labels_injector->GetLabels(metadata));
}
return true;
},
parent_->otel_plugin_);
}
//
// OpenTelemetryPlugin::ClientCallTracer
//

@ -95,6 +95,8 @@ class OpenTelemetryPlugin::ClientCallTracer
grpc_core::RefCountedStringValue value) override;
private:
void PopulateLabelInjectors(grpc_metadata_batch* metadata);
const ClientCallTracer* parent_;
const bool arena_allocated_;
// Start time (for measuring latency).
@ -106,6 +108,7 @@ class OpenTelemetryPlugin::ClientCallTracer
optional_labels_;
std::vector<std::unique_ptr<LabelsIterable>>
injected_labels_from_plugin_options_;
bool is_trailers_only_ = false;
};
ClientCallTracer(

@ -29,6 +29,7 @@
#include <grpc/impl/channel_arg_names.h>
#include <grpc/impl/compression_types.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/sync.h>
#include <grpc/support/workaround_list.h>
#include <grpcpp/completion_queue.h>
@ -45,11 +46,38 @@
#include <grpcpp/support/channel_arguments.h>
#include <grpcpp/support/server_interceptor.h>
#include "src/core/ext/transport/chttp2/server/chttp2_server.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/server/server.h"
#include "src/cpp/server/external_connection_acceptor_impl.h"
namespace grpc {
namespace {
// A PIMPL wrapper class that owns the only ref to the passive listener
// implementation. This is returned to the application.
class PassiveListenerOwner final
: public grpc_core::experimental::PassiveListener {
public:
explicit PassiveListenerOwner(std::shared_ptr<PassiveListener> listener)
: listener_(std::move(listener)) {}
absl::Status AcceptConnectedEndpoint(
std::unique_ptr<grpc_event_engine::experimental::EventEngine::Endpoint>
endpoint) override {
return listener_->AcceptConnectedEndpoint(std::move(endpoint));
}
absl::Status AcceptConnectedFd(int fd) override {
return listener_->AcceptConnectedFd(fd);
}
private:
std::shared_ptr<PassiveListener> listener_;
};
} // namespace
static std::vector<std::unique_ptr<ServerBuilderPlugin> (*)()>*
g_plugin_factory_list;
@ -223,6 +251,18 @@ ServerBuilder& ServerBuilder::SetResourceQuota(
return *this;
}
ServerBuilder& ServerBuilder::experimental_type::AddPassiveListener(
std::shared_ptr<grpc::ServerCredentials> creds,
std::unique_ptr<experimental::PassiveListener>& passive_listener) {
auto core_passive_listener =
std::make_shared<grpc_core::experimental::PassiveListenerImpl>();
builder_->unstarted_passive_listeners_.emplace_back(core_passive_listener,
std::move(creds));
passive_listener =
std::make_unique<PassiveListenerOwner>(std::move(core_passive_listener));
return *builder_;
}
ServerBuilder& ServerBuilder::AddListeningPort(
const std::string& addr_uri, std::shared_ptr<ServerCredentials> creds,
int* selected_port) {
@ -396,6 +436,26 @@ std::unique_ptr<grpc::Server> ServerBuilder::BuildAndStart() {
cq->RegisterServer(server.get());
}
for (auto& unstarted_listener : unstarted_passive_listeners_) {
has_frequently_polled_cqs = true;
auto passive_listener = unstarted_listener.passive_listener.lock();
auto* core_server = grpc_core::Server::FromC(server->c_server());
if (passive_listener != nullptr) {
auto* creds = unstarted_listener.credentials->c_creds();
if (creds == nullptr) {
gpr_log(GPR_ERROR, "Credentials missing for PassiveListener");
return nullptr;
}
auto success = grpc_server_add_passive_listener(
core_server, creds, std::move(passive_listener));
if (!success.ok()) {
gpr_log(GPR_ERROR, "Failed to create a passive listener: %s",
success.ToString().c_str());
return nullptr;
}
}
}
if (!has_frequently_polled_cqs) {
gpr_log(GPR_ERROR,
"At least one of the completion queues must be frequently polled");

@ -106,6 +106,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
# This is only for local development of the plugin: If the Podfile brings this pod from a local
# directory using `:path`, CocoaPods won't download the zip file and so the plugin won't be

@ -108,6 +108,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
# Restrict the gRPC runtime version to the one supported by this plugin.
s.dependency 'gRPC-ProtoRPC', v

@ -114,6 +114,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
# This is only for local development of protoc: If the Podfile brings this pod from a local
# directory using `:path`, CocoaPods won't download the zip file and so the compiler won't be

@ -83,6 +83,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
name = 'openssl_grpc'

@ -47,6 +47,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
# Base directory where the .proto files are.
src = '.'

@ -23,4 +23,4 @@
// `tools/buildgen/generate_projects.sh`.
#define GRPC_OBJC_VERSION_STRING @"1.64.0-dev"
#define GRPC_C_VERSION_STRING @"40.0.0"
#define GRPC_C_VERSION_STRING @"41.0.0"

@ -777,7 +777,7 @@ async def _schedule_rpc_coro(object rpc_coro,
rpc_state,
rpc_coro,
loop,
))
), name="HandleExceptions[%s]" % _decode(rpc_state.method()))
_add_callback_handler(rpc_task, rpc_state)
await _handle_cancellation_from_core(rpc_task, rpc_state, loop)

@ -122,6 +122,7 @@
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
s.requires_arc = false

@ -118,6 +118,7 @@
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
s.requires_arc = false

@ -39,6 +39,7 @@
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
name = 'ProtoRPC'
s.module_name = name

@ -39,6 +39,7 @@
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
name = 'RxLibrary'
s.module_name = name

@ -51,6 +51,7 @@
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
# Exposes the privacy manifest. Depended on by any subspecs containing
# non-interface files.
@ -85,6 +86,7 @@
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
end
s.subspec 'Interface' do |ss|
@ -120,6 +122,7 @@
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
end
s.subspec 'GRPCCore' do |ss|
@ -157,6 +160,7 @@
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
end
s.subspec 'GRPCCoreCronet' do |ss|
@ -181,6 +185,7 @@
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
end
s.subspec 'InternalTesting' do |ss|
@ -193,5 +198,6 @@
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
end
end

@ -108,6 +108,7 @@
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
# This is only for local development of the plugin: If the Podfile brings this pod from a local
# directory using `:path`, CocoaPods won't download the zip file and so the plugin won't be

@ -110,6 +110,7 @@
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
# Restrict the gRPC runtime version to the one supported by this plugin.
s.dependency 'gRPC-ProtoRPC', v

@ -116,6 +116,7 @@
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
# This is only for local development of protoc: If the Podfile brings this pod from a local
# directory using `:path`, CocoaPods won't download the zip file and so the compiler won't be

@ -114,6 +114,7 @@
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '12.0'
s.watchos.deployment_target = '6.0'
s.visionos.deployment_target = '1.0'
name = 'openssl_grpc'

@ -19,6 +19,7 @@
#include <map>
#include <memory>
#include <string>
#include <thread>
#include <tuple>
#include <utility>
#include <vector>
@ -159,6 +160,70 @@ class NotifyOnDelete {
grpc_core::Notification* signal_;
};
// An endpoint implementation that supports Read and Write via std::threads.
// Passing a grpc_core::Notification will allow owners to know when all
// in-flight callbacks have been run, and all endpoint state has been destroyed.
class ThreadedNoopEndpoint : public EventEngine::Endpoint {
public:
explicit ThreadedNoopEndpoint(grpc_core::Notification* destroyed)
: state_(std::make_shared<EndpointState>(destroyed)) {}
~ThreadedNoopEndpoint() override {
std::thread deleter([state = state_]() {
CleanupThread(state->read);
CleanupThread(state->write);
});
deleter.detach();
}
bool Read(absl::AnyInvocable<void(absl::Status)> on_read, SliceBuffer* buffer,
const ReadArgs* /* args */) override {
buffer->Clear();
CleanupThread(state_->read);
state_->read = new std::thread([cb = std::move(on_read)]() mutable {
cb(absl::UnknownError("test"));
});
return false;
}
bool Write(absl::AnyInvocable<void(absl::Status)> on_writable,
SliceBuffer* data, const WriteArgs* /* args */) override {
data->Clear();
CleanupThread(state_->write);
state_->write = new std::thread([cb = std::move(on_writable)]() mutable {
cb(absl::UnknownError("test"));
});
return false;
}
const EventEngine::ResolvedAddress& GetPeerAddress() const override {
return peer_;
}
const EventEngine::ResolvedAddress& GetLocalAddress() const override {
return local_;
}
private:
struct EndpointState {
explicit EndpointState(grpc_core::Notification* deleter)
: delete_notifier_(deleter) {}
std::thread* read = nullptr;
std::thread* write = nullptr;
NotifyOnDelete delete_notifier_;
};
static void CleanupThread(std::thread* thd) {
if (thd != nullptr) {
thd->join();
delete thd;
}
}
std::shared_ptr<EndpointState> state_;
EventEngine::ResolvedAddress peer_;
EventEngine::ResolvedAddress local_;
};
} // namespace experimental
} // namespace grpc_event_engine

@ -73,7 +73,6 @@ grpc_cc_library(
"fuzzer_util.h",
"grpc_profiler.h",
"histogram.h",
"mock_authorization_endpoint.h",
"mock_endpoint.h",
"parse_hexstring.h",
"resolve_localhost_ip46.h",

@ -1,66 +0,0 @@
// Copyright 2021 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_TEST_CORE_TEST_UTIL_MOCK_AUTHORIZATION_ENDPOINT_H
#define GRPC_TEST_CORE_TEST_UTIL_MOCK_AUTHORIZATION_ENDPOINT_H
#include <string>
#include "absl/strings/string_view.h"
#include <grpc/support/port_platform.h>
#include "src/core/lib/iomgr/endpoint.h"
namespace grpc_core {
class MockAuthorizationEndpoint : public grpc_endpoint {
public:
MockAuthorizationEndpoint(absl::string_view local_uri,
absl::string_view peer_uri)
: local_address_(local_uri), peer_address_(peer_uri) {
static constexpr grpc_endpoint_vtable vtable = {
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, GetPeer, GetLocalAddress, nullptr, nullptr};
grpc_endpoint::vtable = &vtable;
}
static absl::string_view GetPeer(grpc_endpoint* ep) {
MockAuthorizationEndpoint* m =
reinterpret_cast<MockAuthorizationEndpoint*>(ep);
return m->peer_address_;
}
static absl::string_view GetLocalAddress(grpc_endpoint* ep) {
MockAuthorizationEndpoint* m =
reinterpret_cast<MockAuthorizationEndpoint*>(ep);
return m->local_address_;
}
void SetPeer(absl::string_view peer_address) {
peer_address_ = std::string(peer_address);
}
void SetLocalAddress(absl::string_view local_address) {
local_address_ = std::string(local_address);
}
private:
std::string local_address_;
std::string peer_address_;
};
} // namespace grpc_core
#endif // GRPC_TEST_CORE_TEST_UTIL_MOCK_AUTHORIZATION_ENDPOINT_H

@ -157,12 +157,7 @@ class MetadataExchangeTest
: public OpenTelemetryPluginEnd2EndTest,
public ::testing::WithParamInterface<TestScenario> {
protected:
void Init(
const std::vector<absl::string_view>& metric_names,
bool enable_client_side_injector = true,
std::map<grpc_core::ClientCallTracer::CallAttemptTracer::OptionalLabelKey,
grpc_core::RefCountedStringValue>
labels_to_inject = {}) {
void Init(Options options, bool enable_client_side_injector = true) {
const char* kBootstrap =
"{\"node\": {\"id\": "
"\"projects/1234567890/networks/mesh:mesh-id/nodes/"
@ -182,11 +177,9 @@ class MetadataExchangeTest
break;
}
OpenTelemetryPluginEnd2EndTest::Init(std::move(
Options()
.set_metric_names(metric_names)
options
.add_plugin_option(std::make_unique<MeshLabelsPluginOption>(
GetParam().GetTestResource().GetAttributes()))
.set_labels_to_inject(std::move(labels_to_inject))
.set_channel_scope_filter(
[enable_client_side_injector](
const OpenTelemetryPluginBuilder::ChannelScope& /*scope*/) {
@ -284,8 +277,9 @@ class MetadataExchangeTest
// Verify that grpc.client.attempt.started does not get service mesh attributes
TEST_P(MetadataExchangeTest, ClientAttemptStarted) {
Init(/*metric_names=*/{
grpc::OpenTelemetryPluginBuilder::kClientAttemptStartedInstrumentName});
Init(std::move(
Options().set_metric_names({grpc::OpenTelemetryPluginBuilder::
kClientAttemptStartedInstrumentName})));
SendRPC();
const char* kMetricName = "grpc.client.attempt.started";
auto data = ReadCurrentMetricsData(
@ -308,8 +302,9 @@ TEST_P(MetadataExchangeTest, ClientAttemptStarted) {
}
TEST_P(MetadataExchangeTest, ClientAttemptDuration) {
Init(/*metric_names=*/{
grpc::OpenTelemetryPluginBuilder::kClientAttemptDurationInstrumentName});
Init(std::move(
Options().set_metric_names({grpc::OpenTelemetryPluginBuilder::
kClientAttemptDurationInstrumentName})));
SendRPC();
const char* kMetricName = "grpc.client.attempt.duration";
auto data = ReadCurrentMetricsData(
@ -333,9 +328,8 @@ TEST_P(MetadataExchangeTest, ClientAttemptDuration) {
// Verify that grpc.server.call.started does not get service mesh attributes
TEST_P(MetadataExchangeTest, ServerCallStarted) {
Init(
/*metric_names=*/{
grpc::OpenTelemetryPluginBuilder::kServerCallStartedInstrumentName});
Init(std::move(Options().set_metric_names(
{grpc::OpenTelemetryPluginBuilder::kServerCallStartedInstrumentName})));
SendRPC();
const char* kMetricName = "grpc.server.call.started";
auto data = ReadCurrentMetricsData(
@ -354,9 +348,8 @@ TEST_P(MetadataExchangeTest, ServerCallStarted) {
}
TEST_P(MetadataExchangeTest, ServerCallDuration) {
Init(
/*metric_names=*/{
grpc::OpenTelemetryPluginBuilder::kServerCallDurationInstrumentName});
Init(std::move(Options().set_metric_names(
{grpc::OpenTelemetryPluginBuilder::kServerCallDurationInstrumentName})));
SendRPC();
const char* kMetricName = "grpc.server.call.duration";
auto data = ReadCurrentMetricsData(
@ -378,10 +371,10 @@ TEST_P(MetadataExchangeTest, ServerCallDuration) {
// Test that the server records unknown when the client does not send metadata
TEST_P(MetadataExchangeTest, ClientDoesNotSendMetadata) {
Init(
/*metric_names=*/{grpc::OpenTelemetryPluginBuilder::
kServerCallDurationInstrumentName},
/*enable_client_side_injector=*/false);
Init(std::move(
Options().set_metric_names({grpc::OpenTelemetryPluginBuilder::
kServerCallDurationInstrumentName})),
/*enable_client_side_injector=*/false);
SendRPC();
const char* kMetricName = "grpc.server.call.duration";
auto data = ReadCurrentMetricsData(
@ -407,14 +400,15 @@ TEST_P(MetadataExchangeTest, ClientDoesNotSendMetadata) {
}
TEST_P(MetadataExchangeTest, VerifyCsmServiceLabels) {
Init(/*metric_names=*/{grpc::OpenTelemetryPluginBuilder::
kClientAttemptDurationInstrumentName},
/*enable_client_side_injector=*/true,
// Injects CSM service labels to be recorded in the call.
{{OptionalLabelKey::kXdsServiceName,
grpc_core::RefCountedStringValue("myservice")},
{OptionalLabelKey::kXdsServiceNamespace,
grpc_core::RefCountedStringValue("mynamespace")}});
Init(std::move(
Options()
.set_metric_names({grpc::OpenTelemetryPluginBuilder::
kClientAttemptDurationInstrumentName})
.set_labels_to_inject(
{{OptionalLabelKey::kXdsServiceName,
grpc_core::RefCountedStringValue("myservice")},
{OptionalLabelKey::kXdsServiceNamespace,
grpc_core::RefCountedStringValue("mynamespace")}})));
SendRPC();
const char* kMetricName = "grpc.client.attempt.duration";
auto data = ReadCurrentMetricsData(
@ -430,6 +424,51 @@ TEST_P(MetadataExchangeTest, VerifyCsmServiceLabels) {
"mynamespace");
}
TEST_P(MetadataExchangeTest, Retries) {
Init(std::move(
Options()
.set_metric_names({grpc::OpenTelemetryPluginBuilder::
kClientAttemptDurationInstrumentName})
.set_service_config(
"{\n"
" \"methodConfig\": [ {\n"
" \"name\": [\n"
" { \"service\": \"grpc.testing.EchoTestService\" }\n"
" ],\n"
" \"retryPolicy\": {\n"
" \"maxAttempts\": 3,\n"
" \"initialBackoff\": \"0.1s\",\n"
" \"maxBackoff\": \"120s\",\n"
" \"backoffMultiplier\": 1,\n"
" \"retryableStatusCodes\": [ \"ABORTED\" ]\n"
" }\n"
" } ]\n"
"}")));
EchoRequest request;
request.mutable_param()->mutable_expected_error()->set_code(
StatusCode::ABORTED);
EchoResponse response;
grpc::ClientContext context;
grpc::Status status = stub_->Echo(&context, request, &response);
const char* kMetricName = "grpc.client.attempt.duration";
auto data = ReadCurrentMetricsData(
[&](const absl::flat_hash_map<
std::string,
std::vector<opentelemetry::sdk::metrics::PointDataAttributes>>&
data) {
return !data.contains(kMetricName) ||
absl::get<opentelemetry::sdk::metrics::HistogramPointData>(
data.at(kMetricName)[0].point_data)
.count_ != 3;
});
ASSERT_EQ(absl::get<opentelemetry::sdk::metrics::HistogramPointData>(
data.at(kMetricName)[0].point_data)
.count_,
3);
VerifyServiceMeshAttributes(data.at(kMetricName)[0].attributes,
/*is_client=*/true);
}
// Creates a serialized slice with labels for metadata exchange based on \a
// resource.
grpc_core::Slice RemoteMetadataSliceFromResource(

@ -148,6 +148,9 @@ void OpenTelemetryPluginEnd2EndTest::Init(Options config) {
});
channel_args.SetPointer(GRPC_ARG_LABELS_TO_INJECT, &labels_to_inject_);
}
if (!config.service_config.empty()) {
channel_args.SetString(GRPC_ARG_SERVICE_CONFIG, config.service_config);
}
reader_ = BuildAndRegisterOpenTelemetryPlugin(std::move(config));
grpc_init();
grpc::ServerBuilder builder;

@ -86,6 +86,11 @@ class OpenTelemetryPluginEnd2EndTest : public ::testing::Test {
return *this;
}
Options& set_service_config(std::string svc_cfg) {
service_config = std::move(svc_cfg);
return *this;
}
Options& set_channel_scope_filter(
absl::AnyInvocable<bool(
const OpenTelemetryPluginBuilder::ChannelScope& /*scope*/) const>
@ -138,6 +143,7 @@ class OpenTelemetryPluginEnd2EndTest : public ::testing::Test {
std::map<grpc_core::ClientCallTracer::CallAttemptTracer::OptionalLabelKey,
grpc_core::RefCountedStringValue>
labels_to_inject;
std::string service_config;
absl::AnyInvocable<bool(
const OpenTelemetryPluginBuilder::ChannelScope& /*scope*/) const>
channel_scope_filter;

@ -28,6 +28,7 @@ grpc_cc_test(
deps = [
"//:grpc++_unsecure",
"//src/proto/grpc/testing:echo_proto",
"//test/core/event_engine:event_engine_test_utils",
"//test/core/test_util:grpc_test_util_base",
"//test/core/test_util:grpc_test_util_unsecure",
],

@ -16,14 +16,19 @@
//
//
#include <sys/socket.h>
#include <gtest/gtest.h>
#include <grpc/event_engine/slice_buffer.h>
#include <grpc/grpc.h>
#include <grpcpp/server.h>
#include <grpcpp/server_builder.h>
#include <grpcpp/support/config.h>
#include "src/core/lib/gprpp/notification.h"
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/core/event_engine/event_engine_test_utils.h"
#include "test/core/test_util/port.h"
#include "test/core/test_util/test_config.h"
@ -83,6 +88,56 @@ TEST_F(ServerBuilderTest, CreateServerRepeatedPortWithDisallowedReusePort) {
nullptr);
}
TEST_F(ServerBuilderTest, AddPassiveListener) {
std::unique_ptr<experimental::PassiveListener> passive_listener;
auto server =
ServerBuilder()
.experimental()
.AddPassiveListener(InsecureServerCredentials(), passive_listener)
.BuildAndStart();
server->Shutdown();
}
TEST_F(ServerBuilderTest, PassiveListenerAcceptConnectedFd) {
std::unique_ptr<experimental::PassiveListener> passive_listener;
ServerBuilder builder;
auto cq = builder.AddCompletionQueue();
// TODO(hork): why is the service necessary? Queue isn't drained otherwise.
auto server =
builder.RegisterService(&g_service)
.experimental()
.AddPassiveListener(InsecureServerCredentials(), passive_listener)
.BuildAndStart();
ASSERT_NE(server.get(), nullptr);
#ifdef GPR_SUPPORT_CHANNELS_FROM_FD
int fd = socket(AF_INET, SOCK_STREAM, 0);
auto accept_status = passive_listener->AcceptConnectedFd(fd);
ASSERT_TRUE(accept_status.ok()) << accept_status;
#else
int fd = -1;
auto accept_status = passive_listener->AcceptConnectedFd(fd);
ASSERT_FALSE(accept_status.ok()) << accept_status;
#endif
server->Shutdown();
}
TEST_F(ServerBuilderTest, PassiveListenerAcceptConnectedEndpoint) {
std::unique_ptr<experimental::PassiveListener> passive_listener;
auto server =
ServerBuilder()
.experimental()
.AddPassiveListener(InsecureServerCredentials(), passive_listener)
.BuildAndStart();
grpc_core::Notification endpoint_destroyed;
auto success = passive_listener->AcceptConnectedEndpoint(
std::make_unique<grpc_event_engine::experimental::ThreadedNoopEndpoint>(
&endpoint_destroyed));
ASSERT_TRUE(success.ok())
<< "AcceptConnectedEndpoint failure: " << success.ToString();
endpoint_destroyed.WaitForNotification();
server->Shutdown();
}
} // namespace
} // namespace grpc

@ -828,7 +828,9 @@ def _exclude_unwanted_cc_tests(tests: List[str]) -> List[str]:
test
for test in tests
if not test.startswith("test/cpp/ext/filters/census:")
and not test.startswith("test/core/xds:xds_channel_stack_modifier_test")
and not test.startswith(
"test/core/server:xds_channel_stack_modifier_test"
)
and not test.startswith("test/cpp/ext/gcp:")
and not test.startswith("test/cpp/ext/filters/logging:")
and not test.startswith("test/cpp/interop:observability_interop")

@ -77,6 +77,10 @@ IGNORED_FILES = [
"src/core/lib/gprpp/global_config_env.h",
"src/core/lib/profiling/timers.h",
"src/core/lib/gprpp/crash.h",
# The grpc_core::Server redundant namespace qualification is required for
# older gcc versions.
"src/core/ext/transport/chttp2/server/chttp2_server.h",
"src/core/server/server.h",
]
# find our home

@ -21,6 +21,13 @@ import os
import re
import sys
IGNORED_FILES = [
# note: the grpc_core::Server redundant namespace qualification is required
# for older gcc versions.
"src/core/ext/transport/chttp2/server/chttp2_server.h",
"src/core/server/server.h",
]
def find_closing_mustache(contents, initial_depth):
"""Find the closing mustache for a given number of open mustaches."""
@ -166,6 +173,8 @@ for config in _CONFIGURATION:
for file in files:
if file.endswith(".cc") or file.endswith(".h"):
path = os.path.join(root, file)
if path in IGNORED_FILES:
continue
try:
with open(path) as f:
contents = f.read()

@ -928,6 +928,7 @@ include/grpc/impl/grpc_types.h \
include/grpc/impl/propagation_bits.h \
include/grpc/impl/slice_type.h \
include/grpc/load_reporting.h \
include/grpc/passive_listener.h \
include/grpc/slice.h \
include/grpc/slice_buffer.h \
include/grpc/status.h \
@ -1040,6 +1041,7 @@ include/grpcpp/impl/server_initializer.h \
include/grpcpp/impl/service_type.h \
include/grpcpp/impl/status.h \
include/grpcpp/impl/sync.h \
include/grpcpp/passive_listener.h \
include/grpcpp/resource_quota.h \
include/grpcpp/security/audit_logging.h \
include/grpcpp/security/auth_context.h \

@ -928,6 +928,7 @@ include/grpc/impl/grpc_types.h \
include/grpc/impl/propagation_bits.h \
include/grpc/impl/slice_type.h \
include/grpc/load_reporting.h \
include/grpc/passive_listener.h \
include/grpc/slice.h \
include/grpc/slice_buffer.h \
include/grpc/status.h \
@ -1040,6 +1041,7 @@ include/grpcpp/impl/server_initializer.h \
include/grpcpp/impl/service_type.h \
include/grpcpp/impl/status.h \
include/grpcpp/impl/sync.h \
include/grpcpp/passive_listener.h \
include/grpcpp/resource_quota.h \
include/grpcpp/security/audit_logging.h \
include/grpcpp/security/auth_context.h \

@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 40.0.0
PROJECT_NUMBER = 41.0.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@ -861,6 +861,7 @@ include/grpc/impl/grpc_types.h \
include/grpc/impl/propagation_bits.h \
include/grpc/impl/slice_type.h \
include/grpc/load_reporting.h \
include/grpc/passive_listener.h \
include/grpc/slice.h \
include/grpc/slice_buffer.h \
include/grpc/status.h \

@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 40.0.0
PROJECT_NUMBER = 41.0.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@ -861,6 +861,7 @@ include/grpc/impl/grpc_types.h \
include/grpc/impl/propagation_bits.h \
include/grpc/impl/slice_type.h \
include/grpc/load_reporting.h \
include/grpc/passive_listener.h \
include/grpc/slice.h \
include/grpc/slice_buffer.h \
include/grpc/status.h \

@ -99,7 +99,7 @@ then
# cocoapods
export LANG=en_US.UTF-8
# use "sudo" to avoid permission error on kokoro monterey image
time sudo gem install cocoapods --version 1.12.0 --no-document --user-install
time sudo gem install cocoapods --version 1.15.2 --no-document --user-install
# pre-fetch cocoapods master repo's most recent commit only
mkdir -p ~/.cocoapods/repos
time git clone --depth 1 https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master

@ -11765,30 +11765,6 @@
],
"uses_polling": false
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix",
"windows"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "xds_channel_stack_modifier_test",
"platforms": [
"linux",
"mac",
"posix",
"windows"
],
"uses_polling": false
},
{
"args": [],
"benchmark": false,

Loading…
Cancel
Save