grpc 1.55.0 → 1.56.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (395) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +102 -68
  3. data/include/grpc/event_engine/event_engine.h +4 -3
  4. data/include/grpc/grpc_audit_logging.h +96 -0
  5. data/include/grpc/grpc_security.h +19 -0
  6. data/include/grpc/module.modulemap +2 -0
  7. data/include/grpc/support/json.h +218 -0
  8. data/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +5 -0
  9. data/src/core/ext/filters/client_channel/backend_metric.cc +2 -0
  10. data/src/core/ext/filters/client_channel/channel_connectivity.cc +4 -4
  11. data/src/core/ext/filters/client_channel/client_channel.cc +86 -104
  12. data/src/core/ext/filters/client_channel/client_channel.h +6 -0
  13. data/src/core/ext/filters/client_channel/client_channel_channelz.cc +19 -18
  14. data/src/core/ext/filters/client_channel/client_channel_internal.h +16 -21
  15. data/src/core/ext/filters/client_channel/config_selector.h +9 -24
  16. data/src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h +3 -0
  17. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +5 -4
  18. data/src/core/ext/filters/client_channel/lb_policy/health_check_client.cc +455 -0
  19. data/src/core/ext/filters/client_channel/lb_policy/health_check_client.h +54 -0
  20. data/src/core/ext/filters/client_channel/lb_policy/health_check_client_internal.h +186 -0
  21. data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc +2 -7
  22. data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.cc +53 -21
  23. data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h +23 -2
  24. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +19 -6
  25. data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +1 -9
  26. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +16 -7
  27. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h +18 -1
  28. data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +12 -9
  29. data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +6 -4
  30. data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +36 -13
  31. data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/static_stride_scheduler.cc +76 -6
  32. data/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/weighted_round_robin.cc +42 -40
  33. data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +4 -10
  34. data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +52 -47
  35. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +1 -9
  36. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +14 -16
  37. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +40 -43
  38. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_override_host.cc +7 -12
  39. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_wrr_locality.cc +12 -19
  40. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +35 -33
  41. data/src/core/ext/filters/client_channel/resolver/dns/event_engine/event_engine_client_channel_resolver.cc +29 -4
  42. data/src/core/ext/filters/client_channel/resolver/dns/event_engine/service_config_helper.cc +1 -1
  43. data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +28 -27
  44. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +163 -46
  45. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h +16 -1
  46. data/src/core/ext/filters/client_channel/retry_service_config.cc +1 -0
  47. data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +10 -40
  48. data/src/core/ext/filters/client_channel/subchannel.cc +10 -196
  49. data/src/core/ext/filters/client_channel/subchannel.h +3 -43
  50. data/src/core/ext/filters/http/message_compress/compression_filter.cc +5 -5
  51. data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +100 -6
  52. data/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc +6 -8
  53. data/src/core/ext/filters/stateful_session/stateful_session_filter.cc +3 -3
  54. data/src/core/ext/filters/stateful_session/stateful_session_filter.h +16 -1
  55. data/src/core/ext/transport/chttp2/transport/flow_control.cc +46 -95
  56. data/src/core/ext/transport/chttp2/transport/hpack_parse_result.cc +176 -0
  57. data/src/core/ext/transport/chttp2/transport/hpack_parse_result.h +325 -0
  58. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +567 -543
  59. data/src/core/ext/transport/chttp2/transport/hpack_parser.h +150 -9
  60. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +46 -32
  61. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +18 -5
  62. data/src/core/ext/transport/chttp2/transport/internal.h +1 -15
  63. data/src/core/ext/transport/chttp2/transport/parsing.cc +12 -12
  64. data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c +11 -2
  65. data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h +15 -0
  66. data/src/core/ext/xds/certificate_provider_store.cc +4 -9
  67. data/src/core/ext/xds/certificate_provider_store.h +1 -1
  68. data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +30 -42
  69. data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +14 -9
  70. data/src/core/ext/xds/xds_api.cc +9 -6
  71. data/src/core/ext/xds/xds_api.h +3 -2
  72. data/src/core/ext/xds/xds_audit_logger_registry.cc +122 -0
  73. data/src/core/ext/xds/xds_audit_logger_registry.h +68 -0
  74. data/src/core/ext/xds/xds_bootstrap_grpc.cc +21 -9
  75. data/src/core/ext/xds/xds_bootstrap_grpc.h +5 -0
  76. data/src/core/ext/xds/xds_client.cc +5 -4
  77. data/src/core/ext/xds/xds_client_stats.h +1 -1
  78. data/src/core/ext/xds/xds_cluster.cc +20 -19
  79. data/src/core/ext/xds/xds_cluster_specifier_plugin.cc +11 -8
  80. data/src/core/ext/xds/xds_common_types.cc +3 -1
  81. data/src/core/ext/xds/xds_http_fault_filter.cc +16 -13
  82. data/src/core/ext/xds/xds_http_fault_filter.h +2 -1
  83. data/src/core/ext/xds/xds_http_filters.h +4 -2
  84. data/src/core/ext/xds/xds_http_rbac_filter.cc +154 -67
  85. data/src/core/ext/xds/xds_http_rbac_filter.h +2 -1
  86. data/src/core/ext/xds/xds_http_stateful_session_filter.cc +15 -11
  87. data/src/core/ext/xds/xds_http_stateful_session_filter.h +2 -1
  88. data/src/core/ext/xds/xds_lb_policy_registry.cc +22 -16
  89. data/src/core/ext/xds/xds_listener.cc +1 -0
  90. data/src/core/ext/xds/xds_route_config.cc +40 -3
  91. data/src/core/ext/xds/xds_routing.cc +2 -2
  92. data/src/core/ext/xds/xds_transport_grpc.cc +3 -1
  93. data/src/core/lib/avl/avl.h +5 -0
  94. data/src/core/lib/backoff/random_early_detection.h +5 -0
  95. data/src/core/lib/channel/channel_args.cc +80 -22
  96. data/src/core/lib/channel/channel_args.h +34 -1
  97. data/src/core/lib/channel/channel_trace.cc +16 -12
  98. data/src/core/lib/channel/channelz.cc +159 -132
  99. data/src/core/lib/channel/channelz.h +42 -35
  100. data/src/core/lib/channel/channelz_registry.cc +23 -20
  101. data/src/core/lib/channel/connected_channel.cc +17 -6
  102. data/src/core/lib/channel/promise_based_filter.cc +0 -4
  103. data/src/core/lib/channel/promise_based_filter.h +2 -0
  104. data/src/core/lib/compression/compression_internal.cc +2 -5
  105. data/src/core/lib/config/config_vars.cc +20 -18
  106. data/src/core/lib/config/config_vars.h +4 -4
  107. data/src/core/lib/config/load_config.cc +13 -0
  108. data/src/core/lib/config/load_config.h +6 -0
  109. data/src/core/lib/debug/event_log.h +1 -1
  110. data/src/core/lib/debug/stats_data.h +1 -1
  111. data/src/core/lib/debug/trace.cc +24 -55
  112. data/src/core/lib/debug/trace.h +3 -1
  113. data/src/core/lib/event_engine/cf_engine/cf_engine.cc +211 -0
  114. data/src/core/lib/event_engine/cf_engine/cf_engine.h +86 -0
  115. data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc +354 -0
  116. data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.h +146 -0
  117. data/src/core/lib/event_engine/cf_engine/cftype_unique_ref.h +79 -0
  118. data/src/core/lib/event_engine/default_event_engine.cc +13 -1
  119. data/src/core/lib/event_engine/default_event_engine_factory.cc +14 -2
  120. data/src/core/lib/event_engine/poller.h +2 -2
  121. data/src/core/lib/event_engine/posix.h +4 -0
  122. data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +1 -1
  123. data/src/core/lib/event_engine/posix_engine/lockfree_event.cc +7 -18
  124. data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +9 -0
  125. data/src/core/lib/event_engine/posix_engine/posix_engine.cc +33 -19
  126. data/src/core/lib/event_engine/posix_engine/posix_engine.h +2 -1
  127. data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +33 -4
  128. data/src/core/lib/event_engine/posix_engine/posix_engine_listener.h +10 -8
  129. data/src/core/lib/event_engine/posix_engine/timer_manager.h +1 -1
  130. data/src/core/lib/event_engine/shim.cc +7 -1
  131. data/src/core/lib/event_engine/{thread_pool.cc → thread_pool/original_thread_pool.cc} +28 -25
  132. data/src/core/lib/event_engine/{thread_pool.h → thread_pool/original_thread_pool.h} +11 -15
  133. data/src/core/lib/event_engine/thread_pool/thread_pool.h +50 -0
  134. data/src/core/lib/event_engine/{executor/executor.h → thread_pool/thread_pool_factory.cc} +17 -15
  135. data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +489 -0
  136. data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h +249 -0
  137. data/src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc +166 -0
  138. data/src/core/lib/event_engine/thready_event_engine/thready_event_engine.h +108 -0
  139. data/src/core/lib/event_engine/windows/iocp.cc +4 -3
  140. data/src/core/lib/event_engine/windows/iocp.h +3 -3
  141. data/src/core/lib/event_engine/windows/win_socket.cc +6 -6
  142. data/src/core/lib/event_engine/windows/win_socket.h +4 -4
  143. data/src/core/lib/event_engine/windows/windows_endpoint.cc +11 -10
  144. data/src/core/lib/event_engine/windows/windows_endpoint.h +3 -2
  145. data/src/core/lib/event_engine/windows/windows_engine.cc +19 -17
  146. data/src/core/lib/event_engine/windows/windows_engine.h +6 -6
  147. data/src/core/lib/event_engine/windows/windows_listener.cc +3 -3
  148. data/src/core/lib/event_engine/windows/windows_listener.h +3 -2
  149. data/src/core/lib/event_engine/work_queue/basic_work_queue.cc +63 -0
  150. data/src/core/lib/event_engine/work_queue/basic_work_queue.h +71 -0
  151. data/src/core/lib/event_engine/work_queue/work_queue.h +62 -0
  152. data/src/core/lib/experiments/config.cc +38 -7
  153. data/src/core/lib/experiments/config.h +16 -0
  154. data/src/core/lib/experiments/experiments.cc +67 -20
  155. data/src/core/lib/experiments/experiments.h +27 -21
  156. data/src/core/lib/gpr/log_internal.h +55 -0
  157. data/src/core/lib/gprpp/crash.cc +10 -0
  158. data/src/core/lib/gprpp/crash.h +3 -0
  159. data/src/core/lib/gprpp/per_cpu.cc +33 -0
  160. data/src/core/lib/gprpp/per_cpu.h +29 -6
  161. data/src/core/lib/gprpp/time.cc +1 -0
  162. data/src/core/lib/iomgr/cfstream_handle.cc +1 -1
  163. data/src/core/lib/iomgr/endpoint_cfstream.cc +10 -8
  164. data/src/core/lib/iomgr/ev_apple.cc +12 -12
  165. data/src/core/lib/iomgr/ev_epoll1_linux.cc +10 -3
  166. data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +15 -1
  167. data/src/core/lib/iomgr/iocp_windows.cc +24 -3
  168. data/src/core/lib/iomgr/iocp_windows.h +11 -0
  169. data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +1 -1
  170. data/src/core/lib/iomgr/socket_utils_common_posix.cc +4 -2
  171. data/src/core/lib/iomgr/socket_windows.cc +61 -7
  172. data/src/core/lib/iomgr/socket_windows.h +9 -2
  173. data/src/core/lib/iomgr/tcp_client_cfstream.cc +14 -3
  174. data/src/core/lib/iomgr/tcp_server_posix.cc +182 -119
  175. data/src/core/lib/iomgr/tcp_server_utils_posix.h +13 -1
  176. data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +21 -0
  177. data/src/core/lib/iomgr/tcp_server_windows.cc +1 -1
  178. data/src/core/lib/json/json.h +2 -166
  179. data/src/core/lib/json/json_object_loader.cc +8 -9
  180. data/src/core/lib/json/json_object_loader.h +25 -18
  181. data/src/core/lib/json/json_reader.cc +13 -6
  182. data/src/core/lib/json/json_util.cc +6 -11
  183. data/src/core/lib/json/json_writer.cc +7 -8
  184. data/src/core/lib/load_balancing/lb_policy.h +13 -0
  185. data/src/core/lib/load_balancing/lb_policy_registry.cc +2 -1
  186. data/src/core/lib/matchers/matchers.cc +3 -4
  187. data/src/core/lib/matchers/matchers.h +2 -1
  188. data/src/core/lib/promise/activity.cc +5 -0
  189. data/src/core/lib/promise/activity.h +10 -0
  190. data/src/core/lib/promise/detail/promise_factory.h +1 -1
  191. data/src/core/lib/promise/party.cc +31 -13
  192. data/src/core/lib/promise/party.h +11 -2
  193. data/src/core/lib/promise/pipe.h +9 -2
  194. data/src/core/lib/promise/prioritized_race.h +95 -0
  195. data/src/core/lib/promise/sleep.cc +2 -1
  196. data/src/core/lib/resolver/server_address.cc +0 -8
  197. data/src/core/lib/resolver/server_address.h +0 -6
  198. data/src/core/lib/resource_quota/memory_quota.cc +7 -7
  199. data/src/core/lib/resource_quota/memory_quota.h +1 -2
  200. data/src/core/lib/security/authorization/audit_logging.cc +98 -0
  201. data/src/core/lib/security/authorization/audit_logging.h +73 -0
  202. data/src/core/lib/security/authorization/grpc_authorization_engine.cc +47 -2
  203. data/src/core/lib/security/authorization/grpc_authorization_engine.h +18 -1
  204. data/src/core/lib/security/authorization/rbac_policy.cc +36 -4
  205. data/src/core/lib/security/authorization/rbac_policy.h +19 -2
  206. data/src/core/lib/security/authorization/stdout_logger.cc +75 -0
  207. data/src/core/lib/security/authorization/stdout_logger.h +61 -0
  208. data/src/core/lib/security/certificate_provider/certificate_provider_factory.h +8 -4
  209. data/src/core/lib/security/certificate_provider/certificate_provider_registry.cc +8 -18
  210. data/src/core/lib/security/certificate_provider/certificate_provider_registry.h +14 -8
  211. data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +19 -12
  212. data/src/core/lib/security/credentials/external/external_account_credentials.cc +4 -2
  213. data/src/core/lib/security/credentials/external/file_external_account_credentials.cc +1 -0
  214. data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +1 -0
  215. data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +1 -0
  216. data/src/core/lib/security/credentials/jwt/json_token.cc +15 -14
  217. data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +4 -2
  218. data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +1 -0
  219. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +1 -0
  220. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +8 -0
  221. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +5 -1
  222. data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +1 -5
  223. data/src/core/lib/security/security_connector/ssl_utils.cc +2 -1
  224. data/src/core/lib/security/security_connector/ssl_utils.h +1 -1
  225. data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +1 -1
  226. data/src/core/lib/security/util/json_util.cc +1 -0
  227. data/src/core/lib/service_config/service_config_call_data.h +49 -20
  228. data/src/core/lib/service_config/service_config_impl.cc +2 -1
  229. data/src/core/lib/surface/call.cc +38 -23
  230. data/src/core/lib/surface/completion_queue.cc +6 -2
  231. data/src/core/lib/surface/validate_metadata.cc +37 -22
  232. data/src/core/lib/surface/validate_metadata.h +13 -3
  233. data/src/core/lib/surface/version.cc +2 -2
  234. data/src/core/lib/transport/batch_builder.cc +15 -12
  235. data/src/core/lib/transport/batch_builder.h +39 -35
  236. data/src/core/plugin_registry/grpc_plugin_registry.cc +0 -2
  237. data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +2 -0
  238. data/src/core/tsi/ssl_transport_security.cc +5 -2
  239. data/src/core/tsi/ssl_transport_security.h +13 -1
  240. data/src/ruby/ext/grpc/extconf.rb +8 -9
  241. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +2 -0
  242. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +3 -0
  243. data/src/ruby/lib/grpc/version.rb +1 -1
  244. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_mbstr.c +9 -8
  245. data/third_party/boringssl-with-bazel/src/crypto/asn1/a_strnid.c +1 -1
  246. data/third_party/boringssl-with-bazel/src/crypto/asn1/internal.h +3 -3
  247. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_dec.c +10 -6
  248. data/third_party/boringssl-with-bazel/src/crypto/asn1/tasn_enc.c +7 -4
  249. data/third_party/boringssl-with-bazel/src/crypto/bio/bio.c +6 -4
  250. data/third_party/boringssl-with-bazel/src/crypto/bio/fd.c +2 -1
  251. data/third_party/boringssl-with-bazel/src/crypto/bio/file.c +5 -9
  252. data/third_party/boringssl-with-bazel/src/crypto/bio/pair.c +4 -2
  253. data/third_party/boringssl-with-bazel/src/crypto/blake2/blake2.c +31 -22
  254. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_tls.c +29 -26
  255. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/internal.h +8 -0
  256. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/tls_cbc.c +189 -13
  257. data/third_party/boringssl-with-bazel/src/crypto/cpu_aarch64_openbsd.c +62 -0
  258. data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_openbsd.c +31 -0
  259. data/third_party/boringssl-with-bazel/src/crypto/curve25519/curve25519.c +6 -4
  260. data/third_party/boringssl-with-bazel/src/crypto/curve25519/curve25519_tables.h +795 -795
  261. data/third_party/boringssl-with-bazel/src/crypto/curve25519/internal.h +1 -5
  262. data/third_party/boringssl-with-bazel/src/crypto/dsa/dsa.c +4 -0
  263. data/third_party/boringssl-with-bazel/src/crypto/ec_extra/hash_to_curve.c +18 -6
  264. data/third_party/boringssl-with-bazel/src/crypto/ec_extra/internal.h +15 -7
  265. data/third_party/boringssl-with-bazel/src/crypto/ecdh_extra/ecdh_extra.c +1 -1
  266. data/third_party/boringssl-with-bazel/src/crypto/evp/p_rsa.c +1 -1
  267. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bcm.c +1 -0
  268. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/dh/dh.c +3 -0
  269. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec.c +24 -24
  270. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec_key.c +1 -1
  271. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/ec_montgomery.c +7 -7
  272. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/internal.h +74 -74
  273. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/oct.c +1 -2
  274. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p224-64.c +11 -11
  275. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p256-nistz.c +12 -12
  276. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p256.c +14 -15
  277. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p256_table.h +1 -1
  278. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/simple.c +10 -10
  279. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/simple_mul.c +23 -23
  280. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/wnaf.c +13 -13
  281. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdh/ecdh.c +1 -1
  282. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ecdsa/ecdsa.c +2 -2
  283. data/third_party/boringssl-with-bazel/src/crypto/{hkdf → fipsmodule/hkdf}/hkdf.c +1 -1
  284. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/cbc.c +2 -10
  285. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/ctr.c +1 -4
  286. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/gcm.c +115 -133
  287. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/gcm_nohw.c +12 -14
  288. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/internal.h +57 -47
  289. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/ofb.c +1 -8
  290. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/modes/polyval.c +27 -28
  291. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rand/urandom.c +11 -23
  292. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/internal.h +21 -16
  293. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/padding.c +5 -288
  294. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa.c +143 -83
  295. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/rsa/rsa_impl.c +95 -183
  296. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/self_check.c +71 -0
  297. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/tls/internal.h +8 -0
  298. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/tls/kdf.c +33 -0
  299. data/third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c +162 -6
  300. data/third_party/boringssl-with-bazel/src/crypto/internal.h +18 -0
  301. data/third_party/boringssl-with-bazel/src/crypto/kyber/kyber.c +18 -11
  302. data/third_party/boringssl-with-bazel/src/crypto/obj/obj_dat.h +6 -13
  303. data/third_party/boringssl-with-bazel/src/crypto/pem/pem_lib.c +18 -14
  304. data/third_party/boringssl-with-bazel/src/crypto/{refcount_lock.c → refcount_no_threads.c} +3 -13
  305. data/third_party/boringssl-with-bazel/src/crypto/refcount_win.c +89 -0
  306. data/third_party/boringssl-with-bazel/src/crypto/rsa_extra/internal.h +77 -0
  307. data/third_party/boringssl-with-bazel/src/crypto/rsa_extra/rsa_crypt.c +568 -0
  308. data/third_party/boringssl-with-bazel/src/crypto/trust_token/internal.h +62 -0
  309. data/third_party/boringssl-with-bazel/src/crypto/trust_token/pmbtoken.c +218 -44
  310. data/third_party/boringssl-with-bazel/src/crypto/trust_token/trust_token.c +35 -0
  311. data/third_party/boringssl-with-bazel/src/crypto/trust_token/voprf.c +588 -39
  312. data/third_party/boringssl-with-bazel/src/crypto/x509/a_sign.c +27 -18
  313. data/third_party/boringssl-with-bazel/src/crypto/x509/asn1_gen.c +1 -1
  314. data/third_party/boringssl-with-bazel/src/crypto/x509/name_print.c +17 -39
  315. data/third_party/boringssl-with-bazel/src/crypto/x509/t_x509.c +39 -48
  316. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_att.c +0 -140
  317. data/third_party/boringssl-with-bazel/src/crypto/x509/x509_req.c +72 -23
  318. data/third_party/boringssl-with-bazel/src/crypto/x509/x509name.c +11 -14
  319. data/third_party/boringssl-with-bazel/src/crypto/x509/x509spki.c +1 -1
  320. data/third_party/boringssl-with-bazel/src/crypto/x509/x_x509a.c +2 -2
  321. data/third_party/boringssl-with-bazel/src/crypto/x509v3/internal.h +1 -1
  322. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_conf.c +33 -46
  323. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_cpols.c +1 -0
  324. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_info.c +3 -5
  325. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_lib.c +14 -46
  326. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_prn.c +14 -26
  327. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_skey.c +17 -10
  328. data/third_party/boringssl-with-bazel/src/crypto/x509v3/v3_utl.c +1 -1
  329. data/third_party/boringssl-with-bazel/src/include/openssl/aead.h +5 -7
  330. data/third_party/boringssl-with-bazel/src/include/openssl/asn1.h +6 -4
  331. data/third_party/boringssl-with-bazel/src/include/openssl/base.h +32 -1
  332. data/third_party/boringssl-with-bazel/src/include/openssl/bio.h +0 -4
  333. data/third_party/boringssl-with-bazel/src/include/openssl/blake2.h +1 -4
  334. data/third_party/boringssl-with-bazel/src/include/openssl/evp.h +3 -3
  335. data/third_party/boringssl-with-bazel/src/include/openssl/hpke.h +28 -0
  336. data/third_party/boringssl-with-bazel/src/include/openssl/nid.h +2 -11
  337. data/third_party/boringssl-with-bazel/src/include/openssl/pem.h +0 -3
  338. data/third_party/boringssl-with-bazel/src/include/openssl/rsa.h +91 -1
  339. data/third_party/boringssl-with-bazel/src/include/openssl/span.h +5 -0
  340. data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +149 -20
  341. data/third_party/boringssl-with-bazel/src/include/openssl/thread.h +4 -0
  342. data/third_party/boringssl-with-bazel/src/include/openssl/tls1.h +4 -0
  343. data/third_party/boringssl-with-bazel/src/include/openssl/trust_token.h +8 -0
  344. data/third_party/boringssl-with-bazel/src/include/openssl/x509.h +774 -615
  345. data/third_party/boringssl-with-bazel/src/include/openssl/x509v3.h +42 -10
  346. data/third_party/boringssl-with-bazel/src/ssl/encrypted_client_hello.cc +11 -6
  347. data/third_party/boringssl-with-bazel/src/ssl/extensions.cc +2 -4
  348. data/third_party/boringssl-with-bazel/src/ssl/handshake_client.cc +24 -16
  349. data/third_party/boringssl-with-bazel/src/ssl/internal.h +65 -18
  350. data/third_party/boringssl-with-bazel/src/ssl/s3_both.cc +37 -18
  351. data/third_party/boringssl-with-bazel/src/ssl/ssl_cipher.cc +187 -193
  352. data/third_party/boringssl-with-bazel/src/ssl/ssl_key_share.cc +13 -129
  353. data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +85 -10
  354. data/third_party/boringssl-with-bazel/src/ssl/ssl_privkey.cc +17 -4
  355. data/third_party/boringssl-with-bazel/src/ssl/ssl_versions.cc +27 -19
  356. data/third_party/boringssl-with-bazel/src/ssl/tls13_client.cc +1 -1
  357. data/third_party/boringssl-with-bazel/src/ssl/tls13_enc.cc +5 -21
  358. data/third_party/boringssl-with-bazel/src/ssl/tls13_server.cc +5 -2
  359. data/third_party/boringssl-with-bazel/src/third_party/fiat/curve25519_64_msvc.h +1281 -0
  360. data/third_party/boringssl-with-bazel/src/third_party/fiat/p256_64_msvc.h +2002 -0
  361. data/third_party/cares/cares/include/ares.h +23 -1
  362. data/third_party/cares/cares/{src/lib → include}/ares_nameser.h +9 -7
  363. data/third_party/cares/cares/include/ares_rules.h +2 -2
  364. data/third_party/cares/cares/include/ares_version.h +3 -3
  365. data/third_party/cares/cares/src/lib/ares__addrinfo2hostent.c +266 -0
  366. data/third_party/cares/cares/src/lib/ares__addrinfo_localhost.c +240 -0
  367. data/third_party/cares/cares/src/lib/ares__parse_into_addrinfo.c +49 -80
  368. data/third_party/cares/cares/src/lib/ares__readaddrinfo.c +37 -43
  369. data/third_party/cares/cares/src/lib/ares__sortaddrinfo.c +12 -4
  370. data/third_party/cares/cares/src/lib/ares_data.c +16 -0
  371. data/third_party/cares/cares/src/lib/ares_data.h +7 -0
  372. data/third_party/cares/cares/src/lib/ares_destroy.c +8 -0
  373. data/third_party/cares/cares/src/lib/ares_expand_name.c +17 -6
  374. data/third_party/cares/cares/src/lib/ares_freeaddrinfo.c +1 -0
  375. data/third_party/cares/cares/src/lib/ares_getaddrinfo.c +156 -78
  376. data/third_party/cares/cares/src/lib/ares_gethostbyname.c +130 -326
  377. data/third_party/cares/cares/src/lib/ares_init.c +97 -485
  378. data/third_party/cares/cares/src/lib/ares_library_init.c +2 -89
  379. data/third_party/cares/cares/src/lib/ares_parse_a_reply.c +23 -142
  380. data/third_party/cares/cares/src/lib/ares_parse_aaaa_reply.c +22 -142
  381. data/third_party/cares/cares/src/lib/ares_parse_uri_reply.c +184 -0
  382. data/third_party/cares/cares/src/lib/ares_private.h +30 -16
  383. data/third_party/cares/cares/src/lib/ares_process.c +55 -16
  384. data/third_party/cares/cares/src/lib/ares_query.c +1 -35
  385. data/third_party/cares/cares/src/lib/ares_rand.c +279 -0
  386. data/third_party/cares/cares/src/lib/ares_send.c +5 -7
  387. data/third_party/cares/cares/src/lib/ares_strdup.c +12 -19
  388. data/third_party/cares/cares/src/lib/ares_strsplit.c +44 -128
  389. data/third_party/cares/cares/src/lib/ares_strsplit.h +9 -10
  390. data/third_party/cares/cares/src/lib/inet_net_pton.c +78 -116
  391. data/third_party/cares/cares/src/tools/ares_getopt.h +53 -0
  392. metadata +50 -12
  393. data/src/core/ext/filters/client_channel/health/health_check_client.cc +0 -175
  394. data/src/core/ext/filters/client_channel/health/health_check_client.h +0 -43
  395. data/third_party/cares/cares/src/lib/ares_library_init.h +0 -43
