grpc 1.20.0 → 1.21.0

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 (209) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +500 -29
  3. data/etc/roots.pem +146 -0
  4. data/include/grpc/grpc_security.h +1 -1
  5. data/include/grpc/impl/codegen/grpc_types.h +10 -7
  6. data/include/grpc/impl/codegen/port_platform.h +11 -1
  7. data/include/grpc/impl/codegen/slice.h +1 -21
  8. data/include/grpc/impl/codegen/status.h +2 -1
  9. data/include/grpc/slice.h +1 -1
  10. data/src/core/ext/filters/client_channel/backup_poller.cc +19 -13
  11. data/src/core/ext/filters/client_channel/backup_poller.h +3 -0
  12. data/src/core/ext/filters/client_channel/channel_connectivity.cc +1 -1
  13. data/src/core/ext/filters/client_channel/client_channel.cc +2084 -1673
  14. data/src/core/ext/filters/client_channel/client_channel_channelz.cc +2 -3
  15. data/src/core/ext/filters/client_channel/client_channel_plugin.cc +4 -0
  16. data/src/core/ext/filters/client_channel/health/health_check_client.cc +54 -49
  17. data/src/core/ext/filters/client_channel/health/health_check_client.h +20 -9
  18. data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +1 -2
  19. data/src/core/ext/filters/client_channel/http_connect_handshaker.h +1 -1
  20. data/src/core/ext/filters/client_channel/lb_policy.cc +3 -30
  21. data/src/core/ext/filters/client_channel/lb_policy.h +16 -25
  22. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +106 -81
  23. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +6 -2
  24. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +8 -12
  25. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +2 -2
  26. data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +1 -1
  27. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +57 -49
  28. data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +47 -41
  29. data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +24 -20
  30. data/src/core/ext/filters/client_channel/lb_policy/xds/xds.cc +989 -284
  31. data/src/core/ext/filters/client_channel/lb_policy_factory.h +4 -1
  32. data/src/core/ext/filters/client_channel/lb_policy_registry.cc +105 -2
  33. data/src/core/ext/filters/client_channel/lb_policy_registry.h +9 -2
  34. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +79 -36
  35. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc +84 -2
  36. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +3 -0
  37. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc +179 -0
  38. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +15 -3
  39. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +80 -4
  40. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +7 -13
  41. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc +2 -2
  42. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc +39 -0
  43. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc +0 -6
  44. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +2 -64
  45. data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc +28 -0
  46. data/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h +29 -0
  47. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +4 -4
  48. data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +367 -232
  49. data/src/core/ext/filters/client_channel/resolver_result_parsing.h +55 -76
  50. data/src/core/ext/filters/client_channel/resolving_lb_policy.cc +50 -39
  51. data/src/core/ext/filters/client_channel/resolving_lb_policy.h +18 -12
  52. data/src/core/ext/filters/client_channel/service_config.cc +247 -27
  53. data/src/core/ext/filters/client_channel/service_config.h +119 -166
  54. data/src/core/ext/filters/client_channel/subchannel.cc +46 -84
  55. data/src/core/ext/filters/client_channel/subchannel.h +7 -7
  56. data/src/core/ext/filters/deadline/deadline_filter.cc +3 -4
  57. data/src/core/ext/filters/deadline/deadline_filter.h +3 -2
  58. data/src/core/ext/filters/http/client/http_client_filter.cc +7 -5
  59. data/src/core/ext/filters/http/client/http_client_filter.h +1 -1
  60. data/src/core/ext/filters/http/client_authority_filter.cc +1 -1
  61. data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +4 -3
  62. data/src/core/ext/filters/http/server/http_server_filter.cc +18 -12
  63. data/src/core/ext/filters/message_size/message_size_filter.cc +118 -76
  64. data/src/core/ext/filters/message_size/message_size_filter.h +33 -0
  65. data/src/core/ext/transport/chttp2/alpn/alpn.h +1 -1
  66. data/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc +9 -7
  67. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +93 -60
  68. data/src/core/ext/transport/chttp2/transport/flow_control.h +1 -1
  69. data/src/core/ext/transport/chttp2/transport/frame_settings.cc +4 -3
  70. data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +3 -3
  71. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +8 -2
  72. data/src/core/ext/transport/chttp2/transport/hpack_table.cc +2 -2
  73. data/src/core/ext/transport/chttp2/transport/incoming_metadata.cc +1 -1
  74. data/src/core/ext/transport/chttp2/transport/incoming_metadata.h +3 -2
  75. data/src/core/ext/transport/chttp2/transport/internal.h +35 -23
  76. data/src/core/ext/transport/chttp2/transport/parsing.cc +4 -4
  77. data/src/core/ext/transport/chttp2/transport/stream_lists.cc +3 -3
  78. data/src/core/ext/transport/chttp2/transport/writing.cc +61 -27
  79. data/src/core/ext/transport/inproc/inproc_transport.cc +18 -18
  80. data/src/core/lib/channel/channel_args.cc +0 -101
  81. data/src/core/lib/channel/channel_args.h +0 -37
  82. data/src/core/lib/channel/channel_stack.h +9 -5
  83. data/src/core/lib/channel/channelz_registry.cc +1 -1
  84. data/src/core/lib/channel/connected_channel.cc +2 -2
  85. data/src/core/lib/channel/context.h +3 -0
  86. data/src/core/lib/channel/handshaker.cc +4 -4
  87. data/src/core/lib/channel/handshaker.h +1 -1
  88. data/src/core/lib/compression/compression_args.cc +127 -0
  89. data/src/core/lib/compression/compression_args.h +55 -0
  90. data/src/core/lib/debug/trace.cc +13 -7
  91. data/src/core/lib/debug/trace.h +12 -0
  92. data/src/core/lib/gpr/arena.h +13 -9
  93. data/src/core/lib/gpr/env.h +2 -5
  94. data/src/core/lib/gpr/env_linux.cc +6 -1
  95. data/src/core/lib/gpr/env_posix.cc +5 -0
  96. data/src/core/lib/gpr/env_windows.cc +7 -5
  97. data/src/core/lib/gpr/log.cc +9 -13
  98. data/src/core/lib/gpr/string.cc +12 -6
  99. data/src/core/lib/gpr/string.h +4 -2
  100. data/src/core/lib/gpr/time_posix.cc +13 -0
  101. data/src/core/lib/gprpp/arena.cc +103 -0
  102. data/src/core/lib/gprpp/arena.h +121 -0
  103. data/src/core/lib/gprpp/fork.cc +12 -29
  104. data/src/core/lib/gprpp/global_config.h +87 -0
  105. data/src/core/lib/gprpp/global_config_custom.h +29 -0
  106. data/src/core/lib/gprpp/global_config_env.cc +135 -0
  107. data/src/core/lib/gprpp/global_config_env.h +131 -0
  108. data/src/core/lib/gprpp/global_config_generic.h +44 -0
  109. data/src/core/lib/gprpp/map.h +419 -0
  110. data/src/core/lib/gprpp/optional.h +1 -0
  111. data/src/core/lib/gprpp/orphanable.h +2 -2
  112. data/src/core/lib/gprpp/{mutex_lock.h → pair.h} +15 -19
  113. data/src/core/lib/gprpp/ref_counted.h +18 -2
  114. data/src/core/lib/gprpp/sync.h +126 -0
  115. data/src/core/lib/http/parser.cc +1 -1
  116. data/src/core/lib/iomgr/call_combiner.cc +84 -90
  117. data/src/core/lib/iomgr/call_combiner.h +75 -82
  118. data/src/core/lib/iomgr/cfstream_handle.cc +202 -0
  119. data/src/core/lib/iomgr/cfstream_handle.h +82 -0
  120. data/src/core/lib/iomgr/combiner.h +1 -1
  121. data/src/core/lib/iomgr/endpoint_cfstream.cc +375 -0
  122. data/src/core/lib/iomgr/endpoint_cfstream.h +49 -0
  123. data/src/core/lib/iomgr/endpoint_pair_windows.cc +2 -2
  124. data/src/core/lib/iomgr/error.h +23 -0
  125. data/src/core/lib/iomgr/error_cfstream.cc +52 -0
  126. data/src/core/lib/iomgr/error_cfstream.h +31 -0
  127. data/src/core/lib/iomgr/ev_epoll1_linux.cc +34 -27
  128. data/src/core/lib/iomgr/ev_epollex_linux.cc +33 -33
  129. data/src/core/lib/iomgr/ev_poll_posix.cc +7 -7
  130. data/src/core/lib/iomgr/ev_posix.cc +15 -13
  131. data/src/core/lib/iomgr/ev_posix.h +4 -1
  132. data/src/core/lib/iomgr/executor.cc +13 -9
  133. data/src/core/lib/iomgr/fork_posix.cc +0 -1
  134. data/src/core/lib/iomgr/internal_errqueue.cc +1 -1
  135. data/src/core/lib/iomgr/iomgr.cc +6 -5
  136. data/src/core/lib/iomgr/iomgr_custom.cc +3 -0
  137. data/src/core/lib/iomgr/iomgr_custom.h +2 -0
  138. data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +93 -0
  139. data/src/core/lib/iomgr/iomgr_windows.cc +1 -0
  140. data/src/core/lib/iomgr/lockfree_event.cc +3 -3
  141. data/src/core/lib/iomgr/port.h +11 -0
  142. data/src/core/lib/iomgr/resource_quota.cc +40 -37
  143. data/src/core/lib/iomgr/socket_utils_common_posix.cc +6 -2
  144. data/src/core/lib/iomgr/socket_windows.cc +19 -0
  145. data/src/core/lib/iomgr/socket_windows.h +8 -0
  146. data/src/core/lib/iomgr/tcp_client_cfstream.cc +216 -0
  147. data/src/core/lib/iomgr/tcp_client_custom.cc +2 -2
  148. data/src/core/lib/iomgr/tcp_client_posix.cc +3 -3
  149. data/src/core/lib/iomgr/tcp_client_windows.cc +1 -1
  150. data/src/core/lib/iomgr/tcp_custom.cc +9 -9
  151. data/src/core/lib/iomgr/tcp_posix.cc +41 -41
  152. data/src/core/lib/iomgr/tcp_server_custom.cc +3 -3
  153. data/src/core/lib/iomgr/tcp_server_posix.cc +14 -1
  154. data/src/core/lib/iomgr/tcp_server_windows.cc +2 -2
  155. data/src/core/lib/iomgr/tcp_windows.cc +7 -9
  156. data/src/core/lib/iomgr/timer_generic.cc +16 -16
  157. data/src/core/lib/iomgr/timer_manager.cc +12 -11
  158. data/src/core/lib/profiling/basic_timers.cc +10 -4
  159. data/src/core/lib/security/context/security_context.cc +6 -7
  160. data/src/core/lib/security/context/security_context.h +3 -4
  161. data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +1 -1
  162. data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +2 -3
  163. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +1 -1
  164. data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +7 -7
  165. data/src/core/lib/security/security_connector/load_system_roots_linux.cc +7 -5
  166. data/src/core/lib/security/security_connector/security_connector.cc +0 -1
  167. data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +3 -2
  168. data/src/core/lib/security/security_connector/ssl_utils.cc +30 -26
  169. data/src/core/lib/security/security_connector/ssl_utils.h +5 -1
  170. data/src/core/lib/security/transport/client_auth_filter.cc +7 -11
  171. data/src/core/lib/security/transport/secure_endpoint.cc +4 -4
  172. data/src/core/lib/security/transport/server_auth_filter.cc +2 -3
  173. data/src/core/lib/slice/slice.cc +99 -116
  174. data/src/core/lib/slice/slice_buffer.cc +5 -0
  175. data/src/core/lib/slice/slice_intern.cc +38 -95
  176. data/src/core/lib/slice/slice_internal.h +200 -2
  177. data/src/core/lib/surface/api_trace.h +1 -1
  178. data/src/core/lib/surface/call.cc +41 -35
  179. data/src/core/lib/surface/call.h +7 -2
  180. data/src/core/lib/surface/call_details.cc +0 -1
  181. data/src/core/lib/surface/completion_queue.cc +36 -27
  182. data/src/core/lib/surface/init.cc +3 -4
  183. data/src/core/lib/surface/lame_client.cc +1 -1
  184. data/src/core/lib/surface/server.cc +18 -25
  185. data/src/core/lib/surface/version.cc +1 -1
  186. data/src/core/lib/transport/bdp_estimator.cc +3 -3
  187. data/src/core/lib/transport/bdp_estimator.h +2 -2
  188. data/src/core/lib/transport/connectivity_state.cc +10 -40
  189. data/src/core/lib/transport/connectivity_state.h +0 -8
  190. data/src/core/lib/transport/error_utils.cc +12 -0
  191. data/src/core/lib/transport/metadata.cc +206 -278
  192. data/src/core/lib/transport/metadata.h +205 -10
  193. data/src/core/lib/transport/static_metadata.cc +108 -116
  194. data/src/core/lib/transport/static_metadata.h +1 -2
  195. data/src/core/lib/transport/status_metadata.cc +3 -3
  196. data/src/core/lib/transport/transport.cc +29 -66
  197. data/src/core/lib/transport/transport.h +36 -8
  198. data/src/core/lib/transport/transport_impl.h +1 -1
  199. data/src/core/tsi/fake_transport_security.cc +4 -4
  200. data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +1 -1
  201. data/src/core/tsi/ssl_transport_security.cc +1 -1
  202. data/src/ruby/ext/grpc/rb_grpc.c +1 -1
  203. data/src/ruby/lib/grpc/errors.rb +22 -3
  204. data/src/ruby/lib/grpc/generic/bidi_call.rb +1 -1
  205. data/src/ruby/lib/grpc/generic/rpc_server.rb +1 -1
  206. data/src/ruby/lib/grpc/version.rb +1 -1
  207. data/src/ruby/spec/errors_spec.rb +141 -0
  208. metadata +57 -33
  209. data/src/core/lib/gpr/arena.cc +0 -192
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.20.0
4
+ version: 1.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - gRPC Authors
8
8
  autorequire:
