grpc 1.49.1 → 1.50.0.pre1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of grpc might be problematic. Click here for more details.

Files changed (270) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +54 -153
  3. data/include/grpc/event_engine/endpoint_config.h +11 -5
  4. data/include/grpc/event_engine/event_engine.h +1 -1
  5. data/include/grpc/impl/codegen/atm_gcc_atomic.h +19 -28
  6. data/include/grpc/impl/codegen/atm_gcc_sync.h +0 -2
  7. data/include/grpc/impl/codegen/atm_windows.h +0 -2
  8. data/include/grpc/impl/codegen/grpc_types.h +6 -0
  9. data/src/core/ext/filters/channel_idle/channel_idle_filter.cc +3 -3
  10. data/src/core/ext/filters/client_channel/backup_poller.cc +4 -6
  11. data/src/core/ext/filters/client_channel/client_channel.cc +33 -22
  12. data/src/core/ext/filters/client_channel/client_channel.h +1 -1
  13. data/src/core/ext/filters/client_channel/client_channel_plugin.cc +0 -16
  14. data/src/core/ext/filters/client_channel/http_proxy.cc +12 -19
  15. data/src/core/ext/filters/client_channel/http_proxy.h +3 -2
  16. data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc +6 -4
  17. data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h +5 -4
  18. data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +0 -2
  19. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +112 -96
  20. data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc +20 -11
  21. data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.cc +106 -108
  22. data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h +16 -0
  23. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +20 -13
  24. data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +165 -257
  25. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +218 -231
  26. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h +10 -6
  27. data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +389 -444
  28. data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +16 -16
  29. data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +8 -13
  30. data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +84 -96
  31. data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +38 -37
  32. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +106 -186
  33. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +106 -93
  34. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +170 -218
  35. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +2 -2
  36. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +1 -1
  37. data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +13 -15
  38. data/src/core/ext/filters/client_channel/resolver/polling_resolver.cc +84 -37
  39. data/src/core/ext/filters/client_channel/resolver/polling_resolver.h +11 -0
  40. data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +1 -0
  41. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +5 -3
  42. data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +5 -4
  43. data/src/core/ext/filters/client_channel/retry_filter.cc +25 -29
  44. data/src/core/ext/filters/client_channel/subchannel.cc +38 -33
  45. data/src/core/ext/filters/client_channel/subchannel.h +12 -3
  46. data/src/core/ext/filters/client_channel/subchannel_stream_client.cc +1 -2
  47. data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +23 -16
  48. data/src/core/ext/filters/fault_injection/fault_injection_filter.h +8 -0
  49. data/src/core/ext/filters/http/client/http_client_filter.cc +1 -2
  50. data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +2 -4
  51. data/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +0 -2
  52. data/src/core/ext/filters/http/server/http_server_filter.cc +1 -2
  53. data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +12 -8
  54. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +32 -26
  55. data/src/core/ext/transport/chttp2/transport/bin_encoder.cc +1 -1
  56. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +25 -130
  57. data/src/core/ext/transport/chttp2/transport/decode_huff.cc +287 -0
  58. data/src/core/ext/transport/chttp2/transport/decode_huff.h +1018 -0
  59. data/src/core/ext/transport/chttp2/transport/flow_control.cc +83 -51
  60. data/src/core/ext/transport/chttp2/transport/flow_control.h +11 -6
  61. data/src/core/ext/transport/chttp2/transport/frame_ping.cc +1 -2
  62. data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +2 -20
  63. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +28 -28
  64. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +1 -10
  65. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +11 -6
  66. data/src/core/ext/transport/chttp2/transport/internal.h +2 -0
  67. data/src/core/ext/transport/chttp2/transport/parsing.cc +44 -0
  68. data/src/core/ext/transport/chttp2/transport/writing.cc +3 -14
  69. data/src/core/ext/transport/inproc/inproc_transport.cc +1 -3
  70. data/src/core/ext/xds/certificate_provider_store.cc +63 -3
  71. data/src/core/ext/xds/certificate_provider_store.h +9 -1
  72. data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +5 -5
  73. data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +1 -1
  74. data/src/core/ext/xds/xds_api.cc +21 -17
  75. data/src/core/ext/xds/xds_api.h +7 -0
  76. data/src/core/ext/xds/xds_bootstrap.cc +5 -537
  77. data/src/core/ext/xds/xds_bootstrap.h +39 -111
  78. data/src/core/ext/xds/xds_bootstrap_grpc.cc +370 -0
  79. data/src/core/ext/xds/xds_bootstrap_grpc.h +169 -0
  80. data/src/core/ext/xds/xds_client.cc +219 -145
  81. data/src/core/ext/xds/xds_client.h +19 -17
  82. data/src/core/ext/xds/xds_client_grpc.cc +18 -80
  83. data/src/core/ext/xds/xds_client_grpc.h +2 -25
  84. data/src/core/ext/xds/xds_client_stats.cc +4 -4
  85. data/src/core/ext/xds/xds_cluster.cc +87 -79
  86. data/src/core/ext/xds/xds_cluster.h +5 -5
  87. data/src/core/ext/xds/xds_cluster_specifier_plugin.cc +3 -1
  88. data/src/core/ext/xds/xds_common_types.cc +13 -5
  89. data/src/core/ext/xds/xds_endpoint.cc +8 -6
  90. data/src/core/ext/xds/xds_endpoint.h +3 -4
  91. data/src/core/ext/xds/xds_lb_policy_registry.cc +4 -2
  92. data/src/core/ext/xds/xds_listener.cc +25 -20
  93. data/src/core/ext/xds/xds_listener.h +3 -4
  94. data/src/core/ext/xds/xds_resource_type.h +11 -8
  95. data/src/core/ext/xds/xds_route_config.cc +15 -16
  96. data/src/core/ext/xds/xds_route_config.h +3 -3
  97. data/src/core/ext/xds/xds_server_config_fetcher.cc +7 -5
  98. data/src/core/ext/xds/xds_transport_grpc.cc +15 -7
  99. data/src/core/lib/backoff/backoff.cc +2 -4
  100. data/src/core/lib/channel/call_finalization.h +1 -3
  101. data/src/core/lib/channel/channel_args.h +114 -14
  102. data/src/core/lib/channel/channel_trace.cc +3 -4
  103. data/src/core/lib/channel/promise_based_filter.cc +18 -19
  104. data/src/core/lib/channel/status_util.cc +27 -0
  105. data/src/core/lib/channel/status_util.h +10 -0
  106. data/src/core/lib/config/core_configuration.cc +5 -1
  107. data/src/core/lib/config/core_configuration.h +33 -0
  108. data/src/core/lib/debug/stats.cc +26 -30
  109. data/src/core/lib/debug/stats.h +2 -12
  110. data/src/core/lib/debug/stats_data.cc +118 -614
  111. data/src/core/lib/debug/stats_data.h +67 -465
  112. data/src/core/lib/debug/trace.cc +0 -2
  113. data/src/core/lib/event_engine/channel_args_endpoint_config.cc +12 -20
  114. data/src/core/lib/event_engine/channel_args_endpoint_config.h +13 -7
  115. data/src/core/lib/event_engine/forkable.cc +1 -1
  116. data/src/core/lib/event_engine/poller.h +14 -12
  117. data/src/core/lib/event_engine/posix_engine/timer_manager.cc +53 -32
  118. data/src/core/lib/event_engine/posix_engine/timer_manager.h +23 -1
  119. data/src/core/lib/event_engine/thread_pool.cc +131 -94
  120. data/src/core/lib/event_engine/thread_pool.h +56 -23
  121. data/src/core/lib/event_engine/time_util.cc +30 -0
  122. data/src/core/lib/event_engine/time_util.h +32 -0
  123. data/src/core/lib/event_engine/utils.cc +0 -5
  124. data/src/core/lib/event_engine/utils.h +0 -4
  125. data/src/core/lib/event_engine/windows/iocp.cc +13 -7
  126. data/src/core/lib/event_engine/windows/iocp.h +2 -1
  127. data/src/core/lib/event_engine/windows/win_socket.cc +1 -1
  128. data/src/core/lib/experiments/config.cc +146 -0
  129. data/src/core/lib/experiments/config.h +43 -0
  130. data/src/core/lib/experiments/experiments.cc +75 -0
  131. data/src/core/lib/experiments/experiments.h +56 -0
  132. data/src/core/lib/gpr/alloc.cc +1 -9
  133. data/src/core/lib/gpr/log_windows.cc +0 -1
  134. data/src/core/lib/gpr/string_util_windows.cc +3 -30
  135. data/src/core/lib/gpr/sync_abseil.cc +0 -14
  136. data/src/core/lib/gpr/sync_posix.cc +0 -14
  137. data/src/core/lib/gpr/time_posix.cc +0 -6
  138. data/src/core/lib/gpr/time_precise.h +1 -1
  139. data/src/core/lib/gpr/tmpfile_windows.cc +5 -7
  140. data/src/core/lib/gpr/useful.h +11 -0
  141. data/src/core/lib/{gpr → gprpp}/env.h +25 -12
  142. data/src/core/lib/{gpr → gprpp}/env_linux.cc +20 -15
  143. data/src/core/lib/{gpr → gprpp}/env_posix.cc +11 -10
  144. data/src/core/lib/gprpp/env_windows.cc +56 -0
  145. data/src/core/lib/gprpp/fork.cc +14 -22
  146. data/src/core/lib/gprpp/fork.h +0 -8
  147. data/src/core/lib/gprpp/global_config_env.cc +7 -6
  148. data/src/core/lib/gprpp/notification.h +67 -0
  149. data/src/core/lib/gprpp/packed_table.h +40 -0
  150. data/src/core/lib/gprpp/ref_counted_ptr.h +20 -33
  151. data/src/core/lib/gprpp/sorted_pack.h +98 -0
  152. data/src/core/lib/gprpp/status_helper.h +6 -0
  153. data/src/core/lib/gprpp/table.h +9 -1
  154. data/src/core/lib/gprpp/tchar.cc +49 -0
  155. data/src/core/lib/gprpp/tchar.h +33 -0
  156. data/src/core/lib/gprpp/time.cc +21 -0
  157. data/src/core/lib/gprpp/time.h +55 -0
  158. data/src/core/lib/gprpp/validation_errors.cc +61 -0
  159. data/src/core/lib/gprpp/validation_errors.h +110 -0
  160. data/src/core/{ext/filters/client_channel → lib/handshaker}/proxy_mapper.h +3 -3
  161. data/src/core/{ext/filters/client_channel → lib/handshaker}/proxy_mapper_registry.cc +14 -36
  162. data/src/core/lib/handshaker/proxy_mapper_registry.h +75 -0
  163. data/src/core/lib/iomgr/call_combiner.cc +0 -8
  164. data/src/core/lib/iomgr/closure.h +0 -1
  165. data/src/core/lib/iomgr/endpoint_pair_posix.cc +14 -10
  166. data/src/core/lib/iomgr/endpoint_pair_windows.cc +2 -2
  167. data/src/core/lib/iomgr/ev_epoll1_linux.cc +1 -38
  168. data/src/core/lib/iomgr/ev_poll_posix.cc +2 -17
  169. data/src/core/lib/iomgr/exec_ctx.cc +0 -10
  170. data/src/core/lib/iomgr/exec_ctx.h +7 -31
  171. data/src/core/lib/iomgr/iocp_windows.cc +1 -2
  172. data/src/core/lib/iomgr/iomgr.cc +6 -8
  173. data/src/core/lib/iomgr/iomgr_fwd.h +1 -0
  174. data/src/core/lib/iomgr/pollset.h +1 -1
  175. data/src/core/lib/iomgr/pollset_set.h +0 -1
  176. data/src/core/lib/iomgr/resolve_address.h +1 -0
  177. data/src/core/lib/iomgr/resolve_address_impl.h +1 -0
  178. data/src/core/lib/iomgr/resolve_address_posix.cc +1 -0
  179. data/src/core/lib/iomgr/resolve_address_windows.cc +1 -0
  180. data/src/core/lib/iomgr/sockaddr_utils_posix.cc +2 -1
  181. data/src/core/lib/iomgr/socket_utils_common_posix.cc +12 -34
  182. data/src/core/lib/iomgr/socket_utils_posix.cc +83 -1
  183. data/src/core/lib/iomgr/socket_utils_posix.h +98 -6
  184. data/src/core/lib/iomgr/tcp_client.cc +6 -7
  185. data/src/core/lib/iomgr/tcp_client.h +11 -11
  186. data/src/core/lib/iomgr/tcp_client_cfstream.cc +6 -6
  187. data/src/core/lib/iomgr/tcp_client_posix.cc +33 -29
  188. data/src/core/lib/iomgr/tcp_client_posix.h +12 -9
  189. data/src/core/lib/iomgr/tcp_client_windows.cc +6 -6
  190. data/src/core/lib/iomgr/tcp_posix.cc +131 -114
  191. data/src/core/lib/iomgr/tcp_posix.h +3 -1
  192. data/src/core/lib/iomgr/tcp_server.cc +5 -4
  193. data/src/core/lib/iomgr/tcp_server.h +9 -6
  194. data/src/core/lib/iomgr/tcp_server_posix.cc +17 -28
  195. data/src/core/lib/iomgr/tcp_server_utils_posix.h +2 -2
  196. data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +3 -3
  197. data/src/core/lib/iomgr/tcp_server_windows.cc +6 -7
  198. data/src/core/lib/iomgr/tcp_windows.cc +0 -1
  199. data/src/core/lib/iomgr/tcp_windows.h +0 -1
  200. data/src/core/lib/iomgr/timer_generic.cc +4 -4
  201. data/src/core/lib/iomgr/timer_manager.cc +1 -2
  202. data/src/core/lib/iomgr/wakeup_fd_eventfd.cc +0 -2
  203. data/src/core/lib/json/json_object_loader.cc +21 -52
  204. data/src/core/lib/json/json_object_loader.h +56 -76
  205. data/src/core/lib/json/json_util.cc +2 -1
  206. data/src/core/lib/load_balancing/lb_policy.h +5 -5
  207. data/src/core/lib/load_balancing/lb_policy_registry.cc +29 -55
  208. data/src/core/lib/load_balancing/lb_policy_registry.h +23 -11
  209. data/src/core/lib/promise/activity.h +2 -3
  210. data/src/core/lib/promise/context.h +1 -1
  211. data/src/core/lib/promise/sleep.cc +16 -4
  212. data/src/core/lib/promise/sleep.h +8 -2
  213. data/src/core/lib/resolver/resolver.h +13 -3
  214. data/src/core/lib/resource_quota/api.cc +9 -0
  215. data/src/core/lib/resource_quota/api.h +6 -0
  216. data/src/core/lib/resource_quota/arena.cc +1 -3
  217. data/src/core/lib/resource_quota/memory_quota.cc +8 -24
  218. data/src/core/lib/resource_quota/memory_quota.h +6 -19
  219. data/src/core/lib/resource_quota/periodic_update.cc +2 -3
  220. data/src/core/{ext/xds → lib/security/certificate_provider}/certificate_provider_factory.h +3 -3
  221. data/src/core/lib/security/certificate_provider/certificate_provider_registry.cc +60 -0
  222. data/src/core/lib/security/certificate_provider/certificate_provider_registry.h +70 -0
  223. data/src/core/lib/security/credentials/channel_creds_registry_init.cc +1 -0
  224. data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +15 -16
  225. data/src/core/lib/security/credentials/external/external_account_credentials.cc +2 -1
  226. data/src/core/lib/security/credentials/google_default/credentials_generic.cc +5 -8
  227. data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +6 -6
  228. data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +3 -2
  229. data/src/core/lib/security/credentials/jwt/jwt_verifier.h +1 -1
  230. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +1 -2
  231. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +4 -3
  232. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +4 -2
  233. data/src/core/lib/security/credentials/tls/tls_utils.cc +3 -1
  234. data/src/core/lib/security/transport/client_auth_filter.cc +12 -1
  235. data/src/core/lib/security/transport/secure_endpoint.cc +0 -4
  236. data/src/core/lib/surface/call.cc +1 -11
  237. data/src/core/lib/surface/channel.cc +3 -2
  238. data/src/core/lib/surface/completion_queue.cc +16 -28
  239. data/src/core/lib/surface/completion_queue.h +1 -1
  240. data/src/core/lib/surface/completion_queue_factory.cc +5 -0
  241. data/src/core/lib/surface/init.cc +16 -11
  242. data/src/core/lib/surface/init_internally.cc +24 -0
  243. data/src/core/lib/surface/init_internally.h +28 -0
  244. data/src/core/lib/surface/server.cc +1 -7
  245. data/src/core/lib/surface/server.h +4 -6
  246. data/src/core/lib/surface/version.cc +2 -2
  247. data/src/core/lib/transport/bdp_estimator.cc +1 -3
  248. data/src/core/lib/transport/metadata_batch.cc +2 -3
  249. data/src/core/lib/transport/metadata_batch.h +9 -7
  250. data/src/core/lib/transport/parsed_metadata.h +4 -2
  251. data/src/core/lib/transport/status_conversion.cc +1 -3
  252. data/src/core/lib/transport/tcp_connect_handshaker.cc +9 -5
  253. data/src/core/lib/transport/transport.h +0 -1
  254. data/src/core/lib/transport/transport_impl.h +0 -1
  255. data/src/core/plugin_registry/grpc_plugin_registry.cc +23 -46
  256. data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +13 -25
  257. data/src/ruby/lib/grpc/version.rb +1 -1
  258. data/src/ruby/spec/channel_spec.rb +5 -0
  259. data/src/ruby/spec/generic/server_interceptors_spec.rb +1 -1
  260. data/src/ruby/spec/user_agent_spec.rb +1 -1
  261. metadata +33 -19
  262. data/src/core/ext/filters/client_channel/proxy_mapper_registry.h +0 -56
  263. data/src/core/ext/xds/certificate_provider_registry.cc +0 -103
  264. data/src/core/ext/xds/certificate_provider_registry.h +0 -59
  265. data/src/core/lib/event_engine/promise.h +0 -78
  266. data/src/core/lib/gpr/env_windows.cc +0 -74
  267. data/src/core/lib/gpr/string_windows.h +0 -32
  268. data/src/core/lib/profiling/basic_timers.cc +0 -295
  269. data/src/core/lib/profiling/stap_timers.cc +0 -50
  270. data/src/core/lib/profiling/timers.h +0 -94
