Merge branch 'master' into pem-util

pull/36357/head
Matthew Stevenson 6 months ago
commit dca4f2e6c5
  1. 151
      BUILD
  2. 215
      CMakeLists.txt
  3. 1
      MAINTAINERS.md
  4. 54
      Makefile
  5. 68
      Package.swift
  6. 36
      bazel/experiments.bzl
  7. 188
      build_autogenerated.yaml
  8. 67
      config.m4
  9. 67
      config.w32
  10. 12
      examples/cpp/otel/BUILD
  11. 9
      examples/cpp/otel/CMakeLists.txt
  12. 6
      examples/cpp/otel/greeter_callback_client.cc
  13. 6
      examples/cpp/otel/greeter_callback_server.cc
  14. 50
      examples/cpp/otel/util.cc
  15. 31
      examples/cpp/otel/util.h
  16. 29
      gRPC-C++.podspec
  17. 84
      gRPC-Core.podspec
  18. 68
      grpc.gemspec
  19. 1
      include/grpc/module.modulemap
  20. 62
      include/grpc/passive_listener.h
  21. 6
      include/grpc/support/log.h
  22. 24
      include/grpcpp/ext/otel_plugin.h
  23. 27
      include/grpcpp/passive_listener.h
  24. 1
      include/grpcpp/security/server_credentials.h
  25. 5
      include/grpcpp/security/tls_credentials_options.h
  26. 28
      include/grpcpp/server_builder.h
  27. 68
      package.xml
  28. 168
      src/core/BUILD
  29. 2
      src/core/channelz/channel_trace.cc
  30. 4
      src/core/channelz/channelz.cc
  31. 12
      src/core/channelz/channelz.h
  32. 3
      src/core/channelz/channelz_registry.cc
  33. 2
      src/core/client_channel/client_channel_filter.cc
  34. 2
      src/core/client_channel/client_channel_filter.h
  35. 2
      src/core/client_channel/config_selector.cc
  36. 2
      src/core/client_channel/config_selector.h
  37. 5
      src/core/client_channel/dynamic_filters.cc
  38. 2
      src/core/client_channel/dynamic_filters.h
  39. 2
      src/core/client_channel/retry_filter.h
  40. 2
      src/core/client_channel/retry_filter_legacy_call_data.cc
  41. 7
      src/core/client_channel/subchannel.cc
  42. 2
      src/core/client_channel/subchannel.h
  43. 2
      src/core/client_channel/subchannel_pool_interface.h
  44. 2
      src/core/client_channel/subchannel_stream_client.cc
  45. 1
      src/core/ext/filters/backend_metrics/backend_metric_filter.cc
  46. 1
      src/core/ext/filters/backend_metrics/backend_metric_filter.h
  47. 1
      src/core/ext/filters/fault_injection/fault_injection_filter.cc
  48. 1
      src/core/ext/filters/fault_injection/fault_injection_filter.h
  49. 1
      src/core/ext/filters/http/client/http_client_filter.cc
  50. 1
      src/core/ext/filters/http/client/http_client_filter.h
  51. 1
      src/core/ext/filters/http/client_authority_filter.cc
  52. 1
      src/core/ext/filters/http/client_authority_filter.h
  53. 2
      src/core/ext/filters/http/message_compress/compression_filter.cc
  54. 2
      src/core/ext/filters/http/message_compress/compression_filter.h
  55. 1
      src/core/ext/filters/http/server/http_server_filter.cc
  56. 1
      src/core/ext/filters/http/server/http_server_filter.h
  57. 1
      src/core/ext/filters/load_reporting/server_load_reporting_filter.cc
  58. 1
      src/core/ext/filters/load_reporting/server_load_reporting_filter.h
  59. 503
      src/core/ext/filters/logging/logging_filter.cc
  60. 77
      src/core/ext/filters/logging/logging_filter.h
  61. 45
      src/core/ext/filters/logging/logging_sink.h
  62. 2
      src/core/ext/filters/message_size/message_size_filter.cc
  63. 2
      src/core/ext/filters/message_size/message_size_filter.h
  64. 1
      src/core/ext/filters/rbac/rbac_filter.cc
  65. 1
      src/core/ext/filters/rbac/rbac_filter.h
  66. 1
      src/core/ext/filters/stateful_session/stateful_session_filter.cc
  67. 1
      src/core/ext/filters/stateful_session/stateful_session_filter.h
  68. 3
      src/core/ext/gcp/metadata_query.cc
  69. 3
      src/core/ext/transport/binder/client/channel_create.cc
  70. 17
      src/core/ext/transport/binder/client/endpoint_binder_pool.cc
  71. 7
      src/core/ext/transport/binder/client/jni_utils.cc
  72. 7
      src/core/ext/transport/binder/server/binder_server.cc
  73. 35
      src/core/ext/transport/binder/transport/binder_transport.cc
  74. 11
      src/core/ext/transport/binder/utils/ndk_binder.cc
  75. 19
      src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc
  76. 5
      src/core/ext/transport/binder/wire_format/binder_android.cc
  77. 21
      src/core/ext/transport/binder/wire_format/wire_reader_impl.cc
  78. 25
      src/core/ext/transport/binder/wire_format/wire_writer.cc
  79. 34
      src/core/ext/transport/chaotic_good/server/chaotic_good_server.cc
  80. 4
      src/core/ext/transport/chaotic_good/server/chaotic_good_server.h
  81. 76
      src/core/ext/transport/chaotic_good/server_transport.cc
  82. 12
      src/core/ext/transport/chaotic_good/server_transport.h
  83. 2
      src/core/ext/transport/chttp2/alpn/alpn.cc
  84. 3
      src/core/ext/transport/chttp2/client/chttp2_connector.cc
  85. 315
      src/core/ext/transport/chttp2/server/chttp2_server.cc
  86. 33
      src/core/ext/transport/chttp2/server/chttp2_server.h
  87. 21
      src/core/ext/transport/chttp2/transport/chttp2_transport.cc
  88. 2
      src/core/ext/transport/chttp2/transport/flow_control.cc
  89. 2
      src/core/ext/transport/chttp2/transport/frame_settings.cc
  90. 6
      src/core/ext/transport/chttp2/transport/hpack_parser_table.cc
  91. 2
      src/core/ext/transport/chttp2/transport/http2_settings.cc
  92. 2
      src/core/ext/transport/chttp2/transport/http2_settings.h
  93. 10
      src/core/ext/transport/chttp2/transport/parsing.cc
  94. 2
      src/core/ext/transport/chttp2/transport/writing.cc
  95. 1
      src/core/ext/transport/cronet/BUILD
  96. 51
      src/core/ext/transport/inproc/inproc_transport.cc
  97. 2
      src/core/ext/transport/inproc/inproc_transport.h
  98. 11
      src/core/ext/transport/inproc/legacy_inproc_transport.cc
  99. 2
      src/core/handshaker/http_connect/http_connect_handshaker.cc
  100. 5
      src/core/handshaker/http_connect/http_proxy_mapper.cc
  101. Some files were not shown because too many files have changed in this diff Show More

151
BUILD