9
9
  bindir: src/ruby/bin
10
10
  cert_chain: []
11
- date: 2019-04-15 00:00:00.000000000 Z
11
+ date: 2019-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.0.0
33
+ version: '1.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.0.0
40
+ version: '1.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -332,13 +332,17 @@ files:
332
332
  - src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
333
333
  - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc
334
334
  - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
335
+ - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc
335
336
  - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
336
337
  - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc
337
338
  - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
338
339
  - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
339
340
  - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc
341
+ - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc
340
342
  - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc
341
343
  - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc
344
+ - src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc
345
+ - src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h
342
346
  - src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
343
347
  - src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
344
348
  - src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h
@@ -468,6 +472,8 @@ files:
468
472
  - src/core/lib/channel/status_util.h
469
473
  - src/core/lib/compression/algorithm_metadata.h
470
474
  - src/core/lib/compression/compression.cc
475
+ - src/core/lib/compression/compression_args.cc
476
+ - src/core/lib/compression/compression_args.h
471
477
  - src/core/lib/compression/compression_internal.cc
472
478
  - src/core/lib/compression/compression_internal.h
473
479
  - src/core/lib/compression/message_compress.cc
@@ -486,7 +492,6 @@ files:
486
492
  - src/core/lib/debug/trace.h
487
493
  - src/core/lib/gpr/alloc.cc