@@ -1,4 +1,4 @@
1
- // Copyright 2022 gRPC authors.
1
+ // Copyright 2023 gRPC authors.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -12,7 +12,7 @@
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
14
 
15
- // Automatically generated by tools/codegen/core/gen_experiments.py
15
+ // Auto generated by tools/codegen/core/gen_experiments.py
16
16
 
17
17
  #include <grpc/support/port_platform.h>
18
18
 
@@ -25,66 +25,113 @@ const char* const description_tcp_frame_size_tuning =
25
25
  "would not indicate completion of a read operation until a specified "
26
26
  "number of bytes have been read over the socket. Buffers are also "
27
27
  "allocated according to estimated RPC sizes.";
28
+ const char* const additional_constraints_tcp_frame_size_tuning = "{}";
28
29
  const char* const description_tcp_rcv_lowat =
29
30
  "Use SO_RCVLOWAT to avoid wakeups on the read path.";
31
+ const char* const additional_constraints_tcp_rcv_lowat = "{}";
30
32
  const char* const description_peer_state_based_framing =
31
33
  "If set, the max sizes of frames sent to lower layers is controlled based "
32
34
  "on the peer's memory pressure which is reflected in its max http2 frame "
33
35
  "size.";
34
- const char* const description_flow_control_fixes =
35
- "Various fixes for flow control, max frame size setting.";
36
+ const char* const additional_constraints_peer_state_based_framing = "{}";
36
37
  const char* const description_memory_pressure_controller =