@ -296,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",
@ -457,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",
@ -581,6 +583,7 @@ grpc_cc_library(
defines = ["GRPC_NO_XDS"],
external_deps = [
"absl/base:core_headers",
"absl/log:log",
],
language = "c++",
public_hdrs = GRPC_PUBLIC_HDRS,
@ -652,6 +655,7 @@ grpc_cc_library(
}),
external_deps = [
"absl/base:core_headers",
"absl/log:log",
],
language = "c++",
public_hdrs = GRPC_PUBLIC_HDRS,
@ -730,31 +734,6 @@ grpc_cc_library(
grpc_cc_library(
name = "gpr",
srcs = [
"//src/core:lib/gpr/alloc.cc",
"//src/core:lib/gpr/android/log.cc",
"//src/core:lib/gpr/iphone/cpu.cc",
"//src/core:lib/gpr/linux/cpu.cc",
"//src/core:lib/gpr/linux/log.cc",
"//src/core:lib/gpr/log.cc",
"//src/core:lib/gpr/msys/tmpfile.cc",
"//src/core:lib/gpr/posix/cpu.cc",
"//src/core:lib/gpr/posix/log.cc",
"//src/core:lib/gpr/posix/string.cc",
"//src/core:lib/gpr/posix/sync.cc",
"//src/core:lib/gpr/posix/time.cc",
"//src/core:lib/gpr/posix/tmpfile.cc",
"//src/core:lib/gpr/string.cc",
"//src/core:lib/gpr/sync.cc",
"//src/core:lib/gpr/sync_abseil.cc",
"//src/core:lib/gpr/time.cc",
"//src/core:lib/gpr/time_precise.cc",
"//src/core:lib/gpr/windows/cpu.cc",
"//src/core:lib/gpr/windows/log.cc",
"//src/core:lib/gpr/windows/string.cc",
"//src/core:lib/gpr/windows/string_util.cc",
"//src/core:lib/gpr/windows/sync.cc",
"//src/core:lib/gpr/windows/time.cc",
"//src/core:lib/gpr/windows/tmpfile.cc",
"//src/core:lib/gprpp/crash.cc",
"//src/core:lib/gprpp/fork.cc",
"//src/core:lib/gprpp/host_port.cc",
@ -764,12 +743,33 @@ grpc_cc_library(
"//src/core:lib/gprpp/time_util.cc",
"//src/core:lib/gprpp/windows/stat.cc",
"//src/core:lib/gprpp/windows/thd.cc",
"//src/core:util/alloc.cc",
"//src/core:util/android/log.cc",
"//src/core:util/iphone/cpu.cc",
"//src/core:util/linux/cpu.cc",
"//src/core:util/linux/log.cc",
"//src/core:util/log.cc",
"//src/core:util/msys/tmpfile.cc",
"//src/core:util/posix/cpu.cc",
"//src/core:util/posix/log.cc",
"//src/core:util/posix/string.cc",
"//src/core:util/posix/sync.cc",
"//src/core:util/posix/time.cc",
"//src/core:util/posix/tmpfile.cc",
"//src/core:util/string.cc",
"//src/core:util/sync.cc",
"//src/core:util/sync_abseil.cc",
"//src/core:util/time.cc",
"//src/core:util/time_precise.cc",
"//src/core:util/windows/cpu.cc",
"//src/core:util/windows/log.cc",
"//src/core:util/windows/string.cc",
"//src/core:util/windows/string_util.cc",
"//src/core:util/windows/sync.cc",
"//src/core:util/windows/time.cc",
"//src/core:util/windows/tmpfile.cc",
],
hdrs = [
"//src/core:lib/gpr/alloc.h",
"//src/core:lib/gpr/string.h",
"//src/core:lib/gpr/time_precise.h",
"//src/core:lib/gpr/tmpfile.h",
"//src/core:lib/gprpp/crash.h",
"//src/core:lib/gprpp/fork.h",
"//src/core:lib/gprpp/host_port.h",
@ -779,15 +779,19 @@ grpc_cc_library(
"//src/core:lib/gprpp/sync.h",
"//src/core:lib/gprpp/thd.h",
"//src/core:lib/gprpp/time_util.h",
"//src/core:util/alloc.h",
"//src/core:util/string.h",
"//src/core:util/time_precise.h",
"//src/core:util/tmpfile.h",
],
external_deps = [
"absl/base",
"absl/base:core_headers",
"absl/base:log_severity",
"absl/functional:any_invocable",
"absl/log",
"absl/log:check",
"absl/log:globals",
"absl/log:log",
"absl/memory",
"absl/random",
"absl/status",
@ -883,7 +887,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",
@ -904,6 +908,7 @@ grpc_cc_library(
hdrs = GRPCXX_PUBLIC_HDRS,
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/strings:cord",
"absl/synchronization",
"protobuf_headers",
@ -934,6 +939,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/strings:cord",
],
language = "c++",
@ -1003,6 +1009,7 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -1062,6 +1069,7 @@ grpc_cc_library(
],
external_deps = [
"absl/container:flat_hash_set",
"absl/log:log",
"absl/strings",
"absl/types:optional",
"absl/types:span",
@ -1134,6 +1142,7 @@ grpc_cc_library(
"absl/functional:any_invocable",
"absl/hash",
"absl/log:check",
"absl/log:log",
"absl/memory",
"absl/meta:type_traits",
"absl/status",
@ -1247,6 +1256,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/strings",
"absl/synchronization",
],
@ -1297,6 +1307,7 @@ grpc_cc_library(
"include/grpcpp/security/alts_util.h",
],
external_deps = [
"absl/log:log",
"@com_google_protobuf//upb:base",
"@com_google_protobuf//upb:mem",
"@com_google_protobuf//upb:message",
@ -1379,6 +1390,7 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/log:check",
"absl/log:log",
"absl/status:statusor",
"absl/strings",
"absl/types:optional",
@ -1438,6 +1450,7 @@ grpc_cc_library(
external_deps = [
"absl/container:inlined_vector",
"absl/log:check",
"absl/log:log",
],
language = "c++",
deps = [
@ -1489,6 +1502,9 @@ grpc_cc_library(
hdrs = [
"//src/core:lib/surface/api_trace.h",
],
external_deps = [
"absl/log:log",
],
language = "c++",
deps = [
"gpr",
@ -1643,6 +1659,7 @@ grpc_cc_library(
"absl/container:flat_hash_set",
"absl/functional:any_invocable",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -1806,6 +1823,7 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/types:optional",
@ -1895,6 +1913,7 @@ grpc_cc_library(
"absl/container:flat_hash_set",
"absl/hash",
"absl/log:check",
"absl/log:log",
"absl/random",
"absl/status",
"absl/status:statusor",
@ -1924,9 +1943,7 @@ grpc_cc_library(
"promise",
"ref_counted_ptr",
"stats",
"//src/core:1999",
"//src/core:activity",
"//src/core:arena",
"//src/core:arena_promise",
"//src/core:cancel_callback",
"//src/core:channel_args",
@ -1940,6 +1957,7 @@ grpc_cc_library(
"//src/core:error",
"//src/core:error_utils",
"//src/core:experiments",
"//src/core:interception_chain",
"//src/core:iomgr_fwd",
"//src/core:map",
"//src/core:metadata_batch",
@ -2013,6 +2031,7 @@ grpc_cc_library(
"absl/functional:any_invocable",
"absl/functional:function_ref",
"absl/log:check",
"absl/log:log",
"absl/meta:type_traits",
"absl/status",
"absl/status:statusor",
@ -2059,10 +2078,12 @@ grpc_cc_library(
"//src/core:arena_promise",
"//src/core:atomic_utils",
"//src/core:bitset",
"//src/core:call_destination",
"//src/core:call_filters",
"//src/core:call_final_info",
"//src/core:call_finalization",
"//src/core:call_spine",
"//src/core:cancel_callback",
"//src/core:channel_args",
"//src/core:channel_args_preconditioning",
"//src/core:channel_fwd",
@ -2140,6 +2161,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
],
language = "c++",
deps = [
@ -2172,6 +2194,9 @@ grpc_cc_library(
"src/cpp/server/load_reporter/load_reporting_service_server_builder_option.cc",
"src/cpp/server/load_reporter/util.cc",
],
external_deps = [
"absl/log:log",
],
language = "c++",
public_hdrs = [
"include/grpcpp/ext/server_load_reporting.h",
@ -2200,6 +2225,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/memory",
"protobuf_headers",
],
@ -2224,6 +2250,9 @@ grpc_cc_library(
hdrs = [
"src/cpp/server/load_reporter/get_cpu_stats.h",
],
external_deps = [
"absl/log:log",
],
language = "c++",
deps = [
"gpr",
@ -2242,6 +2271,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"opencensus-stats",
"opencensus-tags",
"protobuf_headers",
@ -2287,6 +2317,7 @@ grpc_cc_library(
"absl/base:core_headers",
"absl/container:inlined_vector",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -2394,6 +2425,7 @@ grpc_cc_library(
"//src/core:tsi/alts/handshaker/transport_security_common_api.h",
],
external_deps = [
"absl/log:log",
"@com_google_protobuf//upb:base",
"@com_google_protobuf//upb:mem",
],
@ -2452,6 +2484,7 @@ grpc_cc_library(
"absl/base:core_headers",
"absl/functional:any_invocable",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -2508,6 +2541,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",
@ -2535,6 +2569,7 @@ grpc_cc_library(
"absl/base:core_headers",
"absl/functional:any_invocable",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -2566,6 +2601,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",
@ -2587,6 +2623,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",
@ -2689,6 +2726,7 @@ grpc_cc_library(
],
external_deps = [
"absl/base:core_headers",
"absl/log:log",
"absl/strings",
],
language = "c++",
@ -2965,6 +3003,7 @@ grpc_cc_library(
"absl/base:core_headers",
"absl/container:inlined_vector",
"absl/log:check",
"absl/log:log",
],
language = "c++",
visibility = ["@grpc:client_channel"],
@ -2985,7 +3024,10 @@ grpc_cc_library(
name = "grpc_trace",
srcs = ["//src/core:lib/debug/trace.cc"],
hdrs = ["//src/core:lib/debug/trace.h"],
external_deps = ["absl/strings"],
external_deps = [
"absl/log:log",
"absl/strings",
],
language = "c++",
visibility = ["@grpc:trace"],
deps = [
@ -3130,6 +3172,7 @@ grpc_cc_library(
"absl/base:core_headers",
"absl/container:inlined_vector",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/strings:str_format",
],
@ -3166,6 +3209,7 @@ grpc_cc_library(
],
external_deps = [
"absl/base:core_headers",
"absl/log:log",
"absl/status",
"absl/strings",
"absl/types:optional",
@ -3212,6 +3256,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/strings:str_format",
],
visibility = [
@ -3243,6 +3288,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -3277,6 +3323,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/strings",
"absl/strings:str_format",
],
@ -3305,6 +3352,9 @@ grpc_cc_library(
hdrs = [
"//src/core:lib/iomgr/internal_errqueue.h",
],
external_deps = [
"absl/log:log",
],
tags = ["nofixdeps"],
visibility = ["@grpc:iomgr_internal_errqueue"],
deps = [
@ -3323,6 +3373,7 @@ grpc_cc_library(
"//src/core:lib/iomgr/buffer_list.h",
],
external_deps = [
"absl/log:log",
"absl/strings",
"absl/strings:str_format",
"absl/types:optional",
@ -3369,6 +3420,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -3536,6 +3588,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -3569,6 +3622,7 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/strings",
"@com_google_protobuf//upb:base",
@ -3611,6 +3665,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/strings",
],
@ -3667,6 +3722,7 @@ grpc_cc_library(
"absl/container:inlined_vector",
"absl/functional:any_invocable",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -3801,6 +3857,7 @@ grpc_cc_library(
"absl/base:core_headers",
"absl/functional:any_invocable",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -3865,6 +3922,7 @@ grpc_cc_library(
"absl/base:core_headers",
"absl/functional:bind_front",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -3919,6 +3977,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/strings",
"absl/types:optional",
@ -3963,6 +4022,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
],
language = "c++",
visibility = [
@ -3990,6 +4050,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -4050,7 +4111,10 @@ grpc_cc_library(
"//src/core:lib/security/security_connector/load_system_roots_supported.h",
"//src/core:lib/security/util/json_util.h",
],
external_deps = ["absl/strings"],
external_deps = [
"absl/log:log",
"absl/strings",
],
language = "c++",
visibility = ["@grpc:public"],
deps = [
@ -4082,6 +4146,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/strings",
"@com_google_protobuf//upb:base",
"@com_google_protobuf//upb:mem",
@ -4142,6 +4207,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/types:span",
"libcrypto",
"libssl",
@ -4173,6 +4239,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/memory",
"libssl",
],
@ -4204,6 +4271,7 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -4252,6 +4320,7 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -4337,6 +4406,7 @@ grpc_cc_library(
"absl/base:core_headers",
"absl/cleanup",
"absl/log:check",
"absl/log:log",
"absl/memory",
"absl/status",
"absl/status:statusor",
@ -4503,6 +4573,7 @@ grpc_cc_library(
external_deps = [
"absl/functional:function_ref",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/strings",
],
@ -4559,6 +4630,7 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/log:check",
"absl/log:log",
"absl/random:bit_gen_ref",
"absl/status",
"absl/strings",
@ -4601,6 +4673,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/strings",
],
deps = [
@ -4714,6 +4787,7 @@ grpc_cc_library(
"absl/container:flat_hash_map",
"absl/hash",
"absl/log:check",
"absl/log:log",
"absl/meta:type_traits",
"absl/random",
"absl/random:bit_gen_ref",
@ -4832,14 +4906,15 @@ grpc_cc_library(
grpc_cc_library(
name = "subprocess",
srcs = [
"//src/core:lib/gpr/subprocess_posix.cc",
"//src/core:lib/gpr/subprocess_windows.cc",
"//src/core:util/subprocess_posix.cc",
"//src/core:util/subprocess_windows.cc",
],
hdrs = [
"//src/core:lib/gpr/subprocess.h",
"//src/core:util/subprocess.h",
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/strings",
"absl/types:span",
],

215
CMakeLists.txt generated

@ -1052,6 +1052,7 @@ if(gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx dualstack_socket_test)
endif()
add_dependencies(buildtests_cxx dump_args_test)
add_dependencies(buildtests_cxx duplicate_header_bad_client_test)
add_dependencies(buildtests_cxx empty_batch_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
@ -1457,7 +1458,6 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_cxx test_core_event_engine_posix_timer_heap_test)
add_dependencies(buildtests_cxx test_core_event_engine_posix_timer_list_test)
add_dependencies(buildtests_cxx test_core_event_engine_slice_buffer_test)
add_dependencies(buildtests_cxx test_core_gpr_time_test)
add_dependencies(buildtests_cxx test_core_gprpp_time_test)
add_dependencies(buildtests_cxx test_core_iomgr_timer_heap_test)
add_dependencies(buildtests_cxx test_core_security_credentials_test)
@ -1467,6 +1467,7 @@ if(gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx test_core_transport_test_suite_chaotic_good_test)
endif()
add_dependencies(buildtests_cxx test_core_util_time_test)
add_dependencies(buildtests_cxx test_cpp_client_credentials_test)
add_dependencies(buildtests_cxx test_cpp_end2end_ssl_credentials_test)
add_dependencies(buildtests_cxx test_cpp_ext_chaotic_good_test)
@ -1660,32 +1661,6 @@ add_library(gpr
src/core/lib/config/config_vars_non_generated.cc
src/core/lib/config/load_config.cc
src/core/lib/event_engine/thread_local.cc
src/core/lib/gpr/alloc.cc
src/core/lib/gpr/android/log.cc
src/core/lib/gpr/atm.cc
src/core/lib/gpr/iphone/cpu.cc
src/core/lib/gpr/linux/cpu.cc
src/core/lib/gpr/linux/log.cc
src/core/lib/gpr/log.cc
src/core/lib/gpr/msys/tmpfile.cc
src/core/lib/gpr/posix/cpu.cc
src/core/lib/gpr/posix/log.cc
src/core/lib/gpr/posix/string.cc
src/core/lib/gpr/posix/sync.cc
src/core/lib/gpr/posix/time.cc
src/core/lib/gpr/posix/tmpfile.cc
src/core/lib/gpr/string.cc
src/core/lib/gpr/sync.cc
src/core/lib/gpr/sync_abseil.cc
src/core/lib/gpr/time.cc
src/core/lib/gpr/time_precise.cc
src/core/lib/gpr/windows/cpu.cc
src/core/lib/gpr/windows/log.cc
src/core/lib/gpr/windows/string.cc
src/core/lib/gpr/windows/string_util.cc
src/core/lib/gpr/windows/sync.cc
src/core/lib/gpr/windows/time.cc
src/core/lib/gpr/windows/tmpfile.cc
src/core/lib/gprpp/crash.cc
src/core/lib/gprpp/examine_stack.cc
src/core/lib/gprpp/fork.cc
@ -1701,6 +1676,32 @@ add_library(gpr
src/core/lib/gprpp/windows/env.cc
src/core/lib/gprpp/windows/stat.cc
src/core/lib/gprpp/windows/thd.cc
src/core/util/alloc.cc
src/core/util/android/log.cc
src/core/util/atm.cc
src/core/util/iphone/cpu.cc
src/core/util/linux/cpu.cc
src/core/util/linux/log.cc
src/core/util/log.cc
src/core/util/msys/tmpfile.cc
src/core/util/posix/cpu.cc
src/core/util/posix/log.cc
src/core/util/posix/string.cc
src/core/util/posix/sync.cc
src/core/util/posix/time.cc
src/core/util/posix/tmpfile.cc
src/core/util/string.cc
src/core/util/sync.cc
src/core/util/sync_abseil.cc
src/core/util/time.cc
src/core/util/time_precise.cc
src/core/util/windows/cpu.cc
src/core/util/windows/log.cc
src/core/util/windows/string.cc
src/core/util/windows/string_util.cc
src/core/util/windows/sync.cc
src/core/util/windows/time.cc
src/core/util/windows/tmpfile.cc
)
target_compile_features(gpr PUBLIC cxx_std_14)
@ -2501,6 +2502,7 @@ add_library(grpc
src/core/lib/transport/call_spine.cc
src/core/lib/transport/connectivity_state.cc
src/core/lib/transport/error_utils.cc
src/core/lib/transport/interception_chain.cc
src/core/lib/transport/message.cc
src/core/lib/transport/metadata.cc
src/core/lib/transport/metadata_batch.cc
@ -2746,6 +2748,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
@ -3253,6 +3256,7 @@ add_library(grpc_unsecure
src/core/lib/transport/call_spine.cc
src/core/lib/transport/connectivity_state.cc
src/core/lib/transport/error_utils.cc
src/core/lib/transport/interception_chain.cc
src/core/lib/transport/message.cc
src/core/lib/transport/metadata.cc
src/core/lib/transport/metadata_batch.cc
@ -3446,6 +3450,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 +4319,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
@ -4731,8 +4737,8 @@ endif()
if(gRPC_BUILD_TESTS)
add_library(grpc++_test_util
src/core/lib/gpr/subprocess_posix.cc
src/core/lib/gpr/subprocess_windows.cc
src/core/util/subprocess_posix.cc
src/core/util/subprocess_windows.cc
test/core/end2end/data/client_certs.cc
test/core/end2end/data/server1_cert.cc
test/core/end2end/data/server1_key.cc
@ -5054,6 +5060,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
@ -5361,6 +5368,7 @@ add_library(grpc_authorization_provider
src/core/lib/transport/call_spine.cc
src/core/lib/transport/connectivity_state.cc
src/core/lib/transport/error_utils.cc
src/core/lib/transport/interception_chain.cc
src/core/lib/transport/message.cc
src/core/lib/transport/metadata.cc
src/core/lib/transport/metadata_batch.cc
@ -5504,6 +5512,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
@ -6080,8 +6089,8 @@ if(gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_executable(address_sorting_test_unsecure
src/core/lib/gpr/subprocess_posix.cc
src/core/lib/gpr/subprocess_windows.cc
src/core/util/subprocess_posix.cc
src/core/util/subprocess_windows.cc
test/core/test_util/cmdline.cc
test/core/test_util/fuzzer_util.cc
test/core/test_util/grpc_profiler.cc
@ -6304,7 +6313,7 @@ endif()
if(gRPC_BUILD_TESTS)
add_executable(alloc_test
test/core/gpr/alloc_test.cc
test/core/util/alloc_test.cc
)
if(WIN32 AND MSVC)
if(BUILD_SHARED_LIBS)
@ -7615,8 +7624,8 @@ if(gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_executable(bad_ssl_alpn_test
src/core/lib/gpr/subprocess_posix.cc
src/core/lib/gpr/subprocess_windows.cc
src/core/util/subprocess_posix.cc
src/core/util/subprocess_windows.cc
test/core/bad_ssl/bad_ssl_test.cc
test/core/end2end/cq_verifier.cc
test/core/test_util/cmdline.cc
@ -7671,8 +7680,8 @@ if(gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_executable(bad_ssl_cert_test
src/core/lib/gpr/subprocess_posix.cc
src/core/lib/gpr/subprocess_windows.cc
src/core/util/subprocess_posix.cc
src/core/util/subprocess_windows.cc
test/core/bad_ssl/bad_ssl_test.cc
test/core/end2end/cq_verifier.cc
test/core/test_util/cmdline.cc
@ -11713,7 +11722,7 @@ endif()
if(gRPC_BUILD_TESTS)
add_executable(cpu_test
test/core/gpr/cpu_test.cc
test/core/util/cpu_test.cc
)
if(WIN32 AND MSVC)
if(BUILD_SHARED_LIBS)
@ -12385,6 +12394,41 @@ endif()
endif()
if(gRPC_BUILD_TESTS)
add_executable(dump_args_test
src/core/lib/gprpp/dump_args.cc
test/core/gprpp/dump_args_test.cc
)
target_compile_features(dump_args_test PUBLIC cxx_std_14)
target_include_directories(dump_args_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(dump_args_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::any_invocable
absl::check
)
endif()
if(gRPC_BUILD_TESTS)
add_executable(duplicate_header_bad_client_test
test/core/bad_client/bad_client.cc
test/core/bad_client/tests/duplicate_header.cc
@ -12874,7 +12918,7 @@ endif()
if(gRPC_BUILD_TESTS)
add_executable(env_test
test/core/gpr/env_test.cc
test/core/util/env_test.cc
)
if(WIN32 AND MSVC)
if(BUILD_SHARED_LIBS)
@ -19074,7 +19118,7 @@ endif()
if(gRPC_BUILD_TESTS)
add_executable(log_test
test/core/gpr/log_test.cc
test/core/util/log_test.cc
)
if(WIN32 AND MSVC)
if(BUILD_SHARED_LIBS)
@ -26833,6 +26877,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
@ -28495,7 +28540,7 @@ endif()
if(gRPC_BUILD_TESTS)
add_executable(spinlock_test
test/core/gpr/spinlock_test.cc
test/core/util/spinlock_test.cc
)
if(WIN32 AND MSVC)
if(BUILD_SHARED_LIBS)
@ -29241,7 +29286,7 @@ endif()
if(gRPC_BUILD_TESTS)
add_executable(string_test
test/core/gpr/string_test.cc
test/core/util/string_test.cc
)
if(WIN32 AND MSVC)
if(BUILD_SHARED_LIBS)
@ -29326,7 +29371,7 @@ endif()
if(gRPC_BUILD_TESTS)
add_executable(sync_test
test/core/gpr/sync_test.cc
test/core/util/sync_test.cc
)
if(WIN32 AND MSVC)
if(BUILD_SHARED_LIBS)
@ -29953,48 +29998,6 @@ target_link_libraries(test_core_event_engine_slice_buffer_test
)
endif()
if(gRPC_BUILD_TESTS)
add_executable(test_core_gpr_time_test
test/core/gpr/time_test.cc
)
if(WIN32 AND MSVC)
if(BUILD_SHARED_LIBS)
target_compile_definitions(test_core_gpr_time_test
PRIVATE
"GPR_DLL_IMPORTS"
"GRPC_DLL_IMPORTS"
)
endif()
endif()
target_compile_features(test_core_gpr_time_test PUBLIC cxx_std_14)
target_include_directories(test_core_gpr_time_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(test_core_gpr_time_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
grpc_test_util
)
endif()
if(gRPC_BUILD_TESTS)
@ -30342,6 +30345,48 @@ endif()
endif()
if(gRPC_BUILD_TESTS)
add_executable(test_core_util_time_test
test/core/util/time_test.cc
)
if(WIN32 AND MSVC)
if(BUILD_SHARED_LIBS)
target_compile_definitions(test_core_util_time_test
PRIVATE
"GPR_DLL_IMPORTS"
"GRPC_DLL_IMPORTS"
)
endif()
endif()
target_compile_features(test_core_util_time_test PUBLIC cxx_std_14)
target_include_directories(test_core_util_time_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(test_core_util_time_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
grpc_test_util
)
endif()
if(gRPC_BUILD_TESTS)
add_executable(test_cpp_client_credentials_test
test/cpp/client/credentials_test.cc
test/cpp/util/tls_test_utils.cc
@ -32019,7 +32064,7 @@ endif()
if(gRPC_BUILD_TESTS)
add_executable(useful_test
test/core/gpr/useful_test.cc
test/core/util/useful_test.cc
)
target_compile_features(useful_test PUBLIC cxx_std_14)
target_include_directories(useful_test

@ -40,6 +40,7 @@ for general contribution guidelines.
- [vishalpowar](https://github.com/vishalpowar), Google LLC
- [wenbozhu](https://github.com/wenbozhu), Google LLC
- [yashykt](https://github.com/yashykt), Google LLC
- [yijiem](https://github.com/yijiem), Google LLC
- [ZhouyihaiDing](https://github.com/ZhouyihaiDing), Google LLC
<!-- go/keep-sorted end -->

54
Makefile generated

@ -1141,32 +1141,6 @@ LIBGRPC_SRC = \
src/core/lib/event_engine/work_queue/basic_work_queue.cc \
src/core/lib/experiments/config.cc \
src/core/lib/experiments/experiments.cc \
src/core/lib/gpr/alloc.cc \
src/core/lib/gpr/android/log.cc \
src/core/lib/gpr/atm.cc \
src/core/lib/gpr/iphone/cpu.cc \
src/core/lib/gpr/linux/cpu.cc \
src/core/lib/gpr/linux/log.cc \
src/core/lib/gpr/log.cc \
src/core/lib/gpr/msys/tmpfile.cc \
src/core/lib/gpr/posix/cpu.cc \
src/core/lib/gpr/posix/log.cc \
src/core/lib/gpr/posix/string.cc \
src/core/lib/gpr/posix/sync.cc \
src/core/lib/gpr/posix/time.cc \
src/core/lib/gpr/posix/tmpfile.cc \
src/core/lib/gpr/string.cc \
src/core/lib/gpr/sync.cc \
src/core/lib/gpr/sync_abseil.cc \
src/core/lib/gpr/time.cc \
src/core/lib/gpr/time_precise.cc \
src/core/lib/gpr/windows/cpu.cc \
src/core/lib/gpr/windows/log.cc \
src/core/lib/gpr/windows/string.cc \
src/core/lib/gpr/windows/string_util.cc \
src/core/lib/gpr/windows/sync.cc \
src/core/lib/gpr/windows/time.cc \
src/core/lib/gpr/windows/tmpfile.cc \
src/core/lib/gprpp/crash.cc \
src/core/lib/gprpp/examine_stack.cc \
src/core/lib/gprpp/fork.cc \
@ -1387,6 +1361,7 @@ LIBGRPC_SRC = \
src/core/lib/transport/call_spine.cc \
src/core/lib/transport/connectivity_state.cc \
src/core/lib/transport/error_utils.cc \
src/core/lib/transport/interception_chain.cc \
src/core/lib/transport/message.cc \
src/core/lib/transport/metadata.cc \
src/core/lib/transport/metadata_batch.cc \
@ -1484,6 +1459,32 @@ LIBGRPC_SRC = \
src/core/tsi/ssl_transport_security_utils.cc \
src/core/tsi/transport_security.cc \
src/core/tsi/transport_security_grpc.cc \
src/core/util/alloc.cc \
src/core/util/android/log.cc \
src/core/util/atm.cc \
src/core/util/iphone/cpu.cc \
src/core/util/linux/cpu.cc \
src/core/util/linux/log.cc \
src/core/util/log.cc \
src/core/util/msys/tmpfile.cc \
src/core/util/posix/cpu.cc \
src/core/util/posix/log.cc \
src/core/util/posix/string.cc \
src/core/util/posix/sync.cc \
src/core/util/posix/time.cc \
src/core/util/posix/tmpfile.cc \
src/core/util/string.cc \
src/core/util/sync.cc \
src/core/util/sync_abseil.cc \
src/core/util/time.cc \
src/core/util/time_precise.cc \
src/core/util/windows/cpu.cc \
src/core/util/windows/log.cc \
src/core/util/windows/string.cc \
src/core/util/windows/string_util.cc \
src/core/util/windows/sync.cc \
src/core/util/windows/time.cc \
src/core/util/windows/tmpfile.cc \
src/core/xds/grpc/certificate_provider_store.cc \
src/core/xds/grpc/file_watcher_certificate_provider_factory.cc \
src/core/xds/grpc/xds_audit_logger_registry.cc \
@ -1775,6 +1776,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 \

68
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",
@ -1254,38 +1255,6 @@ let package = Package(
"src/core/lib/experiments/config.h",
"src/core/lib/experiments/experiments.cc",
"src/core/lib/experiments/experiments.h",
"src/core/lib/gpr/alloc.cc",
"src/core/lib/gpr/alloc.h",
"src/core/lib/gpr/android/log.cc",
"src/core/lib/gpr/atm.cc",
"src/core/lib/gpr/iphone/cpu.cc",
"src/core/lib/gpr/linux/cpu.cc",
"src/core/lib/gpr/linux/log.cc",
"src/core/lib/gpr/log.cc",
"src/core/lib/gpr/msys/tmpfile.cc",
"src/core/lib/gpr/posix/cpu.cc",
"src/core/lib/gpr/posix/log.cc",
"src/core/lib/gpr/posix/string.cc",
"src/core/lib/gpr/posix/sync.cc",
"src/core/lib/gpr/posix/time.cc",
"src/core/lib/gpr/posix/tmpfile.cc",
"src/core/lib/gpr/spinlock.h",
"src/core/lib/gpr/string.cc",
"src/core/lib/gpr/string.h",
"src/core/lib/gpr/sync.cc",
"src/core/lib/gpr/sync_abseil.cc",
"src/core/lib/gpr/time.cc",
"src/core/lib/gpr/time_precise.cc",
"src/core/lib/gpr/time_precise.h",
"src/core/lib/gpr/tmpfile.h",
"src/core/lib/gpr/useful.h",
"src/core/lib/gpr/windows/cpu.cc",
"src/core/lib/gpr/windows/log.cc",
"src/core/lib/gpr/windows/string.cc",
"src/core/lib/gpr/windows/string_util.cc",
"src/core/lib/gpr/windows/sync.cc",
"src/core/lib/gpr/windows/time.cc",
"src/core/lib/gpr/windows/tmpfile.cc",
"src/core/lib/gprpp/atomic_utils.h",
"src/core/lib/gprpp/bitset.h",
"src/core/lib/gprpp/chunked_vector.h",
@ -1748,6 +1717,7 @@ let package = Package(
"src/core/lib/transport/bdp_estimator.h",
"src/core/lib/transport/call_arena_allocator.cc",
"src/core/lib/transport/call_arena_allocator.h",
"src/core/lib/transport/call_destination.h",
"src/core/lib/transport/call_filters.cc",
"src/core/lib/transport/call_filters.h",
"src/core/lib/transport/call_final_info.cc",
@ -1760,6 +1730,8 @@ let package = Package(
"src/core/lib/transport/error_utils.cc",
"src/core/lib/transport/error_utils.h",
"src/core/lib/transport/http2_errors.h",
"src/core/lib/transport/interception_chain.cc",
"src/core/lib/transport/interception_chain.h",
"src/core/lib/transport/message.cc",
"src/core/lib/transport/message.h",
"src/core/lib/transport/metadata.cc",
@ -1952,6 +1924,38 @@ let package = Package(
"src/core/tsi/transport_security_grpc.cc",
"src/core/tsi/transport_security_grpc.h",
"src/core/tsi/transport_security_interface.h",
"src/core/util/alloc.cc",
"src/core/util/alloc.h",
"src/core/util/android/log.cc",
"src/core/util/atm.cc",
"src/core/util/iphone/cpu.cc",
"src/core/util/linux/cpu.cc",
"src/core/util/linux/log.cc",
"src/core/util/log.cc",
"src/core/util/msys/tmpfile.cc",
"src/core/util/posix/cpu.cc",
"src/core/util/posix/log.cc",
"src/core/util/posix/string.cc",
"src/core/util/posix/sync.cc",
"src/core/util/posix/time.cc",
"src/core/util/posix/tmpfile.cc",
"src/core/util/spinlock.h",
"src/core/util/string.cc",
"src/core/util/string.h",
"src/core/util/sync.cc",
"src/core/util/sync_abseil.cc",
"src/core/util/time.cc",
"src/core/util/time_precise.cc",
"src/core/util/time_precise.h",
"src/core/util/tmpfile.h",
"src/core/util/useful.h",
"src/core/util/windows/cpu.cc",
"src/core/util/windows/log.cc",
"src/core/util/windows/string.cc",
"src/core/util/windows/string_util.cc",
"src/core/util/windows/sync.cc",
"src/core/util/windows/time.cc",
"src/core/util/windows/tmpfile.cc",
"src/core/xds/grpc/certificate_provider_store.cc",
"src/core/xds/grpc/certificate_provider_store.h",
"src/core/xds/grpc/file_watcher_certificate_provider_factory.cc",

@ -31,12 +31,10 @@ EXPERIMENT_ENABLES = {
"monitoring_experiment": "monitoring_experiment",
"multiping": "multiping",
"peer_state_based_framing": "peer_state_based_framing",
"pending_queue_cap": "pending_queue_cap",
"pick_first_new": "pick_first_new",
"promise_based_client_call": "event_engine_client,event_engine_listener,promise_based_client_call",
"promise_based_server_call": "promise_based_server_call",
"chaotic_good": "chaotic_good,event_engine_client,event_engine_listener,promise_based_client_call,promise_based_server_call",
"promise_based_inproc_transport": "event_engine_client,event_engine_listener,promise_based_client_call,promise_based_inproc_transport,promise_based_server_call",
"chaotic_good": "chaotic_good,event_engine_client,event_engine_listener,promise_based_client_call",
"promise_based_inproc_transport": "event_engine_client,event_engine_listener,promise_based_client_call,promise_based_inproc_transport",
"rstpit": "rstpit",
"schedule_cancellation_over_write": "schedule_cancellation_over_write",
"server_privacy": "server_privacy",
@ -59,17 +57,10 @@ EXPERIMENTS = {
"dbg": {
},
"off": {
"core_end2end_test": [
"event_engine_client",
"promise_based_server_call",
],
"endpoint_test": [
"tcp_frame_size_tuning",
"tcp_rcv_lowat",
],
"event_engine_client_test": [
"event_engine_client",
],
"flow_control_test": [
"multiping",
"peer_state_based_framing",
@ -77,27 +68,34 @@ EXPERIMENTS = {
"tcp_frame_size_tuning",
"tcp_rcv_lowat",
],
"logging_test": [
"promise_based_server_call",
],
"resource_quota_test": [
"free_large_allocator",
"unconstrained_max_quota_buffer_size",
],
},
"on": {
"cancel_ares_query_test": [
"event_engine_dns",
],
"core_end2end_test": [
"event_engine_client",
"event_engine_listener",
],
"cpp_lb_end2end_test": [
"pick_first_new",
],
"event_engine_client_test": [
"event_engine_client",
],
"event_engine_listener_test": [
"event_engine_listener",
],
"lb_unit_test": [
"pick_first_new",
],
"resolver_component_tests_runner_invoker": [
"event_engine_dns",
],
"xds_end2end_test": [
"pick_first_new",
],
@ -107,9 +105,6 @@ EXPERIMENTS = {
"dbg": {
},
"off": {
"core_end2end_test": [
"promise_based_server_call",
],
"endpoint_test": [
"tcp_frame_size_tuning",
"tcp_rcv_lowat",
@ -121,9 +116,6 @@ EXPERIMENTS = {
"tcp_frame_size_tuning",
"tcp_rcv_lowat",
],
"logging_test": [
"promise_based_server_call",
],
"resource_quota_test": [
"free_large_allocator",
"unconstrained_max_quota_buffer_size",
@ -149,7 +141,6 @@ EXPERIMENTS = {
"chaotic_good",
"event_engine_client",
"promise_based_client_call",
"promise_based_server_call",
],
"endpoint_test": [
"tcp_frame_size_tuning",
@ -168,9 +159,6 @@ EXPERIMENTS = {
"lame_client_test": [
"promise_based_client_call",
],
"logging_test": [
"promise_based_server_call",
],
"resource_quota_test": [
"free_large_allocator",
"unconstrained_max_quota_buffer_size",

@ -55,11 +55,6 @@ libs:
- src/core/lib/config/config_vars.h
- src/core/lib/config/load_config.h
- src/core/lib/event_engine/thread_local.h
- src/core/lib/gpr/alloc.h
- src/core/lib/gpr/string.h
- src/core/lib/gpr/time_precise.h
- src/core/lib/gpr/tmpfile.h
- src/core/lib/gpr/useful.h
- src/core/lib/gprpp/construct_destruct.h
- src/core/lib/gprpp/crash.h
- src/core/lib/gprpp/debug_location.h
@ -76,37 +71,16 @@ libs:
- src/core/lib/gprpp/tchar.h
- src/core/lib/gprpp/thd.h
- src/core/lib/gprpp/time_util.h
- src/core/util/alloc.h
- src/core/util/string.h
- src/core/util/time_precise.h
- src/core/util/tmpfile.h
- src/core/util/useful.h
src:
- src/core/lib/config/config_vars.cc
- src/core/lib/config/config_vars_non_generated.cc
- src/core/lib/config/load_config.cc
- src/core/lib/event_engine/thread_local.cc
- src/core/lib/gpr/alloc.cc
- src/core/lib/gpr/android/log.cc
- src/core/lib/gpr/atm.cc
- src/core/lib/gpr/iphone/cpu.cc
- src/core/lib/gpr/linux/cpu.cc
- src/core/lib/gpr/linux/log.cc
- src/core/lib/gpr/log.cc
- src/core/lib/gpr/msys/tmpfile.cc
- src/core/lib/gpr/posix/cpu.cc
- src/core/lib/gpr/posix/log.cc
- src/core/lib/gpr/posix/string.cc
- src/core/lib/gpr/posix/sync.cc
- src/core/lib/gpr/posix/time.cc
- src/core/lib/gpr/posix/tmpfile.cc
- src/core/lib/gpr/string.cc
- src/core/lib/gpr/sync.cc
- src/core/lib/gpr/sync_abseil.cc
- src/core/lib/gpr/time.cc
- src/core/lib/gpr/time_precise.cc
- src/core/lib/gpr/windows/cpu.cc
- src/core/lib/gpr/windows/log.cc
- src/core/lib/gpr/windows/string.cc
- src/core/lib/gpr/windows/string_util.cc
- src/core/lib/gpr/windows/sync.cc
- src/core/lib/gpr/windows/time.cc
- src/core/lib/gpr/windows/tmpfile.cc
- src/core/lib/gprpp/crash.cc
- src/core/lib/gprpp/examine_stack.cc
- src/core/lib/gprpp/fork.cc
@ -122,6 +96,32 @@ libs:
- src/core/lib/gprpp/windows/env.cc
- src/core/lib/gprpp/windows/stat.cc
- src/core/lib/gprpp/windows/thd.cc
- src/core/util/alloc.cc
- src/core/util/android/log.cc
- src/core/util/atm.cc
- src/core/util/iphone/cpu.cc
- src/core/util/linux/cpu.cc
- src/core/util/linux/log.cc
- src/core/util/log.cc
- src/core/util/msys/tmpfile.cc
- src/core/util/posix/cpu.cc
- src/core/util/posix/log.cc
- src/core/util/posix/string.cc
- src/core/util/posix/sync.cc
- src/core/util/posix/time.cc
- src/core/util/posix/tmpfile.cc
- src/core/util/string.cc
- src/core/util/sync.cc
- src/core/util/sync_abseil.cc
- src/core/util/time.cc
- src/core/util/time_precise.cc
- src/core/util/windows/cpu.cc
- src/core/util/windows/log.cc
- src/core/util/windows/string.cc
- src/core/util/windows/string_util.cc
- src/core/util/windows/sync.cc
- src/core/util/windows/time.cc
- src/core/util/windows/tmpfile.cc
deps:
- absl/base:base
- absl/base:core_headers
@ -198,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
@ -881,7 +882,6 @@ libs:
- src/core/lib/event_engine/work_queue/work_queue.h
- src/core/lib/experiments/config.h
- src/core/lib/experiments/experiments.h
- src/core/lib/gpr/spinlock.h
- src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/chunked_vector.h
@ -1109,6 +1109,7 @@ libs:
- src/core/lib/transport/batch_builder.h
- src/core/lib/transport/bdp_estimator.h
- src/core/lib/transport/call_arena_allocator.h
- src/core/lib/transport/call_destination.h
- src/core/lib/transport/call_filters.h
- src/core/lib/transport/call_final_info.h
- src/core/lib/transport/call_spine.h
@ -1116,6 +1117,7 @@ libs:
- src/core/lib/transport/custom_metadata.h
- src/core/lib/transport/error_utils.h
- src/core/lib/transport/http2_errors.h
- src/core/lib/transport/interception_chain.h
- src/core/lib/transport/message.h
- src/core/lib/transport/metadata.h
- src/core/lib/transport/metadata_batch.h
@ -1211,6 +1213,7 @@ libs:
- src/core/tsi/transport_security.h
- src/core/tsi/transport_security_grpc.h
- src/core/tsi/transport_security_interface.h
- src/core/util/spinlock.h
- src/core/xds/grpc/certificate_provider_store.h
- src/core/xds/grpc/file_watcher_certificate_provider_factory.h
- src/core/xds/grpc/upb_utils.h
@ -1920,6 +1923,7 @@ libs:
- src/core/lib/transport/call_spine.cc
- src/core/lib/transport/connectivity_state.cc
- src/core/lib/transport/error_utils.cc
- src/core/lib/transport/interception_chain.cc
- src/core/lib/transport/message.cc
- src/core/lib/transport/metadata.cc
- src/core/lib/transport/metadata_batch.cc
@ -2182,6 +2186,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
@ -2415,7 +2420,6 @@ libs:
- src/core/lib/event_engine/work_queue/work_queue.h
- src/core/lib/experiments/config.h
- src/core/lib/experiments/experiments.h
- src/core/lib/gpr/spinlock.h
- src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/chunked_vector.h
@ -2607,6 +2611,7 @@ libs:
- src/core/lib/transport/batch_builder.h
- src/core/lib/transport/bdp_estimator.h
- src/core/lib/transport/call_arena_allocator.h
- src/core/lib/transport/call_destination.h
- src/core/lib/transport/call_filters.h
- src/core/lib/transport/call_final_info.h
- src/core/lib/transport/call_spine.h
@ -2614,6 +2619,7 @@ libs:
- src/core/lib/transport/custom_metadata.h
- src/core/lib/transport/error_utils.h
- src/core/lib/transport/http2_errors.h
- src/core/lib/transport/interception_chain.h
- src/core/lib/transport/message.h
- src/core/lib/transport/metadata.h
- src/core/lib/transport/metadata_batch.h
@ -2677,6 +2683,7 @@ libs:
- src/core/tsi/transport_security.h
- src/core/tsi/transport_security_grpc.h
- src/core/tsi/transport_security_interface.h
- src/core/util/spinlock.h
- third_party/upb/upb/generated_code_support.h
- third_party/upb/upb/mini_descriptor/build_enum.h
- third_party/upb/upb/mini_descriptor/decode.h
@ -3030,6 +3037,7 @@ libs:
- src/core/lib/transport/call_spine.cc
- src/core/lib/transport/connectivity_state.cc
- src/core/lib/transport/error_utils.cc
- src/core/lib/transport/interception_chain.cc
- src/core/lib/transport/message.cc
- src/core/lib/transport/metadata.cc
- src/core/lib/transport/metadata_batch.cc
@ -3786,6 +3794,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
@ -4006,7 +4015,7 @@ libs:
language: c++
public_headers: []
headers:
- src/core/lib/gpr/subprocess.h
- src/core/util/subprocess.h
- test/core/end2end/data/ssl_test_data.h
- test/core/test_util/cmdline.h
- test/core/test_util/evaluate_args_test_util.h
@ -4025,8 +4034,8 @@ libs:
- test/cpp/util/subprocess.h
- test/cpp/util/test_credentials_provider.h
src:
- src/core/lib/gpr/subprocess_posix.cc
- src/core/lib/gpr/subprocess_windows.cc
- src/core/util/subprocess_posix.cc
- src/core/util/subprocess_windows.cc
- test/core/end2end/data/client_certs.cc
- test/core/end2end/data/server1_cert.cc
- test/core/end2end/data/server1_key.cc
@ -4213,6 +4222,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
@ -4361,6 +4371,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
@ -4499,7 +4510,6 @@ libs:
- src/core/lib/event_engine/work_queue/work_queue.h
- src/core/lib/experiments/config.h
- src/core/lib/experiments/experiments.h
- src/core/lib/gpr/spinlock.h
- src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/chunked_vector.h
@ -4600,6 +4610,7 @@ libs:
- src/core/lib/promise/activity.h
- src/core/lib/promise/all_ok.h
- src/core/lib/promise/arena_promise.h
- src/core/lib/promise/cancel_callback.h
- src/core/lib/promise/context.h
- src/core/lib/promise/detail/basic_seq.h
- src/core/lib/promise/detail/join_state.h
@ -4681,6 +4692,7 @@ libs:
- src/core/lib/surface/wait_for_cq_end_op.h
- src/core/lib/transport/batch_builder.h
- src/core/lib/transport/call_arena_allocator.h
- src/core/lib/transport/call_destination.h
- src/core/lib/transport/call_filters.h
- src/core/lib/transport/call_final_info.h
- src/core/lib/transport/call_spine.h
@ -4688,6 +4700,7 @@ libs:
- src/core/lib/transport/custom_metadata.h
- src/core/lib/transport/error_utils.h
- src/core/lib/transport/http2_errors.h
- src/core/lib/transport/interception_chain.h
- src/core/lib/transport/message.h
- src/core/lib/transport/metadata.h
- src/core/lib/transport/metadata_batch.h
@ -4717,6 +4730,7 @@ libs:
- src/core/tsi/transport_security.h
- src/core/tsi/transport_security_grpc.h
- src/core/tsi/transport_security_interface.h
- src/core/util/spinlock.h
- third_party/upb/upb/generated_code_support.h
- third_party/upb/upb/mini_descriptor/build_enum.h
- third_party/upb/upb/mini_descriptor/decode.h
@ -4984,6 +4998,7 @@ libs:
- src/core/lib/transport/call_spine.cc
- src/core/lib/transport/connectivity_state.cc
- src/core/lib/transport/error_utils.cc
- src/core/lib/transport/interception_chain.cc
- src/core/lib/transport/message.cc
- src/core/lib/transport/metadata.cc
- src/core/lib/transport/metadata_batch.cc
@ -5267,7 +5282,7 @@ targets:
build: test
language: c++
headers:
- src/core/lib/gpr/subprocess.h
- src/core/util/subprocess.h
- test/core/test_util/cmdline.h
- test/core/test_util/evaluate_args_test_util.h
- test/core/test_util/fuzzer_util.h
@ -5283,8 +5298,8 @@ targets:
- test/cpp/util/string_ref_helper.h
- test/cpp/util/subprocess.h
src:
- src/core/lib/gpr/subprocess_posix.cc
- src/core/lib/gpr/subprocess_windows.cc
- src/core/util/subprocess_posix.cc
- src/core/util/subprocess_windows.cc
- test/core/test_util/cmdline.cc
- test/core/test_util/fuzzer_util.cc
- test/core/test_util/grpc_profiler.cc
@ -5392,7 +5407,7 @@ targets:
language: c++
headers: []
src:
- test/core/gpr/alloc_test.cc
- test/core/util/alloc_test.cc
deps:
- gtest
- grpc_test_util
@ -5870,7 +5885,7 @@ targets:
build: test
language: c++
headers:
- src/core/lib/gpr/subprocess.h
- src/core/util/subprocess.h
- test/core/end2end/cq_verifier.h
- test/core/test_util/cmdline.h
- test/core/test_util/evaluate_args_test_util.h
@ -5883,8 +5898,8 @@ targets:
- test/core/test_util/slice_splitter.h
- test/core/test_util/tracer_util.h
src:
- src/core/lib/gpr/subprocess_posix.cc
- src/core/lib/gpr/subprocess_windows.cc
- src/core/util/subprocess_posix.cc
- src/core/util/subprocess_windows.cc
- test/core/bad_ssl/bad_ssl_test.cc
- test/core/end2end/cq_verifier.cc
- test/core/test_util/cmdline.cc
@ -5908,7 +5923,7 @@ targets:
build: test
language: c++
headers:
- src/core/lib/gpr/subprocess.h
- src/core/util/subprocess.h
- test/core/end2end/cq_verifier.h
- test/core/test_util/cmdline.h
- test/core/test_util/evaluate_args_test_util.h
@ -5921,8 +5936,8 @@ targets:
- test/core/test_util/slice_splitter.h
- test/core/test_util/tracer_util.h
src:
- src/core/lib/gpr/subprocess_posix.cc
- src/core/lib/gpr/subprocess_windows.cc
- src/core/util/subprocess_posix.cc
- src/core/util/subprocess_windows.cc
- test/core/bad_ssl/bad_ssl_test.cc
- test/core/end2end/cq_verifier.cc
- test/core/test_util/cmdline.cc
@ -6221,8 +6236,8 @@ targets:
build: test
language: c++
headers:
- src/core/lib/gpr/useful.h
- src/core/lib/gprpp/bitset.h
- src/core/util/useful.h
src:
- test/core/gprpp/bitset_test.cc
deps:
@ -6358,7 +6373,6 @@ targets:
- src/core/lib/event_engine/event_engine_context.h
- src/core/lib/experiments/config.h
- src/core/lib/experiments/experiments.h
- src/core/lib/gpr/spinlock.h
- src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/chunked_vector.h
@ -6424,6 +6438,7 @@ targets:
- src/core/lib/transport/simple_slice_based_metadata.h
- src/core/lib/transport/status_conversion.h
- src/core/lib/transport/timeout_encoding.h
- src/core/util/spinlock.h
- test/core/promise/poll_matcher.h
- third_party/upb/upb/generated_code_support.h
- third_party/upb/upb/mini_descriptor/build_enum.h
@ -7646,7 +7661,6 @@ targets:
- src/core/lib/event_engine/event_engine_context.h
- src/core/lib/experiments/config.h
- src/core/lib/experiments/experiments.h
- src/core/lib/gpr/spinlock.h
- src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/chunked_vector.h
@ -7690,6 +7704,7 @@ targets:
- src/core/lib/slice/slice_internal.h
- src/core/lib/slice/slice_refcount.h
- src/core/lib/slice/slice_string_helpers.h
- src/core/util/spinlock.h
- third_party/upb/upb/generated_code_support.h
- third_party/upb/upb/mini_descriptor/build_enum.h
- third_party/upb/upb/mini_descriptor/decode.h
@ -8387,7 +8402,7 @@ targets:
language: c++
headers: []
src:
- test/core/gpr/cpu_test.cc
- test/core/util/cpu_test.cc
deps:
- gtest
- grpc_test_util
@ -8656,6 +8671,20 @@ targets:
- linux
- posix
- mac
- name: dump_args_test
gtest: true
build: test
language: c++
headers:
- src/core/lib/gprpp/dump_args.h
src:
- src/core/lib/gprpp/dump_args.cc
- test/core/gprpp/dump_args_test.cc
deps:
- gtest
- absl/functional:any_invocable
- absl/log:check
uses_polling: false
- name: duplicate_header_bad_client_test
gtest: true
build: test
@ -8966,7 +8995,7 @@ targets:
language: c++
headers: []
src:
- test/core/gpr/env_test.cc
- test/core/util/env_test.cc
deps:
- gtest
- grpc_test_util
@ -9145,7 +9174,6 @@ targets:
- src/core/lib/event_engine/event_engine_context.h
- src/core/lib/experiments/config.h
- src/core/lib/experiments/experiments.h
- src/core/lib/gpr/spinlock.h
- src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/down_cast.h
@ -9173,6 +9201,7 @@ targets:
- src/core/lib/slice/slice_internal.h
- src/core/lib/slice/slice_refcount.h
- src/core/lib/slice/slice_string_helpers.h
- src/core/util/spinlock.h
- third_party/upb/upb/generated_code_support.h
- third_party/upb/upb/mini_descriptor/build_enum.h
- third_party/upb/upb/mini_descriptor/decode.h
@ -9756,7 +9785,6 @@ targets:
- src/core/lib/event_engine/event_engine_context.h
- src/core/lib/experiments/config.h
- src/core/lib/experiments/experiments.h
- src/core/lib/gpr/spinlock.h
- src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/cpp_impl_of.h
@ -9801,6 +9829,7 @@ targets:
- src/core/lib/slice/slice_string_helpers.h
- src/core/lib/transport/bdp_estimator.h
- src/core/lib/transport/http2_errors.h
- src/core/util/spinlock.h
- third_party/upb/upb/generated_code_support.h
- third_party/upb/upb/mini_descriptor/build_enum.h
- third_party/upb/upb/mini_descriptor/decode.h
@ -9887,7 +9916,6 @@ targets:
- src/core/lib/event_engine/event_engine_context.h
- src/core/lib/experiments/config.h
- src/core/lib/experiments/experiments.h
- src/core/lib/gpr/spinlock.h
- src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/cpp_impl_of.h
@ -9939,6 +9967,7 @@ targets:
- src/core/lib/slice/slice_internal.h
- src/core/lib/slice/slice_refcount.h
- src/core/lib/slice/slice_string_helpers.h
- src/core/util/spinlock.h
- test/core/promise/test_wakeup_schedulers.h
- third_party/upb/upb/generated_code_support.h
- third_party/upb/upb/mini_descriptor/build_enum.h
@ -11640,7 +11669,6 @@ targets:
- src/core/lib/event_engine/work_queue/work_queue.h
- src/core/lib/experiments/config.h
- src/core/lib/experiments/experiments.h
- src/core/lib/gpr/spinlock.h
- src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/chunked_vector.h
@ -11739,6 +11767,7 @@ targets:
- src/core/lib/promise/activity.h
- src/core/lib/promise/all_ok.h
- src/core/lib/promise/arena_promise.h
- src/core/lib/promise/cancel_callback.h
- src/core/lib/promise/context.h
- src/core/lib/promise/detail/basic_seq.h
- src/core/lib/promise/detail/join_state.h
@ -11833,6 +11862,7 @@ targets:
- src/core/service_config/service_config_call_data.h
- src/core/service_config/service_config_parser.h
- src/core/tsi/alts/handshaker/transport_security_common_api.h
- src/core/util/spinlock.h
- test/core/promise/poll_matcher.h
- third_party/upb/upb/generated_code_support.h
- third_party/upb/upb/mini_descriptor/build_enum.h
@ -12132,7 +12162,6 @@ targets:
- src/core/lib/event_engine/event_engine_context.h
- src/core/lib/experiments/config.h
- src/core/lib/experiments/experiments.h
- src/core/lib/gpr/spinlock.h
- src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/cpp_impl_of.h
@ -12176,6 +12205,7 @@ targets:
- src/core/lib/slice/slice_internal.h
- src/core/lib/slice/slice_refcount.h
- src/core/lib/slice/slice_string_helpers.h
- src/core/util/spinlock.h
- test/core/promise/test_context.h
- third_party/upb/upb/generated_code_support.h
- third_party/upb/upb/mini_descriptor/build_enum.h
@ -12748,7 +12778,7 @@ targets:
language: c++
headers: []
src:
- test/core/gpr/log_test.cc
- test/core/util/log_test.cc
deps:
- gtest
- grpc_test_util
@ -12805,7 +12835,6 @@ targets:
- src/core/lib/event_engine/event_engine_context.h
- src/core/lib/experiments/config.h
- src/core/lib/experiments/experiments.h
- src/core/lib/gpr/spinlock.h
- src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/cpp_impl_of.h
@ -12857,6 +12886,7 @@ targets:
- src/core/lib/slice/slice_internal.h
- src/core/lib/slice/slice_refcount.h
- src/core/lib/slice/slice_string_helpers.h
- src/core/util/spinlock.h
- test/core/promise/test_wakeup_schedulers.h
- third_party/upb/upb/generated_code_support.h
- third_party/upb/upb/mini_descriptor/build_enum.h
@ -14046,7 +14076,6 @@ targets:
- src/core/lib/debug/trace.h
- src/core/lib/experiments/config.h
- src/core/lib/experiments/experiments.h
- src/core/lib/gpr/spinlock.h
- src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/manual_constructor.h
- src/core/lib/gprpp/status_helper.h
@ -14063,6 +14092,7 @@ targets:
- src/core/lib/slice/slice_internal.h
- src/core/lib/slice/slice_refcount.h
- src/core/lib/slice/slice_string_helpers.h
- src/core/util/spinlock.h
- third_party/upb/upb/generated_code_support.h
- third_party/upb/upb/mini_descriptor/build_enum.h
- third_party/upb/upb/mini_descriptor/decode.h
@ -17784,6 +17814,7 @@ 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
@ -17799,6 +17830,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
@ -18661,7 +18693,7 @@ targets:
language: c++
headers: []
src:
- test/core/gpr/spinlock_test.cc
- test/core/util/spinlock_test.cc
deps:
- gtest
- grpc_test_util
@ -18956,7 +18988,7 @@ targets:
language: c++
headers: []
src:
- test/core/gpr/string_test.cc
- test/core/util/string_test.cc
deps:
- gtest
- grpc_test_util
@ -18985,7 +19017,7 @@ targets:
language: c++
headers: []
src:
- test/core/gpr/sync_test.cc
- test/core/util/sync_test.cc
deps:
- gtest
- grpc_test_util
@ -19024,9 +19056,9 @@ targets:
build: test
language: c++
headers:
- src/core/lib/gpr/useful.h
- src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/table.h
- src/core/util/useful.h
src:
- test/core/gprpp/table_test.cc
deps:
@ -19313,17 +19345,6 @@ targets:
- absl/status:statusor
- absl/utility:utility
- gpr
- name: test_core_gpr_time_test
gtest: true
build: test
language: c++
headers: []
src:
- test/core/gpr/time_test.cc
deps:
- gtest
- grpc_test_util
uses_polling: false
- name: test_core_gprpp_time_test
gtest: true
build: test
@ -19495,6 +19516,17 @@ targets:
- linux
- posix
uses_polling: false
- name: test_core_util_time_test
gtest: true
build: test
language: c++
headers: []
src:
- test/core/util/time_test.cc
deps:
- gtest
- grpc_test_util
uses_polling: false
- name: test_cpp_client_credentials_test
gtest: true
build: test
@ -20195,8 +20227,8 @@ targets:
build: test
language: c++
headers:
- src/core/lib/gpr/useful.h
- src/core/lib/gprpp/unique_type_name.h
- src/core/util/useful.h
src:
- test/core/gprpp/unique_type_name_test.cc
deps:
@ -20232,9 +20264,9 @@ targets:
build: test
language: c++
headers:
- src/core/lib/gpr/useful.h
- src/core/util/useful.h
src:
- test/core/gpr/useful_test.cc
- test/core/util/useful_test.cc
deps:
- gtest
uses_polling: false

67
config.m4 generated

@ -516,32 +516,6 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/event_engine/work_queue/basic_work_queue.cc \
src/core/lib/experiments/config.cc \
src/core/lib/experiments/experiments.cc \
src/core/lib/gpr/alloc.cc \
src/core/lib/gpr/android/log.cc \
src/core/lib/gpr/atm.cc \
src/core/lib/gpr/iphone/cpu.cc \
src/core/lib/gpr/linux/cpu.cc \
src/core/lib/gpr/linux/log.cc \
src/core/lib/gpr/log.cc \
src/core/lib/gpr/msys/tmpfile.cc \
src/core/lib/gpr/posix/cpu.cc \
src/core/lib/gpr/posix/log.cc \
src/core/lib/gpr/posix/string.cc \
src/core/lib/gpr/posix/sync.cc \
src/core/lib/gpr/posix/time.cc \
src/core/lib/gpr/posix/tmpfile.cc \
src/core/lib/gpr/string.cc \
src/core/lib/gpr/sync.cc \
src/core/lib/gpr/sync_abseil.cc \
src/core/lib/gpr/time.cc \
src/core/lib/gpr/time_precise.cc \
src/core/lib/gpr/windows/cpu.cc \
src/core/lib/gpr/windows/log.cc \
src/core/lib/gpr/windows/string.cc \
src/core/lib/gpr/windows/string_util.cc \
src/core/lib/gpr/windows/sync.cc \
src/core/lib/gpr/windows/time.cc \
src/core/lib/gpr/windows/tmpfile.cc \
src/core/lib/gprpp/crash.cc \
src/core/lib/gprpp/examine_stack.cc \
src/core/lib/gprpp/fork.cc \
@ -762,6 +736,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/transport/call_spine.cc \
src/core/lib/transport/connectivity_state.cc \
src/core/lib/transport/error_utils.cc \
src/core/lib/transport/interception_chain.cc \
src/core/lib/transport/message.cc \
src/core/lib/transport/metadata.cc \
src/core/lib/transport/metadata_batch.cc \
@ -859,6 +834,32 @@ if test "$PHP_GRPC" != "no"; then
src/core/tsi/ssl_transport_security_utils.cc \
src/core/tsi/transport_security.cc \
src/core/tsi/transport_security_grpc.cc \
src/core/util/alloc.cc \
src/core/util/android/log.cc \
src/core/util/atm.cc \
src/core/util/iphone/cpu.cc \
src/core/util/linux/cpu.cc \
src/core/util/linux/log.cc \
src/core/util/log.cc \
src/core/util/msys/tmpfile.cc \
src/core/util/posix/cpu.cc \
src/core/util/posix/log.cc \
src/core/util/posix/string.cc \
src/core/util/posix/sync.cc \
src/core/util/posix/time.cc \
src/core/util/posix/tmpfile.cc \
src/core/util/string.cc \
src/core/util/sync.cc \
src/core/util/sync_abseil.cc \
src/core/util/time.cc \
src/core/util/time_precise.cc \
src/core/util/windows/cpu.cc \
src/core/util/windows/log.cc \
src/core/util/windows/string.cc \
src/core/util/windows/string_util.cc \
src/core/util/windows/sync.cc \
src/core/util/windows/time.cc \
src/core/util/windows/tmpfile.cc \
src/core/xds/grpc/certificate_provider_store.cc \
src/core/xds/grpc/file_watcher_certificate_provider_factory.cc \
src/core/xds/grpc/xds_audit_logger_registry.cc \
@ -1525,13 +1526,6 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/event_engine/windows)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/event_engine/work_queue)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/experiments)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gpr)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gpr/android)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gpr/iphone)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gpr/linux)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gpr/msys)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gpr/posix)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gpr/windows)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gprpp)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gprpp/linux)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gprpp/posix)
@ -1605,6 +1599,13 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/tsi/alts/zero_copy_frame_protector)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/tsi/ssl/key_logging)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/tsi/ssl/session_cache)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/util)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/util/android)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/util/iphone)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/util/linux)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/util/msys)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/util/posix)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/util/windows)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/xds/grpc)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/xds/xds_client)
PHP_ADD_BUILD_DIR($ext_builddir/src/php/ext/grpc)

67
config.w32 generated

@ -481,32 +481,6 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\event_engine\\work_queue\\basic_work_queue.cc " +
"src\\core\\lib\\experiments\\config.cc " +
"src\\core\\lib\\experiments\\experiments.cc " +
"src\\core\\lib\\gpr\\alloc.cc " +
"src\\core\\lib\\gpr\\android\\log.cc " +
"src\\core\\lib\\gpr\\atm.cc " +
"src\\core\\lib\\gpr\\iphone\\cpu.cc " +
"src\\core\\lib\\gpr\\linux\\cpu.cc " +
"src\\core\\lib\\gpr\\linux\\log.cc " +
"src\\core\\lib\\gpr\\log.cc " +
"src\\core\\lib\\gpr\\msys\\tmpfile.cc " +
"src\\core\\lib\\gpr\\posix\\cpu.cc " +
"src\\core\\lib\\gpr\\posix\\log.cc " +
"src\\core\\lib\\gpr\\posix\\string.cc " +
"src\\core\\lib\\gpr\\posix\\sync.cc " +
"src\\core\\lib\\gpr\\posix\\time.cc " +
"src\\core\\lib\\gpr\\posix\\tmpfile.cc " +
"src\\core\\lib\\gpr\\string.cc " +
"src\\core\\lib\\gpr\\sync.cc " +
"src\\core\\lib\\gpr\\sync_abseil.cc " +
"src\\core\\lib\\gpr\\time.cc " +
"src\\core\\lib\\gpr\\time_precise.cc " +
"src\\core\\lib\\gpr\\windows\\cpu.cc " +
"src\\core\\lib\\gpr\\windows\\log.cc " +
"src\\core\\lib\\gpr\\windows\\string.cc " +
"src\\core\\lib\\gpr\\windows\\string_util.cc " +
"src\\core\\lib\\gpr\\windows\\sync.cc " +
"src\\core\\lib\\gpr\\windows\\time.cc " +
"src\\core\\lib\\gpr\\windows\\tmpfile.cc " +
"src\\core\\lib\\gprpp\\crash.cc " +
"src\\core\\lib\\gprpp\\examine_stack.cc " +
"src\\core\\lib\\gprpp\\fork.cc " +
@ -727,6 +701,7 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\transport\\call_spine.cc " +
"src\\core\\lib\\transport\\connectivity_state.cc " +
"src\\core\\lib\\transport\\error_utils.cc " +
"src\\core\\lib\\transport\\interception_chain.cc " +
"src\\core\\lib\\transport\\message.cc " +
"src\\core\\lib\\transport\\metadata.cc " +
"src\\core\\lib\\transport\\metadata_batch.cc " +
@ -824,6 +799,32 @@ if (PHP_GRPC != "no") {
"src\\core\\tsi\\ssl_transport_security_utils.cc " +
"src\\core\\tsi\\transport_security.cc " +
"src\\core\\tsi\\transport_security_grpc.cc " +
"src\\core\\util\\alloc.cc " +
"src\\core\\util\\android\\log.cc " +
"src\\core\\util\\atm.cc " +
"src\\core\\util\\iphone\\cpu.cc " +
"src\\core\\util\\linux\\cpu.cc " +
"src\\core\\util\\linux\\log.cc " +
"src\\core\\util\\log.cc " +
"src\\core\\util\\msys\\tmpfile.cc " +
"src\\core\\util\\posix\\cpu.cc " +
"src\\core\\util\\posix\\log.cc " +
"src\\core\\util\\posix\\string.cc " +
"src\\core\\util\\posix\\sync.cc " +
"src\\core\\util\\posix\\time.cc " +
"src\\core\\util\\posix\\tmpfile.cc " +
"src\\core\\util\\string.cc " +
"src\\core\\util\\sync.cc " +
"src\\core\\util\\sync_abseil.cc " +
"src\\core\\util\\time.cc " +
"src\\core\\util\\time_precise.cc " +
"src\\core\\util\\windows\\cpu.cc " +
"src\\core\\util\\windows\\log.cc " +
"src\\core\\util\\windows\\string.cc " +
"src\\core\\util\\windows\\string_util.cc " +
"src\\core\\util\\windows\\sync.cc " +
"src\\core\\util\\windows\\time.cc " +
"src\\core\\util\\windows\\tmpfile.cc " +
"src\\core\\xds\\grpc\\certificate_provider_store.cc " +
"src\\core\\xds\\grpc\\file_watcher_certificate_provider_factory.cc " +
"src\\core\\xds\\grpc\\xds_audit_logger_registry.cc " +
@ -1662,13 +1663,6 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\event_engine\\windows");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\event_engine\\work_queue");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\experiments");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gpr");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gpr\\android");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gpr\\iphone");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gpr\\linux");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gpr\\msys");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gpr\\posix");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gpr\\windows");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gprpp");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gprpp\\linux");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gprpp\\posix");
@ -1745,6 +1739,13 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\tsi\\ssl");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\tsi\\ssl\\key_logging");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\tsi\\ssl\\session_cache");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util\\android");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util\\iphone");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util\\linux");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util\\msys");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util\\posix");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util\\windows");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\xds");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\xds\\grpc");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\xds\\xds_client");

@ -14,11 +14,22 @@
licenses(["notice"])
cc_library(
name = "util",
srcs = ["util.cc"],
hdrs = ["util.h"],
deps = [
"//:grpc++",
"@io_opentelemetry_cpp//sdk/src/metrics",
],
)
cc_binary(
name = "greeter_callback_client",
srcs = ["greeter_callback_client.cc"],
defines = ["BAZEL_BUILD"],
deps = [
"util",
"//:grpc++",
"//:grpcpp_otel_plugin",
"//examples/protos:helloworld_cc_grpc",
@ -34,6 +45,7 @@ cc_binary(
srcs = ["greeter_callback_server.cc"],
defines = ["BAZEL_BUILD"],
deps = [
"util",
"//:grpc++",
"//:grpc++_reflection",
"//:grpcpp_otel_plugin",

@ -50,6 +50,7 @@ add_custom_command(
# Include generated *.pb.h files
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
include_directories("${CMAKE_SOURCE_DIR}")
# hw_grpc_proto
add_library(hw_grpc_proto
@ -62,6 +63,13 @@ target_link_libraries(hw_grpc_proto
${_GRPC_GRPCPP}
${_PROTOBUF_LIBPROTOBUF})
# util
add_library(util
"util.cc")
target_link_libraries(util
opentelemetry-cpp::metrics
${_GRPC_GRPCPP})
# Targets greeter_callback_(client|server)
foreach(_target
greeter_callback_client greeter_callback_server)
@ -75,5 +83,6 @@ foreach(_target
${_REFLECTION}
${_GRPC_GRPCPP}
gRPC::grpcpp_otel_plugin
util
${_PROTOBUF_LIBPROTOBUF})
endforeach()

@ -33,9 +33,11 @@
#include <grpcpp/grpcpp.h>
#ifdef BAZEL_BUILD
#include "examples/cpp/otel/util.h"
#include "examples/protos/helloworld.grpc.pb.h"
#else
#include "helloworld.grpc.pb.h"
#include "util.h"
#endif
ABSL_FLAG(std::string, target, "localhost:50051", "Server address");
@ -110,6 +112,10 @@ int main(int argc, char** argv) {
opentelemetry::exporter::metrics::PrometheusExporterFactory::Create(opts);
auto meter_provider =
std::make_shared<opentelemetry::sdk::metrics::MeterProvider>();
// The default histogram boundaries are not granular enough for RPCs. Override
// the "grpc.client.attempt.duration" view as recommended by
// https://github.com/grpc/proposal/blob/master/A66-otel-stats.md.
AddLatencyView(meter_provider.get(), "grpc.client.attempt.duration", "s");
meter_provider->AddMetricReader(std::move(prometheus_exporter));
auto status = grpc::OpenTelemetryPluginBuilder()
.SetMeterProvider(std::move(meter_provider))

@ -33,9 +33,11 @@
#include <grpcpp/health_check_service_interface.h>
#ifdef BAZEL_BUILD
#include "examples/cpp/otel/util.h"
#include "examples/protos/helloworld.grpc.pb.h"
#else
#include "helloworld.grpc.pb.h"
#include "util.h"
#endif
ABSL_FLAG(uint16_t, port, 50051, "Server port for the service");
@ -96,6 +98,10 @@ int main(int argc, char** argv) {
opentelemetry::exporter::metrics::PrometheusExporterFactory::Create(opts);
auto meter_provider =
std::make_shared<opentelemetry::sdk::metrics::MeterProvider>();
// The default histogram boundaries are not granular enough for RPCs. Override
// the "grpc.server.call.duration" view as recommended by
// https://github.com/grpc/proposal/blob/master/A66-otel-stats.md.
AddLatencyView(meter_provider.get(), "grpc.server.call.duration", "s");
meter_provider->AddMetricReader(std::move(prometheus_exporter));
auto status = grpc::OpenTelemetryPluginBuilder()
.SetMeterProvider(std::move(meter_provider))

@ -0,0 +1,50 @@
//
//
// Copyright 2024 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.
//
//
#ifdef BAZEL_BUILD
#include "examples/cpp/otel/util.h"
#else
#include "util.h"
#endif
#include "opentelemetry/sdk/metrics/view/instrument_selector_factory.h"
#include "opentelemetry/sdk/metrics/view/meter_selector_factory.h"
#include "opentelemetry/sdk/metrics/view/view_factory.h"
#include <grpcpp/grpcpp.h>
void AddLatencyView(opentelemetry::sdk::metrics::MeterProvider* provider,
const std::string& name, const std::string& unit) {
auto histogram_config = std::make_shared<
opentelemetry::sdk::metrics::HistogramAggregationConfig>();
histogram_config->boundaries_ = {
0, 0.00001, 0.00005, 0.0001, 0.0003, 0.0006, 0.0008, 0.001, 0.002,
0.003, 0.004, 0.005, 0.006, 0.008, 0.01, 0.013, 0.016, 0.02,
0.025, 0.03, 0.04, 0.05, 0.065, 0.08, 0.1, 0.13, 0.16,
0.2, 0.25, 0.3, 0.4, 0.5, 0.65, 0.8, 1, 2,
5, 10, 20, 50, 100};
provider->AddView(
opentelemetry::sdk::metrics::InstrumentSelectorFactory::Create(
opentelemetry::sdk::metrics::InstrumentType::kHistogram, name, unit),
opentelemetry::sdk::metrics::MeterSelectorFactory::Create(
"grpc-c++", grpc::Version(), ""),
opentelemetry::sdk::metrics::ViewFactory::Create(
name, "", unit,
opentelemetry::sdk::metrics::AggregationType::kHistogram,
std::move(histogram_config)));
}

@ -0,0 +1,31 @@
//
//
// Copyright 2024 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_EXAMPLES_CPP_OTEL_UTIL_H
#define GRPCPP_EXAMPLES_CPP_OTEL_UTIL_H
#include <string>
#include "opentelemetry/sdk/metrics/meter_provider.h"
// Helper function that adds view for gRPC latency instrument \a name with unit
// \a unit with bucket boundaries that are more useful for RPCs.
void AddLatencyView(opentelemetry::sdk::metrics::MeterProvider* provider,
const std::string& name, const std::string& unit);
#endif // GRPCPP_EXAMPLES_CPP_OTEL_UTIL_H

29
gRPC-C++.podspec generated

@ -176,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',
@ -963,12 +964,6 @@ Pod::Spec.new do |s|
'src/core/lib/event_engine/work_queue/work_queue.h',
'src/core/lib/experiments/config.h',
'src/core/lib/experiments/experiments.h',
'src/core/lib/gpr/alloc.h',
'src/core/lib/gpr/spinlock.h',
'src/core/lib/gpr/string.h',
'src/core/lib/gpr/time_precise.h',
'src/core/lib/gpr/tmpfile.h',
'src/core/lib/gpr/useful.h',
'src/core/lib/gprpp/atomic_utils.h',
'src/core/lib/gprpp/bitset.h',
'src/core/lib/gprpp/chunked_vector.h',
@ -1212,6 +1207,7 @@ Pod::Spec.new do |s|
'src/core/lib/transport/batch_builder.h',
'src/core/lib/transport/bdp_estimator.h',
'src/core/lib/transport/call_arena_allocator.h',
'src/core/lib/transport/call_destination.h',
'src/core/lib/transport/call_filters.h',
'src/core/lib/transport/call_final_info.h',
'src/core/lib/transport/call_spine.h',
@ -1219,6 +1215,7 @@ Pod::Spec.new do |s|
'src/core/lib/transport/custom_metadata.h',
'src/core/lib/transport/error_utils.h',
'src/core/lib/transport/http2_errors.h',
'src/core/lib/transport/interception_chain.h',
'src/core/lib/transport/message.h',
'src/core/lib/transport/metadata.h',
'src/core/lib/transport/metadata_batch.h',
@ -1314,6 +1311,12 @@ Pod::Spec.new do |s|
'src/core/tsi/transport_security.h',
'src/core/tsi/transport_security_grpc.h',
'src/core/tsi/transport_security_interface.h',
'src/core/util/alloc.h',
'src/core/util/spinlock.h',
'src/core/util/string.h',
'src/core/util/time_precise.h',
'src/core/util/tmpfile.h',
'src/core/util/useful.h',
'src/core/xds/grpc/certificate_provider_store.h',
'src/core/xds/grpc/file_watcher_certificate_provider_factory.h',
'src/core/xds/grpc/upb_utils.h',
@ -2232,12 +2235,6 @@ Pod::Spec.new do |s|
'src/core/lib/event_engine/work_queue/work_queue.h',
'src/core/lib/experiments/config.h',
'src/core/lib/experiments/experiments.h',
'src/core/lib/gpr/alloc.h',
'src/core/lib/gpr/spinlock.h',
'src/core/lib/gpr/string.h',
'src/core/lib/gpr/time_precise.h',
'src/core/lib/gpr/tmpfile.h',
'src/core/lib/gpr/useful.h',
'src/core/lib/gprpp/atomic_utils.h',
'src/core/lib/gprpp/bitset.h',
'src/core/lib/gprpp/chunked_vector.h',
@ -2481,6 +2478,7 @@ Pod::Spec.new do |s|
'src/core/lib/transport/batch_builder.h',
'src/core/lib/transport/bdp_estimator.h',
'src/core/lib/transport/call_arena_allocator.h',
'src/core/lib/transport/call_destination.h',
'src/core/lib/transport/call_filters.h',
'src/core/lib/transport/call_final_info.h',
'src/core/lib/transport/call_spine.h',
@ -2488,6 +2486,7 @@ Pod::Spec.new do |s|
'src/core/lib/transport/custom_metadata.h',
'src/core/lib/transport/error_utils.h',
'src/core/lib/transport/http2_errors.h',
'src/core/lib/transport/interception_chain.h',
'src/core/lib/transport/message.h',
'src/core/lib/transport/metadata.h',
'src/core/lib/transport/metadata_batch.h',
@ -2583,6 +2582,12 @@ Pod::Spec.new do |s|
'src/core/tsi/transport_security.h',
'src/core/tsi/transport_security_grpc.h',
'src/core/tsi/transport_security_interface.h',
'src/core/util/alloc.h',
'src/core/util/spinlock.h',
'src/core/util/string.h',
'src/core/util/time_precise.h',
'src/core/util/tmpfile.h',
'src/core/util/useful.h',
'src/core/xds/grpc/certificate_provider_store.h',
'src/core/xds/grpc/file_watcher_certificate_provider_factory.h',
'src/core/xds/grpc/upb_utils.h',

84
gRPC-Core.podspec generated

@ -82,7 +82,7 @@ Pod::Spec.new do |s|
' "$(PODS_TARGET_SRCROOT)/third_party/utf8_range"'\
' "$(PODS_TARGET_SRCROOT)/third_party/xxhash"',
# If we don't set these two settings, `include/grpc/support/time.h` and
# `src/core/lib/gpr/string.h` shadow the system `<time.h>` and `<string.h>`, breaking the
# `src/core/util/string.h` shadow the system `<time.h>` and `<string.h>`, breaking the
# build.
'USE_HEADERMAP' => 'NO',
'ALWAYS_SEARCH_USER_PATHS' => 'NO',
@ -168,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',
@ -1373,38 +1374,6 @@ Pod::Spec.new do |s|
'src/core/lib/experiments/config.h',
'src/core/lib/experiments/experiments.cc',
'src/core/lib/experiments/experiments.h',
'src/core/lib/gpr/alloc.cc',
'src/core/lib/gpr/alloc.h',
'src/core/lib/gpr/android/log.cc',
'src/core/lib/gpr/atm.cc',
'src/core/lib/gpr/iphone/cpu.cc',
'src/core/lib/gpr/linux/cpu.cc',
'src/core/lib/gpr/linux/log.cc',
'src/core/lib/gpr/log.cc',
'src/core/lib/gpr/msys/tmpfile.cc',
'src/core/lib/gpr/posix/cpu.cc',
'src/core/lib/gpr/posix/log.cc',
'src/core/lib/gpr/posix/string.cc',
'src/core/lib/gpr/posix/sync.cc',
'src/core/lib/gpr/posix/time.cc',
'src/core/lib/gpr/posix/tmpfile.cc',
'src/core/lib/gpr/spinlock.h',
'src/core/lib/gpr/string.cc',
'src/core/lib/gpr/string.h',
'src/core/lib/gpr/sync.cc',
'src/core/lib/gpr/sync_abseil.cc',
'src/core/lib/gpr/time.cc',
'src/core/lib/gpr/time_precise.cc',
'src/core/lib/gpr/time_precise.h',
'src/core/lib/gpr/tmpfile.h',
'src/core/lib/gpr/useful.h',
'src/core/lib/gpr/windows/cpu.cc',
'src/core/lib/gpr/windows/log.cc',
'src/core/lib/gpr/windows/string.cc',
'src/core/lib/gpr/windows/string_util.cc',
'src/core/lib/gpr/windows/sync.cc',
'src/core/lib/gpr/windows/time.cc',
'src/core/lib/gpr/windows/tmpfile.cc',
'src/core/lib/gprpp/atomic_utils.h',
'src/core/lib/gprpp/bitset.h',
'src/core/lib/gprpp/chunked_vector.h',
@ -1863,6 +1832,7 @@ Pod::Spec.new do |s|
'src/core/lib/transport/bdp_estimator.h',
'src/core/lib/transport/call_arena_allocator.cc',
'src/core/lib/transport/call_arena_allocator.h',
'src/core/lib/transport/call_destination.h',
'src/core/lib/transport/call_filters.cc',
'src/core/lib/transport/call_filters.h',
'src/core/lib/transport/call_final_info.cc',
@ -1875,6 +1845,8 @@ Pod::Spec.new do |s|
'src/core/lib/transport/error_utils.cc',
'src/core/lib/transport/error_utils.h',
'src/core/lib/transport/http2_errors.h',
'src/core/lib/transport/interception_chain.cc',
'src/core/lib/transport/interception_chain.h',
'src/core/lib/transport/message.cc',
'src/core/lib/transport/message.h',
'src/core/lib/transport/metadata.cc',
@ -2067,6 +2039,38 @@ Pod::Spec.new do |s|
'src/core/tsi/transport_security_grpc.cc',
'src/core/tsi/transport_security_grpc.h',
'src/core/tsi/transport_security_interface.h',
'src/core/util/alloc.cc',
'src/core/util/alloc.h',
'src/core/util/android/log.cc',
'src/core/util/atm.cc',
'src/core/util/iphone/cpu.cc',
'src/core/util/linux/cpu.cc',
'src/core/util/linux/log.cc',
'src/core/util/log.cc',
'src/core/util/msys/tmpfile.cc',
'src/core/util/posix/cpu.cc',
'src/core/util/posix/log.cc',
'src/core/util/posix/string.cc',
'src/core/util/posix/sync.cc',
'src/core/util/posix/time.cc',
'src/core/util/posix/tmpfile.cc',
'src/core/util/spinlock.h',
'src/core/util/string.cc',
'src/core/util/string.h',
'src/core/util/sync.cc',
'src/core/util/sync_abseil.cc',
'src/core/util/time.cc',
'src/core/util/time_precise.cc',
'src/core/util/time_precise.h',
'src/core/util/tmpfile.h',
'src/core/util/useful.h',
'src/core/util/windows/cpu.cc',
'src/core/util/windows/log.cc',
'src/core/util/windows/string.cc',
'src/core/util/windows/string_util.cc',
'src/core/util/windows/sync.cc',
'src/core/util/windows/time.cc',
'src/core/util/windows/tmpfile.cc',
'src/core/xds/grpc/certificate_provider_store.cc',
'src/core/xds/grpc/certificate_provider_store.h',
'src/core/xds/grpc/file_watcher_certificate_provider_factory.cc',
@ -3011,12 +3015,6 @@ Pod::Spec.new do |s|
'src/core/lib/event_engine/work_queue/work_queue.h',
'src/core/lib/experiments/config.h',
'src/core/lib/experiments/experiments.h',
'src/core/lib/gpr/alloc.h',
'src/core/lib/gpr/spinlock.h',
'src/core/lib/gpr/string.h',
'src/core/lib/gpr/time_precise.h',
'src/core/lib/gpr/tmpfile.h',
'src/core/lib/gpr/useful.h',
'src/core/lib/gprpp/atomic_utils.h',
'src/core/lib/gprpp/bitset.h',
'src/core/lib/gprpp/chunked_vector.h',
@ -3260,6 +3258,7 @@ Pod::Spec.new do |s|
'src/core/lib/transport/batch_builder.h',
'src/core/lib/transport/bdp_estimator.h',
'src/core/lib/transport/call_arena_allocator.h',
'src/core/lib/transport/call_destination.h',
'src/core/lib/transport/call_filters.h',
'src/core/lib/transport/call_final_info.h',
'src/core/lib/transport/call_spine.h',
@ -3267,6 +3266,7 @@ Pod::Spec.new do |s|
'src/core/lib/transport/custom_metadata.h',
'src/core/lib/transport/error_utils.h',
'src/core/lib/transport/http2_errors.h',
'src/core/lib/transport/interception_chain.h',
'src/core/lib/transport/message.h',
'src/core/lib/transport/metadata.h',
'src/core/lib/transport/metadata_batch.h',
@ -3362,6 +3362,12 @@ Pod::Spec.new do |s|
'src/core/tsi/transport_security.h',
'src/core/tsi/transport_security_grpc.h',
'src/core/tsi/transport_security_interface.h',
'src/core/util/alloc.h',
'src/core/util/spinlock.h',
'src/core/util/string.h',
'src/core/util/time_precise.h',
'src/core/util/tmpfile.h',
'src/core/util/useful.h',
'src/core/xds/grpc/certificate_provider_store.h',
'src/core/xds/grpc/file_watcher_certificate_provider_factory.h',
'src/core/xds/grpc/upb_utils.h',

68
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 )
@ -1260,38 +1261,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/experiments/config.h )
s.files += %w( src/core/lib/experiments/experiments.cc )
s.files += %w( src/core/lib/experiments/experiments.h )
s.files += %w( src/core/lib/gpr/alloc.cc )
s.files += %w( src/core/lib/gpr/alloc.h )
s.files += %w( src/core/lib/gpr/android/log.cc )
s.files += %w( src/core/lib/gpr/atm.cc )
s.files += %w( src/core/lib/gpr/iphone/cpu.cc )
s.files += %w( src/core/lib/gpr/linux/cpu.cc )
s.files += %w( src/core/lib/gpr/linux/log.cc )
s.files += %w( src/core/lib/gpr/log.cc )
s.files += %w( src/core/lib/gpr/msys/tmpfile.cc )
s.files += %w( src/core/lib/gpr/posix/cpu.cc )
s.files += %w( src/core/lib/gpr/posix/log.cc )
s.files += %w( src/core/lib/gpr/posix/string.cc )
s.files += %w( src/core/lib/gpr/posix/sync.cc )
s.files += %w( src/core/lib/gpr/posix/time.cc )
s.files += %w( src/core/lib/gpr/posix/tmpfile.cc )
s.files += %w( src/core/lib/gpr/spinlock.h )
s.files += %w( src/core/lib/gpr/string.cc )
s.files += %w( src/core/lib/gpr/string.h )
s.files += %w( src/core/lib/gpr/sync.cc )
s.files += %w( src/core/lib/gpr/sync_abseil.cc )
s.files += %w( src/core/lib/gpr/time.cc )
s.files += %w( src/core/lib/gpr/time_precise.cc )
s.files += %w( src/core/lib/gpr/time_precise.h )
s.files += %w( src/core/lib/gpr/tmpfile.h )
s.files += %w( src/core/lib/gpr/useful.h )
s.files += %w( src/core/lib/gpr/windows/cpu.cc )
s.files += %w( src/core/lib/gpr/windows/log.cc )
s.files += %w( src/core/lib/gpr/windows/string.cc )
s.files += %w( src/core/lib/gpr/windows/string_util.cc )
s.files += %w( src/core/lib/gpr/windows/sync.cc )
s.files += %w( src/core/lib/gpr/windows/time.cc )
s.files += %w( src/core/lib/gpr/windows/tmpfile.cc )
s.files += %w( src/core/lib/gprpp/atomic_utils.h )
s.files += %w( src/core/lib/gprpp/bitset.h )
s.files += %w( src/core/lib/gprpp/chunked_vector.h )
@ -1750,6 +1719,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/transport/bdp_estimator.h )
s.files += %w( src/core/lib/transport/call_arena_allocator.cc )
s.files += %w( src/core/lib/transport/call_arena_allocator.h )
s.files += %w( src/core/lib/transport/call_destination.h )
s.files += %w( src/core/lib/transport/call_filters.cc )
s.files += %w( src/core/lib/transport/call_filters.h )
s.files += %w( src/core/lib/transport/call_final_info.cc )
@ -1762,6 +1732,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/transport/error_utils.cc )
s.files += %w( src/core/lib/transport/error_utils.h )
s.files += %w( src/core/lib/transport/http2_errors.h )
s.files += %w( src/core/lib/transport/interception_chain.cc )
s.files += %w( src/core/lib/transport/interception_chain.h )
s.files += %w( src/core/lib/transport/message.cc )
s.files += %w( src/core/lib/transport/message.h )
s.files += %w( src/core/lib/transport/metadata.cc )
@ -1954,6 +1926,38 @@ Gem::Specification.new do |s|
s.files += %w( src/core/tsi/transport_security_grpc.cc )
s.files += %w( src/core/tsi/transport_security_grpc.h )
s.files += %w( src/core/tsi/transport_security_interface.h )
s.files += %w( src/core/util/alloc.cc )
s.files += %w( src/core/util/alloc.h )
s.files += %w( src/core/util/android/log.cc )
s.files += %w( src/core/util/atm.cc )
s.files += %w( src/core/util/iphone/cpu.cc )
s.files += %w( src/core/util/linux/cpu.cc )
s.files += %w( src/core/util/linux/log.cc )
s.files += %w( src/core/util/log.cc )
s.files += %w( src/core/util/msys/tmpfile.cc )
s.files += %w( src/core/util/posix/cpu.cc )
s.files += %w( src/core/util/posix/log.cc )
s.files += %w( src/core/util/posix/string.cc )
s.files += %w( src/core/util/posix/sync.cc )
s.files += %w( src/core/util/posix/time.cc )
s.files += %w( src/core/util/posix/tmpfile.cc )
s.files += %w( src/core/util/spinlock.h )
s.files += %w( src/core/util/string.cc )
s.files += %w( src/core/util/string.h )
s.files += %w( src/core/util/sync.cc )
s.files += %w( src/core/util/sync_abseil.cc )
s.files += %w( src/core/util/time.cc )
s.files += %w( src/core/util/time_precise.cc )
s.files += %w( src/core/util/time_precise.h )
s.files += %w( src/core/util/tmpfile.h )
s.files += %w( src/core/util/useful.h )
s.files += %w( src/core/util/windows/cpu.cc )
s.files += %w( src/core/util/windows/log.cc )
s.files += %w( src/core/util/windows/string.cc )
s.files += %w( src/core/util/windows/string_util.cc )
s.files += %w( src/core/util/windows/sync.cc )
s.files += %w( src/core/util/windows/time.cc )
s.files += %w( src/core/util/windows/tmpfile.cc )
s.files += %w( src/core/xds/grpc/certificate_provider_store.cc )
s.files += %w( src/core/xds/grpc/certificate_provider_store.h )
s.files += %w( src/core/xds/grpc/file_watcher_certificate_provider_factory.cc )

@ -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 */

@ -99,12 +99,6 @@ GPRAPI void gpr_assertion_failed(const char* filename, int line,
} \
} while (0)
#ifndef NDEBUG
#define GPR_DEBUG_ASSERT(x) GPR_ASSERT(x)
#else
#define GPR_DEBUG_ASSERT(x) GPR_ASSERT(true || (x))
#endif
#ifdef __cplusplus
}
#endif

@ -88,11 +88,25 @@ class OpenTelemetryPluginBuilder {
/// If `SetMeterProvider()` is not called, no metrics are collected.
OpenTelemetryPluginBuilder& SetMeterProvider(
std::shared_ptr<opentelemetry::metrics::MeterProvider> meter_provider);
/// If set, \a target_attribute_filter is called per channel to decide whether
/// to record the target attribute on client or to replace it with "other".
/// This helps reduce the cardinality on metrics in cases where many channels
/// are created with different targets in the same binary (which might happen
/// for example, if the channel target string uses IP addresses directly).
/// DEPRECATED: If set, \a target_attribute_filter is called per channel to
/// decide whether to record the target attribute on client or to replace it
/// with "other". This helps reduce the cardinality on metrics in cases where
/// many channels are created with different targets in the same binary (which
/// might happen for example, if the channel target string uses IP addresses
/// directly).
/// This filtration only works for the per-call metrics -
/// grpc.client.attempt.started
/// grpc.client.attempt.duration
/// grpc.client.attempt.sent_total_compressed_message_size
/// grpc.client.attempt.rcvd_total_compressed_message_size
/// For example, the grpc.target attribute on pick first lb policy metrics
/// defined in
/// https://github.com/grpc/proposal/blob/master/A78-grpc-metrics-wrr-pf-xds.md
/// will not be filtered. Please contact the grpc team if this filtration is
/// of interest to you.
GRPC_DEPRECATED(
"Does not work as expected. Please raise an issue on "
"https://github.com/grpc/grpc if this would be of use to you.")
OpenTelemetryPluginBuilder& SetTargetAttributeFilter(
absl::AnyInvocable<bool(absl::string_view /*target*/) const>
target_attribute_filter);

@ -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);

@ -103,6 +103,8 @@ class TlsCredentialsOptions {
// call is covered by the cert that the peer presented.
// We will perform such checks by default. This should be disabled if
// verifiers other than the host name verifier is used.
// Deprecated: This function will be removed in the 1.66 release. This will be
// replaced by and handled within the custom verifier settings.
void set_check_call_host(bool check_call_host);
// Deprecated in favor of set_crl_provider. The
@ -111,6 +113,8 @@ class TlsCredentialsOptions {
// If set, gRPC will read all hashed x.509 CRL files in the directory and
// enforce the CRL files on all TLS handshakes. Only supported for OpenSSL
// version > 1.1.
// Deprecated: This function will be removed in the 1.66 release. Use the
// set_crl_provider function instead.
void set_crl_directory(const std::string& path);
void set_crl_provider(std::shared_ptr<CrlProvider> crl_provider);
@ -184,6 +188,7 @@ class TlsServerCredentialsOptions final : public TlsCredentialsOptions {
// WARNING: This API is extremely dangerous and should not be used. If the
// server's trust bundle is too large, then the TLS server will be unable to
// form a ServerHello, and hence will be unusable.
// Deprecated: This function will be removed in the 1.66 release.
void set_send_client_ca_list(bool send_client_ca_list);
private:

@ -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_;

68
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" />
@ -1242,38 +1243,6 @@
<file baseinstalldir="/" name="src/core/lib/experiments/config.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/experiments/experiments.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/experiments/experiments.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/alloc.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/alloc.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/android/log.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/atm.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/iphone/cpu.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/linux/cpu.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/linux/log.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/log.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/msys/tmpfile.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/posix/cpu.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/posix/log.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/posix/string.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/posix/sync.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/posix/time.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/posix/tmpfile.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/spinlock.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/string.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/string.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/sync.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/sync_abseil.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/time.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/time_precise.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/time_precise.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/tmpfile.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/useful.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/windows/cpu.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/windows/log.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/windows/string.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/windows/string_util.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/windows/sync.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/windows/time.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gpr/windows/tmpfile.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/atomic_utils.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/bitset.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/chunked_vector.h" role="src" />
@ -1732,6 +1701,7 @@
<file baseinstalldir="/" name="src/core/lib/transport/bdp_estimator.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/call_arena_allocator.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/call_arena_allocator.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/call_destination.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/call_filters.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/call_filters.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/call_final_info.cc" role="src" />
@ -1744,6 +1714,8 @@
<file baseinstalldir="/" name="src/core/lib/transport/error_utils.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/error_utils.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/http2_errors.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/interception_chain.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/interception_chain.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/message.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/message.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/metadata.cc" role="src" />
@ -1936,6 +1908,38 @@
<file baseinstalldir="/" name="src/core/tsi/transport_security_grpc.cc" role="src" />
<file baseinstalldir="/" name="src/core/tsi/transport_security_grpc.h" role="src" />
<file baseinstalldir="/" name="src/core/tsi/transport_security_interface.h" role="src" />
<file baseinstalldir="/" name="src/core/util/alloc.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/alloc.h" role="src" />
<file baseinstalldir="/" name="src/core/util/android/log.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/atm.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/iphone/cpu.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/linux/cpu.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/linux/log.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/log.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/msys/tmpfile.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/posix/cpu.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/posix/log.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/posix/string.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/posix/sync.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/posix/time.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/posix/tmpfile.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/spinlock.h" role="src" />
<file baseinstalldir="/" name="src/core/util/string.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/string.h" role="src" />
<file baseinstalldir="/" name="src/core/util/sync.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/sync_abseil.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/time.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/time_precise.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/time_precise.h" role="src" />
<file baseinstalldir="/" name="src/core/util/tmpfile.h" role="src" />
<file baseinstalldir="/" name="src/core/util/useful.h" role="src" />
<file baseinstalldir="/" name="src/core/util/windows/cpu.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/windows/log.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/windows/string.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/windows/string_util.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/windows/sync.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/windows/time.cc" role="src" />
<file baseinstalldir="/" name="src/core/util/windows/tmpfile.cc" role="src" />
<file baseinstalldir="/" name="src/core/xds/grpc/certificate_provider_store.cc" role="src" />
<file baseinstalldir="/" name="src/core/xds/grpc/certificate_provider_store.h" role="src" />
<file baseinstalldir="/" name="src/core/xds/grpc/file_watcher_certificate_provider_factory.cc" role="src" />

@ -48,6 +48,25 @@ grpc_cc_library(
language = "c++",
)
grpc_cc_library(
name = "dump_args",
srcs = [
"lib/gprpp/dump_args.cc",
],
hdrs = [
"lib/gprpp/dump_args.h",
],
external_deps = [
"absl/functional:any_invocable",
"absl/log:check",
"absl/strings",
],
language = "c++",
deps = [
"//:gpr_platform",
],
)
grpc_cc_library(
name = "slice_cast",
hdrs = [
@ -197,6 +216,7 @@ grpc_cc_library(
external_deps = [
"absl/functional:any_invocable",
"absl/log:check",
"absl/log:log",
"absl/strings",
],
language = "c++",
@ -218,7 +238,7 @@ grpc_cc_library(
grpc_cc_library(
name = "useful",
hdrs = ["lib/gpr/useful.h"],
hdrs = ["util/useful.h"],
external_deps = [
"absl/strings",
"absl/types:variant",
@ -243,7 +263,7 @@ grpc_cc_library(
grpc_cc_library(
name = "gpr_atm",
srcs = [
"lib/gpr/atm.cc",
"util/atm.cc",
],
language = "c++",
public_hdrs = [
@ -279,7 +299,7 @@ grpc_cc_library(
name = "gpr_spinlock",
srcs = [],
hdrs = [
"lib/gpr/spinlock.h",
"util/spinlock.h",
],
language = "c++",
deps = [
@ -395,6 +415,7 @@ grpc_cc_library(
"lib/gprpp/validation_errors.h",
],
external_deps = [
"absl/log:log",
"absl/status",
"absl/strings",
],
@ -511,7 +532,10 @@ grpc_cc_library(
grpc_cc_library(
name = "map_pipe",
external_deps = ["absl/status"],
external_deps = [
"absl/log:log",
"absl/status",
],
language = "c++",
public_hdrs = [
"lib/promise/map_pipe.h",
@ -540,6 +564,7 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/log:check",
"absl/log:log",
"absl/strings",
"absl/strings:str_format",
],
@ -639,7 +664,10 @@ grpc_cc_library(
grpc_cc_library(
name = "promise_like",
external_deps = ["absl/meta:type_traits"],
external_deps = [
"absl/functional:any_invocable",
"absl/meta:type_traits",
],
language = "c++",
public_hdrs = [
"lib/promise/detail/promise_like.h",
@ -754,6 +782,7 @@ grpc_cc_library(
name = "join_state",
external_deps = [
"absl/log:check",
"absl/log:log",
],
language = "c++",
public_hdrs = [
@ -843,6 +872,7 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/log:check",
"absl/log:log",
"absl/strings",
],
language = "c++",
@ -982,6 +1012,7 @@ grpc_cc_library(
name = "latch",
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/strings",
],
language = "c++",
@ -1000,6 +1031,7 @@ grpc_cc_library(
name = "inter_activity_latch",
external_deps = [
"absl/base:core_headers",
"absl/log:log",
"absl/strings",
],
language = "c++",
@ -1022,6 +1054,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/strings",
"absl/strings:str_format",
"absl/types:optional",
@ -1045,6 +1078,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/strings",
"absl/types:optional",
"absl/types:variant",
@ -1156,6 +1190,7 @@ grpc_cc_library(
name = "for_each",
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/strings",
],
@ -1178,6 +1213,7 @@ grpc_cc_library(
name = "ref_counted",
external_deps = [
"absl/log:check",
"absl/log:log",
],
language = "c++",
public_hdrs = ["lib/gprpp/ref_counted.h"],
@ -1194,6 +1230,7 @@ grpc_cc_library(
name = "dual_ref_counted",
external_deps = [
"absl/log:check",
"absl/log:log",
],
language = "c++",
public_hdrs = ["lib/gprpp/dual_ref_counted.h"],
@ -1389,6 +1426,7 @@ grpc_cc_library(
"absl/base:core_headers",
"absl/container:flat_hash_set",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/strings",
"absl/types:optional",
@ -1439,6 +1477,9 @@ grpc_cc_library(
hdrs = [
"lib/resource_quota/arena.h",
],
external_deps = [
"absl/log:log",
],
visibility = [
"@grpc:alt_grpc_base_legacy",
],
@ -1538,6 +1579,9 @@ grpc_cc_library(
hdrs = [
"lib/slice/slice_refcount.h",
],
external_deps = [
"absl/log:log",
],
public_hdrs = [
"//:include/grpc/slice.h",
],
@ -1605,6 +1649,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/strings:str_format",
],
@ -1632,6 +1677,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/strings:str_format",
],
visibility = ["@grpc:alt_grpc_base_legacy"],
@ -1653,6 +1699,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/strings:str_format",
"absl/types:optional",
],
@ -1734,6 +1781,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
],
deps = [
"//:config_vars",
@ -1883,6 +1931,7 @@ grpc_cc_library(
"absl/container:flat_hash_set",
"absl/functional:any_invocable",
"absl/log:check",
"absl/log:log",
"absl/time",
"absl/types:optional",
],
@ -1933,6 +1982,7 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/log:check",
"absl/log:log",
"absl/time",
"absl/types:optional",
],
@ -2090,6 +2140,7 @@ grpc_cc_library(
"absl/container:inlined_vector",
"absl/functional:function_ref",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -2196,6 +2247,7 @@ grpc_cc_library(
],
external_deps = [
"absl/functional:any_invocable",
"absl/log:log",
"absl/status",
"absl/types:optional",
],
@ -2220,6 +2272,7 @@ grpc_cc_library(
"absl/functional:any_invocable",
"absl/hash",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -2281,6 +2334,7 @@ grpc_cc_library(
external_deps = [
"absl/cleanup",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -2313,6 +2367,7 @@ grpc_cc_library(
external_deps = [
"absl/cleanup",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -2340,6 +2395,7 @@ grpc_cc_library(
"absl/base:core_headers",
"absl/functional:any_invocable",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -2376,6 +2432,7 @@ grpc_cc_library(
"absl/functional:any_invocable",
"absl/hash",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -2418,6 +2475,7 @@ grpc_cc_library(
hdrs = ["lib/event_engine/windows/windows_engine.h"],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -2472,6 +2530,7 @@ grpc_cc_library(
"absl/base:core_headers",
"absl/functional:any_invocable",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/strings:str_format",
],
@ -2501,6 +2560,7 @@ grpc_cc_library(
"absl/cleanup",
"absl/functional:any_invocable",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/strings:str_format",
],
@ -2529,6 +2589,7 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings:str_format",
@ -2563,6 +2624,7 @@ grpc_cc_library(
external_deps = [
"absl/container:flat_hash_map",
"absl/log:check",
"absl/log:log",
"absl/strings",
"absl/strings:str_format",
],
@ -2597,6 +2659,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -2623,6 +2686,9 @@ grpc_cc_library(
hdrs = [
"lib/event_engine/trace.h",
],
external_deps = [
"absl/log:log",
],
deps = [
"//:gpr",
"//:gpr_platform",
@ -2813,6 +2879,7 @@ grpc_cc_library(
"absl/functional:any_invocable",
"absl/hash",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -2869,6 +2936,7 @@ grpc_cc_library(
hdrs = ["lib/transport/bdp_estimator.h"],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/strings",
],
deps = [
@ -3054,6 +3122,7 @@ grpc_cc_library(
external_deps = [
"absl/functional:any_invocable",
"absl/log:check",
"absl/log:log",
"absl/strings",
"absl/types:optional",
],
@ -3064,6 +3133,7 @@ grpc_cc_library(
"channel_fwd",
"channel_stack_trace",
"channel_stack_type",
"interception_chain",
"//:channel_stack_builder",
"//:debug_location",
"//:gpr",
@ -3081,6 +3151,7 @@ grpc_cc_library(
deps = [
"channel_args",
"//:channelz",
"//:event_engine_base_hdrs",
"//:gpr_platform",
],
)
@ -3130,7 +3201,10 @@ grpc_cc_library(
hdrs = [
"service_config/service_config_parser.h",
],
external_deps = ["absl/strings"],
external_deps = [
"absl/log:log",
"absl/strings",
],
language = "c++",
deps = [
"channel_args",
@ -3159,6 +3233,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/meta:type_traits",
"absl/strings",
"absl/strings:str_format",
@ -3334,6 +3409,7 @@ grpc_cc_library(
"client_channel/retry_service_config.h",
],
external_deps = [
"absl/log:log",
"absl/strings",
"absl/types:optional",
],
@ -3384,6 +3460,7 @@ grpc_cc_library(
"client_channel/backup_poller.h",
],
external_deps = [
"absl/log:log",
"absl/status",
],
language = "c++",
@ -3407,6 +3484,7 @@ grpc_cc_library(
"service_config/service_config_channel_arg_filter.cc",
],
external_deps = [
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/types:optional",
@ -3493,6 +3571,7 @@ grpc_cc_library(
hdrs = ["load_balancing/lb_policy_registry.h"],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -3603,6 +3682,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -3742,6 +3822,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/strings",
],
deps = [
@ -3789,6 +3870,7 @@ grpc_cc_library(
"lib/security/authorization/grpc_server_authz_filter.h",
],
external_deps = [
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -3831,6 +3913,7 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/container:flat_hash_map",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -3864,6 +3947,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -3944,6 +4028,9 @@ grpc_cc_library(
hdrs = [
"tsi/local_transport_security.h",
],
external_deps = [
"absl/log:log",
],
language = "c++",
deps = [
"//:event_engine_base_hdrs",
@ -3965,6 +4052,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -4012,6 +4100,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/strings",
"absl/strings:str_format",
@ -4057,6 +4146,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/status:statusor",
"absl/strings",
"absl/types:optional",
@ -4139,6 +4229,7 @@ grpc_cc_library(
"absl/container:inlined_vector",
"absl/functional:bind_front",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -4225,6 +4316,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -4287,6 +4379,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -4333,6 +4426,7 @@ grpc_cc_library(
"lib/http/httpcli_ssl_credentials.h",
],
external_deps = [
"absl/log:log",
"absl/status",
"absl/strings",
"absl/types:optional",
@ -4407,6 +4501,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -4557,6 +4652,7 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/log:check",
"absl/log:log",
"absl/meta:type_traits",
"absl/random",
"absl/status",
@ -4638,6 +4734,7 @@ grpc_cc_library(
"ext/filters/message_size/message_size_filter.h",
],
external_deps = [
"absl/log:log",
"absl/status:statusor",
"absl/strings",
"absl/strings:str_format",
@ -4686,6 +4783,7 @@ grpc_cc_library(
],
external_deps = [
"absl/base:core_headers",
"absl/log:log",
"absl/meta:type_traits",
"absl/random",
"absl/status",
@ -4825,6 +4923,7 @@ grpc_cc_library(
"absl/container:inlined_vector",
"absl/functional:function_ref",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -4942,6 +5041,7 @@ grpc_cc_library(
"absl/base:core_headers",
"absl/hash",
"absl/log:check",
"absl/log:log",
"absl/random",
"absl/status",
"absl/status:statusor",
@ -5076,6 +5176,7 @@ grpc_cc_library(
"absl/cleanup",
"absl/functional:bind_front",
"absl/log:check",
"absl/log:log",
"absl/memory",
"absl/random",
"absl/status",
@ -5260,6 +5361,7 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -5338,6 +5440,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -5398,6 +5501,7 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -5448,6 +5552,7 @@ grpc_cc_library(
"load_balancing/xds/xds_cluster_manager.cc",
],
external_deps = [
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -5491,6 +5596,7 @@ grpc_cc_library(
"load_balancing/xds/xds_wrr_locality.cc",
],
external_deps = [
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -5560,6 +5666,7 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -5607,6 +5714,7 @@ grpc_cc_library(
external_deps = [
"absl/functional:function_ref",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/types:optional",
@ -5644,6 +5752,7 @@ grpc_cc_library(
external_deps = [
"absl/algorithm:container",
"absl/log:check",
"absl/log:log",
"absl/random",
"absl/status",
"absl/status:statusor",
@ -5730,7 +5839,10 @@ grpc_cc_library(
hdrs = [
"lib/transport/connectivity_state.h",
],
external_deps = ["absl/status"],
external_deps = [
"absl/log:log",
"absl/status",
],
deps = [
"closure",
"error",
@ -5765,6 +5877,7 @@ grpc_cc_library(
"absl/base:core_headers",
"absl/container:inlined_vector",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -5815,6 +5928,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/meta:type_traits",
"absl/random",
"absl/status",
@ -5868,6 +5982,7 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/log:check",
"absl/log:log",
"absl/meta:type_traits",
"absl/random",
"absl/status",
@ -5938,6 +6053,7 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/log:check",
"absl/log:log",
"absl/meta:type_traits",
"absl/random",
"absl/status",
@ -5987,6 +6103,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -6035,6 +6152,7 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/log:check",
"absl/log:log",
"absl/meta:type_traits",
"absl/random",
"absl/status",
@ -6084,6 +6202,7 @@ grpc_cc_library(
"absl/base:core_headers",
"absl/functional:function_ref",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -6145,6 +6264,7 @@ grpc_cc_library(
],
external_deps = [
"absl/container:inlined_vector",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -6189,6 +6309,7 @@ grpc_cc_library(
"ext/filters/backend_metrics/backend_metric_filter.h",
],
external_deps = [
"absl/log:log",
"absl/status:statusor",
"absl/strings",
"absl/types:optional",
@ -6229,6 +6350,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -6293,6 +6415,7 @@ grpc_cc_library(
"absl/base:core_headers",
"absl/cleanup",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -6334,7 +6457,10 @@ grpc_cc_library(
hdrs = [
"resolver/dns/dns_resolver_plugin.h",
],
external_deps = ["absl/strings"],
external_deps = [
"absl/log:log",
"absl/strings",
],
language = "c++",
deps = [
"experiments",
@ -6358,6 +6484,7 @@ grpc_cc_library(
],
external_deps = [
"absl/functional:bind_front",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -6391,6 +6518,7 @@ grpc_cc_library(
"resolver/sockaddr/sockaddr_resolver.cc",
],
external_deps = [
"absl/log:log",
"absl/status:statusor",
"absl/strings",
],
@ -6415,6 +6543,7 @@ grpc_cc_library(
"resolver/binder/binder_resolver.cc",
],
external_deps = [
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -6476,6 +6605,7 @@ grpc_cc_library(
"absl/container:flat_hash_map",
"absl/container:flat_hash_set",
"absl/log:check",
"absl/log:log",
"absl/strings",
],
language = "c++",
@ -6499,6 +6629,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/meta:type_traits",
"absl/random",
"absl/status",
@ -6560,6 +6691,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/status:statusor",
"absl/strings",
"absl/types:optional",
@ -6627,6 +6759,7 @@ grpc_cc_library(
external_deps = [
"absl/functional:function_ref",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/strings",
"absl/strings:str_format",
@ -6821,6 +6954,7 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings:str_format",
@ -6878,6 +7012,7 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -6892,6 +7027,8 @@ grpc_cc_library(
"connection_quota",
"error",
"error_utils",
"event_engine_extensions",
"event_engine_query_extensions",
"grpc_insecure_credentials",
"handshaker_registry",
"iomgr_fwd",
@ -6937,6 +7074,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -6954,6 +7092,7 @@ grpc_cc_library(
"experiments",
"iomgr_fwd",
"metadata_batch",
"resource_quota",
"slice",
"slice_buffer",
"status_helper",
@ -7062,6 +7201,7 @@ grpc_cc_library(
external_deps = [
"absl/functional:any_invocable",
"absl/log:check",
"absl/log:log",
"absl/status",
"absl/status:statusor",
"absl/strings",
@ -7115,6 +7255,7 @@ grpc_cc_library(
"ext/filters/logging/logging_filter.h",
],
external_deps = [
"absl/log:log",
"absl/numeric:int128",
"absl/random",
"absl/random:distributions",
@ -7193,7 +7334,10 @@ grpc_cc_library(
hdrs = [
"ext/transport/chaotic_good/chaotic_good_transport.h",
],
external_deps = ["absl/random"],
external_deps = [
"absl/log:log",
"absl/random",
],
language = "c++",
deps = [
"chaotic_good_frame",
@ -7222,6 +7366,7 @@ grpc_cc_library(
"absl/base:core_headers",
"absl/container:flat_hash_map",
"absl/log:check",
"absl/log:log",
"absl/random",
"absl/random:bit_gen_ref",
"absl/status",
@ -7280,6 +7425,7 @@ grpc_cc_library(
"absl/container:flat_hash_map",
"absl/functional:any_invocable",
"absl/log:check",
"absl/log:log",
"absl/random",
"absl/random:bit_gen_ref",
"absl/status",
@ -7365,6 +7511,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
],
deps = [
"call_final_info",
@ -7475,6 +7622,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
],
deps = [
"1999",
@ -7612,6 +7760,7 @@ grpc_cc_library(
external_deps = [
"absl/container:flat_hash_map",
"absl/log:check",
"absl/log:log",
"absl/random",
"absl/random:bit_gen_ref",
"absl/status",
@ -7677,6 +7826,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"absl/random",
"absl/random:bit_gen_ref",
"absl/status",

@ -28,10 +28,10 @@
#include <grpc/support/port_platform.h>
#include "src/core/channelz/channelz.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/slice/slice.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/util/string.h"
namespace grpc_core {
namespace channelz {

@ -37,12 +37,12 @@
#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/resolved_address.h"
#include "src/core/lib/json/json_writer.h"
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/uri/uri_parser.h"
#include "src/core/util/string.h"
#include "src/core/util/useful.h"
namespace grpc_core {
namespace channelz {

@ -38,13 +38,13 @@
#include <grpc/support/port_platform.h>
#include "src/core/channelz/channel_trace.h"
#include "src/core/lib/gpr/time_precise.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/per_cpu.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/json/json.h"
#include "src/core/util/time_precise.h"
#include "src/core/util/useful.h"
// Channel arg key for channelz node.
#define GRPC_ARG_CHANNELZ_CHANNEL_NODE "grpc.internal.channelz_channel_node"
@ -72,7 +72,7 @@ class ListenSocketNode;
namespace testing {
class CallCountingHelperPeer;
class ChannelNodePeer;
class SubchannelNodePeer;
} // namespace testing
// base class for all channelz entities
@ -228,9 +228,6 @@ class ChannelNode final : public BaseNode {
void RemoveChildSubchannel(intptr_t child_uuid);
private:
// Allows the channel trace test to access trace_.
friend class testing::ChannelNodePeer;
void PopulateChildRefs(Json::Object* json);
std::string target_;
@ -277,6 +274,9 @@ class SubchannelNode final : public BaseNode {
void RecordCallSucceeded() { call_counter_.RecordCallSucceeded(); }
private:
// Allows the channel trace test to access trace_.
friend class testing::SubchannelNodePeer;
std::atomic<grpc_connectivity_state> connectivity_state_{GRPC_CHANNEL_IDLE};
Mutex socket_mu_;
RefCountedPtr<SocketNode> child_socket_ ABSL_GUARDED_BY(socket_mu_);

@ -25,6 +25,7 @@
#include <vector>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include <grpc/grpc.h>
#include <grpc/support/json.h>
@ -171,7 +172,7 @@ void ChannelzRegistry::InternalLogAllEntities() {
}
for (size_t i = 0; i < nodes.size(); ++i) {
std::string json = nodes[i]->RenderJsonString();
gpr_log(GPR_INFO, "%s", json.c_str());
LOG(INFO) << json;
}
}

@ -68,7 +68,6 @@
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/experiments/experiments.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/manual_constructor.h"
@ -104,6 +103,7 @@
#include "src/core/resolver/resolver_registry.h"
#include "src/core/service_config/service_config_call_data.h"
#include "src/core/service_config/service_config_impl.h"
#include "src/core/util/useful.h"
//
// Client channel filter

@ -48,7 +48,6 @@
#include "src/core/lib/channel/channel_fwd.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/context.h"
#include "src/core/lib/gpr/time_precise.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
@ -71,6 +70,7 @@
#include "src/core/load_balancing/lb_policy.h"
#include "src/core/resolver/resolver.h"
#include "src/core/service_config/service_config.h"
#include "src/core/util/time_precise.h"
//
// Client channel filter

@ -19,7 +19,7 @@
#include "src/core/client_channel/config_selector.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/util/useful.h"
namespace grpc_core {

@ -33,13 +33,13 @@
#include "src/core/client_channel/client_channel_internal.h"
#include "src/core/lib/channel/channel_fwd.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/slice/slice.h"
#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/service_config/service_config.h"
#include "src/core/util/useful.h"
// Channel arg key for ConfigSelector.
#define GRPC_ARG_CONFIG_SELECTOR "grpc.internal.config_selector"

@ -24,6 +24,7 @@
#include <utility>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/status/statusor.h"
#include <grpc/support/log.h>
@ -32,10 +33,10 @@
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/channel_stack_builder_impl.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/alloc.h"
#include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/surface/channel_stack_type.h"
#include "src/core/lib/surface/lame_client.h"
#include "src/core/util/alloc.h"
// Conversion between call and call stack.
#define CALL_TO_CALL_STACK(call) \
@ -68,7 +69,7 @@ DynamicFilters::Call::Call(Args args, grpc_error_handle* error)
*error = grpc_call_stack_init(channel_stack_->channel_stack_.get(), 1,
Destroy, this, &call_args);
if (GPR_UNLIKELY(!error->ok())) {
gpr_log(GPR_ERROR, "error: %s", StatusToString(*error).c_str());
LOG(ERROR) << "error: " << StatusToString(*error);
return;
}
grpc_call_stack_set_pollset_or_pollset_set(call_stack, args.pollent);

@ -28,7 +28,6 @@
#include "src/core/lib/channel/channel_fwd.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/context.h"
#include "src/core/lib/gpr/time_precise.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
@ -39,6 +38,7 @@
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/transport/transport.h"
#include "src/core/util/time_precise.h"
namespace grpc_core {

@ -40,10 +40,10 @@
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/context.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/transport/transport.h"
#include "src/core/util/useful.h"
extern grpc_core::TraceFlag grpc_retry_trace;

@ -35,7 +35,6 @@
#include "src/core/lib/channel/context.h"
#include "src/core/lib/channel/status_util.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/construct_destruct.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/orphanable.h"
@ -54,6 +53,7 @@
#include "src/core/lib/transport/error_utils.h"
#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/transport/transport.h"
#include "src/core/util/useful.h"
namespace grpc_core {

@ -27,6 +27,7 @@
#include <utility>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/status/statusor.h"
#include "absl/strings/cord.h"
#include "absl/strings/str_cat.h"
@ -51,8 +52,6 @@
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/debug/stats_data.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/alloc.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/status_helper.h"
@ -68,6 +67,8 @@
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/error_utils.h"
#include "src/core/lib/transport/transport.h"
#include "src/core/util/alloc.h"
#include "src/core/util/useful.h"
// Backoff parameters.
#define GRPC_SUBCHANNEL_INITIAL_CONNECT_BACKOFF_SECONDS 1
@ -196,7 +197,7 @@ SubchannelCall::SubchannelCall(Args args, grpc_error_handle* error)
*error = grpc_call_stack_init(connected_subchannel_->channel_stack(), 1,
SubchannelCall::Destroy, this, &call_args);
if (GPR_UNLIKELY(!error->ok())) {
gpr_log(GPR_ERROR, "error: %s", StatusToString(*error).c_str());
LOG(ERROR) << "error: " << StatusToString(*error);
return;
}
grpc_call_stack_set_pollset_or_pollset_set(callstk, args.pollent);

@ -37,7 +37,6 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_fwd.h"
#include "src/core/lib/channel/context.h"
#include "src/core/lib/gpr/time_precise.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/dual_ref_counted.h"
#include "src/core/lib/gprpp/orphanable.h"
@ -59,6 +58,7 @@
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/transport/transport.h"
#include "src/core/util/time_precise.h"
namespace grpc_core {

@ -27,10 +27,10 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/resolved_address.h"
#include "src/core/util/useful.h"
namespace grpc_core {

@ -29,7 +29,6 @@
#include <grpc/support/log.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/time_precise.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/gprpp/sync.h"
@ -37,6 +36,7 @@
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/resource_quota/resource_quota.h"
#include "src/core/lib/transport/error_utils.h"
#include "src/core/util/time_precise.h"
#define SUBCHANNEL_STREAM_INITIAL_CONNECT_BACKOFF_SECONDS 1
#define SUBCHANNEL_STREAM_RECONNECT_BACKOFF_MULTIPLIER 1.6

@ -52,6 +52,7 @@ TraceFlag grpc_backend_metric_filter_trace(false, "backend_metric_filter");
const NoInterceptor BackendMetricFilter::Call::OnClientInitialMetadata;
const NoInterceptor BackendMetricFilter::Call::OnServerInitialMetadata;
const NoInterceptor BackendMetricFilter::Call::OnClientToServerMessage;
const NoInterceptor BackendMetricFilter::Call::OnClientToServerHalfClose;
const NoInterceptor BackendMetricFilter::Call::OnServerToClientMessage;
const NoInterceptor BackendMetricFilter::Call::OnFinalize;

@ -44,6 +44,7 @@ class BackendMetricFilter : public ImplementChannelFilter<BackendMetricFilter> {
static const NoInterceptor OnServerInitialMetadata;
void OnServerTrailingMetadata(ServerMetadata& md);
static const NoInterceptor OnClientToServerMessage;
static const NoInterceptor OnClientToServerHalfClose;
static const NoInterceptor OnServerToClientMessage;
static const NoInterceptor OnFinalize;
};

@ -58,6 +58,7 @@ TraceFlag grpc_fault_injection_filter_trace(false, "fault_injection_filter");
const NoInterceptor FaultInjectionFilter::Call::OnServerInitialMetadata;
const NoInterceptor FaultInjectionFilter::Call::OnServerTrailingMetadata;
const NoInterceptor FaultInjectionFilter::Call::OnClientToServerMessage;
const NoInterceptor FaultInjectionFilter::Call::OnClientToServerHalfClose;
const NoInterceptor FaultInjectionFilter::Call::OnServerToClientMessage;
const NoInterceptor FaultInjectionFilter::Call::OnFinalize;

@ -58,6 +58,7 @@ class FaultInjectionFilter
static const NoInterceptor OnServerInitialMetadata;
static const NoInterceptor OnServerTrailingMetadata;
static const NoInterceptor OnClientToServerMessage;
static const NoInterceptor OnClientToServerHalfClose;
static const NoInterceptor OnServerToClientMessage;
static const NoInterceptor OnFinalize;
};

@ -54,6 +54,7 @@ namespace grpc_core {
const NoInterceptor HttpClientFilter::Call::OnServerToClientMessage;
const NoInterceptor HttpClientFilter::Call::OnClientToServerMessage;
const NoInterceptor HttpClientFilter::Call::OnClientToServerHalfClose;
const NoInterceptor HttpClientFilter::Call::OnFinalize;
const grpc_channel_filter HttpClientFilter::kFilter =

@ -47,6 +47,7 @@ class HttpClientFilter : public ImplementChannelFilter<HttpClientFilter> {
absl::Status OnServerInitialMetadata(ServerMetadata& md);
absl::Status OnServerTrailingMetadata(ServerMetadata& md);
static const NoInterceptor OnClientToServerMessage;
static const NoInterceptor OnClientToServerHalfClose;
static const NoInterceptor OnServerToClientMessage;
static const NoInterceptor OnFinalize;
};

@ -40,6 +40,7 @@ namespace grpc_core {
const NoInterceptor ClientAuthorityFilter::Call::OnServerInitialMetadata;
const NoInterceptor ClientAuthorityFilter::Call::OnServerTrailingMetadata;
const NoInterceptor ClientAuthorityFilter::Call::OnClientToServerMessage;
const NoInterceptor ClientAuthorityFilter::Call::OnClientToServerHalfClose;
const NoInterceptor ClientAuthorityFilter::Call::OnServerToClientMessage;
const NoInterceptor ClientAuthorityFilter::Call::OnFinalize;

@ -52,6 +52,7 @@ class ClientAuthorityFilter final
static const NoInterceptor OnServerInitialMetadata;
static const NoInterceptor OnServerTrailingMetadata;
static const NoInterceptor OnClientToServerMessage;
static const NoInterceptor OnClientToServerHalfClose;
static const NoInterceptor OnServerToClientMessage;
static const NoInterceptor OnFinalize;
};

@ -57,8 +57,10 @@
namespace grpc_core {
const NoInterceptor ServerCompressionFilter::Call::OnClientToServerHalfClose;
const NoInterceptor ServerCompressionFilter::Call::OnServerTrailingMetadata;
const NoInterceptor ServerCompressionFilter::Call::OnFinalize;
const NoInterceptor ClientCompressionFilter::Call::OnClientToServerHalfClose;
const NoInterceptor ClientCompressionFilter::Call::OnServerTrailingMetadata;
const NoInterceptor ClientCompressionFilter::Call::OnFinalize;

@ -129,6 +129,7 @@ class ClientCompressionFilter final
absl::StatusOr<MessageHandle> OnServerToClientMessage(
MessageHandle message, ClientCompressionFilter* filter);
static const NoInterceptor OnClientToServerHalfClose;
static const NoInterceptor OnServerTrailingMetadata;
static const NoInterceptor OnFinalize;
@ -165,6 +166,7 @@ class ServerCompressionFilter final
MessageHandle OnServerToClientMessage(MessageHandle message,
ServerCompressionFilter* filter);
static const NoInterceptor OnClientToServerHalfClose;
static const NoInterceptor OnServerTrailingMetadata;
static const NoInterceptor OnFinalize;

@ -50,6 +50,7 @@
namespace grpc_core {
const NoInterceptor HttpServerFilter::Call::OnClientToServerMessage;
const NoInterceptor HttpServerFilter::Call::OnClientToServerHalfClose;
const NoInterceptor HttpServerFilter::Call::OnServerToClientMessage;
const NoInterceptor HttpServerFilter::Call::OnFinalize;

@ -50,6 +50,7 @@ class HttpServerFilter : public ImplementChannelFilter<HttpServerFilter> {
void OnServerInitialMetadata(ServerMetadata& md);
void OnServerTrailingMetadata(ServerMetadata& md);
static const NoInterceptor OnClientToServerMessage;
static const NoInterceptor OnClientToServerHalfClose;
static const NoInterceptor OnServerToClientMessage;
static const NoInterceptor OnFinalize;
};

@ -74,6 +74,7 @@ constexpr char kEmptyAddressLengthString[] = "00";
const NoInterceptor ServerLoadReportingFilter::Call::OnServerInitialMetadata;
const NoInterceptor ServerLoadReportingFilter::Call::OnClientToServerMessage;
const NoInterceptor ServerLoadReportingFilter::Call::OnClientToServerHalfClose;
const NoInterceptor ServerLoadReportingFilter::Call::OnServerToClientMessage;
absl::StatusOr<std::unique_ptr<ServerLoadReportingFilter>>

@ -54,6 +54,7 @@ class ServerLoadReportingFilter
void OnServerTrailingMetadata(ServerMetadata& md,
ServerLoadReportingFilter* filter);
static const NoInterceptor OnClientToServerMessage;
static const NoInterceptor OnClientToServerHalfClose;
static const NoInterceptor OnServerToClientMessage;
void OnFinalize(const grpc_call_final_info* final_info,
ServerLoadReportingFilter* filter);

@ -31,6 +31,7 @@
#include <utility>
#include <vector>
#include "absl/log/log.h"
#include "absl/numeric/int128.h"
#include "absl/random/random.h"
#include "absl/random/uniform_int_distribution.h"
@ -73,6 +74,9 @@
namespace grpc_core {
const NoInterceptor ClientLoggingFilter::Call::OnFinalize;
const NoInterceptor ServerLoggingFilter::Call::OnFinalize;
namespace {
LoggingSink* g_logging_sink = nullptr;
@ -157,7 +161,7 @@ LoggingSink::Entry::Address PeerStringToAddress(const Slice& peer_string) {
LoggingSink::Entry::Address address;
absl::StatusOr<URI> uri = URI::Parse(peer_string.as_string_view());
if (!uri.ok()) {
gpr_log(GPR_DEBUG, "peer_string is in invalid format and cannot be logged");
VLOG(2) << "peer_string is in invalid format and cannot be logged";
return address;
}
@ -195,152 +199,148 @@ void EncodeMessageToPayload(const SliceBuffer* message, uint32_t log_len,
}
}
class CallData {
public:
CallData(bool is_client, const CallArgs& call_args,
const std::string& authority)
: call_id_(GetCallId()) {
absl::string_view path;
if (auto* value = call_args.client_initial_metadata->get_pointer(
HttpPathMetadata())) {
path = value->as_string_view();
}
std::vector<std::string> parts =
absl::StrSplit(path, '/', absl::SkipEmpty());
if (parts.size() == 2) {
service_name_ = std::move(parts[0]);
method_name_ = std::move(parts[1]);
} // namespace
namespace logging_filter_detail {
CallData::CallData(bool is_client,
const ClientMetadata& client_initial_metadata,
const std::string& authority)
: call_id_(GetCallId()) {
absl::string_view path;
if (auto* value = client_initial_metadata.get_pointer(HttpPathMetadata())) {
path = value->as_string_view();
}
std::vector<std::string> parts = absl::StrSplit(path, '/', absl::SkipEmpty());
if (parts.size() == 2) {
service_name_ = std::move(parts[0]);
method_name_ = std::move(parts[1]);
}
config_ = g_logging_sink->FindMatch(is_client, service_name_, method_name_);
if (config_.ShouldLog()) {
if (auto* value =
client_initial_metadata.get_pointer(HttpAuthorityMetadata())) {
authority_ = std::string(value->as_string_view());
} else {
authority_ = authority;
}
config_ = g_logging_sink->FindMatch(is_client, service_name_, method_name_);
if (config_.ShouldLog()) {
if (auto* value = call_args.client_initial_metadata->get_pointer(
HttpAuthorityMetadata())) {
authority_ = std::string(value->as_string_view());
} else {
authority_ = authority;
}
}
}
void CallData::LogClientHeader(bool is_client,
CallTracerAnnotationInterface* tracer,
const ClientMetadata& metadata) {
LoggingSink::Entry entry;
if (!is_client) {
if (auto* value = metadata.get_pointer(PeerString())) {
peer_ = PeerStringToAddress(*value);
}
}
SetCommonEntryFields(&entry, is_client, tracer,
LoggingSink::Entry::EventType::kClientHeader);
MetadataEncoder encoder(&entry.payload, nullptr,
config_.max_metadata_bytes());
metadata.Encode(&encoder);
entry.payload_truncated = encoder.truncated();
g_logging_sink->LogEntry(std::move(entry));
}
bool ShouldLog() { return config_.ShouldLog(); }
void CallData::LogClientHalfClose(bool is_client,
CallTracerAnnotationInterface* tracer) {
LoggingSink::Entry entry;
SetCommonEntryFields(&entry, is_client, tracer,
LoggingSink::Entry::EventType::kClientHalfClose);
g_logging_sink->LogEntry(std::move(entry));
}
void LogClientHeader(bool is_client, CallTracerAnnotationInterface* tracer,
const ClientMetadataHandle& metadata) {
LoggingSink::Entry entry;
if (!is_client) {
void CallData::LogServerHeader(bool is_client,
CallTracerAnnotationInterface* tracer,
const ServerMetadata* metadata) {
LoggingSink::Entry entry;
if (metadata != nullptr) {
entry.is_trailer_only = metadata->get(GrpcTrailersOnly()).value_or(false);
if (is_client) {
if (auto* value = metadata->get_pointer(PeerString())) {
peer_ = PeerStringToAddress(*value);
}
}
SetCommonEntryFields(&entry, is_client, tracer,
LoggingSink::Entry::EventType::kClientHeader);
}
SetCommonEntryFields(&entry, is_client, tracer,
LoggingSink::Entry::EventType::kServerHeader);
if (metadata != nullptr) {
MetadataEncoder encoder(&entry.payload, nullptr,
config_.max_metadata_bytes());
metadata->Encode(&encoder);
entry.payload_truncated = encoder.truncated();
g_logging_sink->LogEntry(std::move(entry));
}
void LogClientHalfClose(bool is_client,
CallTracerAnnotationInterface* tracer) {
LoggingSink::Entry entry;
SetCommonEntryFields(&entry, is_client, tracer,
LoggingSink::Entry::EventType::kClientHalfClose);
g_logging_sink->LogEntry(std::move(entry));
}
void LogServerHeader(bool is_client, CallTracerAnnotationInterface* tracer,
const ServerMetadata* metadata) {
LoggingSink::Entry entry;
if (metadata != nullptr) {
entry.is_trailer_only = metadata->get(GrpcTrailersOnly()).value_or(false);
if (is_client) {
if (auto* value = metadata->get_pointer(PeerString())) {
peer_ = PeerStringToAddress(*value);
}
}
}
SetCommonEntryFields(&entry, is_client, tracer,
LoggingSink::Entry::EventType::kServerHeader);
if (metadata != nullptr) {
MetadataEncoder encoder(&entry.payload, nullptr,
config_.max_metadata_bytes());
metadata->Encode(&encoder);
entry.payload_truncated = encoder.truncated();
}
g_logging_sink->LogEntry(std::move(entry));
}
g_logging_sink->LogEntry(std::move(entry));
}
void LogServerTrailer(bool is_client, CallTracerAnnotationInterface* tracer,
const ServerMetadata* metadata) {
LoggingSink::Entry entry;
SetCommonEntryFields(&entry, is_client, tracer,
LoggingSink::Entry::EventType::kServerTrailer);
if (metadata != nullptr) {
entry.is_trailer_only = metadata->get(GrpcTrailersOnly()).value_or(false);
MetadataEncoder encoder(&entry.payload, &entry.payload.status_details,
config_.max_metadata_bytes());
metadata->Encode(&encoder);
entry.payload_truncated = encoder.truncated();
}
g_logging_sink->LogEntry(std::move(entry));
void CallData::LogServerTrailer(bool is_client,
CallTracerAnnotationInterface* tracer,
const ServerMetadata* metadata) {
LoggingSink::Entry entry;
SetCommonEntryFields(&entry, is_client, tracer,
LoggingSink::Entry::EventType::kServerTrailer);
if (metadata != nullptr) {
entry.is_trailer_only = metadata->get(GrpcTrailersOnly()).value_or(false);
MetadataEncoder encoder(&entry.payload, &entry.payload.status_details,
config_.max_metadata_bytes());
metadata->Encode(&encoder);
entry.payload_truncated = encoder.truncated();
}
g_logging_sink->LogEntry(std::move(entry));
}
void LogClientMessage(bool is_client, CallTracerAnnotationInterface* tracer,
const SliceBuffer* message) {
LoggingSink::Entry entry;
SetCommonEntryFields(&entry, is_client, tracer,
LoggingSink::Entry::EventType::kClientMessage);
EncodeMessageToPayload(message, config_.max_message_bytes(), &entry);
g_logging_sink->LogEntry(std::move(entry));
}
void CallData::LogClientMessage(bool is_client,
CallTracerAnnotationInterface* tracer,
const SliceBuffer* message) {
LoggingSink::Entry entry;
SetCommonEntryFields(&entry, is_client, tracer,
LoggingSink::Entry::EventType::kClientMessage);
EncodeMessageToPayload(message, config_.max_message_bytes(), &entry);
g_logging_sink->LogEntry(std::move(entry));
}
void LogServerMessage(bool is_client, CallTracerAnnotationInterface* tracer,
const SliceBuffer* message) {
LoggingSink::Entry entry;
SetCommonEntryFields(&entry, is_client, tracer,
LoggingSink::Entry::EventType::kServerMessage);
EncodeMessageToPayload(message, config_.max_message_bytes(), &entry);
g_logging_sink->LogEntry(std::move(entry));
}
void CallData::LogServerMessage(bool is_client,
CallTracerAnnotationInterface* tracer,
const SliceBuffer* message) {
LoggingSink::Entry entry;
SetCommonEntryFields(&entry, is_client, tracer,
LoggingSink::Entry::EventType::kServerMessage);
EncodeMessageToPayload(message, config_.max_message_bytes(), &entry);
g_logging_sink->LogEntry(std::move(entry));
}
void LogCancel(bool is_client, CallTracerAnnotationInterface* tracer) {
LoggingSink::Entry entry;
SetCommonEntryFields(&entry, is_client, tracer,
LoggingSink::Entry::EventType::kCancel);
g_logging_sink->LogEntry(std::move(entry));
}
void CallData::LogCancel(bool is_client,
CallTracerAnnotationInterface* tracer) {
LoggingSink::Entry entry;
SetCommonEntryFields(&entry, is_client, tracer,
LoggingSink::Entry::EventType::kCancel);
g_logging_sink->LogEntry(std::move(entry));
}
private:
void SetCommonEntryFields(LoggingSink::Entry* entry, bool is_client,
CallTracerAnnotationInterface* tracer,
LoggingSink::Entry::EventType event_type) {
entry->call_id = call_id_;
entry->sequence_id = sequence_id_++;
entry->type = event_type;
entry->logger = is_client ? LoggingSink::Entry::Logger::kClient
: LoggingSink::Entry::Logger::kServer;
entry->authority = authority_;
entry->peer = peer_;
entry->service_name = service_name_;
entry->method_name = method_name_;
entry->timestamp = Timestamp::Now();
if (tracer != nullptr) {
entry->trace_id = tracer->TraceId();
entry->span_id = tracer->SpanId();
entry->is_sampled = tracer->IsSampled();
}
void CallData::SetCommonEntryFields(LoggingSink::Entry* entry, bool is_client,
CallTracerAnnotationInterface* tracer,
LoggingSink::Entry::EventType event_type) {
entry->call_id = call_id_;
entry->sequence_id = sequence_id_++;
entry->type = event_type;
entry->logger = is_client ? LoggingSink::Entry::Logger::kClient
: LoggingSink::Entry::Logger::kServer;
entry->authority = authority_;
entry->peer = peer_;
entry->service_name = service_name_;
entry->method_name = method_name_;
entry->timestamp = Timestamp::Now();
if (tracer != nullptr) {
entry->trace_id = tracer->TraceId();
entry->span_id = tracer->SpanId();
entry->is_sampled = tracer->IsSampled();
}
absl::uint128 call_id_;
uint32_t sequence_id_ = 0;
std::string service_name_;
std::string method_name_;
std::string authority_;
LoggingSink::Entry::Address peer_;
LoggingSink::Config config_;
};
}
} // namespace
} // namespace logging_filter_detail
absl::StatusOr<std::unique_ptr<ClientLoggingFilter>>
ClientLoggingFilter::Create(const ChannelArgs& args,
@ -361,84 +361,57 @@ ClientLoggingFilter::Create(const ChannelArgs& args,
return std::make_unique<ClientLoggingFilter>("");
}
// Construct a promise for one call.
ArenaPromise<ServerMetadataHandle> ClientLoggingFilter::MakeCallPromise(
CallArgs call_args, NextPromiseFactory next_promise_factory) {
CallData* calld = GetContext<Arena>()->ManagedNew<CallData>(
true, call_args, default_authority_);
if (!calld->ShouldLog()) {
return next_promise_factory(std::move(call_args));
void ClientLoggingFilter::Call::OnClientInitialMetadata(
ClientMetadata& md, ClientLoggingFilter* filter) {
call_data_.emplace(true, md, filter->default_authority_);
if (!call_data_->ShouldLog()) {
call_data_.reset();
return;
}
call_data_->LogClientHeader(
/*is_client=*/true, MaybeGetContext<CallTracerAnnotationInterface>(), md);
}
void ClientLoggingFilter::Call::OnServerInitialMetadata(ServerMetadata& md) {
if (!call_data_.has_value()) return;
call_data_->LogServerHeader(
/*is_client=*/true, MaybeGetContext<CallTracerAnnotationInterface>(),
&md);
}
void ClientLoggingFilter::Call::OnServerTrailingMetadata(ServerMetadata& md) {
if (!call_data_.has_value()) return;
if (md.get(GrpcCallWasCancelled()).value_or(false) &&
md.get(GrpcStatusMetadata()) == GRPC_STATUS_CANCELLED) {
call_data_->LogCancel(
/*is_client=*/true, MaybeGetContext<CallTracerAnnotationInterface>());
return;
}
calld->LogClientHeader(
/*is_client=*/true,
static_cast<CallTracerAnnotationInterface*>(
GetContext<grpc_call_context_element>()
[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE]
.value),
call_args.client_initial_metadata);
call_args.server_initial_metadata->InterceptAndMap(
[calld](ServerMetadataHandle metadata) {
calld->LogServerHeader(
/*is_client=*/true,
static_cast<CallTracerAnnotationInterface*>(
GetContext<grpc_call_context_element>()
[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE]
.value),
metadata.get());
return metadata;
});
call_args.client_to_server_messages->InterceptAndMapWithHalfClose(
[calld](MessageHandle message) {
calld->LogClientMessage(
/*is_client=*/true,
static_cast<CallTracerAnnotationInterface*>(
GetContext<grpc_call_context_element>()
[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE]
.value),
message->payload());
return message;
},
[calld] {
calld->LogClientHalfClose(
/*is_client=*/true,
static_cast<CallTracerAnnotationInterface*>(
GetContext<grpc_call_context_element>()
[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE]
.value));
});
call_args.server_to_client_messages->InterceptAndMap(
[calld](MessageHandle message) {
calld->LogServerMessage(
/*is_client=*/true,
static_cast<CallTracerAnnotationInterface*>(
GetContext<grpc_call_context_element>()
[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE]
.value),
message->payload());
return message;
});
return OnCancel(
Map(next_promise_factory(std::move(call_args)),
[calld](ServerMetadataHandle md) {
calld->LogServerTrailer(
/*is_client=*/true,
static_cast<CallTracerAnnotationInterface*>(
GetContext<grpc_call_context_element>()
[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE]
.value),
md.get());
return md;
}),
// TODO(yashykt/ctiller): GetContext<grpc_call_context_element> is not
// valid for the cancellation function requiring us to capture it here.
// This ought to be easy to fix once client side promises are completely
// rolled out.
[calld, ctx = GetContext<grpc_call_context_element>()]() {
calld->LogCancel(
/*is_client=*/true,
static_cast<CallTracerAnnotationInterface*>(
ctx[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE].value));
});
call_data_->LogServerTrailer(
/*is_client=*/true, MaybeGetContext<CallTracerAnnotationInterface>(),
&md);
}
void ClientLoggingFilter::Call::OnClientToServerMessage(
const Message& message) {
if (!call_data_.has_value()) return;
call_data_->LogClientMessage(
/*is_client=*/true, MaybeGetContext<CallTracerAnnotationInterface>(),
message.payload());
}
void ClientLoggingFilter::Call::OnClientToServerHalfClose() {
if (!call_data_.has_value()) return;
call_data_->LogClientHalfClose(
/*is_client=*/true, MaybeGetContext<CallTracerAnnotationInterface>());
}
void ClientLoggingFilter::Call::OnServerToClientMessage(
const Message& message) {
if (!call_data_.has_value()) return;
call_data_->LogServerMessage(
/*is_client=*/true, MaybeGetContext<CallTracerAnnotationInterface>(),
message.payload());
}
const grpc_channel_filter ClientLoggingFilter::kFilter =
@ -454,79 +427,57 @@ ServerLoggingFilter::Create(const ChannelArgs& /*args*/,
}
// Construct a promise for one call.
ArenaPromise<ServerMetadataHandle> ServerLoggingFilter::MakeCallPromise(
CallArgs call_args, NextPromiseFactory next_promise_factory) {
CallData* calld = GetContext<Arena>()->ManagedNew<CallData>(
false, call_args, /*default_authority=*/"");
if (!calld->ShouldLog()) {
return next_promise_factory(std::move(call_args));
void ServerLoggingFilter::Call::OnClientInitialMetadata(ClientMetadata& md) {
call_data_.emplace(false, md, "");
if (!call_data_->ShouldLog()) {
call_data_.reset();
return;
}
auto* call_tracer = static_cast<CallTracerAnnotationInterface*>(
GetContext<grpc_call_context_element>()
[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE]
.value);
calld->LogClientHeader(
/*is_client=*/false, call_tracer, call_args.client_initial_metadata);
call_args.server_initial_metadata->InterceptAndMap(
[calld](ServerMetadataHandle metadata) {
calld->LogServerHeader(
/*is_client=*/false,
static_cast<CallTracerAnnotationInterface*>(
GetContext<grpc_call_context_element>()
[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE]
.value),
metadata.get());
return metadata;
});
call_args.client_to_server_messages->InterceptAndMapWithHalfClose(
[calld](MessageHandle message) {
calld->LogClientMessage(
/*is_client=*/false,
static_cast<CallTracerAnnotationInterface*>(
GetContext<grpc_call_context_element>()
[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE]
.value),
message->payload());
return message;
},
[calld] {
calld->LogClientHalfClose(
/*is_client=*/false,
static_cast<CallTracerAnnotationInterface*>(
GetContext<grpc_call_context_element>()
[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE]
.value));
});
call_args.server_to_client_messages->InterceptAndMap(
[calld](MessageHandle message) {
calld->LogServerMessage(
/*is_client=*/false,
static_cast<CallTracerAnnotationInterface*>(
GetContext<grpc_call_context_element>()
[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE]
.value),
message->payload());
return message;
});
return OnCancel(
Map(next_promise_factory(std::move(call_args)),
[calld](ServerMetadataHandle md) {
calld->LogServerTrailer(
/*is_client=*/false,
static_cast<CallTracerAnnotationInterface*>(
GetContext<grpc_call_context_element>()
[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE]
.value),
md.get());
return md;
}),
// TODO(yashykt/ctiller): GetContext<grpc_call_context_element> is not
// valid for the cancellation function requiring us to capture
// call_tracer.
[calld, call_tracer]() {
calld->LogCancel(
/*is_client=*/false, call_tracer);
});
call_data_->LogClientHeader(
/*is_client=*/false, MaybeGetContext<CallTracerAnnotationInterface>(),
md);
}
void ServerLoggingFilter::Call::OnServerInitialMetadata(ServerMetadata& md) {
if (!call_data_.has_value()) return;
call_data_->LogServerHeader(
/*is_client=*/false, MaybeGetContext<CallTracerAnnotationInterface>(),
&md);
}
void ServerLoggingFilter::Call::OnServerTrailingMetadata(ServerMetadata& md) {
if (!call_data_.has_value()) return;
if (md.get(GrpcCallWasCancelled()).value_or(false) &&
md.get(GrpcStatusMetadata()) == GRPC_STATUS_CANCELLED) {
call_data_->LogCancel(
/*is_client=*/false, MaybeGetContext<CallTracerAnnotationInterface>());
return;
}
call_data_->LogServerTrailer(
/*is_client=*/false, MaybeGetContext<CallTracerAnnotationInterface>(),
&md);
}
void ServerLoggingFilter::Call::OnClientToServerMessage(
const Message& message) {
if (!call_data_.has_value()) return;
call_data_->LogClientMessage(
/*is_client=*/false, MaybeGetContext<CallTracerAnnotationInterface>(),
message.payload());
}
void ServerLoggingFilter::Call::OnClientToServerHalfClose() {
if (!call_data_.has_value()) return;
call_data_->LogClientHalfClose(
/*is_client=*/false, MaybeGetContext<CallTracerAnnotationInterface>());
}
void ServerLoggingFilter::Call::OnServerToClientMessage(
const Message& message) {
if (!call_data_.has_value()) return;
call_data_->LogServerMessage(
/*is_client=*/false, MaybeGetContext<CallTracerAnnotationInterface>(),
message.payload());
}
const grpc_channel_filter ServerLoggingFilter::kFilter =
@ -539,11 +490,11 @@ void RegisterLoggingFilter(LoggingSink* sink) {
g_logging_sink = sink;
CoreConfiguration::RegisterBuilder([](CoreConfiguration::Builder* builder) {
builder->channel_init()
->RegisterFilter<ServerLoggingFilter>(GRPC_SERVER_CHANNEL)
->RegisterV2Filter<ServerLoggingFilter>(GRPC_SERVER_CHANNEL)
// TODO(yashykt) : Figure out a good place to place this channel arg
.IfChannelArg("grpc.experimental.enable_observability", true);
builder->channel_init()
->RegisterFilter<ClientLoggingFilter>(GRPC_CLIENT_CHANNEL)
->RegisterV2Filter<ClientLoggingFilter>(GRPC_CLIENT_CHANNEL)
// TODO(yashykt) : Figure out a good place to place this channel arg
.IfChannelArg("grpc.experimental.enable_observability", true);
});

@ -35,7 +35,46 @@
namespace grpc_core {
class ClientLoggingFilter final : public ChannelFilter {
namespace logging_filter_detail {
class CallData {
public:
CallData(bool is_client, const ClientMetadata& client_initial_metadata,
const std::string& authority);
bool ShouldLog() { return config_.ShouldLog(); }
void LogClientHeader(bool is_client, CallTracerAnnotationInterface* tracer,
const ClientMetadata& metadata);
void LogClientHalfClose(bool is_client,
CallTracerAnnotationInterface* tracer);
void LogServerHeader(bool is_client, CallTracerAnnotationInterface* tracer,
const ServerMetadata* metadata);
void LogServerTrailer(bool is_client, CallTracerAnnotationInterface* tracer,
const ServerMetadata* metadata);
void LogClientMessage(bool is_client, CallTracerAnnotationInterface* tracer,
const SliceBuffer* message);
void LogServerMessage(bool is_client, CallTracerAnnotationInterface* tracer,
const SliceBuffer* message);
void LogCancel(bool is_client, CallTracerAnnotationInterface* tracer);
private:
void SetCommonEntryFields(LoggingSink::Entry* entry, bool is_client,
CallTracerAnnotationInterface* tracer,
LoggingSink::Entry::EventType event_type);
absl::uint128 call_id_;
uint32_t sequence_id_ = 0;
std::string service_name_;
std::string method_name_;
std::string authority_;
LoggingSink::Entry::Address peer_;
LoggingSink::Config config_;
};
} // namespace logging_filter_detail
class ClientLoggingFilter final
: public ImplementChannelFilter<ClientLoggingFilter> {
public:
static const grpc_channel_filter kFilter;
@ -45,24 +84,46 @@ class ClientLoggingFilter final : public ChannelFilter {
explicit ClientLoggingFilter(std::string default_authority)
: default_authority_(std::move(default_authority)) {}
// Construct a promise for one call.
ArenaPromise<ServerMetadataHandle> MakeCallPromise(
CallArgs call_args, NextPromiseFactory next_promise_factory) override;
class Call {
public:
void OnClientInitialMetadata(ClientMetadata& md,
ClientLoggingFilter* filter);
void OnServerInitialMetadata(ServerMetadata& md);
void OnServerTrailingMetadata(ServerMetadata& md);
void OnClientToServerMessage(const Message& message);
void OnClientToServerHalfClose();
void OnServerToClientMessage(const Message& message);
static const NoInterceptor OnFinalize;
private:
absl::optional<logging_filter_detail::CallData> call_data_;
};
private:
const std::string default_authority_;
};
class ServerLoggingFilter final : public ChannelFilter {
class ServerLoggingFilter final
: public ImplementChannelFilter<ServerLoggingFilter> {
public:
static const grpc_channel_filter kFilter;
static absl::StatusOr<std::unique_ptr<ServerLoggingFilter>> Create(
const ChannelArgs& args, ChannelFilter::Args /*filter_args*/);
// Construct a promise for one call.
ArenaPromise<ServerMetadataHandle> MakeCallPromise(
CallArgs call_args, NextPromiseFactory next_promise_factory) override;
class Call {
public:
void OnClientInitialMetadata(ClientMetadata& md);
void OnServerInitialMetadata(ServerMetadata& md);
void OnServerTrailingMetadata(ServerMetadata& md);
void OnClientToServerMessage(const Message& message);
void OnClientToServerHalfClose();
void OnServerToClientMessage(const Message& message);
static const NoInterceptor OnFinalize;
private:
absl::optional<logging_filter_detail::CallData> call_data_;
};
};
void RegisterLoggingFilter(LoggingSink* sink);

@ -27,6 +27,7 @@
#include <string>
#include "absl/numeric/int128.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "src/core/lib/gprpp/time.h"
@ -73,8 +74,42 @@ class LoggingSink {
kCancel
};
static std::string EventTypeString(EventType type) {
switch (type) {
case EventType::kUnknown:
return "UNKNOWN";
case EventType::kClientHeader:
return "CLIENT_HEADER";
case EventType::kServerHeader:
return "SERVER_HEADER";
case EventType::kClientMessage:
return "CLIENT_MESSAGE";
case EventType::kServerMessage:
return "SERVER_MESSAGE";
case EventType::kClientHalfClose:
return "CLIENT_HALF_CLOSE";
case EventType::kServerTrailer:
return "SERVER_TRAILER";
case EventType::kCancel:
return "CANCEL";
}
return absl::StrCat("INVALID(", static_cast<int>(type), ")");
}
enum class Logger { kUnknown = 0, kClient, kServer };
static std::string LoggerString(Logger logger) {
switch (logger) {
case Logger::kUnknown:
return "UNKNOWN";
case Logger::kClient:
return "CLIENT";
case Logger::kServer:
return "SERVER";
}
return absl::StrCat("INVALID(", static_cast<int>(logger), ")");
}
struct Payload {
std::map<std::string, std::string> metadata;
Duration timeout;
@ -118,6 +153,16 @@ class LoggingSink {
virtual void LogEntry(Entry entry) = 0;
};
inline std::ostream& operator<<(std::ostream& out,
const LoggingSink::Entry::EventType& type) {
return out << LoggingSink::Entry::EventTypeString(type);
}
inline std::ostream& operator<<(std::ostream& out,
const LoggingSink::Entry::Logger& logger) {
return out << LoggingSink::Entry::LoggerString(logger);
}
} // namespace grpc_core
#endif // GRPC_SRC_CORE_EXT_FILTERS_LOGGING_LOGGING_SINK_H

@ -51,10 +51,12 @@ namespace grpc_core {
const NoInterceptor ClientMessageSizeFilter::Call::OnClientInitialMetadata;
const NoInterceptor ClientMessageSizeFilter::Call::OnServerInitialMetadata;
const NoInterceptor ClientMessageSizeFilter::Call::OnServerTrailingMetadata;
const NoInterceptor ClientMessageSizeFilter::Call::OnClientToServerHalfClose;
const NoInterceptor ClientMessageSizeFilter::Call::OnFinalize;
const NoInterceptor ServerMessageSizeFilter::Call::OnClientInitialMetadata;
const NoInterceptor ServerMessageSizeFilter::Call::OnServerInitialMetadata;
const NoInterceptor ServerMessageSizeFilter::Call::OnServerTrailingMetadata;
const NoInterceptor ServerMessageSizeFilter::Call::OnClientToServerHalfClose;
const NoInterceptor ServerMessageSizeFilter::Call::OnFinalize;
//

@ -105,6 +105,7 @@ class ServerMessageSizeFilter final
static const NoInterceptor OnFinalize;
ServerMetadataHandle OnClientToServerMessage(
const Message& message, ServerMessageSizeFilter* filter);
static const NoInterceptor OnClientToServerHalfClose;
ServerMetadataHandle OnServerToClientMessage(
const Message& message, ServerMessageSizeFilter* filter);
};
@ -133,6 +134,7 @@ class ClientMessageSizeFilter final
static const NoInterceptor OnServerTrailingMetadata;
static const NoInterceptor OnFinalize;
ServerMetadataHandle OnClientToServerMessage(const Message& message);
static const NoInterceptor OnClientToServerHalfClose;
ServerMetadataHandle OnServerToClientMessage(const Message& message);
private:

@ -46,6 +46,7 @@ namespace grpc_core {
const NoInterceptor RbacFilter::Call::OnServerInitialMetadata;
const NoInterceptor RbacFilter::Call::OnServerTrailingMetadata;
const NoInterceptor RbacFilter::Call::OnClientToServerMessage;
const NoInterceptor RbacFilter::Call::OnClientToServerHalfClose;
const NoInterceptor RbacFilter::Call::OnServerToClientMessage;
const NoInterceptor RbacFilter::Call::OnFinalize;

@ -55,6 +55,7 @@ class RbacFilter : public ImplementChannelFilter<RbacFilter> {
static const NoInterceptor OnServerInitialMetadata;
static const NoInterceptor OnServerTrailingMetadata;
static const NoInterceptor OnClientToServerMessage;
static const NoInterceptor OnClientToServerHalfClose;
static const NoInterceptor OnServerToClientMessage;
static const NoInterceptor OnFinalize;
};

@ -60,6 +60,7 @@ namespace grpc_core {
TraceFlag grpc_stateful_session_filter_trace(false, "stateful_session_filter");
const NoInterceptor StatefulSessionFilter::Call::OnClientToServerMessage;
const NoInterceptor StatefulSessionFilter::Call::OnClientToServerHalfClose;
const NoInterceptor StatefulSessionFilter::Call::OnServerToClientMessage;
const NoInterceptor StatefulSessionFilter::Call::OnFinalize;

@ -86,6 +86,7 @@ class StatefulSessionFilter
void OnServerInitialMetadata(ServerMetadata& md);
void OnServerTrailingMetadata(ServerMetadata& md);
static const NoInterceptor OnClientToServerMessage;
static const NoInterceptor OnClientToServerHalfClose;
static const NoInterceptor OnServerToClientMessage;
static const NoInterceptor OnFinalize;

@ -24,6 +24,7 @@
#include <utility>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_format.h"
@ -120,7 +121,7 @@ void MetadataQuery::OnDone(void* arg, grpc_error_handle error) {
absl::StrFormat("MetadataServer Could not parse zone: %s",
std::string(body).c_str()));
if (GRPC_TRACE_FLAG_ENABLED(grpc_metadata_query_trace)) {
gpr_log(GPR_INFO, "%s", result.status().ToString().c_str());
LOG(INFO) << result.status().ToString();
}
} else {
result = std::string(body.substr(pos + 1));

@ -35,6 +35,7 @@
#ifdef GPR_SUPPORT_BINDER_TRANSPORT
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/memory/memory.h"
#include "absl/strings/substitute.h"
#include "absl/time/clock.h"
@ -111,7 +112,7 @@ std::shared_ptr<grpc::Channel> CreateCustomBinderChannel(
std::string connection_id =
grpc_binder::GetConnectionIdGenerator()->Generate(uri);
gpr_log(GPR_ERROR, "connection id is %s", connection_id.c_str());
LOG(ERROR) << "connection id is " << connection_id;
// After invoking this Java method, Java code will put endpoint binder into
// `EndpointBinderPool` after the connection succeeds

@ -15,6 +15,7 @@
#include "src/core/ext/transport/binder/client/endpoint_binder_pool.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include <grpc/support/port_platform.h>
@ -36,11 +37,11 @@ Java_io_grpc_binder_cpp_GrpcBinderConnection_notifyConnected__Ljava_lang_String_
JNIEnv* jni_env, jobject, jstring conn_id_jstring, jobject ibinder) {
jboolean isCopy;
const char* conn_id = jni_env->GetStringUTFChars(conn_id_jstring, &isCopy);
gpr_log(GPR_INFO, "%s invoked with conn_id = %s", __func__, conn_id);
LOG(INFO) << __func__ << " invoked with conn_id = " << conn_id;
CHECK_NE(ibinder, nullptr);
grpc_binder::ndk_util::SpAIBinder aibinder =
grpc_binder::FromJavaBinder(jni_env, ibinder);
gpr_log(GPR_INFO, "%s got aibinder = %p", __func__, aibinder.get());
LOG(INFO) << __func__ << " got aibinder = " << aibinder.get();
auto b = std::make_unique<grpc_binder::BinderAndroid>(aibinder);
CHECK(b != nullptr);
grpc_binder::GetEndpointBinderPool()->AddEndpointBinder(conn_id,
@ -58,7 +59,7 @@ namespace grpc_binder {
void EndpointBinderPool::GetEndpointBinder(
std::string conn_id,
std::function<void(std::unique_ptr<grpc_binder::Binder>)> cb) {
gpr_log(GPR_INFO, "EndpointBinder requested. conn_id = %s", conn_id.c_str());
LOG(INFO) << "EndpointBinder requested. conn_id = " << conn_id;
std::unique_ptr<grpc_binder::Binder> b;
{
grpc_core::MutexLock l(&m_);
@ -68,9 +69,8 @@ void EndpointBinderPool::GetEndpointBinder(
CHECK(b != nullptr);
} else {
if (pending_requests_.count(conn_id) != 0) {
gpr_log(GPR_ERROR,
"Duplicate GetEndpointBinder requested. conn_id = %s",
conn_id.c_str());
LOG(ERROR) << "Duplicate GetEndpointBinder requested. conn_id = "
<< conn_id;
return;
}
pending_requests_[conn_id] = std::move(cb);
@ -83,15 +83,14 @@ void EndpointBinderPool::GetEndpointBinder(
void EndpointBinderPool::AddEndpointBinder(
std::string conn_id, std::unique_ptr<grpc_binder::Binder> b) {
gpr_log(GPR_INFO, "EndpointBinder added. conn_id = %s", conn_id.c_str());
LOG(INFO) << "EndpointBinder added. conn_id = " << conn_id;
CHECK(b != nullptr);
// cb will be set in the following block if there is a pending callback
std::function<void(std::unique_ptr<grpc_binder::Binder>)> cb = nullptr;
{
grpc_core::MutexLock l(&m_);
if (binder_map_.count(conn_id) != 0) {
gpr_log(GPR_ERROR, "EndpointBinder already in the pool. conn_id = %s",
conn_id.c_str());
LOG(ERROR) << "EndpointBinder already in the pool. conn_id = " << conn_id;
return;
}
if (pending_requests_.count(conn_id)) {

@ -15,6 +15,7 @@
#include "src/core/ext/transport/binder/client/jni_utils.h"
#include "absl/log/check.h"
#include "absl/log/log.h" // IWYU pragma: keep
#include <grpc/support/port_platform.h>
@ -83,7 +84,7 @@ void TryEstablishConnection(JNIEnv* env, jobject application,
jmethodID mid = env->GetStaticMethodID(cl, method.c_str(), type.c_str());
if (mid == nullptr) {
gpr_log(GPR_ERROR, "No method id %s", method.c_str());
LOG(ERROR) << "No method id " << method;
}
env->CallStaticVoidMethod(cl, mid, application,
@ -107,7 +108,7 @@ void TryEstablishConnectionWithUri(JNIEnv* env, jobject application,
jmethodID mid = env->GetStaticMethodID(cl, method.c_str(), type.c_str());
if (mid == nullptr) {
gpr_log(GPR_ERROR, "No method id %s", method.c_str());
LOG(ERROR) << "No method id " << method;
}
env->CallStaticVoidMethod(cl, mid, application,
@ -126,7 +127,7 @@ bool IsSignatureMatch(JNIEnv* env, jobject context, int uid1, int uid2) {
jmethodID mid = env->GetStaticMethodID(cl, method.c_str(), type.c_str());
if (mid == nullptr) {
gpr_log(GPR_ERROR, "No method id %s", method.c_str());
LOG(ERROR) << "No method id " << method;
}
jboolean result = env->CallStaticBooleanMethod(cl, mid, context, uid1, uid2);

@ -160,7 +160,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();
@ -240,9 +240,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;
}

@ -24,6 +24,7 @@
#include <utility>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/memory/memory.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/substitute.h"
@ -141,7 +142,7 @@ static void AssignMetadata(grpc_metadata_batch* mb,
static void cancel_stream_locked(grpc_binder_transport* transport,
grpc_binder_stream* stream,
grpc_error_handle error) {
gpr_log(GPR_INFO, "cancel_stream_locked");
LOG(INFO) << "cancel_stream_locked";
if (!stream->is_closed) {
CHECK(stream->cancel_self_error.ok());
stream->is_closed = true;
@ -200,7 +201,7 @@ static void recv_initial_metadata_locked(void* arg,
CHECK(stream->recv_initial_metadata);
CHECK(stream->recv_initial_metadata_ready);
if (!args->initial_metadata.ok()) {
gpr_log(GPR_ERROR, "Failed to parse initial metadata");
LOG(ERROR) << "Failed to parse initial metadata";
return absl_status_to_grpc_error(args->initial_metadata.status());
}
if (!stream->is_client) {
@ -237,11 +238,11 @@ static void recv_message_locked(void* arg, grpc_error_handle /*error*/) {
CHECK(stream->recv_message);
CHECK(stream->recv_message_ready);
if (!args->message.ok()) {
gpr_log(GPR_ERROR, "Failed to receive message");
LOG(ERROR) << "Failed to receive message";
if (args->message.status().message() ==
grpc_binder::TransportStreamReceiver::
kGrpcBinderTransportCancelledGracefully) {
gpr_log(GPR_ERROR, "message cancelled gracefully");
LOG(ERROR) << "message cancelled gracefully";
// Cancelled because we've already received trailing metadata.
// It's not an error in this case.
return absl::OkStatus();
@ -281,13 +282,13 @@ static void recv_trailing_metadata_locked(void* arg,
CHECK(stream->recv_trailing_metadata);
CHECK(stream->recv_trailing_metadata_finished);
if (!args->trailing_metadata.ok()) {
gpr_log(GPR_ERROR, "Failed to receive trailing metadata");
LOG(ERROR) << "Failed to receive trailing metadata";
return absl_status_to_grpc_error(args->trailing_metadata.status());
}
if (!stream->is_client) {
// Client will not send non-empty trailing metadata.
if (!args->trailing_metadata.value().empty()) {
gpr_log(GPR_ERROR, "Server receives non-empty trailing metadata.");
LOG(ERROR) << "Server receives non-empty trailing metadata.";
return absl::CancelledError();
}
} else {
@ -296,7 +297,7 @@ static void recv_trailing_metadata_locked(void* arg,
// Append status to metadata
// TODO(b/192208695): See if we can avoid to manually put status
// code into the header
gpr_log(GPR_INFO, "status = %d", args->status);
LOG(INFO) << "status = " << args->status;
stream->recv_trailing_metadata->Set(
grpc_core::GrpcStatusMetadata(),
static_cast<grpc_status_code>(args->status));
@ -349,7 +350,7 @@ class MetadataEncoder {
}
void Encode(grpc_core::GrpcStatusMetadata, grpc_status_code status) {
gpr_log(GPR_INFO, "send trailing metadata status = %d", status);
LOG(INFO) << "send trailing metadata status = " << status;
tx_->SetStatus(status);
}
@ -371,7 +372,7 @@ class MetadataEncoder {
static void accept_stream_locked(void* gt, grpc_error_handle /*error*/) {
grpc_binder_transport* transport = static_cast<grpc_binder_transport*>(gt);
if (transport->accept_stream_fn) {
gpr_log(GPR_INFO, "Accepting a stream");
LOG(INFO) << "Accepting a stream";
// must pass in a non-null value.
(*transport->accept_stream_fn)(transport->accept_stream_user_data,
transport, transport);
@ -394,7 +395,7 @@ static void perform_stream_op_locked(void* stream_op,
CHECK(!op->send_initial_metadata && !op->send_message &&
!op->send_trailing_metadata && !op->recv_initial_metadata &&
!op->recv_message && !op->recv_trailing_metadata);
gpr_log(GPR_INFO, "cancel_stream is_client = %d", stream->is_client);
LOG(INFO) << "cancel_stream is_client = " << stream->is_client;
if (!stream->is_client) {
// Send trailing metadata to inform the other end about the cancellation,
// regardless if we'd already done that or not.
@ -449,7 +450,7 @@ static void perform_stream_op_locked(void* stream_op,
std::make_unique<grpc_binder::Transaction>(tx_code, transport->is_client);
if (op->send_initial_metadata) {
gpr_log(GPR_INFO, "send_initial_metadata");
LOG(INFO) << "send_initial_metadata";
grpc_binder::Metadata init_md;
auto batch = op->payload->send_initial_metadata.send_initial_metadata;
@ -459,12 +460,12 @@ static void perform_stream_op_locked(void* stream_op,
tx->SetPrefix(init_md);
}
if (op->send_message) {
gpr_log(GPR_INFO, "send_message");
LOG(INFO) << "send_message";
tx->SetData(op->payload->send_message.send_message->JoinIntoString());
}
if (op->send_trailing_metadata) {
gpr_log(GPR_INFO, "send_trailing_metadata");
LOG(INFO) << "send_trailing_metadata";
auto batch = op->payload->send_trailing_metadata.send_trailing_metadata;
grpc_binder::Metadata trailing_metadata;
@ -477,7 +478,7 @@ static void perform_stream_op_locked(void* stream_op,
tx->SetSuffix(trailing_metadata);
}
if (op->recv_initial_metadata) {
gpr_log(GPR_INFO, "recv_initial_metadata");
LOG(INFO) << "recv_initial_metadata";
stream->recv_initial_metadata_ready =
op->payload->recv_initial_metadata.recv_initial_metadata_ready;
stream->recv_initial_metadata =
@ -500,7 +501,7 @@ static void perform_stream_op_locked(void* stream_op,
});
}
if (op->recv_message) {
gpr_log(GPR_INFO, "recv_message");
LOG(INFO) << "recv_message";
stream->recv_message_ready = op->payload->recv_message.recv_message_ready;
stream->recv_message = op->payload->recv_message.recv_message;
stream->call_failed_before_recv_message =
@ -523,7 +524,7 @@ static void perform_stream_op_locked(void* stream_op,
});
}
if (op->recv_trailing_metadata) {
gpr_log(GPR_INFO, "recv_trailing_metadata");
LOG(INFO) << "recv_trailing_metadata";
stream->recv_trailing_metadata_finished =
op->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
stream->recv_trailing_metadata =
@ -571,7 +572,7 @@ static void perform_stream_op_locked(void* stream_op,
if (op->on_complete != nullptr) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_complete,
absl_status_to_grpc_error(status));
gpr_log(GPR_INFO, "on_complete closure scheduled");
LOG(INFO) << "on_complete closure scheduled";
}
GRPC_BINDER_STREAM_UNREF(stream, "perform_stream_op");
}

@ -23,6 +23,7 @@
#include <dlfcn.h>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include <grpc/support/log.h>
@ -60,10 +61,10 @@ void SetJvm(JNIEnv* env) {
JavaVM* jvm = nullptr;
jint error = env->GetJavaVM(&jvm);
if (error != JNI_OK) {
gpr_log(GPR_ERROR, "Failed to get JVM");
LOG(ERROR) << "Failed to get JVM";
}
g_jvm = jvm;
gpr_log(GPR_INFO, "JVM cached");
LOG(INFO) << "JVM cached";
}
// `SetJvm` need to be called in the process before `AttachJvm`. This is always
@ -77,14 +78,14 @@ bool AttachJvm() {
// Note: The following code would be run at most once per thread.
grpc_core::MutexLock lock(&g_jvm_mu);
if (g_jvm == nullptr) {
gpr_log(GPR_ERROR, "JVM not cached yet");
LOG(ERROR) << "JVM not cached yet";
return false;
}
JNIEnv* env_unused;
// Note that attach a thread that is already attached is a no-op, so it is
// fine to call this again if the thread has already been attached by other.
g_jvm->AttachCurrentThread(&env_unused, /* thr_args= */ nullptr);
gpr_log(GPR_INFO, "JVM attached successfully");
LOG(INFO) << "JVM attached successfully";
g_is_jvm_attached = true;
return true;
}
@ -151,7 +152,7 @@ binder_status_t AIBinder_transact(AIBinder* binder, transaction_code_t code,
AParcel** in, AParcel** out,
binder_flags_t flags) {
if (!AttachJvm()) {
gpr_log(GPR_ERROR, "failed to attach JVM. AIBinder_transact might fail.");
LOG(ERROR) << "failed to attach JVM. AIBinder_transact might fail.";
}
FORWARD(AIBinder_transact)(binder, code, in, out, flags);
}

@ -23,8 +23,7 @@
#include <utility>
#include "absl/log/check.h"
#include <grpc/support/log.h>
#include "absl/log/log.h"
#include "src/core/lib/gprpp/crash.h"
@ -36,7 +35,7 @@ const absl::string_view
void TransportStreamReceiverImpl::RegisterRecvInitialMetadata(
StreamIdentifier id, InitialMetadataCallbackType cb) {
gpr_log(GPR_INFO, "%s id = %d is_client = %d", __func__, id, is_client_);
LOG(INFO) << __func__ << " id = " << id << " is_client = " << is_client_;
absl::StatusOr<Metadata> initial_metadata{};
{
grpc_core::MutexLock l(&m_);
@ -64,7 +63,7 @@ void TransportStreamReceiverImpl::RegisterRecvInitialMetadata(
void TransportStreamReceiverImpl::RegisterRecvMessage(
StreamIdentifier id, MessageDataCallbackType cb) {
gpr_log(GPR_INFO, "%s id = %d is_client = %d", __func__, id, is_client_);
LOG(INFO) << __func__ << " id = " << id << " is_client = " << is_client_;
absl::StatusOr<std::string> message{};
{
grpc_core::MutexLock l(&m_);
@ -98,7 +97,7 @@ void TransportStreamReceiverImpl::RegisterRecvMessage(
void TransportStreamReceiverImpl::RegisterRecvTrailingMetadata(
StreamIdentifier id, TrailingMetadataCallbackType cb) {
gpr_log(GPR_INFO, "%s id = %d is_client = %d", __func__, id, is_client_);
LOG(INFO) << __func__ << " id = " << id << " is_client = " << is_client_;
std::pair<absl::StatusOr<Metadata>, int> trailing_metadata{};
{
grpc_core::MutexLock l(&m_);
@ -122,7 +121,7 @@ void TransportStreamReceiverImpl::RegisterRecvTrailingMetadata(
void TransportStreamReceiverImpl::NotifyRecvInitialMetadata(
StreamIdentifier id, absl::StatusOr<Metadata> initial_metadata) {
gpr_log(GPR_INFO, "%s id = %d is_client = %d", __func__, id, is_client_);
LOG(INFO) << __func__ << " id = " << id << " is_client = " << is_client_;
if (!is_client_ && accept_stream_callback_ && initial_metadata.ok()) {
accept_stream_callback_();
}
@ -143,7 +142,7 @@ void TransportStreamReceiverImpl::NotifyRecvInitialMetadata(
void TransportStreamReceiverImpl::NotifyRecvMessage(
StreamIdentifier id, absl::StatusOr<std::string> message) {
gpr_log(GPR_INFO, "%s id = %d is_client = %d", __func__, id, is_client_);
LOG(INFO) << __func__ << " id = " << id << " is_client = " << is_client_;
MessageDataCallbackType cb;
{
grpc_core::MutexLock l(&m_);
@ -166,7 +165,7 @@ void TransportStreamReceiverImpl::NotifyRecvTrailingMetadata(
// assumes in-order commitments of transactions and that trailing metadata is
// parsed after message data, we can safely cancel all upcoming callbacks of
// recv_message.
gpr_log(GPR_INFO, "%s id = %d is_client = %d", __func__, id, is_client_);
LOG(INFO) << __func__ << " id = " << id << " is_client = " << is_client_;
OnRecvTrailingMetadata(id);
TrailingMetadataCallbackType cb;
{
@ -233,7 +232,7 @@ void TransportStreamReceiverImpl::CancelTrailingMetadataCallback(
}
void TransportStreamReceiverImpl::OnRecvTrailingMetadata(StreamIdentifier id) {
gpr_log(GPR_INFO, "%s id = %d is_client = %d", __func__, id, is_client_);
LOG(INFO) << __func__ << " id = " << id << " is_client = " << is_client_;
m_.Lock();
trailing_metadata_recvd_.insert(id);
m_.Unlock();
@ -245,7 +244,7 @@ void TransportStreamReceiverImpl::OnRecvTrailingMetadata(StreamIdentifier id) {
}
void TransportStreamReceiverImpl::CancelStream(StreamIdentifier id) {
gpr_log(GPR_INFO, "%s id = %d is_client = %d", __func__, id, is_client_);
LOG(INFO) << __func__ << " id = " << id << " is_client = " << is_client_;
CancelInitialMetadataCallback(id, absl::CancelledError("Stream cancelled"));
CancelMessageCallback(id, absl::CancelledError("Stream cancelled"));
CancelTrailingMetadataCallback(id, absl::CancelledError("Stream cancelled"));

@ -21,6 +21,7 @@
#include <map>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/memory/memory.h"
#include "absl/strings/str_cat.h"
@ -65,7 +66,7 @@ ndk_util::binder_status_t f_onTransact(ndk_util::AIBinder* binder,
const ndk_util::AParcel* in,
ndk_util::AParcel* /*out*/) {
gpr_log(GPR_INFO, __func__);
gpr_log(GPR_INFO, "tx code = %u", code);
LOG(INFO) << "tx code = " << code;
auto* user_data =
static_cast<BinderUserData*>(ndk_util::AIBinder_getUserData(binder));
@ -79,7 +80,7 @@ ndk_util::binder_status_t f_onTransact(ndk_util::AIBinder* binder,
if (status.ok()) {
return ndk_util::STATUS_OK;
} else {
gpr_log(GPR_ERROR, "Callback failed: %s", status.ToString().c_str());
LOG(ERROR) << "Callback failed: " << status.ToString();
return ndk_util::STATUS_UNKNOWN_ERROR;
}
}

@ -26,6 +26,7 @@
#include "absl/functional/any_invocable.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/memory/memory.h"
#include "absl/status/statusor.h"
@ -136,9 +137,9 @@ void WireReaderImpl::SendSetupTransport(Binder* binder) {
std::unique_ptr<Binder> WireReaderImpl::RecvSetupTransport() {
// TODO(b/191941760): avoid blocking, handle wire_writer_noti lifetime
// better
gpr_log(GPR_DEBUG, "start waiting for noti");
VLOG(2) << "start waiting for noti";
connection_noti_.WaitForNotification();
gpr_log(GPR_DEBUG, "end waiting for noti");
VLOG(2) << "end waiting for noti";
return std::move(other_end_binder_);
}
@ -153,8 +154,8 @@ absl::Status WireReaderImpl::ProcessTransaction(transaction_code_t code,
BinderTransportTxCode::SETUP_TRANSPORT) &&
code <= static_cast<transaction_code_t>(
BinderTransportTxCode::PING_RESPONSE))) {
gpr_log(GPR_INFO,
"Received unknown control message. Shutdown transport gracefully.");
LOG(INFO)
<< "Received unknown control message. Shutdown transport gracefully.";
// TODO(waynetu): Shutdown transport gracefully.
return absl::OkStatus();
}
@ -210,8 +211,8 @@ absl::Status WireReaderImpl::ProcessTransaction(transaction_code_t code,
break;
}
case BinderTransportTxCode::SHUTDOWN_TRANSPORT: {
gpr_log(GPR_ERROR,
"Received SHUTDOWN_TRANSPORT request but not implemented yet.");
LOG(ERROR)
<< "Received SHUTDOWN_TRANSPORT request but not implemented yet.";
return absl::UnimplementedError("SHUTDOWN_TRANSPORT");
}
case BinderTransportTxCode::ACKNOWLEDGE_BYTES: {
@ -286,16 +287,16 @@ absl::Status WireReaderImpl::ProcessStreamingTransaction(
tx_process_result.ToString().c_str());
// Something went wrong when receiving transaction. Cancel failed requests.
if (cancellation_flags & kFlagPrefix) {
gpr_log(GPR_INFO, "cancelling initial metadata");
LOG(INFO) << "cancelling initial metadata";
transport_stream_receiver_->NotifyRecvInitialMetadata(code,
tx_process_result);
}
if (cancellation_flags & kFlagMessageData) {
gpr_log(GPR_INFO, "cancelling message data");
LOG(INFO) << "cancelling message data";
transport_stream_receiver_->NotifyRecvMessage(code, tx_process_result);
}
if (cancellation_flags & kFlagSuffix) {
gpr_log(GPR_INFO, "cancelling trailing metadata");
LOG(INFO) << "cancelling trailing metadata";
transport_stream_receiver_->NotifyRecvTrailingMetadata(
code, tx_process_result, 0);
}
@ -338,7 +339,7 @@ absl::Status WireReaderImpl::ProcessStreamingTransactionImpl(
// intended behavior.
// TODO(waynetu): What should be returned here?
if (flags == 0) {
gpr_log(GPR_INFO, "[WARNING] Receive empty transaction. Ignored.");
LOG(INFO) << "[WARNING] Receive empty transaction. Ignored.";
return absl::OkStatus();
}

@ -22,6 +22,7 @@
#include "absl/cleanup/cleanup.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/types/variant.h"
#include <grpc/support/log.h>
@ -78,7 +79,7 @@ absl::Status WriteTrailingMetadata(const Transaction& tx,
} else {
// client suffix currently is always empty according to the wireformat
if (!tx.GetSuffixMetadata().empty()) {
gpr_log(GPR_ERROR, "Got non-empty suffix metadata from client.");
LOG(ERROR) << "Got non-empty suffix metadata from client.";
}
}
return absl::OkStatus();
@ -218,8 +219,7 @@ void WireWriterImpl::RunScheduledTxInternal(RunScheduledTxArgs* args) {
return absl::OkStatus();
});
if (!result.ok()) {
gpr_log(GPR_ERROR, "Failed to make binder transaction %s",
result.ToString().c_str());
LOG(ERROR) << "Failed to make binder transaction " << result;
}
delete args;
return;
@ -242,8 +242,7 @@ void WireWriterImpl::RunScheduledTxInternal(RunScheduledTxArgs* args) {
if (CanBeSentInOneTransaction(*stream_tx->tx.get())) { // NOLINT
absl::Status result = RpcCallFastPath(std::move(stream_tx->tx));
if (!result.ok()) {
gpr_log(GPR_ERROR, "Failed to handle non-chunked RPC call %s",
result.ToString().c_str());
LOG(ERROR) << "Failed to handle non-chunked RPC call " << result;
}
delete args;
return;
@ -256,8 +255,7 @@ void WireWriterImpl::RunScheduledTxInternal(RunScheduledTxArgs* args) {
return RunStreamTx(stream_tx, parcel, &is_last_chunk);
});
if (!result.ok()) {
gpr_log(GPR_ERROR, "Failed to make binder transaction %s",
result.ToString().c_str());
LOG(ERROR) << "Failed to make binder transaction " << result;
}
if (!is_last_chunk) {
{
@ -290,7 +288,7 @@ absl::Status WireWriterImpl::SendAck(int64_t num_bytes) {
// Ensure combiner will be run if this is not called from top-level gRPC API
// entrypoint.
grpc_core::ExecCtx exec_ctx;
gpr_log(GPR_INFO, "Ack %" PRId64 " bytes received", num_bytes);
LOG(INFO) << "Ack " << num_bytes << " bytes received";
if (is_transacting_) {
// This can happen because NDK might call our registered callback function
// in the same thread while we are telling it to send a transaction
@ -298,10 +296,8 @@ absl::Status WireWriterImpl::SendAck(int64_t num_bytes) {
// the same thread or the other thread. We are currently in the call stack
// of other transaction, Liveness of ACK is still guaranteed even if this is
// a race with another thread.
gpr_log(
GPR_INFO,
"Scheduling ACK transaction instead of directly execute it to avoid "
"deadlock.");
LOG(INFO) << "Scheduling ACK transaction instead of directly execute it to "
"avoid deadlock.";
auto args = new RunScheduledTxArgs();
args->writer = this;
args->tx = RunScheduledTxArgs::AckTx();
@ -318,8 +314,7 @@ absl::Status WireWriterImpl::SendAck(int64_t num_bytes) {
return absl::OkStatus();
});
if (!result.ok()) {
gpr_log(GPR_ERROR, "Failed to make binder transaction %s",
result.ToString().c_str());
LOG(ERROR) << "Failed to make binder transaction " << result;
}
return result;
}
@ -328,7 +323,7 @@ void WireWriterImpl::OnAckReceived(int64_t num_bytes) {
// Ensure combiner will be run if this is not called from top-level gRPC API
// entrypoint.
grpc_core::ExecCtx exec_ctx;
gpr_log(GPR_INFO, "OnAckReceived %" PRId64, num_bytes);
LOG(INFO) << "OnAckReceived " << num_bytes;
// Do not try to obtain `write_mu_` in this function. NDKBinder might invoke
// the callback to notify us about new incoming binder transaction when we are
// sending transaction. i.e. `write_mu_` might have already been acquired by

@ -22,6 +22,7 @@
#include <vector>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/random/bit_gen_ref.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
@ -99,12 +100,12 @@ absl::StatusOr<int> ChaoticGoodServerListener::Bind(
grpc_event_engine::experimental::EventEngine::ResolvedAddress addr) {
if (grpc_chaotic_good_trace.enabled()) {
auto str = grpc_event_engine::experimental::ResolvedAddressToString(addr);
gpr_log(GPR_INFO, "CHAOTIC_GOOD: Listen on %s",
str.ok() ? str->c_str() : str.status().ToString().c_str());
LOG(INFO) << "CHAOTIC_GOOD: Listen on "
<< (str.ok() ? str->c_str() : str.status().ToString());
}
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;
@ -123,8 +124,7 @@ absl::StatusOr<int> ChaoticGoodServerListener::Bind(
grpc_event_engine::experimental::ChannelArgsEndpointConfig(args_),
std::make_unique<MemoryQuota>("chaotic_good_server_listener"));
if (!ee_listener.ok()) {
gpr_log(GPR_ERROR, "Bind failed: %s",
ee_listener.status().ToString().c_str());
LOG(ERROR) << "Bind failed: " << ee_listener.status().ToString();
return ee_listener.status();
}
ee_listener_ = std::move(ee_listener.value());
@ -139,9 +139,9 @@ absl::Status ChaoticGoodServerListener::StartListening() {
CHECK(ee_listener_ != nullptr);
auto status = ee_listener_->Start();
if (!status.ok()) {
gpr_log(GPR_ERROR, "Start listening failed: %s", status.ToString().c_str());
LOG(ERROR) << "Start listening failed: " << status.ToString();
} else if (grpc_chaotic_good_trace.enabled()) {
gpr_log(GPR_INFO, "CHAOTIC_GOOD: Started listening");
LOG(INFO) << "CHAOTIC_GOOD: Started listening";
}
return status;
}
@ -149,7 +149,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));
}
@ -160,7 +161,7 @@ ChaoticGoodServerListener::ActiveConnection::~ActiveConnection() {
void ChaoticGoodServerListener::ActiveConnection::Orphan() {
if (grpc_chaotic_good_trace.enabled()) {
gpr_log(GPR_INFO, "ActiveConnection::Orphan() %p", this);
LOG(INFO) << "ActiveConnection::Orphan() " << this;
}
if (handshaking_state_ != nullptr) {
handshaking_state_->Shutdown();
@ -192,8 +193,7 @@ void ChaoticGoodServerListener::ActiveConnection::NewConnectionID() {
void ChaoticGoodServerListener::ActiveConnection::Done(
absl::optional<absl::string_view> error) {
if (error.has_value()) {
gpr_log(GPR_ERROR, "ActiveConnection::Done:%p %s", this,
std::string(*error).c_str());
LOG(ERROR) << "ActiveConnection::Done:" << this << " " << *error;
}
// Can easily be holding various locks here: bounce through EE to ensure no
// deadlocks.
@ -458,7 +458,7 @@ Timestamp ChaoticGoodServerListener::ActiveConnection::HandshakingState::
void ChaoticGoodServerListener::Orphan() {
if (grpc_chaotic_good_trace.enabled()) {
gpr_log(GPR_INFO, "ChaoticGoodServerListener::Orphan()");
LOG(INFO) << "ChaoticGoodServerListener::Orphan()";
}
{
absl::flat_hash_set<OrphanablePtr<ActiveConnection>> connection_list;
@ -480,8 +480,8 @@ int grpc_server_add_chaotic_good_port(grpc_server* server, const char* addr) {
const auto resolved_or = grpc_core::GetDNSResolver()->LookupHostnameBlocking(
parsed_addr, absl::StrCat(0xd20));
if (!resolved_or.ok()) {
gpr_log(GPR_ERROR, "Failed to resolve %s: %s", addr,
resolved_or.status().ToString().c_str());
LOG(ERROR) << "Failed to resolve " << addr << ": "
<< resolved_or.status().ToString();
return 0;
}
int port_num = 0;
@ -496,8 +496,8 @@ int grpc_server_add_chaotic_good_port(grpc_server* server, const char* addr) {
->c_str());
auto bind_result = listener->Bind(ee_addr);
if (!bind_result.ok()) {
gpr_log(GPR_ERROR, "Failed to bind to %s: %s", addr,
bind_result.status().ToString().c_str());
LOG(ERROR) << "Failed to bind to " << addr << ": "
<< bind_result.status().ToString();
return 0;
}
if (port_num == 0) {

@ -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 {

@ -235,37 +235,27 @@ auto ChaoticGoodServerTransport::DeserializeAndPushFragmentToNewCall(
FrameHeader frame_header, BufferPair buffers,
ChaoticGoodTransport& transport) {
ClientFragmentFrame fragment_frame;
ScopedArenaPtr arena(acceptor_->CreateArena());
ScopedArenaPtr arena(call_arena_allocator_->MakeArena());
absl::Status status = transport.DeserializeFrame(
frame_header, std::move(buffers), arena.get(), fragment_frame,
FrameLimits{1024 * 1024 * 1024, aligned_bytes_ - 1});
absl::optional<CallInitiator> call_initiator;
if (status.ok()) {
auto create_call_result = acceptor_->CreateCall(
std::move(fragment_frame.headers), arena.release());
if (grpc_chaotic_good_trace.enabled()) {
gpr_log(GPR_INFO,
"CHAOTIC_GOOD: DeserializeAndPushFragmentToNewCall: "
"create_call_result=%s",
create_call_result.ok()
? "ok"
: create_call_result.status().ToString().c_str());
}
if (create_call_result.ok()) {
call_initiator.emplace(std::move(*create_call_result));
auto add_result = NewStream(frame_header.stream_id, *call_initiator);
if (add_result.ok()) {
call_initiator->SpawnGuarded(
"server-write", [this, stream_id = frame_header.stream_id,
call_initiator = *call_initiator]() {
return CallOutboundLoop(stream_id, call_initiator);
});
} else {
call_initiator.reset();
status = add_result;
}
auto call =
MakeCallPair(std::move(fragment_frame.headers), event_engine_.get(),
arena.release(), call_arena_allocator_, nullptr);
call_initiator.emplace(std::move(call.initiator));
auto add_result = NewStream(frame_header.stream_id, *call_initiator);
if (add_result.ok()) {
call_destination_->StartCall(std::move(call.handler));
call_initiator->SpawnGuarded(
"server-write", [this, stream_id = frame_header.stream_id,
call_initiator = *call_initiator]() {
return CallOutboundLoop(stream_id, call_initiator);
});
} else {
status = create_call_result.status();
call_initiator.reset();
status = add_result;
}
}
return MaybePushFragmentIntoCall(std::move(call_initiator), std::move(status),
@ -366,10 +356,13 @@ ChaoticGoodServerTransport::ChaoticGoodServerTransport(
PromiseEndpoint data_endpoint,
std::shared_ptr<grpc_event_engine::experimental::EventEngine> event_engine,
HPackParser hpack_parser, HPackCompressor hpack_encoder)
: outgoing_frames_(4),
allocator_(args.GetObject<ResourceQuota>()
->memory_quota()
->CreateMemoryAllocator("chaotic-good")) {
: call_arena_allocator_(MakeRefCounted<CallArenaAllocator>(
args.GetObject<ResourceQuota>()
->memory_quota()
->CreateMemoryAllocator("chaotic-good"),
1024)),
event_engine_(event_engine),
outgoing_frames_(4) {
auto transport = MakeRefCounted<ChaoticGoodTransport>(
std::move(control_endpoint), std::move(data_endpoint),
std::move(hpack_parser), std::move(hpack_encoder));
@ -381,20 +374,25 @@ ChaoticGoodServerTransport::ChaoticGoodServerTransport(
OnTransportActivityDone("reader"));
}
void ChaoticGoodServerTransport::SetAcceptor(Acceptor* acceptor) {
CHECK_EQ(acceptor_, nullptr);
CHECK_NE(acceptor, nullptr);
acceptor_ = acceptor;
void ChaoticGoodServerTransport::SetCallDestination(
RefCountedPtr<UnstartedCallDestination> call_destination) {
CHECK(call_destination_ == nullptr);
CHECK(call_destination != nullptr);
call_destination_ = call_destination;
got_acceptor_.Set();
}
ChaoticGoodServerTransport::~ChaoticGoodServerTransport() {
if (writer_ != nullptr) {
writer_.reset();
}
if (reader_ != nullptr) {
reader_.reset();
void ChaoticGoodServerTransport::Orphan() {
ActivityPtr writer;
ActivityPtr reader;
{
MutexLock lock(&mu_);
writer = std::move(writer_);
reader = std::move(reader_);
}
writer.reset();
reader.reset();
Unref();
}
void ChaoticGoodServerTransport::AbortWithError() {

@ -86,7 +86,6 @@ class ChaoticGoodServerTransport final : public ServerTransport {
std::shared_ptr<grpc_event_engine::experimental::EventEngine>
event_engine,
HPackParser hpack_parser, HPackCompressor hpack_encoder);
~ChaoticGoodServerTransport() override;
FilterStackTransport* filter_stack_transport() override { return nullptr; }
ClientTransport* client_transport() override { return nullptr; }
@ -96,9 +95,10 @@ class ChaoticGoodServerTransport final : public ServerTransport {
void SetPollsetSet(grpc_stream*, grpc_pollset_set*) override {}
void PerformOp(grpc_transport_op*) override;
grpc_endpoint* GetEndpoint() override { return nullptr; }
void Orphan() override { Unref(); }
void Orphan() override;
void SetAcceptor(Acceptor* acceptor) override;
void SetCallDestination(
RefCountedPtr<UnstartedCallDestination> call_destination) override;
void AbortWithError();
private:
@ -137,7 +137,10 @@ class ChaoticGoodServerTransport final : public ServerTransport {
auto PushFragmentIntoCall(CallInitiator call_initiator,
ClientFragmentFrame frame, uint32_t stream_id);
Acceptor* acceptor_ = nullptr;
RefCountedPtr<UnstartedCallDestination> call_destination_;
const RefCountedPtr<CallArenaAllocator> call_arena_allocator_;
const std::shared_ptr<grpc_event_engine::experimental::EventEngine>
event_engine_;
InterActivityLatch<void> got_acceptor_;
MpscReceiver<ServerFrame> outgoing_frames_;
// Assigned aligned bytes from setting frame.
@ -146,7 +149,6 @@ class ChaoticGoodServerTransport final : public ServerTransport {
// Map of stream incoming server frames, key is stream_id.
StreamMap stream_map_ ABSL_GUARDED_BY(mu_);
uint32_t last_seen_new_stream_id_ = 0;
grpc_event_engine::experimental::MemoryAllocator allocator_;
ActivityPtr writer_ ABSL_GUARDED_BY(mu_);
ActivityPtr reader_ ABSL_GUARDED_BY(mu_);
ConnectivityStateTracker state_tracker_ ABSL_GUARDED_BY(mu_){

@ -23,7 +23,7 @@
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/lib/gpr/useful.h"
#include "src/core/util/useful.h"
// in order of preference
static const char* const supported_versions[] = {"h2"};

@ -25,6 +25,7 @@
#include <utility>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_format.h"
@ -311,7 +312,7 @@ class Chttp2SecureClientChannelFactory : public ClientChannelFactory {
absl::StatusOr<OrphanablePtr<Channel>> CreateChannel(const char* target,
const ChannelArgs& args) {
if (target == nullptr) {
gpr_log(GPR_ERROR, "cannot create channel with NULL target name");
LOG(ERROR) << "cannot create channel with NULL target name";
return absl::InvalidArgumentError("channel target is NULL");
}
return ChannelCreate(target, args, GRPC_CLIENT_CHANNEL, nullptr);

@ -30,6 +30,7 @@
#include "absl/base/thread_annotations.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -42,9 +43,9 @@
#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>
#include <grpc/support/port_platform.h>
#include "src/core/channelz/channelz.h"
@ -58,6 +59,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"
@ -67,6 +70,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"
@ -93,9 +97,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:";
@ -112,14 +118,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();
}
@ -129,6 +144,8 @@ class Chttp2ServerListener : public Server::ListenerInterface {
void Orphan() override;
private:
friend class experimental::PassiveListenerImpl;
class ConfigFetcherWatcher
: public grpc_server_config_fetcher::WatcherInterface {
public:
@ -235,34 +252,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;
@ -285,6 +276,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_;
};
//
@ -331,8 +326,7 @@ void Chttp2ServerListener::ConfigFetcherWatcher::UpdateConnectionManager(
grpc_error_handle error = grpc_tcp_server_add_port(
listener_->tcp_server_, &listener_->resolved_address_, &port_temp);
if (!error.ok()) {
gpr_log(GPR_ERROR, "Error adding port to server: %s",
StatusToString(error).c_str());
LOG(ERROR) << "Error adding port to server: " << StatusToString(error);
// TODO(yashykt): We wouldn't need to assert here if we bound to the
// port earlier during AddPort.
CHECK(0);
@ -381,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_);
}
@ -536,8 +534,8 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::OnHandshakeDone(
});
} else {
// Failed to create channel from transport. Clean up.
gpr_log(GPR_ERROR, "Failed to create channel: %s",
StatusToString(channel_init_err).c_str());
LOG(ERROR) << "Failed to create channel: "
<< StatusToString(channel_init_err);
transport->Orphan();
grpc_slice_buffer_destroy(args->read_buffer);
gpr_free(args->read_buffer);
@ -589,7 +587,11 @@ Chttp2ServerListener::ActiveConnection::ActiveConnection(
grpc_schedule_on_exec_ctx);
}
Chttp2ServerListener::ActiveConnection::~ActiveConnection() {}
Chttp2ServerListener::ActiveConnection::~ActiveConnection() {
if (listener_ != nullptr && listener_->tcp_server_ != nullptr) {
grpc_tcp_server_unref(listener_->tcp_server_);
}
}
void Chttp2ServerListener::ActiveConnection::Orphan() {
OrphanablePtr<HandshakingState> handshaking_state;
@ -637,6 +639,9 @@ void Chttp2ServerListener::ActiveConnection::Start(
const ChannelArgs& args) {
RefCountedPtr<HandshakingState> handshaking_state_ref;
listener_ = std::move(listener);
if (listener_->tcp_server_ != nullptr) {
grpc_tcp_server_ref(listener_->tcp_server_);
}
{
ReleasableMutexLock lock(&mu_);
if (shutdown_) {
@ -709,83 +714,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()) {
@ -800,6 +804,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();
@ -809,10 +816,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 {
@ -826,7 +834,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) {
@ -834,6 +844,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) {
@ -858,7 +874,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.");
@ -899,7 +915,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));
}
}
@ -914,7 +930,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
@ -923,7 +939,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_);
CHECK_NE(config_fetcher_, nullptr);
config_fetcher_->CancelWatch(config_fetcher_watcher_);
}
std::map<ActiveConnection*, OrphanablePtr<ActiveConnection>> connections;
grpc_tcp_server* tcp_server;
@ -941,12 +958,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()
//
@ -1018,7 +1037,7 @@ grpc_error_handle Chttp2ServerAddPort(Server* server, const char* addr,
resolved_or->size() - error_list.size(), resolved_or->size());
error = GRPC_ERROR_CREATE_REFERENCING(msg.c_str(), error_list.data(),
error_list.size());
gpr_log(GPR_INFO, "WARNING: %s", StatusToString(error).c_str());
LOG(INFO) << "WARNING: " << StatusToString(error);
// we managed to bind some addresses: continue without error
}
return absl::OkStatus();
@ -1047,6 +1066,50 @@ ChannelArgs ModifyArgsForConnection(const ChannelArgs& args,
}
} // namespace
namespace experimental {
absl::Status PassiveListenerImpl::AcceptConnectedEndpoint(
std::unique_ptr<EventEngine::Endpoint> endpoint) {
CHECK_NE(server_.get(), 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) {
CHECK_NE(server_.get(), 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,
@ -1094,7 +1157,7 @@ int grpc_server_add_http2_port(grpc_server* server, const char* addr,
done:
sc.reset(DEBUG_LOCATION, "server");
if (!err.ok()) {
gpr_log(GPR_ERROR, "%s", grpc_core::StatusToString(err).c_str());
LOG(ERROR) << grpc_core::StatusToString(err);
}
return port_num;
}
@ -1105,7 +1168,7 @@ void grpc_server_add_channel_from_fd(grpc_server* server, int fd,
// For now, we only support insecure server credentials
if (creds == nullptr ||
creds->type() != grpc_core::InsecureServerCredentials::Type()) {
gpr_log(GPR_ERROR, "Failed to create channel due to invalid creds");
LOG(ERROR) << "Failed to create channel due to invalid creds";
return;
}
grpc_core::ExecCtx exec_ctx;
@ -1130,8 +1193,8 @@ void grpc_server_add_channel_from_fd(grpc_server* server, int fd,
}
grpc_chttp2_transport_start_reading(transport, nullptr, nullptr, nullptr);
} else {
gpr_log(GPR_ERROR, "Failed to create channel: %s",
grpc_core::StatusToString(error).c_str());
LOG(ERROR) << "Failed to create channel: "
<< grpc_core::StatusToString(error);
transport->Orphan();
}
}
@ -1144,3 +1207,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

@ -35,6 +35,7 @@
#include "absl/container/flat_hash_map.h"
#include "absl/hash/hash.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/meta/type_traits.h"
#include "absl/random/random.h"
#include "absl/status/status.h"
@ -79,8 +80,6 @@
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/debug/stats_data.h"
#include "src/core/lib/experiments/experiments.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/bitset.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/debug_location.h"
@ -109,6 +108,8 @@
#include "src/core/lib/transport/metadata_info.h"
#include "src/core/lib/transport/status_conversion.h"
#include "src/core/lib/transport/transport.h"
#include "src/core/util/string.h"
#include "src/core/util/useful.h"
#ifdef GRPC_POSIX_SOCKET_TCP
#include "src/core/lib/iomgr/ev_posix.h"
@ -802,8 +803,8 @@ grpc_chttp2_stream::grpc_chttp2_stream(grpc_chttp2_transport* t,
if (server_data) {
id = static_cast<uint32_t>(reinterpret_cast<uintptr_t>(server_data));
if (grpc_http_trace.enabled()) {
gpr_log(GPR_DEBUG, "HTTP:%p/%p creating accept stream %d [from %p]", t,
this, id, server_data);
VLOG(2) << "HTTP:" << t << "/" << this << " creating accept stream " << id
<< " [from " << server_data << "]";
}
*t->accepting_stream = this;
t->stream_map.emplace(id, this);
@ -1036,8 +1037,8 @@ static void write_action(grpc_chttp2_transport* t) {
max_frame_size = INT_MAX;
}
if (GRPC_TRACE_FLAG_ENABLED(grpc_ping_trace)) {
gpr_log(GPR_INFO, "%s[%p]: Write %" PRIdPTR " bytes",
t->is_client ? "CLIENT" : "SERVER", t, t->outbuf.Length());
LOG(INFO) << (t->is_client ? "CLIENT" : "SERVER") << "[" << t << "]: Write "
<< t->outbuf.Length() << " bytes";
}
t->write_size_policy.BeginWrite(t->outbuf.Length());
grpc_endpoint_write(t->ep, t->outbuf.c_slice_buffer(),
@ -1050,8 +1051,8 @@ static void write_action_end(grpc_core::RefCountedPtr<grpc_chttp2_transport> t,
grpc_error_handle error) {
auto* tp = t.get();
if (GRPC_TRACE_FLAG_ENABLED(grpc_ping_trace)) {
gpr_log(GPR_INFO, "%s[%p]: Finish write",
t->is_client ? "CLIENT" : "SERVER", t.get());
LOG(INFO) << (t->is_client ? "CLIENT" : "SERVER") << "[" << t.get()
<< "]: Finish write";
}
tp->combiner->Run(grpc_core::InitTransportClosure<write_action_end_locked>(
std::move(t), &tp->write_action_end_locked),
@ -1324,11 +1325,11 @@ static bool contains_non_ok_status(grpc_metadata_batch* batch) {
static void log_metadata(const grpc_metadata_batch* md_batch, uint32_t id,
bool is_client, bool is_initial) {
gpr_log(GPR_INFO, "--metadata--");
VLOG(2) << "--metadata--";
const std::string prefix = absl::StrCat(
"HTTP:", id, is_initial ? ":HDR" : ":TRL", is_client ? ":CLI:" : ":SVR:");
md_batch->Log([&prefix](absl::string_view key, absl::string_view value) {
gpr_log(GPR_INFO, "%s", absl::StrCat(prefix, key, ": ", value).c_str());
VLOG(2) << absl::StrCat(prefix, key, ": ", value);
});
}

@ -37,8 +37,8 @@
#include "src/core/ext/transport/chttp2/transport/http2_settings.h"
#include "src/core/lib/experiments/experiments.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/resource_quota/memory_quota.h"
#include "src/core/util/useful.h"
grpc_core::TraceFlag grpc_flowctl_trace(false, "flowctl");

@ -37,10 +37,10 @@
#include "src/core/ext/transport/chttp2/transport/internal.h"
#include "src/core/ext/transport/chttp2/transport/legacy_frame.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/slice/slice.h"
#include "src/core/util/useful.h"
static uint8_t* fill_header(uint8_t* out, uint32_t length, uint8_t flags) {
*out++ = static_cast<uint8_t>(length >> 16);

@ -26,11 +26,11 @@
#include <utility>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/hpack_constants.h"
@ -100,7 +100,7 @@ void HPackTable::SetMaxBytes(uint32_t max_bytes) {
return;
}
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
gpr_log(GPR_INFO, "Update hpack parser max size to %d", max_bytes);
LOG(INFO) << "Update hpack parser max size to " << max_bytes;
}
while (mem_used_ > max_bytes) {
EvictOne();
@ -112,7 +112,7 @@ bool HPackTable::SetCurrentTableSize(uint32_t bytes) {
if (current_table_bytes_ == bytes) return true;
if (bytes > max_bytes_) return false;
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
gpr_log(GPR_INFO, "Update hpack parser table size to %d", bytes);
LOG(INFO) << "Update hpack parser table size to " << bytes;
}
while (mem_used_ > bytes) {
EvictOne();

@ -25,8 +25,8 @@
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/frame.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/transport/http2_errors.h"
#include "src/core/util/useful.h"
namespace grpc_core {

@ -28,8 +28,8 @@
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/frame.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/transport/http2_errors.h"
#include "src/core/util/useful.h"
namespace grpc_core {

@ -29,6 +29,7 @@
#include "absl/base/attributes.h"
#include "absl/container/flat_hash_map.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/random/bit_gen_ref.h"
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
@ -769,7 +770,7 @@ static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t,
frame_type = HPackParser::LogInfo::kTrailers;
break;
case 2:
gpr_log(GPR_ERROR, "too many header frames received");
LOG(ERROR) << "too many header frames received";
return init_header_skip_frame_parser(t, priority_type, is_eoh);
}
if (frame_type == HPackParser::LogInfo::kTrailers && !t->header_eof) {
@ -889,10 +890,9 @@ static grpc_error_handle parse_frame_slice(grpc_chttp2_transport* t,
int is_last) {
grpc_chttp2_stream* s = t->incoming_stream;
if (grpc_http_trace.enabled()) {
gpr_log(GPR_DEBUG,
"INCOMING[%p;%p]: Parse %" PRIdPTR "b %sframe fragment with %s", t,
s, GRPC_SLICE_LENGTH(slice), is_last ? "last " : "",
t->parser.name);
VLOG(2) << "INCOMING[" << t << ";" << s << "]: Parse "
<< GRPC_SLICE_LENGTH(slice) << "b " << (is_last ? "last " : "")
<< "frame fragment with " << t->parser.name;
}
grpc_error_handle err =
t->parser.parser(t->parser.user_data, t, s, slice, is_last);

@ -59,7 +59,6 @@
#include "src/core/lib/debug/stats_data.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/experiments/experiments.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/match.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
@ -73,6 +72,7 @@
#include "src/core/lib/transport/http2_errors.h"
#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/transport/transport.h"
#include "src/core/util/useful.h"
// IWYU pragma: no_include "src/core/lib/gprpp/orphanable.h"

@ -41,6 +41,7 @@ grpc_cc_library(
],
external_deps = [
"absl/log:check",
"absl/log:log",
"cronet_c_for_grpc",
],
language = "c++",

@ -28,6 +28,7 @@
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/promise/promise.h"
#include "src/core/lib/promise/try_seq.h"
#include "src/core/lib/resource_quota/resource_quota.h"
#include "src/core/lib/surface/channel_create.h"
#include "src/core/lib/transport/transport.h"
#include "src/core/server/server.h"
@ -39,8 +40,18 @@ class InprocClientTransport;
class InprocServerTransport final : public ServerTransport {
public:
void SetAcceptor(Acceptor* acceptor) override {
acceptor_ = acceptor;
explicit InprocServerTransport(const ChannelArgs& args)
: event_engine_(
args.GetObjectRef<grpc_event_engine::experimental::EventEngine>()),
call_arena_allocator_(MakeRefCounted<CallArenaAllocator>(
args.GetObject<ResourceQuota>()
->memory_quota()
->CreateMemoryAllocator("inproc_server"),
1024)) {}
void SetCallDestination(
RefCountedPtr<UnstartedCallDestination> unstarted_call_handler) override {
unstarted_call_handler_ = unstarted_call_handler;
ConnectionState expect = ConnectionState::kInitial;
state_.compare_exchange_strong(expect, ConnectionState::kReady,
std::memory_order_acq_rel,
@ -95,7 +106,11 @@ class InprocServerTransport final : public ServerTransport {
case ConnectionState::kReady:
break;
}
return acceptor_->CreateCall(std::move(md), acceptor_->CreateArena());
auto* arena = call_arena_allocator_->MakeArena();
auto server_call = MakeCallPair(std::move(md), event_engine_.get(), arena,
call_arena_allocator_, nullptr);
unstarted_call_handler_->StartCall(std::move(server_call.handler));
return std::move(server_call.initiator);
}
OrphanablePtr<InprocClientTransport> MakeClientTransport();
@ -105,11 +120,14 @@ class InprocServerTransport final : public ServerTransport {
std::atomic<ConnectionState> state_{ConnectionState::kInitial};
std::atomic<bool> disconnecting_{false};
Acceptor* acceptor_;
RefCountedPtr<UnstartedCallDestination> unstarted_call_handler_;
absl::Status disconnect_error_;
Mutex state_tracker_mu_;
ConnectivityStateTracker state_tracker_ ABSL_GUARDED_BY(state_tracker_mu_){
"inproc_server_transport", GRPC_CHANNEL_CONNECTING};
const std::shared_ptr<grpc_event_engine::experimental::EventEngine>
event_engine_;
const RefCountedPtr<CallArenaAllocator> call_arena_allocator_;
};
class InprocClientTransport final : public ClientTransport {
@ -118,16 +136,19 @@ class InprocClientTransport final : public ClientTransport {
RefCountedPtr<InprocServerTransport> server_transport)
: server_transport_(std::move(server_transport)) {}
void StartCall(CallHandler call_handler) override {
call_handler.SpawnGuarded(
void StartCall(CallHandler child_call_handler) override {
child_call_handler.SpawnGuarded(
"pull_initial_metadata",
TrySeq(call_handler.PullClientInitialMetadata(),
TrySeq(child_call_handler.PullClientInitialMetadata(),
[server_transport = server_transport_,
call_handler](ClientMetadataHandle md) {
auto call_initiator =
child_call_handler](ClientMetadataHandle md) {
auto server_call_initiator =
server_transport->AcceptCall(std::move(md));
if (!call_initiator.ok()) return call_initiator.status();
ForwardCall(call_handler, std::move(*call_initiator));
if (!server_call_initiator.ok()) {
return server_call_initiator.status();
}
ForwardCall(child_call_handler,
std::move(*server_call_initiator));
return absl::OkStatus();
}));
}
@ -155,7 +176,6 @@ class InprocClientTransport final : public ClientTransport {
bool UsePromiseBasedTransport() {
if (!IsPromiseBasedInprocTransportEnabled()) return false;
CHECK(IsPromiseBasedClientCallEnabled());
CHECK(IsPromiseBasedServerCallEnabled());
return true;
}
@ -180,7 +200,7 @@ OrphanablePtr<Channel> MakeLameChannel(absl::string_view why,
OrphanablePtr<Channel> MakeInprocChannel(Server* server,
ChannelArgs client_channel_args) {
auto transports = MakeInProcessTransportPair();
auto transports = MakeInProcessTransportPair(server->channel_args());
auto client_transport = std::move(transports.first);
auto server_transport = std::move(transports.second);
auto error =
@ -205,8 +225,9 @@ OrphanablePtr<Channel> MakeInprocChannel(Server* server,
} // namespace
std::pair<OrphanablePtr<Transport>, OrphanablePtr<Transport>>
MakeInProcessTransportPair() {
auto server_transport = MakeOrphanable<InprocServerTransport>();
MakeInProcessTransportPair(const ChannelArgs& server_channel_args) {
auto server_transport =
MakeOrphanable<InprocServerTransport>(server_channel_args);
auto client_transport = server_transport->MakeClientTransport();
return std::make_pair(std::move(client_transport),
std::move(server_transport));

@ -30,7 +30,7 @@ extern grpc_core::TraceFlag grpc_inproc_trace;
namespace grpc_core {
std::pair<OrphanablePtr<Transport>, OrphanablePtr<Transport>>
MakeInProcessTransportPair();
MakeInProcessTransportPair(const ChannelArgs& server_channel_args);
}

@ -28,6 +28,7 @@
#include <utility>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
@ -319,7 +320,7 @@ void log_metadata(const grpc_metadata_batch* md_batch, bool is_client,
std::string prefix = absl::StrCat(
"INPROC:", is_initial ? "HDR:" : "TRL:", is_client ? "CLI:" : "SVR:");
md_batch->Log([&prefix](absl::string_view key, absl::string_view value) {
gpr_log(GPR_INFO, "%s", absl::StrCat(prefix, key, ": ", value).c_str());
LOG(INFO) << absl::StrCat(prefix, key, ": ", value);
});
}
@ -1268,8 +1269,8 @@ grpc_channel* grpc_legacy_inproc_channel_create(grpc_server* server,
"inproc", client_args, GRPC_CLIENT_DIRECT_CHANNEL, client_transport);
if (!new_channel.ok()) {
CHECK(!channel);
gpr_log(GPR_ERROR, "Failed to create client channel: %s",
grpc_core::StatusToString(error).c_str());
LOG(ERROR) << "Failed to create client channel: "
<< grpc_core::StatusToString(error);
intptr_t integer;
grpc_status_code status = GRPC_STATUS_INTERNAL;
if (grpc_error_get_int(error, grpc_core::StatusIntProperty::kRpcStatus,
@ -1286,8 +1287,8 @@ grpc_channel* grpc_legacy_inproc_channel_create(grpc_server* server,
}
} else {
CHECK(!channel);
gpr_log(GPR_ERROR, "Failed to create server channel: %s",
grpc_core::StatusToString(error).c_str());
LOG(ERROR) << "Failed to create server channel: "
<< grpc_core::StatusToString(error);
intptr_t integer;
grpc_status_code status = GRPC_STATUS_INTERNAL;
if (grpc_error_get_int(error, grpc_core::StatusIntProperty::kRpcStatus,

@ -41,7 +41,6 @@
#include "src/core/handshaker/handshaker_registry.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/sync.h"
@ -53,6 +52,7 @@
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/iomgr_fwd.h"
#include "src/core/lib/iomgr/tcp_server.h"
#include "src/core/util/string.h"
namespace grpc_core {

@ -26,6 +26,7 @@
#include <utility>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/ascii.h"
@ -47,12 +48,12 @@
#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/env.h"
#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/uri/uri_parser.h"
#include "src/core/util/string.h"
namespace grpc_core {
namespace {
@ -150,7 +151,7 @@ absl::optional<std::string> GetHttpProxyServer(
// User cred found
*user_cred = authority_strs[0];
proxy_name = authority_strs[1];
gpr_log(GPR_DEBUG, "userinfo found in proxy URI");
VLOG(2) << "userinfo found in proxy URI";
} else {
// Bad authority
proxy_name = absl::nullopt;

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

Loading…
Cancel
Save