488
494
  - src/core/lib/gpr/alloc.h
489
- - src/core/lib/gpr/arena.cc
490
495
  - src/core/lib/gpr/arena.h
491
496
  - src/core/lib/gpr/atm.cc
492
497
  - src/core/lib/gpr/cpu_iphone.cc
@@ -535,18 +540,27 @@ files:
535
540
  - src/core/lib/gpr/useful.h
536
541
  - src/core/lib/gpr/wrap_memcpy.cc
537
542
  - src/core/lib/gprpp/abstract.h
543
+ - src/core/lib/gprpp/arena.cc
544
+ - src/core/lib/gprpp/arena.h
538
545
  - src/core/lib/gprpp/atomic.h
539
546
  - src/core/lib/gprpp/debug_location.h
540
547
  - src/core/lib/gprpp/fork.cc
541
548
  - src/core/lib/gprpp/fork.h
549
+ - src/core/lib/gprpp/global_config.h
550
+ - src/core/lib/gprpp/global_config_custom.h
551
+ - src/core/lib/gprpp/global_config_env.cc
552
+ - src/core/lib/gprpp/global_config_env.h
553
+ - src/core/lib/gprpp/global_config_generic.h
542
554
  - src/core/lib/gprpp/inlined_vector.h
543
555
  - src/core/lib/gprpp/manual_constructor.h
