grpc 1.71.0 → 1.72.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (597) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +78 -75
  3. data/include/grpc/event_engine/memory_request.h +3 -3
  4. data/include/grpc/impl/channel_arg_names.h +70 -50
  5. data/include/grpc/support/workaround_list.h +1 -4
  6. data/src/core/{lib/transport → call}/call_arena_allocator.cc +1 -1
  7. data/src/core/{lib/transport → call}/call_arena_allocator.h +3 -3
  8. data/src/core/{lib/transport → call}/call_destination.h +4 -4
  9. data/src/core/{lib/transport → call}/call_filters.cc +2 -2
  10. data/src/core/{lib/transport → call}/call_filters.h +25 -6
  11. data/src/core/{lib/channel → call}/call_finalization.h +3 -3
  12. data/src/core/{lib/transport → call}/call_spine.cc +1 -1
  13. data/src/core/{lib/transport → call}/call_spine.h +68 -26
  14. data/src/core/{lib/transport → call}/call_state.cc +1 -1
  15. data/src/core/{lib/transport → call}/call_state.h +3 -3
  16. data/src/core/{lib/surface → call}/client_call.cc +9 -7
  17. data/src/core/{lib/surface → call}/client_call.h +4 -4
  18. data/src/core/{lib/transport → call}/custom_metadata.h +3 -3
  19. data/src/core/{lib/transport → call}/interception_chain.cc +5 -5
  20. data/src/core/{lib/transport → call}/interception_chain.h +7 -7
  21. data/src/core/{lib/transport → call}/message.cc +1 -1
  22. data/src/core/{lib/transport → call}/message.h +7 -3
  23. data/src/core/{lib/transport → call}/metadata.cc +2 -2
  24. data/src/core/{lib/transport → call}/metadata.h +4 -4
  25. data/src/core/{lib/transport → call}/metadata_batch.cc +1 -1
  26. data/src/core/{lib/transport → call}/metadata_batch.h +7 -7
  27. data/src/core/{lib/transport → call}/metadata_compression_traits.h +3 -3
  28. data/src/core/{lib/transport → call}/metadata_info.cc +27 -9
  29. data/src/core/{lib/transport → call}/metadata_info.h +4 -4
  30. data/src/core/{lib/transport → call}/parsed_metadata.cc +1 -1
  31. data/src/core/{lib/transport → call}/parsed_metadata.h +3 -3
  32. data/src/core/call/request_buffer.h +3 -3
  33. data/src/core/call/security_context.cc +125 -0
  34. data/src/core/call/security_context.h +114 -0
  35. data/src/core/{lib/surface → call}/server_call.cc +3 -3
  36. data/src/core/{lib/surface → call}/server_call.h +5 -5
  37. data/src/core/{lib/transport → call}/simple_slice_based_metadata.h +4 -4
  38. data/src/core/{lib/channel → call}/status_util.cc +1 -1
  39. data/src/core/{lib/channel → call}/status_util.h +3 -3
  40. data/src/core/client_channel/client_channel.cc +24 -16
  41. data/src/core/client_channel/client_channel.h +4 -3
  42. data/src/core/client_channel/client_channel_filter.cc +10 -20
  43. data/src/core/client_channel/client_channel_filter.h +1 -1
  44. data/src/core/client_channel/client_channel_internal.h +1 -1
  45. data/src/core/client_channel/config_selector.h +2 -2
  46. data/src/core/client_channel/direct_channel.cc +2 -2
  47. data/src/core/client_channel/dynamic_filters.cc +0 -1
  48. data/src/core/client_channel/dynamic_filters.h +0 -1
  49. data/src/core/client_channel/lb_metadata.h +1 -1
  50. data/src/core/client_channel/load_balanced_call_destination.cc +1 -1
  51. data/src/core/client_channel/load_balanced_call_destination.h +1 -1
  52. data/src/core/client_channel/retry_filter_legacy_call_data.cc +43 -41
  53. data/src/core/client_channel/retry_filter_legacy_call_data.h +6 -6
  54. data/src/core/client_channel/retry_interceptor.h +1 -1
  55. data/src/core/client_channel/retry_service_config.cc +1 -1
  56. data/src/core/client_channel/retry_service_config.h +1 -1
  57. data/src/core/client_channel/retry_throttle.cc +30 -34
  58. data/src/core/client_channel/retry_throttle.h +10 -2
  59. data/src/core/client_channel/subchannel.cc +7 -8
  60. data/src/core/client_channel/subchannel.h +1 -2
  61. data/src/core/client_channel/subchannel_stream_client.cc +14 -11
  62. data/src/core/client_channel/subchannel_stream_client.h +2 -2
  63. data/src/core/config/core_configuration.h +2 -2
  64. data/src/core/credentials/call/call_credentials.h +157 -0
  65. data/src/core/{lib/security/credentials → credentials/call}/call_creds_util.cc +4 -4
  66. data/src/core/{lib/security/credentials → credentials/call}/call_creds_util.h +4 -4
  67. data/src/core/{lib/security/credentials/composite/composite_credentials.cc → credentials/call/composite/composite_call_credentials.cc} +4 -57
  68. data/src/core/credentials/call/composite/composite_call_credentials.h +82 -0
  69. data/src/core/{lib/security/credentials → credentials/call}/external/aws_external_account_credentials.cc +2 -2
  70. data/src/core/{lib/security/credentials → credentials/call}/external/aws_external_account_credentials.h +5 -5
  71. data/src/core/{lib/security/credentials → credentials/call}/external/aws_request_signer.cc +1 -1
  72. data/src/core/{lib/security/credentials → credentials/call}/external/aws_request_signer.h +3 -3
  73. data/src/core/{lib/security/credentials → credentials/call}/external/external_account_credentials.cc +6 -6
  74. data/src/core/{lib/security/credentials → credentials/call}/external/external_account_credentials.h +5 -5
  75. data/src/core/{lib/security/credentials → credentials/call}/external/file_external_account_credentials.cc +1 -1
  76. data/src/core/{lib/security/credentials → credentials/call}/external/file_external_account_credentials.h +4 -4
  77. data/src/core/{lib/security/credentials → credentials/call}/external/url_external_account_credentials.cc +3 -2
  78. data/src/core/{lib/security/credentials → credentials/call}/external/url_external_account_credentials.h +4 -4
  79. data/src/core/{lib/security/credentials → credentials/call}/gcp_service_account_identity/gcp_service_account_identity_credentials.cc +3 -2
  80. data/src/core/{lib/security/credentials → credentials/call}/gcp_service_account_identity/gcp_service_account_identity_credentials.h +6 -6
  81. data/src/core/{lib/security/credentials → credentials/call}/iam/iam_credentials.cc +2 -2
  82. data/src/core/{lib/security/credentials → credentials/call}/iam/iam_credentials.h +4 -4
  83. data/src/core/{lib/security/util → credentials/call}/json_util.cc +1 -1
  84. data/src/core/{lib/security/util → credentials/call}/json_util.h +3 -3
  85. data/src/core/{lib/security/credentials → credentials/call}/jwt/json_token.cc +2 -2
  86. data/src/core/{lib/security/credentials → credentials/call}/jwt/json_token.h +3 -3
  87. data/src/core/{lib/security/credentials → credentials/call}/jwt/jwt_credentials.cc +3 -3
  88. data/src/core/{lib/security/credentials → credentials/call}/jwt/jwt_credentials.h +5 -5
  89. data/src/core/{lib/security/credentials → credentials/call}/jwt/jwt_verifier.cc +3 -2
  90. data/src/core/{lib/security/credentials → credentials/call}/jwt/jwt_verifier.h +3 -3
  91. data/src/core/{lib/security/credentials → credentials/call}/oauth2/oauth2_credentials.cc +4 -3
  92. data/src/core/{lib/security/credentials → credentials/call}/oauth2/oauth2_credentials.h +5 -5
  93. data/src/core/{lib/security/credentials → credentials/call}/plugin/plugin_credentials.cc +2 -2
  94. data/src/core/{lib/security/credentials → credentials/call}/plugin/plugin_credentials.h +5 -5
  95. data/src/core/{lib/security/credentials → credentials/call}/token_fetcher/token_fetcher_credentials.cc +1 -1
  96. data/src/core/{lib/security/credentials → credentials/call}/token_fetcher/token_fetcher_credentials.h +5 -5
  97. data/src/core/{lib/security/credentials → credentials/transport}/alts/alts_credentials.cc +4 -4
  98. data/src/core/{lib/security/credentials → credentials/transport}/alts/alts_credentials.h +5 -5
  99. data/src/core/{lib/security/security_connector → credentials/transport}/alts/alts_security_connector.cc +4 -4
  100. data/src/core/{lib/security/security_connector → credentials/transport}/alts/alts_security_connector.h +4 -4
  101. data/src/core/{lib/security/credentials → credentials/transport}/alts/check_gcp_environment.cc +1 -1
  102. data/src/core/{lib/security/credentials → credentials/transport}/alts/check_gcp_environment.h +3 -3
  103. data/src/core/{lib/security/credentials → credentials/transport}/alts/check_gcp_environment_linux.cc +1 -1
  104. data/src/core/{lib/security/credentials → credentials/transport}/alts/check_gcp_environment_no_op.cc +1 -1
  105. data/src/core/{lib/security/credentials → credentials/transport}/alts/check_gcp_environment_windows.cc +1 -1
  106. data/src/core/{lib/security/credentials → credentials/transport}/alts/grpc_alts_credentials_client_options.cc +1 -1
  107. data/src/core/{lib/security/credentials → credentials/transport}/alts/grpc_alts_credentials_options.cc +1 -1
  108. data/src/core/{lib/security/credentials → credentials/transport}/alts/grpc_alts_credentials_options.h +3 -3
  109. data/src/core/{lib/security/credentials → credentials/transport}/alts/grpc_alts_credentials_server_options.cc +1 -1
  110. data/src/core/{lib/security/credentials → credentials/transport}/channel_creds_registry.h +4 -4
  111. data/src/core/{lib/security/credentials → credentials/transport}/channel_creds_registry_init.cc +21 -17
  112. data/src/core/credentials/transport/composite/composite_channel_credentials.cc +68 -0
  113. data/src/core/{lib/security/credentials/composite/composite_credentials.h → credentials/transport/composite/composite_channel_credentials.h} +6 -51
  114. data/src/core/{lib/security/credentials → credentials/transport}/fake/fake_credentials.cc +4 -26
  115. data/src/core/{lib/security/credentials → credentials/transport}/fake/fake_credentials.h +5 -37
  116. data/src/core/{lib/security/security_connector → credentials/transport}/fake/fake_security_connector.cc +4 -4
  117. data/src/core/{lib/security/security_connector → credentials/transport}/fake/fake_security_connector.h +4 -4
  118. data/src/core/{lib/security/credentials → credentials/transport}/google_default/credentials_generic.cc +2 -2
  119. data/src/core/{lib/security/credentials → credentials/transport}/google_default/google_default_credentials.cc +31 -19
  120. data/src/core/{lib/security/credentials → credentials/transport}/google_default/google_default_credentials.h +5 -5
  121. data/src/core/{lib/security/credentials → credentials/transport}/insecure/insecure_credentials.cc +2 -2
  122. data/src/core/{lib/security/credentials → credentials/transport}/insecure/insecure_credentials.h +5 -5
  123. data/src/core/{lib/security/security_connector → credentials/transport}/insecure/insecure_security_connector.cc +2 -2
  124. data/src/core/{lib/security/security_connector → credentials/transport}/insecure/insecure_security_connector.h +5 -5
  125. data/src/core/{lib/security/credentials → credentials/transport}/local/local_credentials.cc +2 -2
  126. data/src/core/{lib/security/credentials → credentials/transport}/local/local_credentials.h +5 -5
  127. data/src/core/{lib/security/security_connector → credentials/transport}/local/local_security_connector.cc +4 -4
  128. data/src/core/{lib/security/security_connector → credentials/transport}/local/local_security_connector.h +4 -4
  129. data/src/core/{lib/security/security_connector → credentials/transport}/security_connector.cc +2 -2
  130. data/src/core/{lib/security/security_connector → credentials/transport}/security_connector.h +3 -3
  131. data/src/core/{lib/security/credentials → credentials/transport}/ssl/ssl_credentials.cc +2 -2
  132. data/src/core/{lib/security/credentials → credentials/transport}/ssl/ssl_credentials.h +6 -6
  133. data/src/core/{lib/security/security_connector → credentials/transport}/ssl/ssl_security_connector.cc +5 -5
  134. data/src/core/{lib/security/security_connector → credentials/transport}/ssl/ssl_security_connector.h +4 -4
  135. data/src/core/{lib/security/certificate_provider → credentials/transport/tls}/certificate_provider_factory.h +3 -3
  136. data/src/core/{lib/security/certificate_provider → credentials/transport/tls}/certificate_provider_registry.cc +1 -1
  137. data/src/core/{lib/security/certificate_provider → credentials/transport/tls}/certificate_provider_registry.h +4 -4
  138. data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_distributor.cc +1 -1
  139. data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_distributor.h +4 -4
  140. data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_match.cc +1 -1
  141. data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_provider.cc +2 -2
  142. data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_provider.h +5 -5
  143. data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_verifier.cc +2 -2
  144. data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_certificate_verifier.h +3 -3
  145. data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_credentials_options.cc +1 -1
  146. data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_credentials_options.h +7 -7
  147. data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_crl_provider.cc +1 -1
  148. data/src/core/{lib/security/credentials → credentials/transport}/tls/grpc_tls_crl_provider.h +3 -3
  149. data/src/core/{lib/security/security_connector → credentials/transport/tls}/load_system_roots.h +3 -3
  150. data/src/core/{lib/security/security_connector → credentials/transport/tls}/load_system_roots_fallback.cc +1 -1
  151. data/src/core/{lib/security/security_connector → credentials/transport/tls}/load_system_roots_supported.cc +2 -2
  152. data/src/core/{lib/security/security_connector → credentials/transport/tls}/load_system_roots_supported.h +3 -3
  153. data/src/core/{lib/security/security_connector → credentials/transport/tls}/load_system_roots_windows.cc +1 -1
  154. data/src/core/{lib/security/security_connector → credentials/transport/tls}/ssl_utils.cc +3 -3
  155. data/src/core/{lib/security/security_connector → credentials/transport/tls}/ssl_utils.h +4 -4
  156. data/src/core/{lib/security/credentials → credentials/transport}/tls/tls_credentials.cc +4 -4
  157. data/src/core/{lib/security/credentials → credentials/transport}/tls/tls_credentials.h +5 -5
  158. data/src/core/{lib/security/security_connector → credentials/transport}/tls/tls_security_connector.cc +6 -6
  159. data/src/core/{lib/security/security_connector → credentials/transport}/tls/tls_security_connector.h +6 -6
  160. data/src/core/{lib/security/credentials → credentials/transport}/tls/tls_utils.cc +1 -1
  161. data/src/core/{lib/security/credentials → credentials/transport}/tls/tls_utils.h +3 -3
  162. data/src/core/{lib/security/credentials/credentials.cc → credentials/transport/transport_credentials.cc} +1 -3
  163. data/src/core/{lib/security/credentials/credentials.h → credentials/transport/transport_credentials.h} +5 -121
  164. data/src/core/{lib/security/credentials → credentials/transport}/xds/xds_credentials.cc +5 -5
  165. data/src/core/{lib/security/credentials → credentials/transport}/xds/xds_credentials.h +6 -6
  166. data/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +1 -1
  167. data/src/core/ext/filters/channel_idle/legacy_channel_idle_filter.cc +8 -5
  168. data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +2 -2
  169. data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.cc +1 -1
  170. data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.cc +2 -2
  171. data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.h +1 -1
  172. data/src/core/ext/filters/http/client/http_client_filter.h +1 -1
  173. data/src/core/ext/filters/http/client_authority_filter.cc +2 -2
  174. data/src/core/ext/filters/http/message_compress/compression_filter.cc +1 -1
  175. data/src/core/ext/filters/http/message_compress/compression_filter.h +1 -1
  176. data/src/core/ext/filters/http/server/http_server_filter.cc +1 -1
  177. data/src/core/ext/filters/message_size/message_size_filter.cc +1 -1
  178. data/src/core/ext/filters/rbac/rbac_filter.cc +2 -2
  179. data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +1 -1
  180. data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +3 -3
  181. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +8 -5
  182. data/src/core/ext/transport/chttp2/server/chttp2_server.h +5 -1
  183. data/src/core/ext/transport/chttp2/transport/call_tracer_wrapper.cc +2 -2
  184. data/src/core/ext/transport/chttp2/transport/call_tracer_wrapper.h +1 -3
  185. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +58 -57
  186. data/src/core/ext/transport/chttp2/transport/context_list_entry.h +3 -3
  187. data/src/core/ext/transport/chttp2/transport/frame.cc +89 -68
  188. data/src/core/ext/transport/chttp2/transport/frame.h +37 -1
  189. data/src/core/ext/transport/chttp2/transport/frame_data.cc +2 -0
  190. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +6 -3
  191. data/src/core/ext/transport/chttp2/transport/frame_settings.cc +4 -2
  192. data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +2 -2
  193. data/src/core/ext/transport/chttp2/transport/hpack_parse_result.h +1 -1
  194. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +2 -2
  195. data/src/core/ext/transport/chttp2/transport/hpack_parser.h +1 -1
  196. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +2 -2
  197. data/src/core/ext/transport/chttp2/transport/http2_settings.cc +10 -8
  198. data/src/core/ext/transport/chttp2/transport/http2_settings.h +2 -2
  199. data/src/core/ext/transport/chttp2/transport/http2_status.h +52 -0
  200. data/src/core/ext/transport/chttp2/transport/internal.h +11 -14
  201. data/src/core/ext/transport/chttp2/transport/parsing.cc +36 -23
  202. data/src/core/ext/transport/chttp2/transport/writing.cc +15 -14
  203. data/src/core/ext/transport/inproc/inproc_transport.cc +1 -1
  204. data/src/core/ext/transport/inproc/legacy_inproc_transport.cc +1 -1
  205. data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb.h +65 -65
  206. data/src/core/ext/upb-gen/envoy/admin/v3/clusters.upb_minitable.c +28 -28
  207. data/src/core/ext/upb-gen/envoy/admin/v3/config_dump_shared.upb.h +14 -14
  208. data/src/core/ext/upb-gen/envoy/admin/v3/config_dump_shared.upb_minitable.c +6 -6
  209. data/src/core/ext/upb-gen/envoy/admin/v3/metrics.upb.h +6 -6
  210. data/src/core/ext/upb-gen/envoy/admin/v3/metrics.upb_minitable.c +4 -4
  211. data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb.h +133 -133
  212. data/src/core/ext/upb-gen/envoy/admin/v3/server_info.upb_minitable.c +71 -71
  213. data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb.h +26 -26
  214. data/src/core/ext/upb-gen/envoy/config/accesslog/v3/accesslog.upb_minitable.c +7 -7
  215. data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb.h +216 -218
  216. data/src/core/ext/upb-gen/envoy/config/bootstrap/v3/bootstrap.upb_minitable.c +66 -66
  217. data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb.h +27 -27
  218. data/src/core/ext/upb-gen/envoy/config/cluster/v3/circuit_breaker.upb_minitable.c +9 -9
  219. data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb.h +326 -328
  220. data/src/core/ext/upb-gen/envoy/config/cluster/v3/cluster.upb_minitable.c +103 -103
  221. data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb.h +58 -58
  222. data/src/core/ext/upb-gen/envoy/config/cluster/v3/outlier_detection.upb_minitable.c +14 -14
  223. data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb.h +22 -24
  224. data/src/core/ext/upb-gen/envoy/config/common/matcher/v3/matcher.upb_minitable.c +3 -3
  225. data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb.h +29 -29
  226. data/src/core/ext/upb-gen/envoy/config/core/v3/address.upb_minitable.c +16 -16
  227. data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb.h +186 -192
  228. data/src/core/ext/upb-gen/envoy/config/core/v3/base.upb_minitable.c +54 -54
  229. data/src/core/ext/upb-gen/envoy/config/core/v3/config_source.upb.h +54 -54
  230. data/src/core/ext/upb-gen/envoy/config/core/v3/config_source.upb_minitable.c +21 -21
  231. data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb.h +59 -61
  232. data/src/core/ext/upb-gen/envoy/config/core/v3/grpc_service.upb_minitable.c +15 -15
  233. data/src/core/ext/upb-gen/envoy/config/core/v3/health_check.upb.h +100 -100
  234. data/src/core/ext/upb-gen/envoy/config/core/v3/health_check.upb_minitable.c +34 -34
  235. data/src/core/ext/upb-gen/envoy/config/core/v3/http_uri.upb.h +12 -12
  236. data/src/core/ext/upb-gen/envoy/config/core/v3/http_uri.upb_minitable.c +5 -5
  237. data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb.h +118 -118
  238. data/src/core/ext/upb-gen/envoy/config/core/v3/protocol.upb_minitable.c +39 -39
  239. data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb.h +19 -19
  240. data/src/core/ext/upb-gen/envoy/config/core/v3/socket_option.upb_minitable.c +9 -9
  241. data/src/core/ext/upb-gen/envoy/config/core/v3/substitution_format_string.upb.h +27 -27
  242. data/src/core/ext/upb-gen/envoy/config/core/v3/substitution_format_string.upb_minitable.c +10 -10
  243. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint.upb.h +12 -14
  244. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint.upb_minitable.c +2 -2
  245. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb.h +41 -41
  246. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/endpoint_components.upb_minitable.c +16 -16
  247. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/load_report.upb.h +24 -24
  248. data/src/core/ext/upb-gen/envoy/config/endpoint/v3/load_report.upb_minitable.c +9 -9
  249. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb.h +139 -139
  250. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener.upb_minitable.c +46 -46
  251. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener_components.upb.h +61 -61
  252. data/src/core/ext/upb-gen/envoy/config/listener/v3/listener_components.upb_minitable.c +20 -20
  253. data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb.h +3 -3
  254. data/src/core/ext/upb-gen/envoy/config/listener/v3/quic_config.upb_minitable.c +1 -1
  255. data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb.h +6 -6
  256. data/src/core/ext/upb-gen/envoy/config/metrics/v3/metrics_service.upb_minitable.c +4 -4
  257. data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb.h +33 -33
  258. data/src/core/ext/upb-gen/envoy/config/metrics/v3/stats.upb_minitable.c +14 -14
  259. data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb.h +12 -14
  260. data/src/core/ext/upb-gen/envoy/config/rbac/v3/rbac.upb_minitable.c +2 -2
  261. data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb.h +52 -54
  262. data/src/core/ext/upb-gen/envoy/config/route/v3/route.upb_minitable.c +10 -10
  263. data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb.h +620 -626
  264. data/src/core/ext/upb-gen/envoy/config/route/v3/route_components.upb_minitable.c +215 -215
  265. data/src/core/ext/upb-gen/envoy/config/route/v3/scoped_route.upb.h +13 -13
  266. data/src/core/ext/upb-gen/envoy/config/route/v3/scoped_route.upb_minitable.c +4 -4
  267. data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb.h +3 -3
  268. data/src/core/ext/upb-gen/envoy/config/tap/v3/common.upb_minitable.c +2 -2
  269. data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb.h +7 -7
  270. data/src/core/ext/upb-gen/envoy/config/trace/v3/opentelemetry.upb_minitable.c +3 -3
  271. data/src/core/ext/upb-gen/envoy/config/trace/v3/skywalking.upb.h +15 -15
  272. data/src/core/ext/upb-gen/envoy/config/trace/v3/skywalking.upb_minitable.c +7 -7
  273. data/src/core/ext/upb-gen/envoy/config/trace/v3/xray.upb.h +7 -7
  274. data/src/core/ext/upb-gen/envoy/config/trace/v3/xray.upb_minitable.c +3 -3
  275. data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb.h +16 -16
  276. data/src/core/ext/upb-gen/envoy/config/trace/v3/zipkin.upb_minitable.c +10 -10
  277. data/src/core/ext/upb-gen/envoy/data/accesslog/v3/accesslog.upb.h +306 -312
  278. data/src/core/ext/upb-gen/envoy/data/accesslog/v3/accesslog.upb_minitable.c +96 -96
  279. data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb.h +61 -61
  280. data/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.c +27 -27
  281. data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h +19 -19
  282. data/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c +6 -6
  283. data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +25 -25
  284. data/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c +9 -9
  285. data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb.h +34 -34
  286. data/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb_minitable.c +9 -9
  287. data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb.h +3 -3
  288. data/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.c +2 -2
  289. data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +294 -294
  290. data/src/core/ext/upb-gen/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb_minitable.c +105 -105
  291. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb.h +3 -3
  292. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/common/v3/common.upb_minitable.c +1 -1
  293. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h +23 -23
  294. data/src/core/ext/upb-gen/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb_minitable.c +8 -8
  295. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb.h +84 -84
  296. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/common.upb_minitable.c +28 -28
  297. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +87 -87
  298. data/src/core/ext/upb-gen/envoy/extensions/transport_sockets/tls/v3/tls.upb_minitable.c +31 -31
  299. data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb.h +24 -24
  300. data/src/core/ext/upb-gen/envoy/extensions/upstreams/http/v3/http_protocol_options.upb_minitable.c +5 -5
  301. data/src/core/ext/upb-gen/envoy/service/discovery/v3/discovery.upb.h +130 -132
  302. data/src/core/ext/upb-gen/envoy/service/discovery/v3/discovery.upb_minitable.c +43 -43
  303. data/src/core/ext/upb-gen/envoy/service/load_stats/v3/lrs.upb.h +6 -6
  304. data/src/core/ext/upb-gen/envoy/service/load_stats/v3/lrs.upb_minitable.c +2 -2
  305. data/src/core/ext/upb-gen/envoy/service/status/v3/csds.upb.h +60 -60
  306. data/src/core/ext/upb-gen/envoy/service/status/v3/csds.upb_minitable.c +26 -26
  307. data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb.h +7 -7
  308. data/src/core/ext/upb-gen/envoy/type/http/v3/cookie.upb_minitable.c +3 -3
  309. data/src/core/ext/upb-gen/envoy/type/matcher/v3/metadata.upb.h +6 -6
  310. data/src/core/ext/upb-gen/envoy/type/matcher/v3/metadata.upb_minitable.c +2 -2
  311. data/src/core/ext/upb-gen/envoy/type/matcher/v3/regex.upb.h +7 -7
  312. data/src/core/ext/upb-gen/envoy/type/matcher/v3/regex.upb_minitable.c +3 -3
  313. data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb.h +11 -11
  314. data/src/core/ext/upb-gen/envoy/type/tracing/v3/custom_tag.upb_minitable.c +4 -4
  315. data/src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.upb.h +85 -89
  316. data/src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.upb_minitable.c +20 -20
  317. data/src/core/ext/upb-gen/google/api/expr/v1alpha1/syntax.upb.h +80 -83
  318. data/src/core/ext/upb-gen/google/api/expr/v1alpha1/syntax.upb_minitable.c +27 -27
  319. data/src/core/ext/upb-gen/google/api/http.upb.h +51 -51
  320. data/src/core/ext/upb-gen/google/api/http.upb_minitable.c +22 -22
  321. data/src/core/ext/upb-gen/google/protobuf/descriptor.upb.h +327 -301
  322. data/src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.c +97 -85
  323. data/src/core/ext/upb-gen/google/protobuf/descriptor.upb_minitable.h +1 -0
  324. data/src/core/ext/upb-gen/google/protobuf/struct.upb.h +9 -11
  325. data/src/core/ext/upb-gen/src/proto/grpc/gcp/altscontext.upb.h +9 -10
  326. data/src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb.h +110 -113
  327. data/src/core/ext/upb-gen/src/proto/grpc/gcp/handshaker.upb_minitable.c +25 -25
  328. data/src/core/ext/upb-gen/src/proto/grpc/lb/v1/load_balancer.upb.h +6 -6
  329. data/src/core/ext/upb-gen/src/proto/grpc/lb/v1/load_balancer.upb_minitable.c +4 -4
  330. data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls.upb.h +21 -22
  331. data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls.upb_minitable.c +3 -3
  332. data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls_config.upb.h +70 -72
  333. data/src/core/ext/upb-gen/src/proto/grpc/lookup/v1/rls_config.upb_minitable.c +17 -17
  334. data/src/core/ext/upb-gen/validate/validate.upb.h +368 -368
  335. data/src/core/ext/upb-gen/validate/validate.upb_minitable.c +117 -117
  336. data/src/core/ext/upb-gen/xds/core/v3/context_params.upb.h +9 -10
  337. data/src/core/ext/upb-gen/xds/core/v3/resource.upb.h +7 -7
  338. data/src/core/ext/upb-gen/xds/core/v3/resource.upb_minitable.c +3 -3
  339. data/src/core/ext/upb-gen/xds/core/v3/resource_locator.upb.h +12 -12
  340. data/src/core/ext/upb-gen/xds/core/v3/resource_locator.upb_minitable.c +2 -2
  341. data/src/core/ext/upb-gen/xds/data/orca/v3/orca_load_report.upb.h +27 -30
  342. data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb.h +7 -7
  343. data/src/core/ext/upb-gen/xds/type/matcher/v3/cel.upb_minitable.c +3 -3
  344. data/src/core/ext/upb-gen/xds/type/matcher/v3/ip.upb.h +3 -3
  345. data/src/core/ext/upb-gen/xds/type/matcher/v3/ip.upb_minitable.c +1 -1
  346. data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb.h +22 -24
  347. data/src/core/ext/upb-gen/xds/type/matcher/v3/matcher.upb_minitable.c +3 -3
  348. data/src/core/ext/upbdefs-gen/google/protobuf/descriptor.upbdefs.c +98 -87
  349. data/src/core/{lib/security/transport → filter/auth}/auth_filters.h +8 -7
  350. data/src/core/{lib/security/transport → filter/auth}/client_auth_filter.cc +7 -6
  351. data/src/core/{lib/security/transport → filter/auth}/server_auth_filter.cc +5 -4
  352. data/src/core/handshaker/handshaker.cc +0 -8
  353. data/src/core/handshaker/security/security_handshaker.cc +1 -1
  354. data/src/core/handshaker/security/security_handshaker.h +1 -1
  355. data/src/core/lib/channel/channel_args.h +49 -30
  356. data/src/core/lib/channel/channel_stack.h +1 -2
  357. data/src/core/lib/channel/channel_stack_builder_impl.cc +1 -1
  358. data/src/core/lib/channel/connected_channel.cc +2 -2
  359. data/src/core/lib/channel/promise_based_filter.h +3 -3
  360. data/src/core/lib/debug/trace_flags.cc +2 -4
  361. data/src/core/lib/debug/trace_flags.h +1 -2
  362. data/src/core/lib/event_engine/default_event_engine_factory.cc +6 -6
  363. data/src/core/lib/event_engine/default_event_engine_factory.h +1 -1
  364. data/src/core/lib/event_engine/extensions/iomgr_compatible.h +39 -0
  365. data/src/core/lib/event_engine/extensions/supports_win_sockets.h +48 -0
  366. data/src/core/lib/event_engine/extensions/tcp_trace.h +1 -1
  367. data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +0 -2
  368. data/src/core/lib/event_engine/posix_engine/posix_engine.cc +1 -3
  369. data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +26 -0
  370. data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.h +4 -0
  371. data/src/core/lib/event_engine/posix_engine/set_socket_dualstack.cc +64 -0
  372. data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +0 -11
  373. data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.cc +10 -2
  374. data/src/core/lib/event_engine/shim.cc +9 -16
  375. data/src/core/lib/event_engine/shim.h +11 -0
  376. data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +15 -7
  377. data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h +2 -1
  378. data/src/core/lib/event_engine/windows/win_socket.cc +11 -0
  379. data/src/core/lib/event_engine/windows/win_socket.h +3 -0
  380. data/src/core/lib/event_engine/windows/windows_endpoint.cc +5 -10
  381. data/src/core/lib/event_engine/windows/windows_engine.cc +42 -0
  382. data/src/core/lib/event_engine/windows/windows_engine.h +8 -2
  383. data/src/core/lib/event_engine/windows/windows_listener.cc +5 -6
  384. data/src/core/lib/event_engine/windows/windows_listener.h +9 -4
  385. data/src/core/lib/experiments/experiments.cc +174 -21
  386. data/src/core/lib/experiments/experiments.h +70 -13
  387. data/src/core/lib/iomgr/endpoint_pair_posix.cc +43 -16
  388. data/src/core/lib/iomgr/endpoint_pair_windows.cc +43 -8
  389. data/src/core/lib/iomgr/error.cc +27 -43
  390. data/src/core/lib/iomgr/ev_epoll1_linux.cc +13 -1
  391. data/src/core/lib/iomgr/ev_poll_posix.cc +13 -0
  392. data/src/core/lib/iomgr/polling_entity.cc +2 -7
  393. data/src/core/lib/iomgr/socket_utils_common_posix.cc +1 -0
  394. data/src/core/lib/iomgr/socket_utils_posix.cc +22 -11
  395. data/src/core/lib/iomgr/socket_utils_posix.h +12 -2
  396. data/src/core/lib/iomgr/tcp_client_cfstream.cc +8 -9
  397. data/src/core/lib/iomgr/tcp_client_posix.cc +11 -15
  398. data/src/core/lib/iomgr/tcp_client_posix.h +1 -1
  399. data/src/core/lib/iomgr/tcp_posix.cc +58 -31
  400. data/src/core/lib/iomgr/tcp_posix.h +10 -2
  401. data/src/core/lib/iomgr/tcp_server_posix.cc +9 -1
  402. data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +1 -4
  403. data/src/core/lib/iomgr/tcp_server_windows.cc +27 -16
  404. data/src/core/lib/iomgr/wakeup_fd_pipe.cc +10 -2
  405. data/src/core/lib/promise/all_ok.h +31 -0
  406. data/src/core/lib/promise/loop.h +8 -5
  407. data/src/core/lib/promise/map.h +65 -2
  408. data/src/core/lib/promise/party.h +5 -1
  409. data/src/core/lib/promise/poll.h +22 -20
  410. data/src/core/lib/promise/promise.h +2 -2
  411. data/src/core/lib/promise/status_flag.h +23 -11
  412. data/src/core/lib/security/authorization/evaluate_args.cc +1 -1
  413. data/src/core/lib/security/authorization/evaluate_args.h +1 -1
  414. data/src/core/lib/security/authorization/grpc_server_authz_filter.cc +1 -1
  415. data/src/core/lib/security/authorization/grpc_server_authz_filter.h +1 -1
  416. data/src/core/lib/slice/slice.h +6 -0
  417. data/src/core/lib/surface/call.cc +20 -18
  418. data/src/core/lib/surface/call_utils.cc +3 -3
  419. data/src/core/lib/surface/call_utils.h +3 -3
  420. data/src/core/lib/surface/channel.h +2 -2
  421. data/src/core/lib/surface/channel_init.h +2 -2
  422. data/src/core/lib/surface/completion_queue.cc +77 -17
  423. data/src/core/lib/surface/filter_stack_call.cc +40 -27
  424. data/src/core/lib/surface/filter_stack_call.h +1 -1
  425. data/src/core/lib/surface/init.cc +2 -3
  426. data/src/core/lib/surface/lame_client.cc +1 -1
  427. data/src/core/lib/surface/legacy_channel.cc +27 -23
  428. data/src/core/lib/surface/legacy_channel.h +1 -1
  429. data/src/core/lib/surface/version.cc +2 -2
  430. data/src/core/lib/transport/error_utils.cc +65 -11
  431. data/src/core/lib/transport/error_utils.h +2 -2
  432. data/src/core/lib/transport/status_conversion.cc +16 -14
  433. data/src/core/lib/transport/status_conversion.h +5 -4
  434. data/src/core/lib/transport/transport.h +5 -5
  435. data/src/core/lib/transport/transport_op_string.cc +1 -1
  436. data/src/core/load_balancing/delegating_helper.h +1 -1
  437. data/src/core/load_balancing/grpclb/client_load_reporting_filter.cc +1 -1
  438. data/src/core/load_balancing/grpclb/grpclb.cc +1 -2
  439. data/src/core/load_balancing/pick_first/pick_first.cc +0 -955
  440. data/src/core/load_balancing/rls/rls.cc +31 -37
  441. data/src/core/load_balancing/weighted_target/weighted_target.cc +1 -1
  442. data/src/core/load_balancing/xds/cds.cc +3 -10
  443. data/src/core/load_balancing/xds/xds_cluster_impl.cc +1 -1
  444. data/src/core/plugin_registry/grpc_plugin_registry.cc +2 -0
  445. data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +0 -2
  446. data/src/core/resolver/dns/c_ares/dns_resolver_ares.cc +1 -3
  447. data/src/core/resolver/dns/c_ares/grpc_ares_wrapper.h +4 -0
  448. data/src/core/resolver/google_c2p/google_c2p_resolver.cc +1 -1
  449. data/src/core/resolver/xds/xds_dependency_manager.cc +8 -3
  450. data/src/core/resolver/xds/xds_resolver.cc +2 -2
  451. data/src/core/server/server.cc +7 -4
  452. data/src/core/server/server.h +1 -1
  453. data/src/core/server/server_call_tracer_filter.cc +1 -1
  454. data/src/core/server/server_config_selector.h +1 -1
  455. data/src/core/server/server_config_selector_filter.cc +1 -1
  456. data/src/core/server/xds_server_config_fetcher.cc +5 -5
  457. data/src/core/service_config/service_config_channel_arg_filter.cc +1 -1
  458. data/src/core/telemetry/call_tracer.cc +2 -4
  459. data/src/core/telemetry/call_tracer.h +3 -3
  460. data/src/core/telemetry/metrics.cc +30 -12
  461. data/src/core/telemetry/metrics.h +15 -3
  462. data/src/core/telemetry/stats_data.cc +75 -2
  463. data/src/core/telemetry/stats_data.h +46 -4
  464. data/src/core/telemetry/tcp_tracer.h +90 -84
  465. data/src/core/{lib/security/context/security_context.cc → transport/auth_context.cc} +1 -96
  466. data/src/core/{lib/security/context/security_context.h → transport/auth_context.h} +6 -76
  467. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +1 -1
  468. data/src/core/tsi/ssl_transport_security.cc +1 -1
  469. data/src/core/util/check_class_size.h +48 -0
  470. data/src/core/util/gcp_metadata_query.cc +1 -1
  471. data/src/core/util/http_client/httpcli.cc +3 -3
  472. data/src/core/util/http_client/httpcli_security_connector.cc +3 -3
  473. data/src/core/util/load_file.cc +26 -14
  474. data/src/core/util/status_helper.cc +86 -63
  475. data/src/core/util/status_helper.h +9 -26
  476. data/src/core/xds/grpc/certificate_provider_store.cc +1 -1
  477. data/src/core/xds/grpc/certificate_provider_store.h +3 -3
  478. data/src/core/xds/grpc/file_watcher_certificate_provider_factory.cc +3 -3
  479. data/src/core/xds/grpc/file_watcher_certificate_provider_factory.h +1 -1
  480. data/src/core/xds/grpc/xds_bootstrap_grpc.cc +10 -7
  481. data/src/core/xds/grpc/xds_certificate_provider.cc +1 -1
  482. data/src/core/xds/grpc/xds_certificate_provider.h +2 -2
  483. data/src/core/xds/grpc/xds_client_grpc.cc +7 -6
  484. data/src/core/xds/grpc/xds_client_grpc.h +4 -2
  485. data/src/core/xds/grpc/xds_cluster.h +3 -3
  486. data/src/core/xds/grpc/xds_cluster_parser.cc +3 -2
  487. data/src/core/xds/grpc/xds_http_fault_filter.cc +1 -1
  488. data/src/core/xds/grpc/xds_http_filter.h +1 -1
  489. data/src/core/xds/grpc/xds_http_filter_registry.h +1 -1
  490. data/src/core/xds/grpc/xds_route_config.h +1 -1
  491. data/src/core/xds/grpc/xds_route_config_parser.cc +1 -1
  492. data/src/core/xds/grpc/xds_route_config_parser.h +1 -1
  493. data/src/core/xds/grpc/xds_routing.h +1 -1
  494. data/src/core/xds/grpc/xds_server_grpc.cc +60 -48
  495. data/src/core/xds/grpc/xds_server_grpc.h +23 -13
  496. data/src/core/xds/grpc/xds_server_grpc_interface.h +2 -2
  497. data/src/core/xds/grpc/xds_transport_grpc.cc +5 -5
  498. data/src/core/xds/grpc/xds_transport_grpc.h +5 -3
  499. data/src/core/xds/xds_client/lrs_client.cc +6 -5
  500. data/src/core/xds/xds_client/lrs_client.h +7 -7
  501. data/src/core/xds/xds_client/xds_bootstrap.h +16 -1
  502. data/src/core/xds/xds_client/xds_client.cc +25 -23
  503. data/src/core/xds/xds_client/xds_client.h +3 -1
  504. data/src/core/xds/xds_client/xds_resource_type.h +1 -2
  505. data/src/core/xds/xds_client/xds_transport.h +1 -1
  506. data/src/ruby/ext/grpc/extconf.rb +1 -1
  507. data/src/ruby/lib/grpc/version.rb +1 -1
  508. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_apple.cc +0 -2
  509. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_fuchsia.cc +0 -2
  510. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_linux.cc +0 -2
  511. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_openbsd.cc +0 -2
  512. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_sysreg.cc +0 -2
  513. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_win.cc +0 -2
  514. data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_freebsd.cc +0 -1
  515. data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_linux.cc +0 -1
  516. data/third_party/boringssl-with-bazel/src/crypto/crypto.cc +0 -2
  517. data/third_party/boringssl-with-bazel/src/crypto/internal.h +20 -3
  518. data/third_party/boringssl-with-bazel/src/include/openssl/arm_arch.h +3 -25
  519. data/third_party/boringssl-with-bazel/src/ssl/extensions.cc +3 -7
  520. data/third_party/boringssl-with-bazel/src/ssl/handshake_client.cc +1 -1
  521. data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +1 -1
  522. data/third_party/boringssl-with-bazel/src/ssl/internal.h +13 -6
  523. data/third_party/boringssl-with-bazel/src/ssl/ssl_credential.cc +2 -1
  524. data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +1 -1
  525. data/third_party/boringssl-with-bazel/src/ssl/tls13_server.cc +1 -1
  526. data/third_party/upb/upb/base/internal/log2.h +3 -1
  527. data/third_party/upb/upb/base/string_view.h +10 -0
  528. data/third_party/upb/upb/hash/common.c +5 -1
  529. data/third_party/upb/upb/json/decode.c +2 -2
  530. data/third_party/upb/upb/json/decode.h +0 -1
  531. data/third_party/upb/upb/mem/alloc.h +5 -0
  532. data/third_party/upb/upb/mem/arena.c +296 -142
  533. data/third_party/upb/upb/mem/arena.h +47 -11
  534. data/third_party/upb/upb/mem/arena.hpp +4 -20
  535. data/third_party/upb/upb/mem/internal/arena.h +4 -6
  536. data/third_party/upb/upb/message/accessors.h +41 -0
  537. data/third_party/upb/upb/message/compat.c +11 -14
  538. data/third_party/upb/upb/message/compat.h +4 -3
  539. data/third_party/upb/upb/message/copy.c +35 -30
  540. data/third_party/upb/upb/message/internal/accessors.h +139 -10
  541. data/third_party/upb/upb/message/internal/extension.c +28 -25
  542. data/third_party/upb/upb/message/internal/extension.h +21 -5
  543. data/third_party/upb/upb/message/internal/iterator.c +58 -0
  544. data/third_party/upb/upb/message/internal/iterator.h +29 -0
  545. data/third_party/upb/upb/message/internal/map.h +2 -3
  546. data/third_party/upb/upb/message/internal/map_sorter.h +3 -2
  547. data/third_party/upb/upb/message/internal/message.c +48 -29
  548. data/third_party/upb/upb/message/internal/message.h +154 -24
  549. data/third_party/upb/upb/message/map_sorter.c +20 -8
  550. data/third_party/upb/upb/message/message.c +90 -38
  551. data/third_party/upb/upb/message/message.h +58 -2
  552. data/third_party/upb/upb/message/value.h +9 -0
  553. data/third_party/upb/upb/mini_descriptor/build_enum.c +1 -1
  554. data/third_party/upb/upb/mini_descriptor/decode.c +97 -136
  555. data/third_party/upb/upb/mini_descriptor/decode.h +4 -3
  556. data/third_party/upb/upb/mini_descriptor/internal/encode.hpp +1 -1
  557. data/third_party/upb/upb/mini_table/extension_registry.c +24 -12
  558. data/third_party/upb/upb/mini_table/extension_registry.h +13 -6
  559. data/third_party/upb/upb/mini_table/message.c +21 -13
  560. data/third_party/upb/upb/port/atomic.h +134 -7
  561. data/third_party/upb/upb/port/def.inc +140 -38
  562. data/third_party/upb/upb/port/undef.inc +11 -1
  563. data/third_party/upb/upb/reflection/def.hpp +5 -1
  564. data/third_party/upb/upb/reflection/def_pool.c +10 -3
  565. data/third_party/upb/upb/reflection/descriptor_bootstrap.h +1 -1
  566. data/third_party/upb/upb/reflection/file_def.c +12 -5
  567. data/third_party/upb/upb/reflection/internal/def_builder.c +1 -1
  568. data/third_party/upb/upb/reflection/internal/upb_edition_defaults.h +1 -1
  569. data/third_party/upb/upb/reflection/message.c +19 -16
  570. data/third_party/upb/upb/reflection/message.h +3 -1
  571. data/third_party/upb/upb/text/encode.c +1 -13
  572. data/third_party/upb/upb/text/internal/encode.c +25 -6
  573. data/third_party/upb/upb/text/internal/encode.h +4 -0
  574. data/third_party/upb/upb/wire/decode.c +60 -45
  575. data/third_party/upb/upb/wire/decode.h +4 -2
  576. data/third_party/upb/upb/wire/encode.c +77 -42
  577. data/third_party/upb/upb/wire/encode.h +2 -0
  578. data/third_party/upb/upb/wire/eps_copy_input_stream.h +18 -20
  579. data/third_party/upb/upb/wire/internal/decoder.h +4 -11
  580. data/third_party/utf8_range/utf8_range.c +15 -275
  581. data/third_party/utf8_range/utf8_range_neon.inc +117 -0
  582. data/third_party/utf8_range/utf8_range_sse.inc +272 -0
  583. data/third_party/zlib/deflate.c +40 -15
  584. data/third_party/zlib/deflate.h +33 -2
  585. data/third_party/zlib/gzguts.h +2 -6
  586. data/third_party/zlib/inflate.c +1 -1
  587. data/third_party/zlib/inftrees.c +3 -3
  588. data/third_party/zlib/inftrees.h +2 -2
  589. data/third_party/zlib/trees.c +18 -4
  590. data/third_party/zlib/zconf.h +1 -9
  591. data/third_party/zlib/zlib.h +12 -12
  592. data/third_party/zlib/zutil.h +4 -25
  593. metadata +155 -145
  594. data/include/grpc/grpc_cronet.h +0 -37
  595. data/src/core/lib/transport/http2_errors.h +0 -43
  596. data/third_party/upb/upb/message/internal/compare_unknown.c +0 -289
  597. data/third_party/upb/upb/message/internal/compare_unknown.h +0 -49