37
38
  "New memory pressure controller";
39
+ const char* const additional_constraints_memory_pressure_controller = "{}";
38
40
  const char* const description_unconstrained_max_quota_buffer_size =
39
41
  "Discard the cap on the max free pool size for one memory allocator";
42
+ const char* const additional_constraints_unconstrained_max_quota_buffer_size =
43
+ "{}";
40
44
  const char* const description_event_engine_client =
41
45
  "Use EventEngine clients instead of iomgr's grpc_tcp_client";
46
+ const char* const additional_constraints_event_engine_client = "{}";
42
47
  const char* const description_monitoring_experiment =
43
48
  "Placeholder experiment to prove/disprove our monitoring is working";
49
+ const char* const additional_constraints_monitoring_experiment = "{}";
44
50
  const char* const description_promise_based_client_call =
45
51
  "If set, use the new gRPC promise based call code when it's appropriate "
46
52
  "(ie when all filters in a stack are promise based)";
53
+ const char* const additional_constraints_promise_based_client_call = "{}";
47
54
  const char* const description_free_large_allocator =
48
55
  "If set, return all free bytes from a \042big\042 allocator";
56
+ const char* const additional_constraints_free_large_allocator = "{}";
49
57
  const char* const description_promise_based_server_call =
50
58
  "If set, use the new gRPC promise based call code when it's appropriate "