556
+ - src/core/lib/gprpp/map.h
544
557
  - src/core/lib/gprpp/memory.h
545
- - src/core/lib/gprpp/mutex_lock.h
546
558
  - src/core/lib/gprpp/optional.h
547
559
  - src/core/lib/gprpp/orphanable.h
560
+ - src/core/lib/gprpp/pair.h
548
561
  - src/core/lib/gprpp/ref_counted.h
549
562
  - src/core/lib/gprpp/ref_counted_ptr.h
563
+ - src/core/lib/gprpp/sync.h
550
564
  - src/core/lib/gprpp/thd.h
551
565
  - src/core/lib/gprpp/thd_posix.cc
552
566
  - src/core/lib/gprpp/thd_windows.cc
@@ -562,18 +576,24 @@ files:
562
576
  - src/core/lib/iomgr/buffer_list.h
563
577
  - src/core/lib/iomgr/call_combiner.cc
564
578
  - src/core/lib/iomgr/call_combiner.h
579
+ - src/core/lib/iomgr/cfstream_handle.cc
580
+ - src/core/lib/iomgr/cfstream_handle.h
565
581
  - src/core/lib/iomgr/closure.h
566
582
  - src/core/lib/iomgr/combiner.cc
567
583
  - src/core/lib/iomgr/combiner.h