@@ -16,21 +16,15 @@
16
16
  //
17
17
  //
18
18
 
19
- #include <grpc/impl/grpc_types.h>
20
19
  #include <grpc/support/port_platform.h>
21
20
 
22
- #include <optional>
23
-
24
- #include "absl/base/thread_annotations.h"
25
- #include "absl/status/status.h"
26
- #include "absl/strings/str_cat.h"
27
- #include "absl/strings/string_view.h"
28
- #include "src/core/lib/iomgr/exec_ctx.h"
29
21
  #include "src/core/lib/iomgr/port.h"
30
22
 
31
23
  #ifdef GRPC_POSIX_SOCKET_TCP
32
24
 
33
25
  #include <errno.h>
26
+ #include <grpc/event_engine/endpoint_config.h>
27
+ #include <grpc/event_engine/event_engine.h>
34
28
  #include <grpc/slice.h>
35
29
  #include <grpc/support/alloc.h>
36
30
  #include <grpc/support/string_util.h>
@@ -48,12 +42,21 @@
48
42
  #include <unistd.h>
49
43
 
50
44
  #include <algorithm>
45
+ #include <optional>
51
46
  #include <unordered_map>
52
47
 
48
+ #include "absl/base/thread_annotations.h"
53
49
  #include "absl/log/check.h"