51
59
  "(ie when all filters in a stack are promise based)";
60
+ const char* const additional_constraints_promise_based_server_call = "{}";
52
61
  const char* const description_transport_supplies_client_latency =
53
62
  "If set, use the transport represented value for client latency in "
54
63
  "opencensus";
64
+ const char* const additional_constraints_transport_supplies_client_latency =
65
+ "{}";
55
66
  const char* const description_event_engine_listener =
56
67
  "Use EventEngine listeners instead of iomgr's grpc_tcp_server";
68
+ const char* const additional_constraints_event_engine_listener = "{}";
57
69
  const char* const description_schedule_cancellation_over_write =
58
70
  "Allow cancellation op to be scheduled over a write";
71
+ const char* const additional_constraints_schedule_cancellation_over_write =
72
+ "{}";
59
73
  const char* const description_trace_record_callops =
60
74
  "Enables tracing of call batch initiation and completion.";
75
+ const char* const additional_constraints_trace_record_callops = "{}";
61
76
  const char* const description_event_engine_dns =
62
77
  "If set, use EventEngine DNSResolver for client channel resolution";
78
+ const char* const additional_constraints_event_engine_dns = "{}";
79
+ const char* const description_work_stealing =
80
+ "If set, use a work stealing thread pool implementation in EventEngine";
81
+ const char* const additional_constraints_work_stealing = "{}";
82
+ const char* const description_client_privacy = "If set, client privacy";
83
+ const char* const additional_constraints_client_privacy = "{}";
84
+ const char* const description_canary_client_privacy =
85
+ "If set, canary client privacy";
86
+ const char* const additional_constraints_canary_client_privacy = "{}";
87
+ const char* const description_server_privacy = "If set, server privacy";
88
+ const char* const additional_constraints_server_privacy = "{}";
63
89
  } // namespace