568
584
  - src/core/lib/iomgr/dynamic_annotations.h
569
585
  - src/core/lib/iomgr/endpoint.cc
570
586
  - src/core/lib/iomgr/endpoint.h
587
+ - src/core/lib/iomgr/endpoint_cfstream.cc
588
+ - src/core/lib/iomgr/endpoint_cfstream.h
571
589
  - src/core/lib/iomgr/endpoint_pair.h
572
590
  - src/core/lib/iomgr/endpoint_pair_posix.cc
573
591
  - src/core/lib/iomgr/endpoint_pair_uv.cc
574
592
  - src/core/lib/iomgr/endpoint_pair_windows.cc
575
593
  - src/core/lib/iomgr/error.cc
576
594
  - src/core/lib/iomgr/error.h
595
+ - src/core/lib/iomgr/error_cfstream.cc
596
+ - src/core/lib/iomgr/error_cfstream.h
577
597
  - src/core/lib/iomgr/error_internal.h
578
598
  - src/core/lib/iomgr/ev_epoll1_linux.cc
579
599
  - src/core/lib/iomgr/ev_epoll1_linux.h
@@ -609,6 +629,7 @@ files:
609
629
  - src/core/lib/iomgr/iomgr_internal.h
610
630
  - src/core/lib/iomgr/iomgr_posix.cc
611
631
  - src/core/lib/iomgr/iomgr_posix.h
632
+ - src/core/lib/iomgr/iomgr_posix_cfstream.cc
612
633
  - src/core/lib/iomgr/iomgr_uv.cc
613
634
  - src/core/lib/iomgr/iomgr_windows.cc
614
635
  - src/core/lib/iomgr/is_epollexclusive_available.cc
@@ -664,6 +685,7 @@ files:
664
685
  - src/core/lib/iomgr/sys_epoll_wrapper.h
665
686
  - src/core/lib/iomgr/tcp_client.cc
666
687
  - src/core/lib/iomgr/tcp_client.h
688
+ - src/core/lib/iomgr/tcp_client_cfstream.cc
667
689
  - src/core/lib/iomgr/tcp_client_custom.cc
668
690
  - src/core/lib/iomgr/tcp_client_posix.cc
669
691
  - src/core/lib/iomgr/tcp_client_posix.h
@@ -1004,6 +1026,7 @@ files:
1004
1026
  - src/ruby/spec/client_server_spec.rb
1005
1027
  - src/ruby/spec/compression_options_spec.rb