54
50
  #include "absl/log/log.h"
51
+ #include "absl/status/status.h"
52
+ #include "absl/strings/str_cat.h"
53
+ #include "absl/strings/string_view.h"
55
54
  #include "src/core/lib/address_utils/sockaddr_utils.h"
55
+ #include "src/core/lib/channel/channel_args.h"
56
56
  #include "src/core/lib/debug/trace.h"
57
+ #include "src/core/lib/event_engine/extensions/supports_fd.h"
58
+ #include "src/core/lib/event_engine/query_extensions.h"
59
+ #include "src/core/lib/event_engine/shim.h"
57
60
  #include "src/core/lib/experiments/experiments.h"
58
61
  #include "src/core/lib/iomgr/buffer_list.h"
59
62
  #include "src/core/lib/iomgr/ev_posix.h"
@@ -61,7 +64,6 @@
61
64
  #include "src/core/lib/iomgr/executor.h"
62
65
  #include "src/core/lib/iomgr/socket_utils_posix.h"
63
66
  #include "src/core/lib/iomgr/tcp_posix.h"
64
- #include "src/core/lib/resource_quota/api.h"
65
67
  #include "src/core/lib/resource_quota/memory_quota.h"
66
68
  #include "src/core/lib/slice/slice_internal.h"
67
69
  #include "src/core/lib/slice/slice_string_helpers.h"