@@ -52,7 +52,6 @@
52
52
  #include "src/core/lib/iomgr/executor.h"
53
53
  #include "src/core/lib/iomgr/iomgr.h"
54
54
  #include "src/core/lib/iomgr/pollset.h"
55
- #include "src/core/lib/profiling/timers.h"
56
55
  #include "src/core/lib/surface/api_trace.h"
57
56
  #include "src/core/lib/surface/event_string.h"
58
57
 
@@ -489,17 +488,9 @@ grpc_cq_completion* CqEventQueue::Pop() {
489
488
  grpc_cq_completion* c = nullptr;
490
489
 
491
490
  if (gpr_spinlock_trylock(&queue_lock_)) {
492
- GRPC_STATS_INC_CQ_EV_QUEUE_TRYLOCK_SUCCESSES();
493
-
494
491
  bool is_empty = false;
495
492
  c = reinterpret_cast<grpc_cq_completion*>(queue_.PopAndCheckEnd(&is_empty));
496
493
  gpr_spinlock_unlock(&queue_lock_);
497
-
498
- if (c == nullptr && !is_empty) {
499
- GRPC_STATS_INC_CQ_EV_QUEUE_TRANSIENT_POP_FAILURES();
500
- }
501
- } else {
502
- GRPC_STATS_INC_CQ_EV_QUEUE_TRYLOCK_FAILURES();
503
494
  }
504
495
 
505
496
  if (c) {
@@ -512,8 +503,6 @@ grpc_cq_completion* CqEventQueue::Pop() {
512
503
  grpc_completion_queue* grpc_completion_queue_create_internal(
513
504
  grpc_cq_completion_type completion_type, grpc_cq_polling_type polling_type,
514
505
  grpc_completion_queue_functor* shutdown_callback) {
515
- GPR_TIMER_SCOPE("grpc_completion_queue_create_internal", 0);
516
-
517
506
  grpc_completion_queue* cq;
518
507
 
519
508
  GRPC_API_TRACE(
@@ -521,12 +510,23 @@ grpc_completion_queue* grpc_completion_queue_create_internal(
521
510
  "polling_type=%d)",
522
511
  2, (completion_type, polling_type));
523
512
 
513
+ switch (completion_type) {
514
+ case GRPC_CQ_NEXT:
515
+ GRPC_STATS_INC_CQ_NEXT_CREATES();
516
+ break;
517
+ case GRPC_CQ_PLUCK:
518
+ GRPC_STATS_INC_CQ_PLUCK_CREATES();
519
+ break;
520
+ case GRPC_CQ_CALLBACK:
521
+ GRPC_STATS_INC_CQ_CALLBACK_CREATES();
522
+ break;
523
+ }
524
+
524
525
  const cq_vtable* vtable = &g_cq_vtable[completion_type];
525
526
  const cq_poller_vtable* poller_vtable =
526
527
  &g_poller_vtable_by_poller_type[polling_type];
527
528
 
528
529
  grpc_core::ExecCtx exec_ctx;
529
- GRPC_STATS_INC_CQS_CREATED();
530
530
 
531
531
  cq = static_cast<grpc_completion_queue*>(
532
532
  gpr_zalloc(sizeof(grpc_completion_queue) + vtable->data_size +
@@ -690,8 +690,6 @@ static void cq_end_op_for_next(
690
690
  grpc_completion_queue* cq, void* tag, grpc_error_handle error,
691
691
  void (*done)(void* done_arg, grpc_cq_completion* storage), void* done_arg,
692
692
  grpc_cq_completion* storage, bool /*internal*/) {
693
- GPR_TIMER_SCOPE("cq_end_op_for_next", 0);
694
-
695
693
  if (GRPC_TRACE_FLAG_ENABLED(grpc_api_trace) ||
696
694
  (GRPC_TRACE_FLAG_ENABLED(grpc_trace_operation_failures) &&
697
695
  !GRPC_ERROR_IS_NONE(error))) {
@@ -768,8 +766,6 @@ static void cq_end_op_for_pluck(
768
766
  grpc_completion_queue* cq, void* tag, grpc_error_handle error,
769
767
  void (*done)(void* done_arg, grpc_cq_completion* storage), void* done_arg,
770
768
  grpc_cq_completion* storage, bool /*internal*/) {
771
- GPR_TIMER_SCOPE("cq_end_op_for_pluck", 0);
772
-
773
769
  cq_pluck_data* cqd = static_cast<cq_pluck_data*> DATA_FROM_CQ(cq);
774
770
  int is_success = (GRPC_ERROR_IS_NONE(error));
775
771
 
@@ -838,8 +834,6 @@ static void cq_end_op_for_callback(
838
834
  grpc_completion_queue* cq, void* tag, grpc_error_handle error,
839
835
  void (*done)(void* done_arg, grpc_cq_completion* storage), void* done_arg,
840
836
  grpc_cq_completion* storage, bool internal) {
841
- GPR_TIMER_SCOPE("cq_end_op_for_callback", 0);
842
-
843
837
  cq_callback_data* cqd = static_cast<cq_callback_data*> DATA_FROM_CQ(cq);
844
838
 
845
839
  if (GRPC_TRACE_FLAG_ENABLED(grpc_api_trace) ||
@@ -935,7 +929,7 @@ class ExecCtxNext : public grpc_core::ExecCtx {
935
929
  return true;
936
930
  }
937
931
  }
938
- return !a->first_loop && a->deadline < grpc_core::ExecCtx::Get()->Now();
932
+ return !a->first_loop && a->deadline < grpc_core::Timestamp::Now();
939
933
  }
940
934
 
941
935
  private:
@@ -960,8 +954,6 @@ static void dump_pending_tags(grpc_completion_queue* /*cq*/) {}
960
954
 
961
955
  static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline,
962
956
  void* reserved) {
963
- GPR_TIMER_SCOPE("grpc_completion_queue_next", 0);
964
-
965
957
  grpc_event ret;
966
958
  cq_next_data* cqd = static_cast<cq_next_data*> DATA_FROM_CQ(cq);
967
959
 
@@ -1041,7 +1033,7 @@ static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline,
1041
1033
  }
1042
1034
 
1043
1035
  if (!is_finished_arg.first_loop &&
1044
- grpc_core::ExecCtx::Get()->Now() >= deadline_millis) {
1036
+ grpc_core::Timestamp::Now() >= deadline_millis) {
1045
1037
  ret.type = GRPC_QUEUE_TIMEOUT;
1046
1038
  ret.success = 0;
1047
1039
  dump_pending_tags(cq);
@@ -1196,7 +1188,7 @@ class ExecCtxPluck : public grpc_core::ExecCtx {
1196
1188
  }
1197
1189
  gpr_mu_unlock(cq->mu);
1198
1190
  }
1199
- return !a->first_loop && a->deadline < grpc_core::ExecCtx::Get()->Now();
1191
+ return !a->first_loop && a->deadline < grpc_core::Timestamp::Now();
1200
1192
  }
1201
1193
 
1202
1194
  private:
@@ -1205,8 +1197,6 @@ class ExecCtxPluck : public grpc_core::ExecCtx {
1205
1197
 
1206
1198
  static grpc_event cq_pluck(grpc_completion_queue* cq, void* tag,
1207
1199
  gpr_timespec deadline, void* reserved) {
1208
- GPR_TIMER_SCOPE("grpc_completion_queue_pluck", 0);
1209
-
1210
1200
  grpc_event ret;
1211
1201
  grpc_cq_completion* c;
1212
1202
  grpc_cq_completion* prev;
@@ -1289,7 +1279,7 @@ static grpc_event cq_pluck(grpc_completion_queue* cq, void* tag,
1289
1279
  break;
1290
1280
  }
1291
1281
  if (!is_finished_arg.first_loop &&
1292
- grpc_core::ExecCtx::Get()->Now() >= deadline_millis) {
1282
+ grpc_core::Timestamp::Now() >= deadline_millis) {
1293
1283
  del_plucker(cq, tag, &worker);
1294
1284
  gpr_mu_unlock(cq->mu);
1295
1285
  ret.type = GRPC_QUEUE_TIMEOUT;
@@ -1412,7 +1402,6 @@ static void cq_shutdown_callback(grpc_completion_queue* cq) {
1412
1402
  /* Shutdown simply drops a ref that we reserved at creation time; if we drop
1413
1403
  to zero here, then enter shutdown mode and wake up any waiters */
1414
1404
  void grpc_completion_queue_shutdown(grpc_completion_queue* cq) {
1415
- GPR_TIMER_SCOPE("grpc_completion_queue_shutdown", 0);
1416
1405
  grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
1417
1406
  grpc_core::ExecCtx exec_ctx;
1418
1407
  GRPC_API_TRACE("grpc_completion_queue_shutdown(cq=%p)", 1, (cq));
@@ -1420,7 +1409,6 @@ void grpc_completion_queue_shutdown(grpc_completion_queue* cq) {
1420
1409
  }
1421
1410
 
1422
1411
  void grpc_completion_queue_destroy(grpc_completion_queue* cq) {
1423
- GPR_TIMER_SCOPE("grpc_completion_queue_destroy", 0);
1424
1412
  GRPC_API_TRACE("grpc_completion_queue_destroy(cq=%p)", 1, (cq));
1425
1413
  grpc_completion_queue_shutdown(cq);
1426
1414
 
@@ -31,7 +31,7 @@
31
31
  #include "src/core/lib/gprpp/manual_constructor.h"
32
32
  #include "src/core/lib/gprpp/mpscq.h"
33
33
  #include "src/core/lib/iomgr/error.h"
34
- #include "src/core/lib/iomgr/pollset.h"
34
+ #include "src/core/lib/iomgr/iomgr_fwd.h"
35
35
 
36
36
  /* These trace flags default to 1. The corresponding lines are only traced
37
37
  if grpc_api_trace is also truthy */
@@ -23,6 +23,7 @@
23
23
  #include <grpc/grpc.h>
24
24
  #include <grpc/support/log.h>
25
25
 
26
+ #include "src/core/lib/iomgr/exec_ctx.h"
26
27
  #include "src/core/lib/surface/completion_queue.h"
27
28
 
28
29
  /*
@@ -60,6 +61,7 @@ const grpc_completion_queue_factory* grpc_completion_queue_factory_lookup(
60
61
  */
61
62
 
62
63
  grpc_completion_queue* grpc_completion_queue_create_for_next(void* reserved) {
64
+ grpc_core::ExecCtx exec_ctx;
63
65
  GPR_ASSERT(!reserved);
64
66
  grpc_completion_queue_attributes attr = {1, GRPC_CQ_NEXT,
65
67
  GRPC_CQ_DEFAULT_POLLING, nullptr};
@@ -67,6 +69,7 @@ grpc_completion_queue* grpc_completion_queue_create_for_next(void* reserved) {
67
69
  }
68
70
 
69
71
  grpc_completion_queue* grpc_completion_queue_create_for_pluck(void* reserved) {
72
+ grpc_core::ExecCtx exec_ctx;
70
73
  GPR_ASSERT(!reserved);
71
74
  grpc_completion_queue_attributes attr = {1, GRPC_CQ_PLUCK,
72
75
  GRPC_CQ_DEFAULT_POLLING, nullptr};
@@ -75,6 +78,7 @@ grpc_completion_queue* grpc_completion_queue_create_for_pluck(void* reserved) {
75
78
 
76
79
  grpc_completion_queue* grpc_completion_queue_create_for_callback(
77
80
  grpc_completion_queue_functor* shutdown_callback, void* reserved) {
81
+ grpc_core::ExecCtx exec_ctx;
78
82
  GPR_ASSERT(!reserved);
79
83
  grpc_completion_queue_attributes attr = {
80
84
  2, GRPC_CQ_CALLBACK, GRPC_CQ_DEFAULT_POLLING, shutdown_callback};
@@ -84,6 +88,7 @@ grpc_completion_queue* grpc_completion_queue_create_for_callback(
84
88
  grpc_completion_queue* grpc_completion_queue_create(
85
89
  const grpc_completion_queue_factory* factory,
86
90
  const grpc_completion_queue_attributes* attr, void* reserved) {
91
+ grpc_core::ExecCtx exec_ctx;
87
92
  GPR_ASSERT(!reserved);
88
93
  return factory->vtable->create(factory, attr);
89
94
  }
@@ -33,18 +33,21 @@
33
33
  #include <grpc/support/sync.h>
34
34
  #include <grpc/support/time.h>
35
35
 
36
+ #include "src/core/ext/filters/client_channel/backup_poller.h"
36
37
  #include "src/core/lib/channel/channel_args.h"
37
38
  #include "src/core/lib/channel/channel_stack_builder.h"
38
39
  #include "src/core/lib/config/core_configuration.h"
39
40
  #include "src/core/lib/debug/trace.h"
41
+ #include "src/core/lib/event_engine/default_event_engine.h"
40
42
  #include "src/core/lib/event_engine/forkable.h"
43
+ #include "src/core/lib/event_engine/posix_engine/timer_manager.h"
44
+ #include "src/core/lib/experiments/config.h"
41
45
  #include "src/core/lib/gprpp/fork.h"
42
46
  #include "src/core/lib/gprpp/sync.h"
43
47
  #include "src/core/lib/gprpp/thd.h"
44
48
  #include "src/core/lib/iomgr/exec_ctx.h"
45
49
  #include "src/core/lib/iomgr/iomgr.h"
46
50
  #include "src/core/lib/iomgr/timer_manager.h"
47
- #include "src/core/lib/profiling/timers.h"
48
51
  #include "src/core/lib/security/authorization/grpc_server_authz_filter.h"
49
52
  #include "src/core/lib/security/credentials/credentials.h"
50
53
  #include "src/core/lib/security/security_connector/security_connector.h"
@@ -52,6 +55,7 @@
52
55
  #include "src/core/lib/surface/api_trace.h"
53
56
  #include "src/core/lib/surface/channel_init.h"
54
57
  #include "src/core/lib/surface/channel_stack_type.h"
58
+ #include "src/core/lib/surface/init_internally.h"
55
59
 
56
60
  /* (generated) built in registry of plugins */
57
61
  extern void grpc_register_built_in_plugins(void);
@@ -114,11 +118,19 @@ void RegisterSecurityFilters(CoreConfiguration::Builder* builder) {
114
118
  } // namespace grpc_core
115
119
 
116
120
  static void do_basic_init(void) {
121
+ grpc_core::InitInternally = grpc_init;
122
+ grpc_core::ShutdownInternally = grpc_shutdown;
117
123
  gpr_log_verbosity_init();
118
124
  g_init_mu = new grpc_core::Mutex();
119
125
  g_shutting_down_cv = new grpc_core::CondVar();
120
126
  grpc_register_built_in_plugins();
121
127
  gpr_time_init();
128
+ grpc_core::PrintExperimentsList();
129
+ grpc_core::Fork::GlobalInit();
130
+ grpc_event_engine::experimental::RegisterForkHandlers();
131
+ grpc_fork_handlers_auto_register();
132
+ grpc_tracer_init();
133
+ grpc_client_channel_global_init_backup_polling();
122
134
  }
123
135
 
124
136
  typedef struct grpc_plugin {
@@ -147,18 +159,12 @@ void grpc_init(void) {
147
159
  g_shutting_down = false;
148
160
  g_shutting_down_cv->SignalAll();
149
161
  }
150
- grpc_core::Fork::GlobalInit();
151
- grpc_event_engine::experimental::RegisterForkHandlers();
152
- grpc_fork_handlers_auto_register();
153
- grpc_core::ApplicationCallbackExecCtx::GlobalInit();
154
162
  grpc_iomgr_init();
155
- gpr_timers_global_init();
156
163
  for (int i = 0; i < g_number_of_plugins; i++) {
157
164
  if (g_all_of_the_plugins[i].init != nullptr) {
158
165
  g_all_of_the_plugins[i].init();
159
166
  }
160
167
  }
161
- grpc_tracer_init();
162
168
  grpc_iomgr_start();
163
169
  }
164
170
 
@@ -179,12 +185,9 @@ void grpc_shutdown_internal_locked(void)
179
185
  }
180
186
  }
181
187
  }
188
+ grpc_event_engine::experimental::ResetDefaultEventEngine();
182
189
  grpc_iomgr_shutdown();
183
- gpr_timers_global_destroy();
184
- grpc_tracer_shutdown();
185
- grpc_core::Fork::GlobalShutdown();
186
190
  }
187
- grpc_core::ApplicationCallbackExecCtx::GlobalShutdown();
188
191
  g_shutting_down = false;
189
192
  g_shutting_down_cv->SignalAll();
190
193
  }
@@ -208,6 +211,8 @@ void grpc_shutdown(void) {
208
211
  grpc_core::ApplicationCallbackExecCtx* acec =
209
212
  grpc_core::ApplicationCallbackExecCtx::Get();
210
213
  if (!grpc_iomgr_is_any_background_poller_thread() &&
214
+ !grpc_event_engine::posix_engine::TimerManager::
215
+ IsTimerManagerThread() &&
211
216
  (acec == nullptr ||
212
217
  (acec->Flags() & GRPC_APP_CALLBACK_EXEC_CTX_FLAG_IS_INTERNAL_THREAD) ==
213
218
  0)) {
@@ -0,0 +1,24 @@
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
+
15
+ #include <grpc/support/port_platform.h>
16
+
17
+ #include "src/core/lib/surface/init_internally.h"
18
+
19
+ namespace grpc_core {
20
+
21
+ void (*InitInternally)();
22
+ void (*ShutdownInternally)();
23
+
24
+ } // namespace grpc_core
@@ -0,0 +1,28 @@
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
+
15
+ #ifndef GRPC_CORE_LIB_SURFACE_INIT_INTERNALLY_H
16
+ #define GRPC_CORE_LIB_SURFACE_INIT_INTERNALLY_H
17
+
18
+ namespace grpc_core {
19
+
20
+ // Function pointers that should be used in preference to grpc_init,
21
+ // grpc_shutdown from within core, but otherwise do the same thing.
22
+ // Avoids a build dependency cycle between grpc and grpc_base (and friends).
23
+ extern void (*InitInternally)();
24
+ extern void (*ShutdownInternally)();
25
+
26
+ } // namespace grpc_core
27
+
28
+ #endif // GRPC_CORE_LIB_SURFACE_INIT_INTERNALLY_H
@@ -45,7 +45,6 @@
45
45
  #include "src/core/lib/channel/channel_trace.h"
46
46
  #include "src/core/lib/channel/channelz.h"
47
47
  #include "src/core/lib/config/core_configuration.h"
48
- #include "src/core/lib/debug/stats.h"
49
48
  #include "src/core/lib/gpr/useful.h"
50
49
  #include "src/core/lib/gprpp/debug_location.h"
51
50
  #include "src/core/lib/gprpp/mpscq.h"
@@ -275,14 +274,12 @@ class Server::RealRequestMatcher : public RequestMatcherInterface {
275
274
  RequestedCall* rc =
276
275
  reinterpret_cast<RequestedCall*>(requests_per_cq_[cq_idx].TryPop());
277
276
  if (rc != nullptr) {
278
- GRPC_STATS_INC_SERVER_CQS_CHECKED(i);
279
277
  calld->SetState(CallData::CallState::ACTIVATED);
280
278
  calld->Publish(cq_idx, rc);
281
279
  return;
282
280
  }
283
281
  }
284
282
  // No cq to take the request found; queue it on the slow list.
285
- GRPC_STATS_INC_SERVER_SLOWPATH_REQUESTS_QUEUED();
286
283
  // We need to ensure that all the queues are empty. We do this under
287
284
  // the server mu_call_ lock to ensure that if something is added to
288
285
  // an empty request queue, it will block until the call is actually
@@ -306,7 +303,6 @@ class Server::RealRequestMatcher : public RequestMatcherInterface {
306
303
  return;
307
304
  }
308
305
  }
309
- GRPC_STATS_INC_SERVER_CQS_CHECKED(loop_count + requests_per_cq_.size());
310
306
  calld->SetState(CallData::CallState::ACTIVATED);
311
307
  calld->Publish(cq_idx, rc);
312
308
  }
@@ -794,7 +790,7 @@ void DonePublishedShutdown(void* /*done_arg*/, grpc_cq_completion* storage) {
794
790
  // connection is NOT closed until the server is done with all those calls.
795
791
  // -- Once there are no more calls in progress, the channel is closed.
796
792
  void Server::ShutdownAndNotify(grpc_completion_queue* cq, void* tag) {
797
- absl::Notification* await_requests = nullptr;
793
+ Notification* await_requests = nullptr;
798
794
  ChannelBroadcaster broadcaster;
799
795
  {
800
796
  // Wait for startup to be finished. Locks mu_global.
@@ -1525,7 +1521,6 @@ grpc_call_error grpc_server_request_call(
1525
1521
  grpc_completion_queue* cq_for_notification, void* tag) {
1526
1522
  grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
1527
1523
  grpc_core::ExecCtx exec_ctx;
1528
- GRPC_STATS_INC_SERVER_REQUESTED_CALLS();
1529
1524
  GRPC_API_TRACE(
1530
1525
  "grpc_server_request_call("
1531
1526
  "server=%p, call=%p, details=%p, initial_metadata=%p, "
@@ -1546,7 +1541,6 @@ grpc_call_error grpc_server_request_registered_call(
1546
1541
  grpc_completion_queue* cq_for_notification, void* tag_new) {
1547
1542
  grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
1548
1543
  grpc_core::ExecCtx exec_ctx;
1549
- GRPC_STATS_INC_SERVER_REQUESTED_CALLS();
1550
1544
  auto* rm =
1551
1545
  static_cast<grpc_core::Server::RegisteredMethod*>(registered_method);
1552
1546
  GRPC_API_TRACE(
@@ -33,7 +33,6 @@
33
33
  #include "absl/base/thread_annotations.h"
34
34
  #include "absl/memory/memory.h"
35
35
  #include "absl/status/statusor.h"
36
- #include "absl/synchronization/notification.h"
37
36
  #include "absl/types/optional.h"
38
37
 
39
38
  #include <grpc/grpc.h>
@@ -49,6 +48,7 @@
49
48
  #include "src/core/lib/debug/trace.h"
50
49
  #include "src/core/lib/gprpp/cpp_impl_of.h"
51
50
  #include "src/core/lib/gprpp/dual_ref_counted.h"
51
+ #include "src/core/lib/gprpp/notification.h"
52
52
  #include "src/core/lib/gprpp/orphanable.h"
53
53
  #include "src/core/lib/gprpp/ref_counted_ptr.h"
54
54
  #include "src/core/lib/gprpp/sync.h"
@@ -58,7 +58,6 @@
58
58
  #include "src/core/lib/iomgr/endpoint.h"
59
59
  #include "src/core/lib/iomgr/error.h"
60
60
  #include "src/core/lib/iomgr/iomgr_fwd.h"
61
- #include "src/core/lib/iomgr/pollset.h"
62
61
  #include "src/core/lib/slice/slice.h"
63
62
  #include "src/core/lib/surface/channel.h"
64
63
  #include "src/core/lib/surface/completion_queue.h"
@@ -420,14 +419,14 @@ class Server : public InternallyRefCounted<Server>,
420
419
  }
421
420
  // Returns a notification pointer to wait on if there are requests in-flight,
422
421
  // or null.
423
- absl::Notification* ShutdownUnrefOnShutdownCall()
422
+ Notification* ShutdownUnrefOnShutdownCall()
424
423
  ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_global_) GRPC_MUST_USE_RESULT {
425
424
  if (shutdown_refs_.fetch_sub(1, std::memory_order_acq_rel) == 1) {
426
425
  // There is no request in-flight.
427
426
  MaybeFinishShutdown();
428
427
  return nullptr;
429
428
  }
430
- requests_complete_ = absl::make_unique<absl::Notification>();
429
+ requests_complete_ = absl::make_unique<Notification>();
431
430
  return requests_complete_.get();
432
431
  }
433
432
 
@@ -479,8 +478,7 @@ class Server : public InternallyRefCounted<Server>,
479
478
  std::atomic<int> shutdown_refs_{1};
480
479
  bool shutdown_published_ ABSL_GUARDED_BY(mu_global_) = false;
481
480
  std::vector<ShutdownTag> shutdown_tags_ ABSL_GUARDED_BY(mu_global_);
482
- std::unique_ptr<absl::Notification> requests_complete_
483
- ABSL_GUARDED_BY(mu_global_);
481
+ std::unique_ptr<Notification> requests_complete_ ABSL_GUARDED_BY(mu_global_);
484
482
 
485
483
  std::list<ChannelData*> channels_;
486
484
 
@@ -23,6 +23,6 @@
23
23
 
24
24
  #include <grpc/grpc.h>
25
25
 
26
- const char* grpc_version_string(void) { return "27.0.0"; }
26
+ const char* grpc_version_string(void) { return "28.0.0"; }
27
27
 
28
- const char* grpc_g_stands_for(void) { return "gamma"; }
28
+ const char* grpc_g_stands_for(void) { return "galley"; }
@@ -25,8 +25,6 @@
25
25
 
26
26
  #include <algorithm>
27
27
 
28
- #include "src/core/lib/iomgr/exec_ctx.h"
29
-
30
28
  grpc_core::TraceFlag grpc_bdp_estimator_trace(false, "bdp_estimator");
31
29
 
32
30
  namespace grpc_core {
@@ -82,7 +80,7 @@ Timestamp BdpEstimator::CompletePing() {
82
80
  }
83
81
  ping_state_ = PingState::UNSCHEDULED;
84
82
  accumulator_ = 0;
85
- return ExecCtx::Get()->Now() + inter_ping_delay_;
83
+ return Timestamp::Now() + inter_ping_delay_;
86
84
  }
87
85
 
88
86
  } // namespace grpc_core
@@ -24,7 +24,6 @@
24
24
  #include "absl/strings/match.h"
25
25
  #include "absl/strings/str_cat.h"
26
26
 
27
- #include "src/core/lib/iomgr/exec_ctx.h"
28
27
  #include "src/core/lib/transport/timeout_encoding.h"
29
28
 
30
29
  namespace grpc_core {
@@ -120,11 +119,11 @@ GrpcTimeoutMetadata::ValueType GrpcTimeoutMetadata::MementoToValue(
120
119
  if (timeout == Duration::Infinity()) {
121
120
  return Timestamp::InfFuture();
122
121
  }
123
- return ExecCtx::Get()->Now() + timeout;
122
+ return Timestamp::Now() + timeout;
124
123
  }
125
124
 
126
125
  Slice GrpcTimeoutMetadata::Encode(ValueType x) {
127
- return Timeout::FromDuration(x - ExecCtx::Get()->Now()).Encode();
126
+ return Timeout::FromDuration(x - Timestamp::Now()).Encode();
128
127
  }
129
128
 
130
129
  TeMetadata::MementoType TeMetadata::ParseMemento(
@@ -40,7 +40,7 @@
40
40
 
41
41
  #include "src/core/lib/compression/compression_internal.h"
42
42
  #include "src/core/lib/gprpp/chunked_vector.h"
43
- #include "src/core/lib/gprpp/table.h"
43
+ #include "src/core/lib/gprpp/packed_table.h"
44
44
  #include "src/core/lib/gprpp/time.h"
45
45
  #include "src/core/lib/resource_quota/arena.h"
46
46
  #include "src/core/lib/slice/slice.h"
@@ -93,7 +93,7 @@ struct ContentTypeMetadata {
93
93
  // gRPC says that content-type can be application/grpc[;something]
94
94
  // Core has only ever verified the prefix.
95
95
  // IF we want to start verifying more, we can expand this type.
96
- enum ValueType {
96
+ enum ValueType : uint8_t {
97
97
  kApplicationGrpc,
98
98
  kEmpty,
99
99
  kInvalid,
@@ -112,7 +112,7 @@ struct ContentTypeMetadata {
112
112
  // scheme metadata trait.
113
113
  struct HttpSchemeMetadata {
114
114
  static constexpr bool kRepeatable = false;
115
- enum ValueType {
115
+ enum ValueType : uint8_t {
116
116
  kHttp,
117
117
  kHttps,
118
118
  kInvalid,
@@ -134,7 +134,7 @@ struct HttpSchemeMetadata {
134
134
  // method metadata trait.
135
135
  struct HttpMethodMetadata {
136
136
  static constexpr bool kRepeatable = false;
137
- enum ValueType {
137
+ enum ValueType : uint8_t {
138
138
  kPost,
139
139
  kGet,
140
140
  kPut,
@@ -498,7 +498,7 @@ class ParseHelper {
498
498
  return ParsedMetadata<Container>(
499
499
  trait,
500
500
  ParseValueToMemento<typename Trait::MementoType, Trait::ParseMemento>(),
501
- transport_size_);
501
+ static_cast<uint32_t>(transport_size_));
502
502
  }
503
503
 
504
504
  GPR_ATTRIBUTE_NOINLINE ParsedMetadata<Container> NotFound(
@@ -1045,7 +1045,9 @@ class MetadataMap {
1045
1045
  // void Encode(string_view key, Slice value);
1046
1046
  template <typename Encoder>
1047
1047
  void Encode(Encoder* encoder) const {
1048
- table_.ForEach(metadata_detail::EncodeWrapper<Encoder>{encoder});
1048
+ table_.template ForEachIn<metadata_detail::EncodeWrapper<Encoder>,
1049
+ Value<Traits>...>(
1050
+ metadata_detail::EncodeWrapper<Encoder>{encoder});
1049
1051
  for (const auto& unk : unknown_) {
1050
1052
  encoder->Encode(unk.first, unk.second);
1051
1053
  }
@@ -1222,7 +1224,7 @@ class MetadataMap {
1222
1224
  using Value = metadata_detail::Value<Which>;
1223
1225
 
1224
1226
  // Table of known metadata types.
1225
- Table<Value<Traits>...> table_;
1227
+ PackedTable<Value<Traits>...> table_;
1226
1228
  metadata_detail::UnknownMap unknown_;
1227
1229
  };
1228
1230
 
@@ -152,7 +152,7 @@ class ParsedMetadata {
152
152
  // Construct metadata from a string key, slice value pair.
153
153
  ParsedMetadata(Slice key, Slice value)
154
154
  : vtable_(ParsedMetadata::KeyValueVTable(key.as_string_view())),
155
- transport_size_(key.size() + value.size() + 32) {
155
+ transport_size_(static_cast<uint32_t>(key.size() + value.size() + 32)) {
156
156
  value_.pointer =
157
157
  new std::pair<Slice, Slice>(std::move(key), std::move(value));
158
158
  }
@@ -191,7 +191,9 @@ class ParsedMetadata {
191
191
  ParsedMetadata result;
192
192
  result.vtable_ = vtable_;
193
193
  result.value_ = value_;
194
- result.transport_size_ = TransportSize(key().length(), value.length());
194
+ result.transport_size_ =
195
+ TransportSize(static_cast<uint32_t>(key().length()),
196
+ static_cast<uint32_t>(value.length()));
195
197
  vtable_->with_new_value(&value, on_error, &result);
196
198
  return result;
197
199
  }
@@ -20,8 +20,6 @@
20
20
 
21
21
  #include "src/core/lib/transport/status_conversion.h"
22
22
 
23
- #include "src/core/lib/iomgr/exec_ctx.h"
24
-
25
23
  grpc_http2_error_code grpc_status_to_http2_error(grpc_status_code status) {
26
24
  switch (status) {
27
25
  case GRPC_STATUS_OK:
@@ -50,7 +48,7 @@ grpc_status_code grpc_http2_error_to_grpc_status(
50
48
  case GRPC_HTTP2_CANCEL:
51
49
  /* http2 cancel translates to STATUS_CANCELLED iff deadline hasn't been
52
50
  * exceeded */
53
- return grpc_core::ExecCtx::Get()->Now() > deadline
51
+ return grpc_core::Timestamp::Now() > deadline
54
52
  ? GRPC_STATUS_DEADLINE_EXCEEDED
55
53
  : GRPC_STATUS_CANCELLED;
56
54
  case GRPC_HTTP2_ENHANCE_YOUR_CALM:
@@ -35,6 +35,7 @@
35
35
  #include "src/core/lib/address_utils/parse_address.h"
36
36
  #include "src/core/lib/channel/channel_args.h"
37
37
  #include "src/core/lib/config/core_configuration.h"
38
+ #include "src/core/lib/event_engine/channel_args_endpoint_config.h"
38
39
  #include "src/core/lib/gprpp/debug_location.h"
39
40
  #include "src/core/lib/gprpp/ref_counted_ptr.h"
40
41
  #include "src/core/lib/gprpp/sync.h"
@@ -154,9 +155,11 @@ void TCPConnectHandshaker::DoHandshake(grpc_tcp_server_acceptor* /*acceptor*/,
154
155
  // we don't want to pass args->endpoint directly.
155
156
  // Instead pass endpoint_ and swap this endpoint to
156
157
  // args endpoint on success.
157
- grpc_tcp_client_connect(&connected_, &endpoint_to_destroy_,
158
- interested_parties_, args->args.ToC().get(), &addr_,
159
- args->deadline);
158
+ // TODO(hork): use EventEngine::Connect if(IsEventEngineClientEnabled())
159
+ grpc_tcp_client_connect(
160
+ &connected_, &endpoint_to_destroy_, interested_parties_,
161
+ grpc_event_engine::experimental::ChannelArgsEndpointConfig(args->args),
162
+ &addr_, args->deadline);
160
163
  }
161
164
 
162
165
  void TCPConnectHandshaker::Connected(void* arg, grpc_error_handle error) {
@@ -179,8 +182,9 @@ void TCPConnectHandshaker::Connected(void* arg, grpc_error_handle error) {
179
182
  self->shutdown_ = true;
180
183
  self->FinishLocked(error);
181
184
  } else {
182
- // The on_handshake_done_ is already as part of shutdown when connecting
183
- // So nothing to be done here other than unrefing the error.
185
+ // The on_handshake_done_ is already as part of shutdown when
186
+ // connecting So nothing to be done here other than unrefing the
187
+ // error.
184
188
  GRPC_ERROR_UNREF(error);
185
189
  }
186
190
  return;
@@ -49,7 +49,6 @@
49
49
  #include "src/core/lib/iomgr/error.h"
50
50
  #include "src/core/lib/iomgr/iomgr_fwd.h"
51
51
  #include "src/core/lib/iomgr/polling_entity.h"
52
- #include "src/core/lib/iomgr/pollset.h"
53
52
  #include "src/core/lib/promise/arena_promise.h"
54
53
  #include "src/core/lib/promise/context.h"
55
54
  #include "src/core/lib/promise/latch.h"
@@ -28,7 +28,6 @@
28
28
  #include "src/core/lib/iomgr/closure.h"
29
29
  #include "src/core/lib/iomgr/endpoint.h"
30
30
  #include "src/core/lib/iomgr/iomgr_fwd.h"
31
- #include "src/core/lib/iomgr/pollset.h"
32
31
  #include "src/core/lib/promise/arena_promise.h"
33
32
  #include "src/core/lib/resource_quota/arena.h"
34
33
  #include "src/core/lib/transport/transport.h"