1006
1028
  - src/ruby/spec/error_sanity_spec.rb
1029
+ - src/ruby/spec/errors_spec.rb
1007
1030
  - src/ruby/spec/generic/active_call_spec.rb
1008
1031
  - src/ruby/spec/generic/client_interceptors_spec.rb
1009
1032
  - src/ruby/spec/generic/client_stub_spec.rb
@@ -1600,38 +1623,39 @@ signing_key:
1600
1623
  specification_version: 4
1601
1624
  summary: GRPC system in Ruby
1602
1625
  test_files:
1603
- - src/ruby/spec/google_rpc_status_utils_spec.rb
1604
- - src/ruby/spec/server_spec.rb
1605
- - src/ruby/spec/spec_helper.rb
1606
- - src/ruby/spec/call_spec.rb
1607
- - src/ruby/spec/testdata/client.pem
1608
- - src/ruby/spec/testdata/ca.pem
1609
- - src/ruby/spec/testdata/server1.pem
1610
- - src/ruby/spec/testdata/server1.key
1611
- - src/ruby/spec/testdata/README
1612
- - src/ruby/spec/testdata/client.key
1613
- - src/ruby/spec/server_credentials_spec.rb
1614
- - src/ruby/spec/channel_spec.rb
1615
- - src/ruby/spec/support/helpers.rb
1616
- - src/ruby/spec/support/services.rb
1617
- - src/ruby/spec/compression_options_spec.rb
1618
- - src/ruby/spec/client_server_spec.rb
1619
- - src/ruby/spec/pb/health/checker_spec.rb
1620
- - src/ruby/spec/pb/duplicate/codegen_spec.rb
1621
- - src/ruby/spec/pb/codegen/package_option_spec.rb
1622
- - src/ruby/spec/pb/codegen/grpc/testing/package_options.proto
1623
- - src/ruby/spec/error_sanity_spec.rb
1624
- - src/ruby/spec/channel_credentials_spec.rb
1625
1626
  - src/ruby/spec/client_auth_spec.rb
1627
+ - src/ruby/spec/error_sanity_spec.rb
1628
+ - src/ruby/spec/server_spec.rb
1629
+ - src/ruby/spec/generic/rpc_server_pool_spec.rb
1630
+ - src/ruby/spec/generic/interceptor_registry_spec.rb
1631
+ - src/ruby/spec/generic/active_call_spec.rb
1632
+ - src/ruby/spec/generic/server_interceptors_spec.rb
1626
1633
  - src/ruby/spec/generic/rpc_desc_spec.rb
1627
1634
  - src/ruby/spec/generic/rpc_server_spec.rb
1628
1635
  - src/ruby/spec/generic/client_stub_spec.rb
1629
1636
  - src/ruby/spec/generic/client_interceptors_spec.rb
1630
- - src/ruby/spec/generic/rpc_server_pool_spec.rb
1631
1637
  - src/ruby/spec/generic/service_spec.rb
1632
- - src/ruby/spec/generic/server_interceptors_spec.rb
1633
- - src/ruby/spec/generic/interceptor_registry_spec.rb
1634
- - src/ruby/spec/generic/active_call_spec.rb
1638
+ - src/ruby/spec/client_server_spec.rb
1639
+ - src/ruby/spec/channel_spec.rb
1635
1640
  - src/ruby/spec/time_consts_spec.rb
1636
- - src/ruby/spec/channel_connection_spec.rb
1641
+ - src/ruby/spec/errors_spec.rb
1642
+ - src/ruby/spec/google_rpc_status_utils_spec.rb
1637
1643
  - src/ruby/spec/call_credentials_spec.rb