@@ -73,7 +75,6 @@
73
75
  #include "src/core/util/string.h"
74
76
  #include "src/core/util/sync.h"
75
77
  #include "src/core/util/time.h"
76
- #include "src/core/util/useful.h"
77
78
 
78
79
  #ifndef SOL_TCP
79
80
  #define SOL_TCP IPPROTO_TCP
@@ -735,13 +736,12 @@ static void finish_estimate(grpc_tcp* tcp) {
735
736
  tcp->bytes_read_this_round = 0;
736
737
  }
737
738
 
738
- static grpc_error_handle tcp_annotate_error(grpc_error_handle src_error,
739
- grpc_tcp* tcp) {
740
- return grpc_error_set_int(
741
- grpc_error_set_int(src_error, grpc_core::StatusIntProperty::kFd, tcp->fd),
742
- // All tcp errors are marked with UNAVAILABLE so that application may
743
- // choose to retry.
744
- grpc_core::StatusIntProperty::kRpcStatus, GRPC_STATUS_UNAVAILABLE);
739
+ static grpc_error_handle tcp_annotate_error(grpc_error_handle src_error) {
740
+ return grpc_error_set_int(src_error,
741
+ // All tcp errors are marked with UNAVAILABLE so
742
+ // that application may choose to retry.
743
+ grpc_core::StatusIntProperty::kRpcStatus,
744
+ GRPC_STATUS_UNAVAILABLE);
745
745
  }
746
746
 
747
747
  static void tcp_handle_read(void* arg /* grpc_tcp */, grpc_error_handle error);
@@ -969,12 +969,10 @@ static bool tcp_do_read(grpc_tcp* tcp, grpc_error_handle* error)
969
969
  // 0 read size ==> end of stream
970
970
  grpc_slice_buffer_reset_and_unref(tcp->incoming_buffer);
971
971
  if (read_bytes == 0) {
972
- *error = tcp_annotate_error(absl::InternalError("Socket closed"), tcp);
972
+ *error = tcp_annotate_error(absl::InternalError("Socket closed"));
973
973
  } else {
974
- *error =
975
- tcp_annotate_error(absl::InternalError(absl::StrCat(
976
- "recvmsg:", grpc_core::StrError(errno))),
977
- tcp);
974
+ *error = tcp_annotate_error(absl::InternalError(
975
+ absl::StrCat("recvmsg:", grpc_core::StrError(errno))));
978
976
  }
979
977
  return true;
980
978
  }