64
90
 
65
91
  namespace grpc_core {
66
92
 
67
93
  const ExperimentMetadata g_experiment_metadata[] = {
68
- {"tcp_frame_size_tuning", description_tcp_frame_size_tuning, false},
69
- {"tcp_rcv_lowat", description_tcp_rcv_lowat, false},
70
- {"peer_state_based_framing", description_peer_state_based_framing, false},
71
- {"flow_control_fixes", description_flow_control_fixes, true},
94
+ {"tcp_frame_size_tuning", description_tcp_frame_size_tuning,
95
+ additional_constraints_tcp_frame_size_tuning, false, true},
96
+ {"tcp_rcv_lowat", description_tcp_rcv_lowat,
97
+ additional_constraints_tcp_rcv_lowat, false, true},
98
+ {"peer_state_based_framing", description_peer_state_based_framing,
99
+ additional_constraints_peer_state_based_framing, false, true},
72
100
  {"memory_pressure_controller", description_memory_pressure_controller,
73
- false},
101
+ additional_constraints_memory_pressure_controller, false, true},
74
102
  {"unconstrained_max_quota_buffer_size",
75
- description_unconstrained_max_quota_buffer_size, false},
76
- {"event_engine_client", description_event_engine_client, false},
77
- {"monitoring_experiment", description_monitoring_experiment, true},
78
- {"promise_based_client_call", description_promise_based_client_call, false},
79
- {"free_large_allocator", description_free_large_allocator, false},
80
- {"promise_based_server_call", description_promise_based_server_call, false},
103
+ description_unconstrained_max_quota_buffer_size,
104
+ additional_constraints_unconstrained_max_quota_buffer_size, false, true},
105
+ {"event_engine_client", description_event_engine_client,
106
+ additional_constraints_event_engine_client, false, true},
107
+ {"monitoring_experiment", description_monitoring_experiment,
108
+ additional_constraints_monitoring_experiment, true, true},
109
+ {"promise_based_client_call", description_promise_based_client_call,
110
+ additional_constraints_promise_based_client_call, false, true},
111
+ {"free_large_allocator", description_free_large_allocator,
112
+ additional_constraints_free_large_allocator, false, true},
113
+ {"promise_based_server_call", description_promise_based_server_call,
114
+ additional_constraints_promise_based_server_call, false, true},
81
115
  {"transport_supplies_client_latency",
82
- description_transport_supplies_client_latency, false},
83
- {"event_engine_listener", description_event_engine_listener, false},
116
+ description_transport_supplies_client_latency,
117
+ additional_constraints_transport_supplies_client_latency, false, true},
118
+ {"event_engine_listener", description_event_engine_listener,
119
+ additional_constraints_event_engine_listener, false, true},
84
120
  {"schedule_cancellation_over_write",
85
- description_schedule_cancellation_over_write, false},
86
- {"trace_record_callops", description_trace_record_callops, false},
87
- {"event_engine_dns", description_event_engine_dns, false},
121
+ description_schedule_cancellation_over_write,
122
+ additional_constraints_schedule_cancellation_over_write, false, true},
123
+ {"trace_record_callops", description_trace_record_callops,
124
+ additional_constraints_trace_record_callops, false, true},
125
+ {"event_engine_dns", description_event_engine_dns,
126
+ additional_constraints_event_engine_dns, false, false},
127
+ {"work_stealing", description_work_stealing,
128
+ additional_constraints_work_stealing, false, false},
129
+ {"client_privacy", description_client_privacy,
130
+ additional_constraints_client_privacy, false, false},
131
+ {"canary_client_privacy", description_canary_client_privacy,
132
+ additional_constraints_canary_client_privacy, false, false},
133
+ {"server_privacy", description_server_privacy,
134
+ additional_constraints_server_privacy, false, false},
88
135
  };
89
136
 
90
137
  } // namespace grpc_core
@@ -1,4 +1,4 @@
1
- // Copyright 2022 gRPC authors.
1
+ // Copyright 2023 gRPC authors.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -12,7 +12,7 @@
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
14
 
15
- // Automatically generated by tools/codegen/core/gen_experiments.py
15
+ // Auto generated by tools/codegen/core/gen_experiments.py
16
16
  //
17
17
  // This file contains the autogenerated parts of the experiments API.
18
18
  //
