grpc 1.25.0 → 1.26.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 (278) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +782 -291
  3. data/include/grpc/impl/codegen/grpc_types.h +4 -0
  4. data/include/grpc/impl/codegen/port_platform.h +7 -0
  5. data/include/grpc/support/alloc.h +0 -16
  6. data/src/core/ext/filters/client_channel/backend_metric.cc +2 -2
  7. data/src/core/ext/filters/client_channel/backup_poller.cc +1 -1
  8. data/src/core/ext/filters/client_channel/channel_connectivity.cc +2 -2
  9. data/src/core/ext/filters/client_channel/client_channel.cc +95 -88
  10. data/src/core/ext/filters/client_channel/client_channel_channelz.cc +7 -7
  11. data/src/core/ext/filters/client_channel/client_channel_channelz.h +4 -2
  12. data/src/core/ext/filters/client_channel/client_channel_factory.cc +1 -1
  13. data/src/core/ext/filters/client_channel/client_channel_plugin.cc +3 -3
  14. data/src/core/ext/filters/client_channel/connector.h +40 -45
  15. data/src/core/ext/filters/client_channel/global_subchannel_pool.cc +10 -10
  16. data/src/core/ext/filters/client_channel/health/health_check_client.cc +16 -13
  17. data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +66 -37
  18. data/src/core/ext/filters/client_channel/http_proxy.cc +107 -116
  19. data/src/core/ext/filters/client_channel/http_proxy.h +5 -1
  20. data/src/core/ext/filters/client_channel/lb_policy.cc +3 -3
  21. data/src/core/ext/filters/client_channel/lb_policy.h +9 -5
  22. data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +10 -8
  23. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +18 -19
  24. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +4 -3
  25. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +4 -4
  26. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +1 -1
  27. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +3 -3
  28. data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +3 -3
  29. data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +6 -9
  30. data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +368 -0
  31. data/src/core/ext/filters/client_channel/lb_policy/xds/xds.cc +157 -77
  32. data/src/core/ext/filters/client_channel/lb_policy_registry.cc +5 -5
  33. data/src/core/ext/filters/client_channel/lb_policy_registry.h +1 -1
  34. data/src/core/ext/filters/client_channel/local_subchannel_pool.cc +8 -8
  35. data/src/core/ext/filters/client_channel/proxy_mapper.h +14 -34
  36. data/src/core/ext/filters/client_channel/proxy_mapper_registry.cc +46 -79
  37. data/src/core/ext/filters/client_channel/proxy_mapper_registry.h +23 -17
  38. data/src/core/ext/filters/client_channel/resolver.cc +2 -1
  39. data/src/core/ext/filters/client_channel/resolver.h +2 -2
  40. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +1 -1
  41. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc +4 -4
  42. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +1 -1
  43. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc +13 -10
  44. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +3 -2
  45. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +9 -8
  46. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +17 -16
  47. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +2 -2
  48. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc +4 -4
  49. data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +9 -9
  50. data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +5 -3
  51. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +1 -1
  52. data/src/core/ext/filters/client_channel/resolver_factory.h +3 -3
  53. data/src/core/ext/filters/client_channel/resolver_registry.cc +14 -12
  54. data/src/core/ext/filters/client_channel/resolver_registry.h +6 -4
  55. data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +6 -6
  56. data/src/core/ext/filters/client_channel/resolver_result_parsing.h +6 -6
  57. data/src/core/ext/filters/client_channel/resolving_lb_policy.cc +5 -5
  58. data/src/core/ext/filters/client_channel/resolving_lb_policy.h +3 -3
  59. data/src/core/ext/filters/client_channel/service_config.cc +15 -14
  60. data/src/core/ext/filters/client_channel/service_config.h +14 -19
  61. data/src/core/ext/filters/client_channel/subchannel.cc +38 -36
  62. data/src/core/ext/filters/client_channel/subchannel.h +11 -12
  63. data/src/core/ext/filters/client_channel/subchannel_interface.h +1 -1
  64. data/src/core/ext/filters/client_channel/xds/xds_api.cc +19 -9
  65. data/src/core/ext/filters/client_channel/xds/xds_api.h +19 -9
  66. data/src/core/ext/filters/client_channel/xds/xds_bootstrap.cc +3 -3
  67. data/src/core/ext/filters/client_channel/xds/xds_bootstrap.h +6 -5
  68. data/src/core/ext/filters/client_channel/xds/xds_client.cc +58 -31
  69. data/src/core/ext/filters/client_channel/xds/xds_client.h +20 -15
  70. data/src/core/ext/filters/client_channel/xds/xds_client_stats.cc +5 -3
  71. data/src/core/ext/filters/client_channel/xds/xds_client_stats.h +18 -15
  72. data/src/core/ext/filters/client_idle/client_idle_filter.cc +10 -10
  73. data/src/core/ext/filters/deadline/deadline_filter.cc +15 -13
  74. data/src/core/ext/filters/http/client/http_client_filter.cc +12 -12
  75. data/src/core/ext/filters/http/client_authority_filter.cc +3 -3
  76. data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +13 -7
  77. data/src/core/ext/filters/http/server/http_server_filter.cc +14 -13
  78. data/src/core/ext/filters/max_age/max_age_filter.cc +16 -14
  79. data/src/core/ext/filters/message_size/message_size_filter.cc +10 -8
  80. data/src/core/ext/filters/message_size/message_size_filter.h +1 -1
  81. data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc +9 -8
  82. data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +141 -174
  83. data/src/core/ext/transport/chttp2/client/chttp2_connector.h +31 -1
  84. data/src/core/ext/transport/chttp2/client/insecure/channel_create.cc +7 -6
  85. data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +14 -12
  86. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +8 -5
  87. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +46 -38
  88. data/src/core/ext/transport/chttp2/transport/context_list.cc +2 -2
  89. data/src/core/ext/transport/chttp2/transport/flow_control.h +0 -5
  90. data/src/core/ext/transport/chttp2/transport/frame_data.cc +6 -7
  91. data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +2 -2
  92. data/src/core/ext/transport/chttp2/transport/frame_ping.cc +1 -1
  93. data/src/core/ext/transport/chttp2/transport/frame_settings.cc +4 -3
  94. data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +5 -5
  95. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +11 -8
  96. data/src/core/ext/transport/chttp2/transport/internal.h +3 -3
  97. data/src/core/ext/transport/chttp2/transport/parsing.cc +4 -4
  98. data/src/core/ext/transport/chttp2/transport/writing.cc +3 -2
  99. data/src/core/ext/transport/inproc/inproc_transport.cc +65 -41
  100. data/src/core/ext/upb-generated/envoy/api/v2/auth/cert.upb.c +0 -1
  101. data/src/core/ext/upb-generated/envoy/api/v2/cds.upb.c +141 -70
  102. data/src/core/ext/upb-generated/envoy/api/v2/cds.upb.h +352 -118
  103. data/src/core/ext/upb-generated/envoy/api/v2/cluster/circuit_breaker.upb.c +0 -1
  104. data/src/core/ext/upb-generated/envoy/api/v2/cluster/filter.upb.c +0 -1
  105. data/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.c +8 -4
  106. data/src/core/ext/upb-generated/envoy/api/v2/cluster/outlier_detection.upb.h +65 -0
  107. data/src/core/ext/upb-generated/envoy/api/v2/core/address.upb.c +0 -1
  108. data/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.c +16 -2
  109. data/src/core/ext/upb-generated/envoy/api/v2/core/base.upb.h +36 -0
  110. data/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.c +12 -5
  111. data/src/core/ext/upb-generated/envoy/api/v2/core/config_source.upb.h +34 -0
  112. data/src/core/ext/upb-generated/envoy/api/v2/core/grpc_service.upb.c +1 -2
  113. data/src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.c +13 -12
  114. data/src/core/ext/upb-generated/envoy/api/v2/core/health_check.upb.h +28 -24
  115. data/src/core/ext/upb-generated/envoy/api/v2/core/http_uri.upb.c +0 -1
  116. data/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.c +5 -4
  117. data/src/core/ext/upb-generated/envoy/api/v2/core/protocol.upb.h +13 -0
  118. data/src/core/ext/upb-generated/envoy/api/v2/discovery.upb.c +0 -1
  119. data/src/core/ext/upb-generated/envoy/api/v2/eds.upb.c +23 -23
  120. data/src/core/ext/upb-generated/envoy/api/v2/eds.upb.h +48 -44
  121. data/src/core/ext/upb-generated/envoy/api/v2/endpoint/endpoint.upb.c +0 -1
  122. data/src/core/ext/upb-generated/envoy/api/v2/endpoint/load_report.upb.c +0 -1
  123. data/src/core/ext/upb-generated/envoy/type/http.upb.c +16 -0
  124. data/src/core/ext/upb-generated/envoy/type/http.upb.h +36 -0
  125. data/src/core/ext/upb-generated/envoy/type/percent.upb.c +0 -1
  126. data/src/core/ext/upb-generated/envoy/type/range.upb.c +0 -1
  127. data/src/core/lib/avl/avl.cc +1 -1
  128. data/src/core/lib/channel/channel_stack.cc +1 -1
  129. data/src/core/lib/channel/channel_stack.h +16 -4
  130. data/src/core/lib/channel/channel_trace.cc +4 -4
  131. data/src/core/lib/channel/channelz.cc +46 -46
  132. data/src/core/lib/channel/channelz.h +37 -35
  133. data/src/core/lib/channel/channelz_registry.cc +2 -2
  134. data/src/core/lib/channel/channelz_registry.h +1 -1
  135. data/src/core/lib/channel/connected_channel.cc +3 -2
  136. data/src/core/lib/channel/handshaker.cc +1 -1
  137. data/src/core/lib/channel/handshaker_registry.cc +5 -5
  138. data/src/core/lib/channel/handshaker_registry.h +3 -3
  139. data/src/core/lib/compression/message_compress.cc +3 -2
  140. data/src/core/lib/compression/stream_compression_identity.cc +5 -7
  141. data/src/core/lib/gpr/alloc.cc +4 -29
  142. data/src/core/lib/gpr/cpu_linux.cc +1 -1
  143. data/src/core/lib/gprpp/fork.cc +4 -4
  144. data/src/core/lib/gprpp/global_config_env.cc +7 -7
  145. data/src/core/lib/gprpp/global_config_env.h +2 -2
  146. data/src/core/lib/gprpp/host_port.cc +8 -8
  147. data/src/core/lib/gprpp/host_port.h +3 -3
  148. data/src/core/lib/gprpp/inlined_vector.h +13 -0
  149. data/src/core/lib/gprpp/map.h +2 -9
  150. data/src/core/lib/gprpp/memory.h +12 -98
  151. data/src/core/lib/gprpp/orphanable.h +3 -3
  152. data/src/core/lib/gprpp/ref_counted.h +3 -3
  153. data/src/core/lib/gprpp/ref_counted_ptr.h +1 -1
  154. data/src/core/lib/gprpp/string_view.h +45 -23
  155. data/src/core/lib/gprpp/thd.h +1 -1
  156. data/src/core/lib/gprpp/thd_posix.cc +6 -5
  157. data/src/core/lib/gprpp/thd_windows.cc +3 -3
  158. data/src/core/lib/http/httpcli.cc +1 -1
  159. data/src/core/lib/http/httpcli_security_connector.cc +3 -3
  160. data/src/core/lib/iomgr/buffer_list.cc +10 -5
  161. data/src/core/lib/iomgr/call_combiner.cc +7 -6
  162. data/src/core/lib/iomgr/call_combiner.h +4 -3
  163. data/src/core/lib/iomgr/cfstream_handle.cc +2 -2
  164. data/src/core/lib/iomgr/closure.h +33 -135
  165. data/src/core/lib/iomgr/combiner.cc +10 -17
  166. data/src/core/lib/iomgr/combiner.h +0 -2
  167. data/src/core/lib/iomgr/endpoint_cfstream.cc +2 -2
  168. data/src/core/lib/iomgr/endpoint_pair_posix.cc +1 -1
  169. data/src/core/lib/iomgr/ev_epoll1_linux.cc +3 -2
  170. data/src/core/lib/iomgr/ev_epollex_linux.cc +23 -13
  171. data/src/core/lib/iomgr/ev_poll_posix.cc +30 -17
  172. data/src/core/lib/iomgr/exec_ctx.cc +52 -5
  173. data/src/core/lib/iomgr/exec_ctx.h +6 -2
  174. data/src/core/lib/iomgr/executor.cc +16 -37
  175. data/src/core/lib/iomgr/executor.h +4 -7
  176. data/src/core/lib/iomgr/executor/threadpool.cc +4 -4
  177. data/src/core/lib/iomgr/iomgr_custom.cc +1 -1
  178. data/src/core/lib/iomgr/lockfree_event.cc +9 -8
  179. data/src/core/lib/iomgr/logical_thread.cc +103 -0
  180. data/src/core/lib/iomgr/logical_thread.h +52 -0
  181. data/src/core/lib/iomgr/pollset_custom.cc +5 -5
  182. data/src/core/lib/iomgr/pollset_set_custom.cc +9 -9
  183. data/src/core/lib/iomgr/pollset_windows.cc +16 -2
  184. data/src/core/lib/iomgr/port.h +3 -0
  185. data/src/core/lib/iomgr/resolve_address_custom.cc +4 -4
  186. data/src/core/lib/iomgr/resolve_address_posix.cc +8 -9
  187. data/src/core/lib/iomgr/resolve_address_windows.cc +4 -6
  188. data/src/core/lib/iomgr/resource_quota.cc +26 -21
  189. data/src/core/lib/iomgr/socket_utils_common_posix.cc +11 -0
  190. data/src/core/lib/iomgr/socket_windows.cc +2 -2
  191. data/src/core/lib/iomgr/tcp_client_cfstream.cc +2 -2
  192. data/src/core/lib/iomgr/tcp_client_custom.cc +2 -2
  193. data/src/core/lib/iomgr/tcp_client_posix.cc +5 -4
  194. data/src/core/lib/iomgr/tcp_client_windows.cc +2 -2
  195. data/src/core/lib/iomgr/tcp_custom.cc +10 -9
  196. data/src/core/lib/iomgr/tcp_posix.cc +19 -15
  197. data/src/core/lib/iomgr/tcp_server_custom.cc +3 -2
  198. data/src/core/lib/iomgr/tcp_server_posix.cc +5 -4
  199. data/src/core/lib/iomgr/tcp_server_windows.cc +5 -3
  200. data/src/core/lib/iomgr/tcp_windows.cc +16 -13
  201. data/src/core/lib/iomgr/timer_custom.cc +4 -3
  202. data/src/core/lib/iomgr/timer_generic.cc +11 -9
  203. data/src/core/lib/iomgr/udp_server.cc +16 -13
  204. data/src/core/lib/security/credentials/alts/alts_credentials.cc +8 -5
  205. data/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc +45 -57
  206. data/src/core/lib/security/credentials/composite/composite_credentials.cc +7 -6
  207. data/src/core/lib/security/credentials/credentials.cc +8 -8
  208. data/src/core/lib/security/credentials/credentials.h +5 -5
  209. data/src/core/lib/security/credentials/fake/fake_credentials.cc +5 -5
  210. data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +1 -1
  211. data/src/core/lib/security/credentials/iam/iam_credentials.cc +4 -4
  212. data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +4 -4
  213. data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +2 -2
  214. data/src/core/lib/security/credentials/local/local_credentials.cc +3 -3
  215. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +13 -11
  216. data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +6 -5
  217. data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +4 -4
  218. data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +5 -5
  219. data/src/core/lib/security/credentials/tls/spiffe_credentials.cc +2 -2
  220. data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +28 -22
  221. data/src/core/lib/security/security_connector/alts/alts_security_connector.h +5 -0
  222. data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +10 -10
  223. data/src/core/lib/security/security_connector/load_system_roots_linux.cc +2 -1
  224. data/src/core/lib/security/security_connector/local/local_security_connector.cc +8 -8
  225. data/src/core/lib/security/security_connector/security_connector.h +1 -1
  226. data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +9 -9
  227. data/src/core/lib/security/security_connector/ssl_utils.cc +5 -4
  228. data/src/core/lib/security/security_connector/tls/spiffe_security_connector.cc +14 -15
  229. data/src/core/lib/security/transport/client_auth_filter.cc +4 -3
  230. data/src/core/lib/security/transport/secure_endpoint.cc +9 -8
  231. data/src/core/lib/security/transport/security_handshaker.cc +67 -23
  232. data/src/core/lib/security/transport/server_auth_filter.cc +6 -5
  233. data/src/core/lib/security/transport/target_authority_table.h +1 -1
  234. data/src/core/lib/slice/b64.cc +3 -4
  235. data/src/core/lib/slice/b64.h +1 -2
  236. data/src/core/lib/slice/slice.cc +8 -13
  237. data/src/core/lib/surface/call.cc +19 -19
  238. data/src/core/lib/surface/call.h +6 -7
  239. data/src/core/lib/surface/call_log_batch.cc +1 -2
  240. data/src/core/lib/surface/channel.cc +17 -18
  241. data/src/core/lib/surface/channel.h +4 -19
  242. data/src/core/lib/surface/channel_ping.cc +1 -1
  243. data/src/core/lib/surface/completion_queue.cc +21 -22
  244. data/src/core/lib/surface/completion_queue_factory.cc +1 -1
  245. data/src/core/lib/surface/init.cc +1 -1
  246. data/src/core/lib/surface/init_secure.cc +2 -2
  247. data/src/core/lib/surface/lame_client.cc +10 -12
  248. data/src/core/lib/surface/server.cc +24 -18
  249. data/src/core/lib/surface/version.cc +2 -2
  250. data/src/core/lib/transport/byte_stream.cc +2 -2
  251. data/src/core/lib/transport/byte_stream.h +2 -1
  252. data/src/core/lib/transport/connectivity_state.cc +4 -4
  253. data/src/core/lib/transport/connectivity_state.h +2 -2
  254. data/src/core/lib/transport/metadata.cc +8 -10
  255. data/src/core/lib/transport/metadata.h +5 -8
  256. data/src/core/lib/transport/metadata_batch.cc +6 -0
  257. data/src/core/lib/transport/static_metadata.cc +2 -4
  258. data/src/core/lib/transport/status_metadata.cc +7 -0
  259. data/src/core/lib/transport/status_metadata.h +18 -0
  260. data/src/core/lib/transport/transport.cc +9 -7
  261. data/src/core/plugin_registry/grpc_plugin_registry.cc +4 -0
  262. data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +292 -43
  263. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +197 -46
  264. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +4 -2
  265. data/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h +5 -0
  266. data/src/core/tsi/ssl/session_cache/ssl_session.h +1 -1
  267. data/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc +1 -1
  268. data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +4 -4
  269. data/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc +1 -1
  270. data/src/core/tsi/ssl_transport_security.cc +2 -1
  271. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +0 -4
  272. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +0 -6
  273. data/src/ruby/lib/grpc/version.rb +1 -1
  274. data/third_party/upb/upb/decode.c +1 -0
  275. metadata +34 -32
  276. data/src/core/ext/filters/client_channel/connector.cc +0 -41
  277. data/src/core/ext/filters/client_channel/proxy_mapper.cc +0 -48
  278. data/src/core/lib/gprpp/set.h +0 -33