1644
+ - src/ruby/spec/pb/codegen/grpc/testing/package_options.proto
1645
+ - src/ruby/spec/pb/codegen/package_option_spec.rb
1646
+ - src/ruby/spec/pb/health/checker_spec.rb
1647
+ - src/ruby/spec/pb/duplicate/codegen_spec.rb
1648
+ - src/ruby/spec/call_spec.rb
1649
+ - src/ruby/spec/server_credentials_spec.rb
1650
+ - src/ruby/spec/channel_connection_spec.rb
1651
+ - src/ruby/spec/channel_credentials_spec.rb
1652
+ - src/ruby/spec/testdata/ca.pem
1653
+ - src/ruby/spec/testdata/README
1654
+ - src/ruby/spec/testdata/server1.key
1655
+ - src/ruby/spec/testdata/client.pem
1656
+ - src/ruby/spec/testdata/client.key
1657
+ - src/ruby/spec/testdata/server1.pem
1658
+ - src/ruby/spec/support/helpers.rb
1659
+ - src/ruby/spec/support/services.rb
1660
+ - src/ruby/spec/compression_options_spec.rb
1661
+ - src/ruby/spec/spec_helper.rb
@@ -1,192 +0,0 @@
1
- /*
2
- *
3
- * Copyright 2017 gRPC authors.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- */
18
-
19
- #include <grpc/support/port_platform.h>
20
-
21
- #include "src/core/lib/gpr/arena.h"
22
-
23
- #include <string.h>
24
- #include <new>
25
-
26
- #include <grpc/support/alloc.h>
27
- #include <grpc/support/atm.h>
28
- #include <grpc/support/log.h>
29
- #include <grpc/support/sync.h>
30
-
31
- #include "src/core/lib/gpr/alloc.h"
32
- #include "src/core/lib/gpr/env.h"
33
- #include "src/core/lib/gprpp/memory.h"
34
-
35
- namespace {
36
- enum init_strategy {
37
- NO_INIT, // Do not initialize the arena blocks.
38
- ZERO_INIT, // Initialize arena blocks with 0.
39
- NON_ZERO_INIT, // Initialize arena blocks with a non-zero value.
40
- };
41
-
42
- gpr_once g_init_strategy_once = GPR_ONCE_INIT;
43
- init_strategy g_init_strategy = NO_INIT;
44
- } // namespace
45
-
46
- static void set_strategy_from_env() {
47
- char* str = gpr_getenv("GRPC_ARENA_INIT_STRATEGY");
48
- if (str == nullptr) {
49
- g_init_strategy = NO_INIT;
50
- } else if (strcmp(str, "zero_init") == 0) {
51
- g_init_strategy = ZERO_INIT;
52
- } else if (strcmp(str, "non_zero_init") == 0) {
53
- g_init_strategy = NON_ZERO_INIT;
54
- } else {
55
- g_init_strategy = NO_INIT;
56
- }
57
- gpr_free(str);
58
- }
59
-
60
- static void* gpr_arena_alloc_maybe_init(size_t size) {
61
- void* mem = gpr_malloc_aligned(size, GPR_MAX_ALIGNMENT);
62
- gpr_once_init(&g_init_strategy_once, set_strategy_from_env);
63
- if (GPR_UNLIKELY(g_init_strategy != NO_INIT)) {
64
- if (g_init_strategy == ZERO_INIT) {
65
- memset(mem, 0, size);
66
- } else { // NON_ZERO_INIT.
67
- memset(mem, 0xFE, size);
68
- }
69
- }
70
- return mem;
71
- }
72
-
73
- void gpr_arena_init() {
74
- gpr_once_init(&g_init_strategy_once, set_strategy_from_env);
75
- }
76
-
77
- // Uncomment this to use a simple arena that simply allocates the
78
- // requested amount of memory for each call to gpr_arena_alloc(). This
79
- // effectively eliminates the efficiency gain of using an arena, but it
80
- // may be useful for debugging purposes.
81
- //#define SIMPLE_ARENA_FOR_DEBUGGING
82
- #ifdef SIMPLE_ARENA_FOR_DEBUGGING
83
-
84
- struct gpr_arena {
85
- gpr_arena() { gpr_mu_init(&mu); }
86
- ~gpr_arena() {
87
- gpr_mu_destroy(&mu);
88
- for (size_t i = 0; i < num_ptrs; ++i) {
89
- gpr_free_aligned(ptrs[i]);
90
- }
91
- gpr_free(ptrs);
92
- }
93
-
94
- gpr_mu mu;
95
- void** ptrs = nullptr;
96
- size_t num_ptrs = 0;
97
- };
98
-
99
- gpr_arena* gpr_arena_create(size_t ignored_initial_size) {
100
- return grpc_core::New<gpr_arena>();
101
- }
102
-
103
- size_t gpr_arena_destroy(gpr_arena* arena) {
104
- grpc_core::Delete(arena);
105
- return 1; // Value doesn't matter, since it won't be used.
106
- }
107
-
108
- void* gpr_arena_alloc(gpr_arena* arena, size_t size) {
109
- gpr_mu_lock(&arena->mu);
110
- arena->ptrs =
111
- (void**)gpr_realloc(arena->ptrs, sizeof(void*) * (arena->num_ptrs + 1));
112
- void* retval = arena->ptrs[arena->num_ptrs++] =
113
- gpr_arena_alloc_maybe_init(size);
114
- gpr_mu_unlock(&arena->mu);
115
- return retval;
116
- }
117
-
118
- #else // SIMPLE_ARENA_FOR_DEBUGGING
119
-
120
- // TODO(roth): We currently assume that all callers need alignment of 16
121
- // bytes, which may be wrong in some cases. As part of converting the
122
- // arena API to C++, we should consider replacing gpr_arena_alloc() with a
123
- // template that takes the type of the value being allocated, which
124
- // would allow us to use the alignment actually needed by the caller.
125
-
126
- typedef struct zone {
127
- zone* next = nullptr;
128
- } zone;
129
-
130
- struct gpr_arena {
131
- gpr_arena(size_t initial_size)
132
- : initial_zone_size(initial_size), last_zone(&initial_zone) {
133
- gpr_mu_init(&arena_growth_mutex);
134
- }
135
- ~gpr_arena() {
136
- gpr_mu_destroy(&arena_growth_mutex);
137
- zone* z = initial_zone.next;
138
- while (z) {
139
- zone* next_z = z->next;
140
- z->~zone();
141
- gpr_free_aligned(z);
142
- z = next_z;
143
- }
144
- }
145
-
146
- // Keep track of the total used size. We use this in our call sizing
147
- // historesis.
148
- gpr_atm total_used = 0;
149
- size_t initial_zone_size;
150
- zone initial_zone;
151
- zone* last_zone;
152
- gpr_mu arena_growth_mutex;
153
- };
154
-
155
- gpr_arena* gpr_arena_create(size_t initial_size) {
156
- initial_size = GPR_ROUND_UP_TO_ALIGNMENT_SIZE(initial_size);
157
- return new (gpr_arena_alloc_maybe_init(
158
- GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(gpr_arena)) + initial_size))
159
- gpr_arena(initial_size);
160
- }
161
-
162
- size_t gpr_arena_destroy(gpr_arena* arena) {
163
- const gpr_atm size = gpr_atm_no_barrier_load(&arena->total_used);
164
- arena->~gpr_arena();
165
- gpr_free_aligned(arena);
166
- return static_cast<size_t>(size);
167
- }
168
-
169
- void* gpr_arena_alloc(gpr_arena* arena, size_t size) {
170
- size = GPR_ROUND_UP_TO_ALIGNMENT_SIZE(size);
171
- size_t begin = gpr_atm_no_barrier_fetch_add(&arena->total_used, size);
172
- if (begin + size <= arena->initial_zone_size) {
173
- return reinterpret_cast<char*>(arena) +
174
- GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(gpr_arena)) + begin;
175
- } else {
176
- // If the allocation isn't able to end in the initial zone, create a new
177
- // zone for this allocation, and any unused space in the initial zone is
178
- // wasted. This overflowing and wasting is uncommon because of our arena
179
- // sizing historesis (that is, most calls should have a large enough initial
180
- // zone and will not need to grow the arena).
181
- gpr_mu_lock(&arena->arena_growth_mutex);
182
- zone* z = new (gpr_arena_alloc_maybe_init(
183
- GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(zone)) + size)) zone();
184
- arena->last_zone->next = z;
185
- arena->last_zone = z;
186
- gpr_mu_unlock(&arena->arena_growth_mutex);
187
- return reinterpret_cast<char*>(z) +
188
- GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(zone));
189
- }
190
- }
191
-
192
- #endif // SIMPLE_ARENA_FOR_DEBUGGING