@@ -60,8 +60,6 @@ namespace grpc_core {
60
60
  inline bool IsTcpFrameSizeTuningEnabled() { return false; }
61
61
  inline bool IsTcpRcvLowatEnabled() { return false; }
62
62
  inline bool IsPeerStateBasedFramingEnabled() { return false; }
63
- #define GRPC_EXPERIMENT_IS_INCLUDED_FLOW_CONTROL_FIXES
64
- inline bool IsFlowControlFixesEnabled() { return true; }
65
63
  inline bool IsMemoryPressureControllerEnabled() { return false; }
66
64
  inline bool IsUnconstrainedMaxQuotaBufferSizeEnabled() { return false; }
67
65
  inline bool IsEventEngineClientEnabled() { return false; }
@@ -75,6 +73,10 @@ inline bool IsEventEngineListenerEnabled() { return false; }
75
73
  inline bool IsScheduleCancellationOverWriteEnabled() { return false; }
76
74
  inline bool IsTraceRecordCallopsEnabled() { return false; }
77
75
  inline bool IsEventEngineDnsEnabled() { return false; }
76
+ inline bool IsWorkStealingEnabled() { return false; }
77
+ inline bool IsClientPrivacyEnabled() { return false; }
78
+ inline bool IsCanaryClientPrivacyEnabled() { return false; }
79
+ inline bool IsServerPrivacyEnabled() { return false; }
78
80
  #else
79
81
  #define GRPC_EXPERIMENT_IS_INCLUDED_TCP_FRAME_SIZE_TUNING
80
82
  inline bool IsTcpFrameSizeTuningEnabled() { return IsExperimentEnabled(0); }
@@ -82,44 +84,48 @@ inline bool IsTcpFrameSizeTuningEnabled() { return IsExperimentEnabled(0); }
82
84
  inline bool IsTcpRcvLowatEnabled() { return IsExperimentEnabled(1); }
83
85
  #define GRPC_EXPERIMENT_IS_INCLUDED_PEER_STATE_BASED_FRAMING
84
86
  inline bool IsPeerStateBasedFramingEnabled() { return IsExperimentEnabled(2); }
85
- #define GRPC_EXPERIMENT_IS_INCLUDED_FLOW_CONTROL_FIXES
86
- inline bool IsFlowControlFixesEnabled() { return IsExperimentEnabled(3); }
87
87
  #define GRPC_EXPERIMENT_IS_INCLUDED_MEMORY_PRESSURE_CONTROLLER
88
88
  inline bool IsMemoryPressureControllerEnabled() {
89
- return IsExperimentEnabled(4);
89
+ return IsExperimentEnabled(3);
90
90
  }
91
91
  #define GRPC_EXPERIMENT_IS_INCLUDED_UNCONSTRAINED_MAX_QUOTA_BUFFER_SIZE
92
92
  inline bool IsUnconstrainedMaxQuotaBufferSizeEnabled() {
93
- return IsExperimentEnabled(5);
93
+ return IsExperimentEnabled(4);
94
94
  }
95
95
  #define GRPC_EXPERIMENT_IS_INCLUDED_EVENT_ENGINE_CLIENT
96
- inline bool IsEventEngineClientEnabled() { return IsExperimentEnabled(6); }
96
+ inline bool IsEventEngineClientEnabled() { return IsExperimentEnabled(5); }
97
97
  #define GRPC_EXPERIMENT_IS_INCLUDED_MONITORING_EXPERIMENT
98
- inline bool IsMonitoringExperimentEnabled() { return IsExperimentEnabled(7); }
98
+ inline bool IsMonitoringExperimentEnabled() { return IsExperimentEnabled(6); }
99
99
  #define GRPC_EXPERIMENT_IS_INCLUDED_PROMISE_BASED_CLIENT_CALL
100
- inline bool IsPromiseBasedClientCallEnabled() { return IsExperimentEnabled(8); }
100
+ inline bool IsPromiseBasedClientCallEnabled() { return IsExperimentEnabled(7); }
101
101
  #define GRPC_EXPERIMENT_IS_INCLUDED_FREE_LARGE_ALLOCATOR
102
- inline bool IsFreeLargeAllocatorEnabled() { return IsExperimentEnabled(9); }
102
+ inline bool IsFreeLargeAllocatorEnabled() { return IsExperimentEnabled(8); }
103
103
  #define GRPC_EXPERIMENT_IS_INCLUDED_PROMISE_BASED_SERVER_CALL
104
- inline bool IsPromiseBasedServerCallEnabled() {
105
- return IsExperimentEnabled(10);
106
- }
104
+ inline bool IsPromiseBasedServerCallEnabled() { return IsExperimentEnabled(9); }
107
105
  #define GRPC_EXPERIMENT_IS_INCLUDED_TRANSPORT_SUPPLIES_CLIENT_LATENCY
108
106
  inline bool IsTransportSuppliesClientLatencyEnabled() {
109
- return IsExperimentEnabled(11);
107
+ return IsExperimentEnabled(10);
110
108
  }
111
109
  #define GRPC_EXPERIMENT_IS_INCLUDED_EVENT_ENGINE_LISTENER
112
- inline bool IsEventEngineListenerEnabled() { return IsExperimentEnabled(12); }
110
+ inline bool IsEventEngineListenerEnabled() { return IsExperimentEnabled(11); }
113
111
  #define GRPC_EXPERIMENT_IS_INCLUDED_SCHEDULE_CANCELLATION_OVER_WRITE
114
112
  inline bool IsScheduleCancellationOverWriteEnabled() {
115
- return IsExperimentEnabled(13);
113
+ return IsExperimentEnabled(12);
116
114
  }
117
115
  #define GRPC_EXPERIMENT_IS_INCLUDED_TRACE_RECORD_CALLOPS
118
- inline bool IsTraceRecordCallopsEnabled() { return IsExperimentEnabled(14); }
116
+ inline bool IsTraceRecordCallopsEnabled() { return IsExperimentEnabled(13); }
119
117
  #define GRPC_EXPERIMENT_IS_INCLUDED_EVENT_ENGINE_DNS
120
- inline bool IsEventEngineDnsEnabled() { return IsExperimentEnabled(15); }
118
+ inline bool IsEventEngineDnsEnabled() { return IsExperimentEnabled(14); }
119
+ #define GRPC_EXPERIMENT_IS_INCLUDED_WORK_STEALING
120
+ inline bool IsWorkStealingEnabled() { return IsExperimentEnabled(15); }
121
+ #define GRPC_EXPERIMENT_IS_INCLUDED_CLIENT_PRIVACY
122
+ inline bool IsClientPrivacyEnabled() { return IsExperimentEnabled(16); }
123
+ #define GRPC_EXPERIMENT_IS_INCLUDED_CANARY_CLIENT_PRIVACY
124
+ inline bool IsCanaryClientPrivacyEnabled() { return IsExperimentEnabled(17); }
125
+ #define GRPC_EXPERIMENT_IS_INCLUDED_SERVER_PRIVACY
126
+ inline bool IsServerPrivacyEnabled() { return IsExperimentEnabled(18); }
121
127
 
122
- constexpr const size_t kNumExperiments = 16;
128
+ constexpr const size_t kNumExperiments = 19;
123
129
  extern const ExperimentMetadata g_experiment_metadata[kNumExperiments];
124
130
 
125
131
  #endif
@@ -0,0 +1,55 @@
1
+ // Copyright 2022 gRPC authors.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ #ifndef GRPC_SRC_CORE_LIB_GPR_LOG_INTERNAL_H
15
+ #define GRPC_SRC_CORE_LIB_GPR_LOG_INTERNAL_H
16
+
17
+ #include <grpc/support/port_platform.h>
18
+
19
+ #include <stdio.h>
20
+ #include <stdlib.h>
21
+
22
+ #include <cstring>
23
+
24
+ /// abort() the process if x is zero, with rudimentary logging to prevent
25
+ /// circular dependencies with gpr_log.
26
+
27
+ /// Intended for internal invariants. If the error can be recovered from,
28
+ /// without the possibility of corruption, or might best be reflected via
29
+ /// an exception in a higher-level language, consider returning error code.
30
+ #define GPR_ASSERT_INTERNAL(x) \
31
+ do { \
32
+ if (GPR_UNLIKELY(!(x))) { \
33
+ fprintf(stderr, "assertion failed: %s", #x); \
34
+ abort(); \
35
+ } \
36
+ } while (0)
37
+
38
+ #ifndef NDEBUG
39
+ #define GPR_DEBUG_ASSERT_INTERNAL(x) GPR_ASSERT_INTERNAL(x)
40
+ #else
41
+ #define GPR_DEBUG_ASSERT_INTERNAL(x)
42
+ #endif
43
+
44
+ #define GPR_LOG_ERROR_INTERNAL(format, ...) \
45
+ do { \
46
+ char f[] = __FILE__; \
47
+ char* display_file = f; \
48
+ char* slash_pos = strrchr(f, '/'); \
49
+ if (slash_pos != nullptr) display_file = slash_pos + 1; \
50
+ char prefix[60]; \
51
+ sprintf(prefix, "INTERNAL %37s:%d]", display_file, __LINE__); \
52
+ fprintf(stderr, "%-60s " format "\n", prefix, __VA_ARGS__); \
53
+ } while (0)
54
+
55
+ #endif // GRPC_SRC_CORE_LIB_GPR_LOG_INTERNAL_H
@@ -16,10 +16,13 @@
16
16
 
17
17
  #include "src/core/lib/gprpp/crash.h"
18
18
 
19
+ #include <stdio.h>
19
20
  #include <stdlib.h>
20
21
 
21
22
  #include <string>
22
23
 
24
+ #include "absl/strings/str_cat.h"
25
+
23
26
  #include <grpc/support/log.h>
24
27
 
25
28
  namespace grpc_core {
@@ -30,4 +33,11 @@ void Crash(absl::string_view message, SourceLocation location) {
30
33
  abort();
31
34
  }
32
35
 
36
+ void CrashWithStdio(absl::string_view message, SourceLocation location) {
37
+ fputs(absl::StrCat(location.file(), ":", location.line(), ": ", message, "\n")
38
+ .c_str(),
39
+ stderr);
40
+ abort();
41
+ }
42
+
33
43
  } // namespace grpc_core
@@ -29,6 +29,9 @@ namespace grpc_core {
29
29
  [[noreturn]] void Crash(absl::string_view message,
30
30
  ::grpc_core::SourceLocation location = {});
31
31
 
32
+ [[noreturn]] void CrashWithStdio(absl::string_view message,
33
+ ::grpc_core::SourceLocation location = {});
34
+
32
35
  } // namespace grpc_core
33
36
 
34
37
  #endif // GRPC_SRC_CORE_LIB_GPRPP_CRASH_H
@@ -0,0 +1,33 @@
1
+ // Copyright 2023 gRPC authors.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ #include <grpc/support/port_platform.h>
16
+
17
+ #include "src/core/lib/gprpp/per_cpu.h"
18
+
19
+ #include <grpc/support/cpu.h>
20
+
21
+ #include "src/core/lib/gpr/useful.h"
22
+
23
+ namespace grpc_core {
24
+
25
+ size_t PerCpuOptions::Shards() {
26
+ return ShardsForCpuCount(gpr_cpu_num_cores());
27
+ }
28
+
29
+ size_t PerCpuOptions::ShardsForCpuCount(size_t cpu_count) {
30
+ return Clamp<size_t>(cpu_count / cpus_per_shard_, 1, max_shards_);
31
+ }
32
+
33
+ } // namespace grpc_core
@@ -22,18 +22,41 @@
22
22
  #include <limits>
23
23
  #include <memory>
24
24
 
25
- #include <grpc/support/cpu.h>
26
-
27
25
  #include "src/core/lib/iomgr/exec_ctx.h"
28
26
 
29
27
  namespace grpc_core {
30
28
 
29
+ class PerCpuOptions {
30
+ public:
31
+ // Set the number of cpus that colocate on the same shard
32
+ PerCpuOptions SetCpusPerShard(size_t cpus_per_shard) {
33
+ cpus_per_shard_ = std::max<size_t>(1, cpus_per_shard);
34
+ return *this;
35
+ }
36
+
37
+ // Set the maximum number of allowable shards
38
+ PerCpuOptions SetMaxShards(size_t max_shards) {
39
+ max_shards_ = std::max<size_t>(1, max_shards);
40
+ return *this;
41
+ }
42
+
43
+ size_t cpus_per_shard() const { return cpus_per_shard_; }
44
+ size_t max_shards() const { return max_shards_; }
45
+
46
+ size_t Shards();
47
+ size_t ShardsForCpuCount(size_t cpu_count);
48
+
49
+ private:
50
+ size_t cpus_per_shard_ = 1;
51
+ size_t max_shards_ = std::numeric_limits<size_t>::max();
52
+ };
53
+
31
54
  template <typename T>
32
55
  class PerCpu {
33
56
  public:
34
- explicit PerCpu(size_t max = std::numeric_limits<size_t>::max())
35
- : cpus_(std::min<size_t>(max, gpr_cpu_num_cores())),
36
- data_{new T[cpus_]} {}
57
+ // Options are not defaulted to try and force consideration of what the
58
+ // options specify.
59
+ explicit PerCpu(PerCpuOptions options) : cpus_(options.Shards()) {}
37
60
 
38
61
  T& this_cpu() { return data_[ExecCtx::Get()->starting_cpu() % cpus_]; }
39
62
 
@@ -44,7 +67,7 @@ class PerCpu {
44
67
 
45
68
  private:
46
69
  const size_t cpus_;
47
- std::unique_ptr<T[]> data_;
70
+ std::unique_ptr<T[]> data_{new T[cpus_]};
48
71
  };
49
72
 
50
73
  } // namespace grpc_core
@@ -229,6 +229,7 @@ Duration::operator grpc_event_engine::experimental::EventEngine::Duration()
229
229
  void TestOnlySetProcessEpoch(gpr_timespec epoch) {
230
230
  g_process_epoch_seconds.store(
231
231
  gpr_convert_clock_type(epoch, GPR_CLOCK_MONOTONIC).tv_sec);
232
+ g_process_epoch_cycles.store(gpr_get_cycle_counter());
232
233
  }
233
234
 
234
235
  std::ostream& operator<<(std::ostream& out, Timestamp timestamp) {
@@ -188,7 +188,7 @@ void CFStreamHandle::Ref(const char* file, int line, const char* reason) {
188
188
  void CFStreamHandle::Unref(const char* file, int line, const char* reason) {
189
189
  if (grpc_tcp_trace.enabled()) {
190
190
  gpr_atm val = gpr_atm_no_barrier_load(&refcount_.count);
191
- gpr_log(GPR_DEBUG,
191
+ gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
192
192
  "CFStream Handle unref %p : %s %" PRIdPTR " -> %" PRIdPTR, this,
193
193
  reason, val, val - 1);
194
194
  }
@@ -240,7 +240,7 @@ static void WriteAction(void* arg, grpc_error_handle error) {
240
240
  }
241
241
 
242
242
  static void CFStreamRead(grpc_endpoint* ep, grpc_slice_buffer* slices,
243
- grpc_closure* cb, bool urgent,
243
+ grpc_closure* cb, bool /*urgent*/,
244
244
  int /*min_progress_size*/) {
245
245
  CFStreamEndpoint* ep_impl = reinterpret_cast<CFStreamEndpoint*>(ep);
246
246
  if (grpc_tcp_trace.enabled()) {
@@ -258,7 +258,8 @@ static void CFStreamRead(grpc_endpoint* ep, grpc_slice_buffer* slices,
258
258
  }
259
259
 
260
260
  static void CFStreamWrite(grpc_endpoint* ep, grpc_slice_buffer* slices,
261
- grpc_closure* cb, void* arg, int /*max_frame_size*/) {
261
+ grpc_closure* cb, void* /*arg*/,
262
+ int /*max_frame_size*/) {
262
263
  CFStreamEndpoint* ep_impl = reinterpret_cast<CFStreamEndpoint*>(ep);
263
264
  if (grpc_tcp_trace.enabled()) {
264
265
  gpr_log(GPR_DEBUG, "CFStream endpoint:%p write (%p, %p) length:%zu",
@@ -304,14 +305,15 @@ absl::string_view CFStreamGetLocalAddress(grpc_endpoint* ep) {
304
305
  return ep_impl->local_address;
305
306
  }
306
307
 
307
- int CFStreamGetFD(grpc_endpoint* ep) { return 0; }
308
+ int CFStreamGetFD(grpc_endpoint* /*ep*/) { return 0; }
308
309
 
309
- bool CFStreamCanTrackErr(grpc_endpoint* ep) { return false; }
310
+ bool CFStreamCanTrackErr(grpc_endpoint* /*ep*/) { return false; }
310
311
 
311
- void CFStreamAddToPollset(grpc_endpoint* ep, grpc_pollset* pollset) {}
312
- void CFStreamAddToPollsetSet(grpc_endpoint* ep, grpc_pollset_set* pollset) {}
313
- void CFStreamDeleteFromPollsetSet(grpc_endpoint* ep,
314
- grpc_pollset_set* pollset) {}
312
+ void CFStreamAddToPollset(grpc_endpoint* /*ep*/, grpc_pollset* /*pollset*/) {}
313
+ void CFStreamAddToPollsetSet(grpc_endpoint* /*ep*/,
314
+ grpc_pollset_set* /*pollset*/) {}
315
+ void CFStreamDeleteFromPollsetSet(grpc_endpoint* /*ep*/,
316
+ grpc_pollset_set* /*pollset*/) {}
315
317
 
316
318
  static const grpc_endpoint_vtable vtable = {CFStreamRead,
317
319
  CFStreamWrite,
@@ -118,7 +118,7 @@ static void grpc_apple_register_write_stream_queue(
118
118
  /// be issued to the run loop when a network event happens and will be driven by
119
119
  /// the global run loop thread gGlobalRunLoopThread.
120
120
  static void grpc_apple_register_read_stream_run_loop(
121
- CFReadStreamRef read_stream, dispatch_queue_t dispatch_queue) {
121
+ CFReadStreamRef read_stream, dispatch_queue_t /*dispatch_queue*/) {
122
122
  GRPC_POLLING_TRACE("Register read stream: %p", read_stream);
123
123
  grpc_core::MutexLock lock(&gGlobalRunLoopContext->mu);
124
124
  CFReadStreamScheduleWithRunLoop(read_stream, gGlobalRunLoopContext->run_loop,
@@ -131,7 +131,7 @@ static void grpc_apple_register_read_stream_run_loop(
131
131
  /// be issued to the run loop when a network event happens, and will be driven
132
132
  /// by the global run loop thread gGlobalRunLoopThread.
133
133
  static void grpc_apple_register_write_stream_run_loop(
134
- CFWriteStreamRef write_stream, dispatch_queue_t dispatch_queue) {
134
+ CFWriteStreamRef write_stream, dispatch_queue_t /*dispatch_queue*/) {
135
135
  GRPC_POLLING_TRACE("Register write stream: %p", write_stream);
136
136
  grpc_core::MutexLock lock(&gGlobalRunLoopContext->mu);
137
137
  CFWriteStreamScheduleWithRunLoop(
@@ -163,7 +163,7 @@ void grpc_apple_register_write_stream(CFWriteStreamRef write_stream,
163
163
 
164
164
  /// Drive the run loop in a global singleton thread until the global run loop is
165
165
  /// shutdown.
166
- static void GlobalRunLoopFunc(void* arg) {
166
+ static void GlobalRunLoopFunc(void* /*arg*/) {
167
167
  grpc_core::LockableAndReleasableMutexLock lock(&gGlobalRunLoopContext->mu);
168
168
  gGlobalRunLoopContext->run_loop = CFRunLoopGetCurrent();
169
169
  gGlobalRunLoopContext->init_cv.Signal();
@@ -342,15 +342,15 @@ grpc_pollset_vtable grpc_apple_pollset_vtable = {
342
342
  // pollset_set implementation
343
343
 
344
344
  grpc_pollset_set* pollset_set_create(void) { return nullptr; }
345
- void pollset_set_destroy(grpc_pollset_set* pollset_set) {}
346
- void pollset_set_add_pollset(grpc_pollset_set* pollset_set,
347
- grpc_pollset* pollset) {}
348
- void pollset_set_del_pollset(grpc_pollset_set* pollset_set,
349
- grpc_pollset* pollset) {}
350
- void pollset_set_add_pollset_set(grpc_pollset_set* bag,
351
- grpc_pollset_set* item) {}
352
- void pollset_set_del_pollset_set(grpc_pollset_set* bag,
353
- grpc_pollset_set* item) {}
345
+ void pollset_set_destroy(grpc_pollset_set* /*pollset_set*/) {}
346
+ void pollset_set_add_pollset(grpc_pollset_set* /*pollset_set*/,
347
+ grpc_pollset* /*pollset*/) {}
348
+ void pollset_set_del_pollset(grpc_pollset_set* /*pollset_set*/,
349
+ grpc_pollset* /*pollset*/) {}
350
+ void pollset_set_add_pollset_set(grpc_pollset_set* /*bag*/,
351
+ grpc_pollset_set* /*item*/) {}
352
+ void pollset_set_del_pollset_set(grpc_pollset_set* /*bag*/,
353
+ grpc_pollset_set* /*item*/) {}
354
354
 
355
355
  grpc_pollset_set_vtable grpc_apple_pollset_set_vtable = {
356
356
  pollset_set_create, pollset_set_destroy,
@@ -61,6 +61,7 @@
61
61
  #include "src/core/lib/iomgr/wakeup_fd_posix.h"
62
62
 
63
63
  static grpc_wakeup_fd global_wakeup_fd;
64
+ static bool g_is_shutdown = true;
64
65
 
65
66
  //******************************************************************************
66
67
  // Singleton epoll set related fields
@@ -1239,6 +1240,7 @@ static void shutdown_engine(void) {
1239
1240
  gpr_mu_destroy(&fork_fd_list_mu);
1240
1241
  grpc_core::Fork::SetResetChildPollingEngineFunc(nullptr);
1241
1242
  }
1243
+ g_is_shutdown = true;
1242
1244
  }
1243
1245
 
1244
1246
  static bool init_epoll1_linux();
@@ -1278,10 +1280,13 @@ const grpc_event_engine_vtable grpc_ev_epoll1_posix = {
1278
1280
 
1279
1281
  is_any_background_poller_thread,
1280
1282
  /* name = */ "epoll1",
1281
- /* check_engine_available = */ [](bool) { return init_epoll1_linux(); },
1282
- /* init_engine = */ []() {},
1283
+ /* check_engine_available = */
1284
+ [](bool) { return init_epoll1_linux(); },
1285
+ /* init_engine = */
1286
+ []() { GPR_ASSERT(init_epoll1_linux()); },
1283
1287
  shutdown_background_closure,
1284
- /* shutdown_engine = */ []() {},
1288
+ /* shutdown_engine = */
1289
+ []() { shutdown_engine(); },
1285
1290
  add_closure_to_background_poller,
1286
1291
 
1287
1292
  fd_set_pre_allocated,
@@ -1306,6 +1311,7 @@ static void reset_event_manager_on_fork() {
1306
1311
  // Create epoll_fd (epoll_set_init() takes care of that) to make sure epoll
1307
1312
  // support is available
1308
1313
  static bool init_epoll1_linux() {
1314
+ if (!g_is_shutdown) return true;
1309
1315
  if (!grpc_has_wakeup_fd()) {
1310
1316
  gpr_log(GPR_ERROR, "Skipping epoll1 because of no wakeup fd.");
1311
1317
  return false;
@@ -1328,6 +1334,7 @@ static bool init_epoll1_linux() {
1328
1334
  grpc_core::Fork::SetResetChildPollingEngineFunc(
1329
1335
  reset_event_manager_on_fork);
1330
1336
  }
1337
+ g_is_shutdown = false;
1331
1338
  return true;
1332
1339
  }
1333
1340
 
@@ -256,6 +256,15 @@ class EventEngineEndpointWrapper {
256
256
  }
257
257
  }
258
258
 
259
+ bool CanTrackErrors() {
260
+ if (EventEngineSupportsFd()) {
261
+ return reinterpret_cast<PosixEndpointWithFdSupport*>(endpoint_.get())
262
+ ->CanTrackErrors();
263
+ } else {
264
+ return false;
265
+ }
266
+ }
267
+
259
268
  private:
260
269
  void OnShutdownInternal() {
261
270
  {
@@ -378,7 +387,12 @@ int EndpointGetFd(grpc_endpoint* ep) {
378
387
  return eeep->wrapper->Fd();
379
388
  }
380
389
 
381
- bool EndpointCanTrackErr(grpc_endpoint* /* ep */) { return false; }
390
+ bool EndpointCanTrackErr(grpc_endpoint* ep) {
391
+ auto* eeep =
392
+ reinterpret_cast<EventEngineEndpointWrapper::grpc_event_engine_endpoint*>(
393
+ ep);
394
+ return eeep->wrapper->CanTrackErrors();
395
+ }
382
396
 
383
397
  grpc_endpoint_vtable grpc_event_engine_endpoint_vtable = {
384
398
  EndpointRead,