@@ -30,9 +30,11 @@
30
30
  #include <grpc/support/sync.h>
31
31
  #include <grpc/support/thd_id.h>
32
32
 
33
+ #include "src/core/lib/gprpp/sync.h"
33
34
  #include "src/core/lib/gprpp/thd.h"
34
35
  #include "src/core/lib/iomgr/closure.h"
35
36
  #include "src/core/lib/slice/slice_internal.h"
37
+ #include "src/core/lib/surface/channel.h"
36
38
  #include "src/core/tsi/alts/frame_protector/alts_frame_protector.h"
37
39
  #include "src/core/tsi/alts/handshaker/alts_handshaker_client.h"
38
40
  #include "src/core/tsi/alts/handshaker/alts_shared_resource.h"
@@ -42,7 +44,6 @@
42
44
  /* Main struct for ALTS TSI handshaker. */
43
45
  struct alts_tsi_handshaker {
44
46
  tsi_handshaker base;
45
- alts_handshaker_client* client;
46
47
  grpc_slice target_name;
47
48
  bool is_client;
48
49
  bool has_sent_start_message;
@@ -52,6 +53,16 @@ struct alts_tsi_handshaker {
52
53
  grpc_alts_credentials_options* options;
53
54
  alts_handshaker_client_vtable* client_vtable_for_testing;
54
55
  grpc_channel* channel;
56
+ bool use_dedicated_cq;
57
+ // mu synchronizes all fields below. Note these are the
58
+ // only fields that can be concurrently accessed (due to
59
+ // potential concurrency of tsi_handshaker_shutdown and
60
+ // tsi_handshaker_next).
61
+ gpr_mu mu;
62
+ alts_handshaker_client* client;
63
+ // shutdown effectively follows base.handshake_shutdown,
64
+ // but is synchronized by the mutex of this object.
65
+ bool shutdown;
55
66
  };
56
67
 
57
68
  /* Main struct for ALTS TSI handshaker result. */
@@ -63,6 +74,7 @@ typedef struct alts_tsi_handshaker_result {
63
74
  size_t unused_bytes_size;
64
75
  grpc_slice rpc_versions;
65
76
  bool is_client;
77
+ grpc_slice serialized_context;
66
78
  } alts_tsi_handshaker_result;
67
79
 
68
80
  static tsi_result handshaker_result_extract_peer(
@@ -74,7 +86,7 @@ static tsi_result handshaker_result_extract_peer(
74
86
  alts_tsi_handshaker_result* result =
75
87
  reinterpret_cast<alts_tsi_handshaker_result*>(
76
88
  const_cast<tsi_handshaker_result*>(self));
77
- GPR_ASSERT(kTsiAltsNumOfPeerProperties == 3);
89
+ GPR_ASSERT(kTsiAltsNumOfPeerProperties == 4);
78
90
  tsi_result ok = tsi_construct_peer(kTsiAltsNumOfPeerProperties, peer);
79
91
  int index = 0;
80
92
  if (ok != TSI_OK) {
@@ -104,7 +116,17 @@ static tsi_result handshaker_result_extract_peer(
104
116
  ok = tsi_construct_string_peer_property(
105
117
  TSI_ALTS_RPC_VERSIONS,
106
118
  reinterpret_cast<char*>(GRPC_SLICE_START_PTR(result->rpc_versions)),
107
- GRPC_SLICE_LENGTH(result->rpc_versions), &peer->properties[2]);
119
+ GRPC_SLICE_LENGTH(result->rpc_versions), &peer->properties[index]);
120
+ if (ok != TSI_OK) {
121
+ tsi_peer_destruct(peer);
122
+ gpr_log(GPR_ERROR, "Failed to set tsi peer property");
123
+ }
124
+ index++;
125
+ GPR_ASSERT(&peer->properties[index] != nullptr);
126
+ ok = tsi_construct_string_peer_property(
127
+ TSI_ALTS_CONTEXT,
128
+ reinterpret_cast<char*>(GRPC_SLICE_START_PTR(result->serialized_context)),
129
+ GRPC_SLICE_LENGTH(result->serialized_context), &peer->properties[index]);
108
130
  if (ok != TSI_OK) {
109
131
  tsi_peer_destruct(peer);
110
132
  gpr_log(GPR_ERROR, "Failed to set tsi peer property");
@@ -183,6 +205,7 @@ static void handshaker_result_destroy(tsi_handshaker_result* self) {
183
205
  gpr_free(result->key_data);
184
206
  gpr_free(result->unused_bytes);
185
207
  grpc_slice_unref_internal(result->rpc_versions);
208
+ grpc_slice_unref_internal(result->serialized_context);
186
209
  gpr_free(result);
187
210
  }
188
211
 
@@ -207,9 +230,10 @@ tsi_result alts_tsi_handshaker_result_create(grpc_gcp_HandshakerResp* resp,
207
230
  gpr_log(GPR_ERROR, "Invalid identity");
208
231
  return TSI_FAILED_PRECONDITION;
209
232
  }
210
- upb_strview service_account = grpc_gcp_Identity_service_account(identity);
211
- if (service_account.size == 0) {
212
- gpr_log(GPR_ERROR, "Invalid service account");
233
+ upb_strview peer_service_account =
234
+ grpc_gcp_Identity_service_account(identity);
235
+ if (peer_service_account.size == 0) {
236
+ gpr_log(GPR_ERROR, "Invalid peer service account");
213
237
  return TSI_FAILED_PRECONDITION;
214
238
  }
215
239
  upb_strview key_data = grpc_gcp_HandshakerResult_key_data(hresult);
@@ -223,21 +247,65 @@ tsi_result alts_tsi_handshaker_result_create(grpc_gcp_HandshakerResp* resp,
223
247
  gpr_log(GPR_ERROR, "Peer does not set RPC protocol versions.");
224
248
  return TSI_FAILED_PRECONDITION;
225
249
  }
250
+ upb_strview application_protocol =
251
+ grpc_gcp_HandshakerResult_application_protocol(hresult);
252
+ if (application_protocol.size == 0) {
253
+ gpr_log(GPR_ERROR, "Invalid application protocol");
254
+ return TSI_FAILED_PRECONDITION;
255
+ }
256
+ upb_strview record_protocol =
257
+ grpc_gcp_HandshakerResult_record_protocol(hresult);
258
+ if (record_protocol.size == 0) {
259
+ gpr_log(GPR_ERROR, "Invalid record protocol");
260
+ return TSI_FAILED_PRECONDITION;
261
+ }
262
+ const grpc_gcp_Identity* local_identity =
263
+ grpc_gcp_HandshakerResult_local_identity(hresult);
264
+ if (local_identity == nullptr) {
265
+ gpr_log(GPR_ERROR, "Invalid local identity");
266
+ return TSI_FAILED_PRECONDITION;
267
+ }
268
+ upb_strview local_service_account =
269
+ grpc_gcp_Identity_service_account(local_identity);
270
+ // We don't check if local service account is empty here
271
+ // because local identity could be empty in certain situations.
226
272
  alts_tsi_handshaker_result* result =
227
273
  static_cast<alts_tsi_handshaker_result*>(gpr_zalloc(sizeof(*result)));
228
274
  result->key_data =
229
275
  static_cast<char*>(gpr_zalloc(kAltsAes128GcmRekeyKeyLength));
230
276
  memcpy(result->key_data, key_data.data, kAltsAes128GcmRekeyKeyLength);
231
277
  result->peer_identity =
232
- static_cast<char*>(gpr_zalloc(service_account.size + 1));
233
- memcpy(result->peer_identity, service_account.data, service_account.size);
234
- upb::Arena arena;
278
+ static_cast<char*>(gpr_zalloc(peer_service_account.size + 1));
279
+ memcpy(result->peer_identity, peer_service_account.data,
280
+ peer_service_account.size);
281
+ upb::Arena rpc_versions_arena;
235
282
  bool serialized = grpc_gcp_rpc_protocol_versions_encode(
236
- peer_rpc_version, arena.ptr(), &result->rpc_versions);
283
+ peer_rpc_version, rpc_versions_arena.ptr(), &result->rpc_versions);
237
284
  if (!serialized) {
238
285
  gpr_log(GPR_ERROR, "Failed to serialize peer's RPC protocol versions.");
239
286
  return TSI_FAILED_PRECONDITION;
240
287
  }
288
+ upb::Arena context_arena;
289
+ grpc_gcp_AltsContext* context = grpc_gcp_AltsContext_new(context_arena.ptr());
290
+ grpc_gcp_AltsContext_set_application_protocol(context, application_protocol);
291
+ grpc_gcp_AltsContext_set_record_protocol(context, record_protocol);
292
+ // ALTS currently only supports the security level of 2,
293
+ // which is "grpc_gcp_INTEGRITY_AND_PRIVACY".
294
+ grpc_gcp_AltsContext_set_security_level(context, 2);
295
+ grpc_gcp_AltsContext_set_peer_service_account(context, peer_service_account);
296
+ grpc_gcp_AltsContext_set_local_service_account(context,
297
+ local_service_account);
298
+ grpc_gcp_AltsContext_set_peer_rpc_versions(
299
+ context, const_cast<grpc_gcp_RpcProtocolVersions*>(peer_rpc_version));
300
+ size_t serialized_ctx_length;
301
+ char* serialized_ctx = grpc_gcp_AltsContext_serialize(
302
+ context, context_arena.ptr(), &serialized_ctx_length);
303
+ if (serialized_ctx == nullptr) {
304
+ gpr_log(GPR_ERROR, "Failed to serialize peer's ALTS context.");
305
+ return TSI_FAILED_PRECONDITION;
306
+ }
307
+ result->serialized_context =
308
+ grpc_slice_from_copied_buffer(serialized_ctx, serialized_ctx_length);
241
309
  result->is_client = is_client;
242
310
  result->base.vtable = &result_vtable;
243
311
  *self = &result->base;
@@ -272,22 +340,11 @@ static void on_handshaker_service_resp_recv_dedicated(void* arg,
272
340
  nullptr, &resource->storage);
273
341
  }
274
342
 
275
- static tsi_result handshaker_next(
276
- tsi_handshaker* self, const unsigned char* received_bytes,
277
- size_t received_bytes_size, const unsigned char** /*bytes_to_send*/,
278
- size_t* /*bytes_to_send_size*/, tsi_handshaker_result** /*result*/,
279
- tsi_handshaker_on_next_done_cb cb, void* user_data) {
280
- if (self == nullptr || cb == nullptr) {
281
- gpr_log(GPR_ERROR, "Invalid arguments to handshaker_next()");
282
- return TSI_INVALID_ARGUMENT;
283
- }
284
- if (self->handshake_shutdown) {
285
- gpr_log(GPR_ERROR, "TSI handshake shutdown");
286
- return TSI_HANDSHAKE_SHUTDOWN;
287
- }
288
- alts_tsi_handshaker* handshaker =
289
- reinterpret_cast<alts_tsi_handshaker*>(self);
290
- tsi_result ok = TSI_OK;
343
+ /* Returns TSI_OK if and only if no error is encountered. */
344
+ static tsi_result alts_tsi_handshaker_continue_handshaker_next(
345
+ alts_tsi_handshaker* handshaker, const unsigned char* received_bytes,
346
+ size_t received_bytes_size, tsi_handshaker_on_next_done_cb cb,
347
+ void* user_data) {
291
348
  if (!handshaker->has_created_handshaker_client) {
292
349
  if (handshaker->channel == nullptr) {
293
350
  grpc_alts_shared_resource_dedicated_start(
@@ -303,15 +360,24 @@ static tsi_result handshaker_next(
303
360
  handshaker->channel == nullptr
304
361
  ? grpc_alts_get_shared_resource_dedicated()->channel
305
362
  : handshaker->channel;
306
- handshaker->client = alts_grpc_handshaker_client_create(
363
+ alts_handshaker_client* client = alts_grpc_handshaker_client_create(
307
364
  handshaker, channel, handshaker->handshaker_service_url,
308
365
  handshaker->interested_parties, handshaker->options,
309
366
  handshaker->target_name, grpc_cb, cb, user_data,
310
367
  handshaker->client_vtable_for_testing, handshaker->is_client);
311
- if (handshaker->client == nullptr) {
368
+ if (client == nullptr) {
312
369
  gpr_log(GPR_ERROR, "Failed to create ALTS handshaker client");
313
370
  return TSI_FAILED_PRECONDITION;
314
371
  }
372
+ {
373
+ grpc_core::MutexLock lock(&handshaker->mu);
374
+ GPR_ASSERT(handshaker->client == nullptr);
375
+ handshaker->client = client;
376
+ if (handshaker->shutdown) {
377
+ gpr_log(GPR_ERROR, "TSI handshake shutdown");
378
+ return TSI_HANDSHAKE_SHUTDOWN;
379
+ }
380
+ }
315
381
  handshaker->has_created_handshaker_client = true;
316
382
  }
317
383
  if (handshaker->channel == nullptr &&
@@ -324,18 +390,100 @@ static tsi_result handshaker_next(
324
390
  : grpc_slice_from_copied_buffer(
325
391
  reinterpret_cast<const char*>(received_bytes),
326
392
  received_bytes_size);
393
+ tsi_result ok = TSI_OK;
327
394
  if (!handshaker->has_sent_start_message) {
395
+ handshaker->has_sent_start_message = true;
328
396
  ok = handshaker->is_client
329
397
  ? alts_handshaker_client_start_client(handshaker->client)
330
398
  : alts_handshaker_client_start_server(handshaker->client, &slice);
331
- handshaker->has_sent_start_message = true;
399
+ // It's unsafe for the current thread to access any state in handshaker
400
+ // at this point, since alts_handshaker_client_start_client/server
401
+ // have potentially just started an op batch on the handshake call.
402
+ // The completion callback for that batch is unsynchronized and so
403
+ // can invoke the TSI next API callback from any thread, at which point
404
+ // there is nothing taking ownership of this handshaker to prevent it
405
+ // from being destroyed.
332
406
  } else {
333
407
  ok = alts_handshaker_client_next(handshaker->client, &slice);
334
408
  }
335
409
  grpc_slice_unref_internal(slice);
336
- if (ok != TSI_OK) {
337
- gpr_log(GPR_ERROR, "Failed to schedule ALTS handshaker requests");
338
- return ok;
410
+ return ok;
411
+ }
412
+
413
+ struct alts_tsi_handshaker_continue_handshaker_next_args {
414
+ alts_tsi_handshaker* handshaker;
415
+ std::unique_ptr<unsigned char> received_bytes;
416
+ size_t received_bytes_size;
417
+ tsi_handshaker_on_next_done_cb cb;
418
+ void* user_data;
419
+ grpc_closure closure;
420
+ };
421
+
422
+ static void alts_tsi_handshaker_create_channel(void* arg,
423
+ grpc_error* unused_error) {
424
+ alts_tsi_handshaker_continue_handshaker_next_args* next_args =
425
+ static_cast<alts_tsi_handshaker_continue_handshaker_next_args*>(arg);
426
+ alts_tsi_handshaker* handshaker = next_args->handshaker;
427
+ GPR_ASSERT(handshaker->channel == nullptr);
428
+ handshaker->channel = grpc_insecure_channel_create(
429
+ next_args->handshaker->handshaker_service_url, nullptr, nullptr);
430
+ tsi_result continue_next_result =
431
+ alts_tsi_handshaker_continue_handshaker_next(
432
+ handshaker, next_args->received_bytes.get(),
433
+ next_args->received_bytes_size, next_args->cb, next_args->user_data);
434
+ if (continue_next_result != TSI_OK) {
435
+ next_args->cb(continue_next_result, next_args->user_data, nullptr, 0,
436
+ nullptr);
437
+ }
438
+ delete next_args;
439
+ }
440
+
441
+ static tsi_result handshaker_next(
442
+ tsi_handshaker* self, const unsigned char* received_bytes,
443
+ size_t received_bytes_size, const unsigned char** /*bytes_to_send*/,
444
+ size_t* /*bytes_to_send_size*/, tsi_handshaker_result** /*result*/,
445
+ tsi_handshaker_on_next_done_cb cb, void* user_data) {
446
+ if (self == nullptr || cb == nullptr) {
447
+ gpr_log(GPR_ERROR, "Invalid arguments to handshaker_next()");
448
+ return TSI_INVALID_ARGUMENT;
449
+ }
450
+ alts_tsi_handshaker* handshaker =
451
+ reinterpret_cast<alts_tsi_handshaker*>(self);
452
+ {
453
+ grpc_core::MutexLock lock(&handshaker->mu);
454
+ if (handshaker->shutdown) {
455
+ gpr_log(GPR_ERROR, "TSI handshake shutdown");
456
+ return TSI_HANDSHAKE_SHUTDOWN;
457
+ }
458
+ }
459
+ if (handshaker->channel == nullptr && !handshaker->use_dedicated_cq) {
460
+ alts_tsi_handshaker_continue_handshaker_next_args* args =
461
+ new alts_tsi_handshaker_continue_handshaker_next_args();
462
+ args->handshaker = handshaker;
463
+ args->received_bytes = nullptr;
464
+ args->received_bytes_size = received_bytes_size;
465
+ if (received_bytes_size > 0) {
466
+ args->received_bytes = std::unique_ptr<unsigned char>(
467
+ static_cast<unsigned char*>(gpr_zalloc(received_bytes_size)));
468
+ memcpy(args->received_bytes.get(), received_bytes, received_bytes_size);
469
+ }
470
+ args->cb = cb;
471
+ args->user_data = user_data;
472
+ GRPC_CLOSURE_INIT(&args->closure, alts_tsi_handshaker_create_channel, args,
473
+ grpc_schedule_on_exec_ctx);
474
+ // We continue this handshaker_next call at the bottom of the ExecCtx just
475
+ // so that we can invoke grpc_channel_create at the bottom of the call
476
+ // stack. Doing so avoids potential lock cycles between g_init_mu and other
477
+ // mutexes within core that might be held on the current call stack
478
+ // (note that g_init_mu gets acquired during channel creation).
479
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, &args->closure, GRPC_ERROR_NONE);
480
+ } else {
481
+ tsi_result ok = alts_tsi_handshaker_continue_handshaker_next(
482
+ handshaker, received_bytes, received_bytes_size, cb, user_data);
483
+ if (ok != TSI_OK) {
484
+ gpr_log(GPR_ERROR, "Failed to schedule ALTS handshaker requests");
485
+ return ok;
486
+ }
339
487
  }
340
488
  return TSI_ASYNC;
341
489
  }
@@ -358,12 +506,16 @@ static tsi_result handshaker_next_dedicated(
358
506
 
359
507
  static void handshaker_shutdown(tsi_handshaker* self) {
360
508
  GPR_ASSERT(self != nullptr);
361
- if (self->handshake_shutdown) {
362
- return;
363
- }
364
509
  alts_tsi_handshaker* handshaker =
365
510
  reinterpret_cast<alts_tsi_handshaker*>(self);
366
- alts_handshaker_client_shutdown(handshaker->client);
511
+ grpc_core::MutexLock lock(&handshaker->mu);
512
+ if (handshaker->shutdown) {
513
+ return;
514
+ }
515
+ if (handshaker->client != nullptr) {
516
+ alts_handshaker_client_shutdown(handshaker->client);
517
+ }
518
+ handshaker->shutdown = true;
367
519
  }
368
520
 
369
521
  static void handshaker_destroy(tsi_handshaker* self) {
@@ -376,9 +528,10 @@ static void handshaker_destroy(tsi_handshaker* self) {
376
528
  grpc_slice_unref_internal(handshaker->target_name);
377
529
  grpc_alts_credentials_options_destroy(handshaker->options);
378
530
  if (handshaker->channel != nullptr) {
379
- grpc_channel_destroy(handshaker->channel);
531
+ grpc_channel_destroy_internal(handshaker->channel);
380
532
  }
381
533
  gpr_free(handshaker->handshaker_service_url);
534
+ gpr_mu_destroy(&handshaker->mu);
382
535
  gpr_free(handshaker);
383
536
  }
384
537
 
@@ -400,7 +553,8 @@ static const tsi_handshaker_vtable handshaker_vtable_dedicated = {
400
553
 
401
554
  bool alts_tsi_handshaker_has_shutdown(alts_tsi_handshaker* handshaker) {
402
555
  GPR_ASSERT(handshaker != nullptr);
403
- return handshaker->base.handshake_shutdown;
556
+ grpc_core::MutexLock lock(&handshaker->mu);
557
+ return handshaker->shutdown;
404
558
  }
405
559
 
406
560
  tsi_result alts_tsi_handshaker_create(
@@ -414,7 +568,8 @@ tsi_result alts_tsi_handshaker_create(
414
568
  }
415
569
  alts_tsi_handshaker* handshaker =
416
570
  static_cast<alts_tsi_handshaker*>(gpr_zalloc(sizeof(*handshaker)));
417
- bool use_dedicated_cq = interested_parties == nullptr;
571
+ gpr_mu_init(&handshaker->mu);
572
+ handshaker->use_dedicated_cq = interested_parties == nullptr;
418
573
  handshaker->client = nullptr;
419
574
  handshaker->is_client = is_client;
420
575
  handshaker->has_sent_start_message = false;
@@ -425,13 +580,9 @@ tsi_result alts_tsi_handshaker_create(
425
580
  handshaker->has_created_handshaker_client = false;
426
581
  handshaker->handshaker_service_url = gpr_strdup(handshaker_service_url);
427
582
  handshaker->options = grpc_alts_credentials_options_copy(options);
428
- handshaker->base.vtable =
429
- use_dedicated_cq ? &handshaker_vtable_dedicated : &handshaker_vtable;
430
- handshaker->channel =
431
- use_dedicated_cq
432
- ? nullptr
433
- : grpc_insecure_channel_create(handshaker->handshaker_service_url,
434
- nullptr, nullptr);
583
+ handshaker->base.vtable = handshaker->use_dedicated_cq
584
+ ? &handshaker_vtable_dedicated
585
+ : &handshaker_vtable;
435
586
  *self = &handshaker->base;
436
587
  return TSI_OK;
437
588
  }
@@ -28,13 +28,15 @@
28
28
  #include "src/core/tsi/alts/handshaker/alts_handshaker_client.h"
29
29
  #include "src/core/tsi/transport_security.h"
30
30
  #include "src/core/tsi/transport_security_interface.h"
31
+ #include "src/proto/grpc/gcp/altscontext.upb.h"
31
32
  #include "src/proto/grpc/gcp/handshaker.upb.h"
32
33
 
33
- #define TSI_ALTS_SERVICE_ACCOUNT_PEER_PROPERTY "service_accont"
34
+ #define TSI_ALTS_SERVICE_ACCOUNT_PEER_PROPERTY "service_account"
34
35
  #define TSI_ALTS_CERTIFICATE_TYPE "ALTS"
35
36
  #define TSI_ALTS_RPC_VERSIONS "rpc_versions"
37
+ #define TSI_ALTS_CONTEXT "alts_context"
36
38
 
37
- const size_t kTsiAltsNumOfPeerProperties = 3;
39
+ const size_t kTsiAltsNumOfPeerProperties = 4;
38
40
 
39
41
  typedef struct alts_tsi_handshaker alts_tsi_handshaker;
40
42
 
@@ -77,6 +77,11 @@ void alts_handshaker_client_set_cb_for_testing(
77
77
  grpc_closure* alts_handshaker_client_get_closure_for_testing(
78
78
  alts_handshaker_client* client);
79
79
 
80
+ void alts_handshaker_client_on_status_received_for_testing(
81
+ alts_handshaker_client* client, grpc_status_code status, grpc_error* error);
82
+
83
+ void alts_handshaker_client_ref_for_testing(alts_handshaker_client* c);
84
+
80
85
  } // namespace internal
81
86
  } // namespace grpc_core
82
87
 
@@ -57,7 +57,7 @@ class SslCachedSession {
57
57
  SslCachedSession& operator=(const SslCachedSession&) = delete;
58
58
 
59
59
  /// Create single cached instance of \a session.
60
- static grpc_core::UniquePtr<SslCachedSession> Create(SslSessionPtr session);
60
+ static std::unique_ptr<SslCachedSession> Create(SslSessionPtr session);
61
61
 
62
62
  virtual ~SslCachedSession() = default;
63
63
 
@@ -47,7 +47,7 @@ class BoringSslCachedSession : public SslCachedSession {
47
47
 
48
48
  } // namespace
49
49
 
50
- grpc_core::UniquePtr<SslCachedSession> SslCachedSession::Create(
50
+ std::unique_ptr<SslCachedSession> SslCachedSession::Create(
51
51
  SslSessionPtr session) {
52
52
  return grpc_core::MakeUnique<BoringSslCachedSession>(std::move(session));
53
53
  }
@@ -76,7 +76,7 @@ class SslSessionLRUCache::Node {
76
76
  friend class SslSessionLRUCache;
77
77
 
78
78
  grpc_slice key_;
79
- grpc_core::UniquePtr<SslCachedSession> session_;
79
+ std::unique_ptr<SslCachedSession> session_;
80
80
 
81
81
  Node* next_ = nullptr;
82
82
  Node* prev_ = nullptr;
@@ -92,7 +92,7 @@ SslSessionLRUCache::~SslSessionLRUCache() {
92
92
  Node* node = use_order_list_head_;
93
93
  while (node) {
94
94
  Node* next = node->next_;
95
- grpc_core::Delete(node);
95
+ delete node;
96
96
  node = next;
97
97
  }
98
98
  grpc_avl_unref(entry_by_key_, nullptr);
@@ -127,7 +127,7 @@ void SslSessionLRUCache::Put(const char* key, SslSessionPtr session) {
127
127
  return;
128
128
  }
129
129
  grpc_slice key_slice = grpc_slice_from_copied_string(key);
130
- node = grpc_core::New<Node>(key_slice, std::move(session));
130
+ node = new Node(key_slice, std::move(session));
131
131
  PushFront(node);
132
132
  entry_by_key_ = grpc_avl_add(entry_by_key_, node->AvlKey(), node, nullptr);
133
133
  AssertInvariants();
@@ -137,7 +137,7 @@ void SslSessionLRUCache::Put(const char* key, SslSessionPtr session) {
137
137
  Remove(node);
138
138
  // Order matters, key is destroyed after deleting node.
139
139
  entry_by_key_ = grpc_avl_remove(entry_by_key_, node->AvlKey(), nullptr);
140
- grpc_core::Delete(node);
140
+ delete node;
141
141
  AssertInvariants();
142
142
  }
143
143
  }