@@ -1122,8 +1120,7 @@ static void tcp_handle_read(void* arg /* grpc_tcp */, grpc_error_handle error) {
1122
1120
  tcp_trace_read(tcp, tcp_read_error);
1123
1121
  } else {
1124
1122
  if (!tcp->memory_owner.is_valid() && error.ok()) {
1125
- tcp_read_error =
1126
- tcp_annotate_error(absl::InternalError("Socket closed"), tcp);
1123
+ tcp_read_error = tcp_annotate_error(absl::InternalError("Socket closed"));
1127
1124
  } else {
1128
1125
  tcp_read_error = error;
1129
1126
  }
@@ -1617,7 +1614,7 @@ static bool do_tcp_flush_zerocopy(grpc_tcp* tcp, TcpZerocopySendRecord* record,
1617
1614
  record->UnwindIfThrottled(unwind_slice_idx, unwind_byte_idx);
1618
1615
  return false;
1619
1616
  } else {
1620
- *error = tcp_annotate_error(GRPC_OS_ERROR(saved_errno, "sendmsg"), tcp);
1617
+ *error = tcp_annotate_error(GRPC_OS_ERROR(saved_errno, "sendmsg"));
1621
1618
  tcp_shutdown_buffer_list(tcp);
1622
1619
  return true;
1623
1620
  }
@@ -1727,7 +1724,7 @@ static bool tcp_flush(grpc_tcp* tcp, grpc_error_handle* error) {
1727
1724
  }
1728
1725
  return false;
1729
1726
  } else {
1730
- *error = tcp_annotate_error(GRPC_OS_ERROR(saved_errno, "sendmsg"), tcp);
1727
+ *error = tcp_annotate_error(GRPC_OS_ERROR(saved_errno, "sendmsg"));
1731
1728
  grpc_slice_buffer_reset_and_unref(tcp->outgoing_buffer);
1732
1729
  tcp_shutdown_buffer_list(tcp);
1733
1730
  return true;
@@ -1822,11 +1819,10 @@ static void tcp_write(grpc_endpoint* ep, grpc_slice_buffer* buf,
1822
1819
  DCHECK_EQ(tcp->current_zerocopy_send, nullptr);
1823
1820
 
1824
1821
  if (buf->length == 0) {
1825
- grpc_core::Closure::Run(
1826
- DEBUG_LOCATION, cb,
1827
- grpc_fd_is_shutdown(tcp->em_fd)
1828
- ? tcp_annotate_error(GRPC_ERROR_CREATE("EOF"), tcp)
1829
- : absl::OkStatus());
1822
+ grpc_core::Closure::Run(DEBUG_LOCATION, cb,
1823
+ grpc_fd_is_shutdown(tcp->em_fd)
1824
+ ? tcp_annotate_error(GRPC_ERROR_CREATE("EOF"))
1825
+ : absl::OkStatus());
1830
1826
  tcp_shutdown_buffer_list(tcp);
1831
1827
  return;
1832
1828
  }
@@ -1914,9 +1910,40 @@ static const grpc_endpoint_vtable vtable = {tcp_read,
1914
1910
  tcp_get_fd,
1915
1911
  tcp_can_track_err};
1916
1912
 
1913
+ grpc_endpoint* grpc_tcp_create(
1914
+ grpc_fd* fd, const grpc_event_engine::experimental::EndpointConfig& config,
1915
+ absl::string_view peer_string) {
1916
+ if (grpc_core::IsEventEngineForAllOtherEndpointsEnabled()) {
1917
+ // Create an EventEngine endpoint when creating the transport.
1918
+ auto* engine =
1919
+ reinterpret_cast<grpc_event_engine::experimental::EventEngine*>(
1920
+ config.GetVoidPointer(GRPC_INTERNAL_ARG_EVENT_ENGINE));
1921
+ if (engine == nullptr) {
1922
+ grpc_core::Crash("EventEngine is not set");
1923
+ }
1924
+ auto* engine_supports_fd = grpc_event_engine::experimental::QueryExtension<
1925
+ grpc_event_engine::experimental::EventEngineSupportsFdExtension>(
1926
+ engine);
1927
+ if (engine_supports_fd == nullptr) {
1928
+ grpc_core::Crash("EventEngine does not support fds");
1929
+ }
1930
+ int wrapped_fd;
1931
+ grpc_fd_orphan(fd, nullptr, &wrapped_fd, "Hand fd over to EventEngine");
1932
+ return grpc_event_engine_endpoint_create(
1933
+ engine_supports_fd->CreateEndpointFromFd(wrapped_fd, config));
1934
+ }
1935
+ return grpc_tcp_create(fd, TcpOptionsFromEndpointConfig(config), peer_string);
1936
+ }
1937
+
1917
1938
  grpc_endpoint* grpc_tcp_create(grpc_fd* em_fd,
1918
1939
  const grpc_core::PosixTcpOptions& options,
1919
1940
  absl::string_view peer_string) {
1941
+ CHECK(!grpc_event_engine::experimental::UsePollsetAlternative())
1942
+ << "This function must not be called when the pollset_alternative "
1943
+ "experiment is enabled. This is a bug.";
1944
+ CHECK(!grpc_core::IsEventEngineForAllOtherEndpointsEnabled())
1945
+ << "The event_engine_for_all_other_endpoints experiment should prevent "
1946
+ "this method from being called. This is a bug.";
1920
1947
  grpc_tcp* tcp = new grpc_tcp(options);
1921
1948
  tcp->base.vtable = &vtable;
1922
1949
  tcp->peer_string = std::string(peer_string);
@@ -29,6 +29,7 @@
29
29
  // otherwise specified.
30
30
  //
31
31
 
32
+ #include <grpc/event_engine/endpoint_config.h>
32
33
  #include <grpc/support/port_platform.h>
33
34
 
34
35
  #include "src/core/lib/debug/trace.h"
@@ -38,12 +39,19 @@
38
39
  #include "src/core/lib/iomgr/port.h"
39
40
  #include "src/core/lib/iomgr/socket_utils_posix.h"
40
41
 
41
- /// Create a tcp endpoint given a file descriptor and a read slice size.
42
- /// Takes ownership of \a fd. Takes ownership of the \a slice_allocator.
42
+ /// [DEPRECATED] Create a tcp endpoint given a file descriptor and a read slice
43
+ /// size. Takes ownership of \a fd. This is a legacy API, intended for iomgr use
44
+ /// only, it will not support EventEngine.
43
45
  grpc_endpoint* grpc_tcp_create(grpc_fd* fd,
44
46
  const grpc_core::PosixTcpOptions& options,
45
47
  absl::string_view peer_string);
46
48
 
49
+ /// Create a tcp endpoint given a file descriptor and a read slice size.
50
+ /// Takes ownership of \a fd.
51
+ grpc_endpoint* grpc_tcp_create(
52
+ grpc_fd* fd, const grpc_event_engine::experimental::EndpointConfig& config,
53
+ absl::string_view peer_string);
54
+
47
55
  /// Return the tcp endpoint's fd, or -1 if this is not available. Does not
48
56
  /// release the fd. Requires: \a ep must be a tcp endpoint.
49
57
  int grpc_tcp_fd(grpc_endpoint* ep);
@@ -16,6 +16,7 @@
16
16
  //
17
17
  //
18
18
 
19
+ #include <grpc/slice_buffer.h>
19
20
  #include <grpc/support/atm.h>
20
21
  #include <grpc/support/port_platform.h>
21
22
 
@@ -475,6 +476,7 @@ static void on_read(void* arg, grpc_error_handle err) {
475
476
  acceptor->port_index = sp->port_index;
476
477
  acceptor->fd_index = sp->fd_index;
477
478
  acceptor->external_connection = false;
479
+ acceptor->pending_data = nullptr;
478
480
  sp->server->on_accept_cb(
479
481
  sp->server->on_accept_cb_arg,
480
482
  grpc_tcp_create(fdobj, sp->server->options, addr_uri.value()),
@@ -926,7 +928,13 @@ class ExternalConnectionHandler : public grpc_core::TcpServerFdHandler {
926
928
  acceptor->fd_index = -1;
927
929
  acceptor->external_connection = true;
928
930
  acceptor->listener_fd = listener_fd;
929
- acceptor->pending_data = buf;
931
+ if (buf != nullptr && buf->data.raw.slice_buffer.length > 0) {
932
+ acceptor->pending_data = grpc_raw_byte_buffer_create(nullptr, 0);
933
+ grpc_slice_buffer_swap(&acceptor->pending_data->data.raw.slice_buffer,
934
+ &buf->data.raw.slice_buffer);
935
+ } else {
936
+ acceptor->pending_data = nullptr;
937
+ }
930
938
  s_->on_accept_cb(s_->on_accept_cb_arg,
931
939
  grpc_tcp_create(fdobj, s_->options, addr_uri.value()),
932
940
  read_notifier_pollset, acceptor);
@@ -273,10 +273,7 @@ error:
273
273
  if (fd >= 0) {
274
274
  close(fd);
275
275
  }
276
- grpc_error_handle ret = grpc_error_set_int(
277
- GRPC_ERROR_CREATE_REFERENCING("Unable to configure socket", &err, 1),
278
- grpc_core::StatusIntProperty::kFd, fd);
279
- return ret;
276
+ return GRPC_ERROR_CREATE_REFERENCING("Unable to configure socket", &err, 1);
280
277
  }
281
278
 
282
279
  #endif // GRPC_POSIX_SOCKET_TCP_SERVER_UTILS_COMMON
@@ -70,8 +70,6 @@ using ::grpc_event_engine::experimental::MemoryAllocator;
70
70
  using ::grpc_event_engine::experimental::MemoryQuotaBasedMemoryAllocatorFactory;
71
71
  using ::grpc_event_engine::experimental::ResolvedAddressSetPort;
72
72
  using ::grpc_event_engine::experimental::RunEventEngineClosure;
73
- using ::grpc_event_engine::experimental::WindowsEventEngine;
74
- using ::grpc_event_engine::experimental::WindowsEventEngineListener;
75
73
  } // namespace
76
74
 
77
75
  // one listening port
@@ -129,7 +127,7 @@ struct grpc_tcp_server {
129
127
  grpc_closure* shutdown_complete;
130
128
 
131
129
  // used for the EventEngine shim
132
- WindowsEventEngineListener* ee_listener;
130
+ std::unique_ptr<EventEngine::Listener> ee_listener;
133
131
  };
134
132
 
135
133
  // TODO(hork): This may be refactored to share with posix engine and event
@@ -179,6 +177,7 @@ static grpc_error_handle tcp_server_create(grpc_closure* shutdown_complete,
179
177
  s->shutdown_starting.head = NULL;
180
178
  s->shutdown_starting.tail = NULL;
181
179
  s->shutdown_complete = shutdown_complete;
180
+ new (&s->ee_listener) std::unique_ptr<EventEngine::Listener>(nullptr);
182
181
  *server = s;
183
182
  return absl::OkStatus();
184
183
  }
@@ -197,6 +196,7 @@ static void destroy_server(void* arg, grpc_error_handle /* error */) {
197
196
  unlink_if_unix_domain_socket(&sp->resolved_addr);
198
197
  gpr_free(sp);
199
198
  }
199
+ std::destroy_at(&s->ee_listener);
200
200
  gpr_mu_destroy(&s->mu);
201
201
  gpr_free(s);
202
202
  }
@@ -292,9 +292,8 @@ static grpc_error_handle prepare_socket(SOCKET sock,
292
292
 
293
293
  failure:
294
294
  CHECK(!error.ok());
295
- error = grpc_error_set_int(GRPC_ERROR_CREATE_REFERENCING(
296
- "Failed to prepare server socket", &error, 1),
297
- grpc_core::StatusIntProperty::kFd, (intptr_t)sock);
295
+ error = GRPC_ERROR_CREATE_REFERENCING("Failed to prepare server socket",
296
+ &error, 1);
298
297
  if (sock != INVALID_SOCKET) closesocket(sock);
299
298
  return error;
300
299
  }
@@ -445,6 +444,7 @@ static void on_accept(void* arg, grpc_error_handle error) {
445
444
  acceptor->port_index = sp->port_index;
446
445
  acceptor->fd_index = 0;
447
446
  acceptor->external_connection = false;
447
+ acceptor->pending_data = nullptr;
448
448
  sp->server->on_accept_cb(sp->server->on_accept_cb_arg, ep, NULL, acceptor);
449
449
  }
450
450
  // As we were notified from the IOCP of one and exactly one accept,
@@ -641,11 +641,8 @@ static grpc_error_handle event_engine_create(grpc_closure* shutdown_complete,
641
641
  grpc_tcp_server_cb on_accept_cb,
642
642
  void* on_accept_cb_arg,
643
643
  grpc_tcp_server** server) {
644
- // On Windows, the event_engine_listener experiment only supports the
645
- // default engine
646
- WindowsEventEngine* engine_ptr = reinterpret_cast<WindowsEventEngine*>(
647
- config.GetVoidPointer(GRPC_INTERNAL_ARG_EVENT_ENGINE));
648
644
  grpc_tcp_server* s = (grpc_tcp_server*)gpr_malloc(sizeof(grpc_tcp_server));
645
+ new (&s->ee_listener) std::unique_ptr<EventEngine::Listener>(nullptr);
649
646
  CHECK_NE(on_accept_cb, nullptr);
650
647
  auto accept_cb = [s, on_accept_cb, on_accept_cb_arg](
651
648
  std::unique_ptr<EventEngine::Endpoint> endpoint,
@@ -657,6 +654,7 @@ static grpc_error_handle event_engine_create(grpc_closure* shutdown_complete,
657
654
  acceptor->port_index = -1;
658
655
  acceptor->fd_index = -1;
659
656
  acceptor->external_connection = false;
657
+ acceptor->pending_data = nullptr;
660
658
  on_accept_cb(on_accept_cb_arg,
661
659
  grpc_event_engine_endpoint_create(std::move(endpoint)),
662
660
  nullptr, acceptor);
@@ -673,11 +671,18 @@ static grpc_error_handle event_engine_create(grpc_closure* shutdown_complete,
673
671
  }
674
672
  gpr_ref_init(&s->refs, 1);
675
673
  gpr_mu_init(&s->mu);
676
- s->ee_listener = new WindowsEventEngineListener(
677
- engine_ptr->poller(), std::move(accept_cb), std::move(on_shutdown),
674
+ EventEngine* engine = reinterpret_cast<EventEngine*>(
675
+ config.GetVoidPointer(GRPC_INTERNAL_ARG_EVENT_ENGINE));
676
+ CHECK_NE(engine, nullptr);
677
+ auto listener = engine->CreateListener(
678
+ std::move(accept_cb), std::move(on_shutdown), config,
678
679
  std::make_unique<MemoryQuotaBasedMemoryAllocatorFactory>(
679
- resource_quota->memory_quota()),
680
- engine_ptr->shared_from_this(), engine_ptr->thread_pool(), config);
680
+ resource_quota->memory_quota()));
681
+ GRPC_RETURN_IF_ERROR(listener.status());
682
+ CHECK_NE(listener->get(), nullptr);
683
+ GRPC_TRACE_LOG(event_engine, INFO)
684
+ << "EventEngine::" << engine << ": created Listener::" << listener->get();
685
+ s->ee_listener = std::move(*listener);
681
686
  s->active_ports = -1;
682
687
  s->on_accept_cb = [](void* /* arg */, grpc_endpoint* /* ep */,
683
688
  grpc_pollset* /* accepting_pollset */,
@@ -733,7 +738,13 @@ static grpc_tcp_server* event_engine_ref(grpc_tcp_server* s) {
733
738
  }
734
739
 
735
740
  static void event_engine_shutdown_listeners(grpc_tcp_server* s) {
736
- s->ee_listener->ShutdownListeners();
741
+ auto* iomgr_compatible_listener =
742
+ grpc_event_engine::experimental::QueryExtension<
743
+ grpc_event_engine::experimental::IomgrCompatibleListener>(
744
+ s->ee_listener.get());
745
+ if (iomgr_compatible_listener != nullptr) {
746
+ iomgr_compatible_listener->Shutdown();
747
+ }
737
748
  }
738
749
 
739
750
  static void event_engine_unref(grpc_tcp_server* s) {
@@ -743,7 +754,7 @@ static void event_engine_unref(grpc_tcp_server* s) {
743
754
  grpc_core::ExecCtx::RunList(DEBUG_LOCATION, &s->shutdown_starting);
744
755
  gpr_mu_unlock(&s->mu);
745
756
  gpr_mu_destroy(&s->mu);
746
- delete s->ee_listener;
757
+ std::destroy_at(&s->ee_listener);
747
758
  gpr_free(s);
748
759
  }
749
760
  }
@@ -43,9 +43,17 @@ static grpc_error_handle pipe_init(grpc_wakeup_fd* fd_info) {
43
43
  }
44
44
  grpc_error_handle err;
45
45
  err = grpc_set_socket_nonblocking(pipefd[0], 1);
46
- if (!err.ok()) return err;
46
+ if (!err.ok()) {
47
+ close(pipefd[0]);
48
+ close(pipefd[1]);
49
+ return err;
50
+ }
47
51
  err = grpc_set_socket_nonblocking(pipefd[1], 1);
48
- if (!err.ok()) return err;
52
+ if (!err.ok()) {
53
+ close(pipefd[0]);
54
+ close(pipefd[1]);
55
+ return err;
56
+ }
49
57
  fd_info->read_fd = pipefd[0];
50
58
  fd_info->write_fd = pipefd[1];
51
59
  return absl::OkStatus();
@@ -30,6 +30,37 @@
30
30
  #include "src/core/lib/promise/status_flag.h"
31
31
 
32
32
  namespace grpc_core {
33
+ // AllOk promise combinator.
34
+ //
35
+ // Input:
36
+ // 1. Two or more promises.
37
+ // 2. All promises MUST return either a Poll<StatusFlag> or Poll<absl::Status>.
38
+ //
39
+ // Return:
40
+ // 1. The return type of AllOk<Result, Promises...> is Poll<Result>, where
41
+ // Result is either StatusFlag or absl::Status.
42
+ // 2. If Result is StatusFlag, then all the promises MUST return
43
+ // Poll<StatusFlag>.
44
+ // 3. If Result is absl::Status, then the promises may return either
45
+ // Poll<StatusFlag> or Poll<absl::Status>.
46
+ // For further understanding of points 2 and 3, refer the WithMixedTypes* tests
47
+ // in all_ok_test.cc.
48
+ //
49
+ // Polling the AllOk combinator works in the following way :
50
+ // Polling this AllOk combinator will make the pending promises run
51
+ // serially, in order and on the same thread.
52
+ // Each promise being executed either returns a status (StatusFlag or
53
+ // absl::Status) or Pending{}. Each subsequent execution of the AllOk will only
54
+ // execute the input promises which are still pending. This mechanism ensures
55
+ // that no promise is executed after it resolves, which is an essential
56
+ // requirement. If all the promises have finished running successfully, the
57
+ // AllOk combinator will return a success status. If there is at least one
58
+ // promise that has returned Pending{}, the AllOk combinator will return
59
+ // Pending{}.
60
+ //
61
+ // The execution of promises in the AllOk combinator will stop if any one
62
+ // promise returns a failure status. This failure status is returned by the
63
+ // AllOk combinator.
33
64
 
34
65
  namespace promise_detail {
35
66
 
@@ -60,14 +60,17 @@ namespace grpc_core {
60
60
  // {
61
61
  // std::string execution_order;
62
62
  // int i = 0;
63
- // Poll<int> retval = Loop([&execution_order, &i]() -> LoopCtl<int> {
64
- // absl::StrAppend(&execution_order, i);
65
- // i++;
66
- // if (i < 5) return Continue();
67
- // return i;
63
+ // Poll<int> retval = Loop([&execution_order, &i]() {
64
+ // return [&execution_order, &i]() -> LoopCtl<int> {
65
+ // absl::StrAppend(&execution_order, i);
66
+ // i++;
67
+ // if (i < 5) return Continue();
68
+ // return i;
69
+ // };
68
70
  // })();
69
71
  // EXPECT_TRUE(retval.ready());
70
72
  // EXPECT_EQ(retval.value(), 5);
73
+ // EXPECT_EQ(i, 5);
71
74
  // EXPECT_STREQ(execution_order.c_str(), "01234");
72
75
  // }
73
76
 
@@ -102,8 +102,34 @@ class FusedFns {
102
102
  } // namespace promise_detail
103
103
 
104
104
  // Mapping combinator.
105
- // Takes a promise, and a synchronous function to mutate its result, and
106
- // returns a promise.
105
+ //
106
+ // Input:
107
+ // 1. The first argument is a promise.
108
+ // 2. The second argument is a synchronous function.
109
+ // 3. The synchronous function MUST be callable with the result type of the
110
+ // promise.
111
+ // 4. If the promise returns void, the synchronous function MUST be callable
112
+ // with Empty.
113
+ //
114
+ // Return:
115
+ // Mapping combinator returns Poll<T> where T is the return type of the
116
+ // synchronous function.
117
+ // Note: If the synchronous function returns void, the result type of the
118
+ // mapping combinator will be Poll<Empty>.
119
+ //
120
+ // Polling the mapping combinator works as follows:
121
+ // 1. Poll the promise.
122
+ // 2. If the promise is pending, return Pending{}.
123
+ // 3. If the promise is ready, return the result of the synchronous function.
124
+ // Note: If the first argument to the Map is a promise factory instead of a
125
+ // promise, Map will pass the promise returned by the promise factory as a
126
+ // parameter to the synchronous function.
127
+ //
128
+ // Example:
129
+ // TEST(MapTest, Works) {
130
+ // Promise<int> x = Map([]() { return 42; }, [](int i) { return i / 2; });
131
+ // EXPECT_THAT(x(), IsReady(21));
132
+ // }
107
133
  template <typename Promise, typename Fn>
108
134
  class Map {
109
135
  using PromiseType = promise_detail::PromiseLike<Promise>;
@@ -251,6 +277,43 @@ auto AddErrorPrefix(absl::string_view prefix, Promise promise) {
251
277
  });
252
278
  }
253
279
 
280
+ // Input : A promise that resolves to Type T
281
+ // Returns : A Map promise which contains the input promise and then discards
282
+ // the return value of the input promise. the main use case for DiscardResult is
283
+ // when you need to pass a promise as a parameter, and it returns a status or
284
+ // some value which cannot be discarded. If this value is not used, the compiler
285
+ // gives an error. DiscardResult helps to discard the return value of the
286
+ // promise.
287
+ template <typename Promise>
288
+ auto DiscardResult(Promise promise) {
289
+ return Map(std::move(promise), [](auto) {});
290
+ }
291
+
292
+ // Given a promise, and N values, return a tuple with the resolved promise
293
+ // first, and then the N values stapled to it.
294
+ template <typename Promise, typename... Values>
295
+ auto Staple(Promise promise, Values&&... values) {
296
+ return Map(std::move(promise), [values = std::tuple(std::forward<Values>(
297
+ values)...)](auto first_value) mutable {
298
+ return std::tuple_cat(std::tuple(std::move(first_value)),
299
+ std::move(values));
300
+ });
301
+ }
302
+
303
+ // Same as Staple, but assumes a StatusOr<X>, and returns X, Values.
304
+ template <typename Promise, typename... Values>
305
+ auto TryStaple(Promise promise, Values&&... values) {
306
+ return Map(
307
+ std::move(promise),
308
+ [values = std::tuple(std::forward<Values>(values)...)](
309
+ auto first_value) mutable
310
+ -> absl::StatusOr<std::tuple<decltype(*first_value), Values...>> {
311
+ if (!first_value.ok()) return first_value.status();
312
+ return std::tuple_cat(std::tuple(std::move(*first_value)),
313
+ std::move(values));
314
+ });
315
+ }
316
+
254
317
  } // namespace grpc_core
255
318
 
256
319
  #endif // GRPC_SRC_CORE_LIB_PROMISE_MAP_H
@@ -35,6 +35,7 @@
35
35
  #include "src/core/lib/promise/detail/promise_factory.h"
36
36
  #include "src/core/lib/promise/poll.h"
37
37
  #include "src/core/lib/resource_quota/arena.h"
38
+ #include "src/core/util/check_class_size.h"
38
39
  #include "src/core/util/construct_destruct.h"
39
40
  #include "src/core/util/crash.h"
40
41
  #include "src/core/util/ref_counted.h"
@@ -305,7 +306,8 @@ class Party : public Activity, private Wakeable {
305
306
  // The party can poll the promise until it is resolved, or until the party is
306
307
  // shut down.
307
308
  // The on_complete callback will be called with the result of the
308
- // promise if it completes.
309
+ // promise if it completes. Even if the promise returns a failed status,
310
+ // on_complete will be called.
309
311
  // promise_factory called to create the promise with the party lock taken;
310
312
  // after the promise is created the factory is destroyed. This means that
311
313
  // pointers or references to factory members will be invalidated after the
@@ -637,6 +639,8 @@ class Party : public Activity, private Wakeable {
637
639
  RefCountedPtr<Arena> arena_;
638
640
  };
639
641
 
642
+ GRPC_CHECK_CLASS_SIZE(Party, 180);
643
+
640
644
  template <>
641
645
  struct ContextSubclass<Party> {
642
646
  using Base = Activity;
@@ -23,6 +23,7 @@
23
23
 
24
24
  #include "absl/log/check.h"
25
25
  #include "absl/strings/str_format.h"
26
+ #include "absl/strings/str_join.h"
26
27
  #include "src/core/util/construct_destruct.h"
27
28
 
28
29
  namespace grpc_core {
@@ -281,39 +282,40 @@ std::string PollToString(
281
282
  }
282
283
 
283
284
  template <typename Sink, typename T>
284
- void AbslStringify(Sink& sink, const Poll<T>& poll) {
285
- if (poll.pending()) {
286
- absl::Format(&sink, "<<pending>>");
285
+ void PollValueStringify(Sink& sink, const T& value) {
286
+ absl::Format(&sink, "%v", value);
287
+ }
288
+
289
+ template <typename Sink, typename... Ts>
290
+ void PollValueStringify(Sink& sink, const std::tuple<Ts...>& values) {
291
+ absl::Format(&sink, "(%v)", absl::StrJoin(values, ", "));
292
+ }
293
+
294
+ template <typename Sink, typename T>
295
+ void PollValueStringify(Sink& sink, const std::optional<T>& value) {
296
+ if (!value.has_value()) {
297
+ sink.Append("nullopt");
287
298
  return;
288
299
  }
289
- absl::Format(&sink, "%v", poll.value());
300
+ PollValueStringify(sink, *value);
290
301
  }
291
302
 
292
303
  template <typename Sink, typename T>
293
- void AbslStringify(Sink& sink, const Poll<absl::StatusOr<T>>& poll) {
294
- if (poll.pending()) {
295
- absl::Format(&sink, "<<pending>>");
304
+ void PollValueStringify(Sink& sink, const absl::StatusOr<T>& value) {
305
+ if (!value.ok()) {
306
+ PollValueStringify(sink, value.status());
296
307
  return;
297
308
  }
298
- if (poll.value().ok()) {
299
- absl::Format(&sink, "%v", *poll.value());
300
- } else {
301
- absl::Format(&sink, "%v", poll.value().status());
302
- }
309
+ PollValueStringify(sink, *value);
303
310
  }
304
311
 
305
312
  template <typename Sink, typename T>
306
- void AbslStringify(Sink& sink, const Poll<std::optional<T>>& poll) {
313
+ void AbslStringify(Sink& sink, const Poll<T>& poll) {
307
314
  if (poll.pending()) {
308
315
  absl::Format(&sink, "<<pending>>");
309
316
  return;
310
317
  }
311
- const auto& value = poll.value();
312
- if (value.has_value()) {
313
- absl::Format(&sink, "%v", value);
314
- } else {
315
- sink.append("nullopt");
316
- }
318
+ PollValueStringify(sink, poll.value());
317
319
  }
318
320
 
319
321
  // Hack to get metadata printing
@@ -326,7 +328,7 @@ void AbslStringify(
326
328
  }
327
329
  const auto& value = poll.value();
328
330
  if (value.has_value()) {
329
- absl::Format(&sink, "%v", *value);
331
+ PollValueStringify(sink, *value);
330
332
  } else {
331
333
  sink.Append("nullopt");
332
334
  }
@@ -83,12 +83,12 @@ struct ImmediateOkStatus {
83
83
  };
84
84
 
85
85
  // Typecheck that a promise returns the expected return type.
86
- // usage: auto promise = WithResult<int>([]() { return 3; });
86
+ // usage: auto promise = AssertResultType<int>([]() { return 3; });
87
87
  // NOTE: there are tests in promise_test.cc that are commented out because they
88
88
  // should fail to compile. When modifying this code these should be uncommented
89
89
  // and their miscompilation verified.
90
90
  template <typename T, typename F>
91
- GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION inline auto WithResult(F f) ->
91
+ GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION inline auto AssertResultType(F f) ->
92
92
  typename std::enable_if<std::is_same<decltype(f()), Poll<T>>::value,
93
93
  F>::type {
94
94
  return f;