grpc 0.15.0 → 1.0.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 (93) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +127 -159
  3. data/etc/roots.pem +784 -509
  4. data/include/grpc/grpc_posix.h +8 -0
  5. data/include/grpc/impl/codegen/byte_buffer.h +5 -4
  6. data/include/grpc/impl/codegen/grpc_types.h +2 -0
  7. data/include/grpc/impl/codegen/port_platform.h +2 -1
  8. data/include/grpc/module.modulemap +15 -0
  9. data/src/core/ext/census/grpc_filter.c +3 -0
  10. data/src/core/ext/client_config/channel_connectivity.c +4 -3
  11. data/src/core/ext/client_config/client_channel.c +6 -0
  12. data/src/core/ext/client_config/subchannel.c +2 -0
  13. data/src/core/ext/client_config/subchannel_call_holder.c +2 -5
  14. data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.c +2 -1
  15. data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c +2 -1
  16. data/src/core/ext/transport/chttp2/transport/chttp2_transport.c +171 -104
  17. data/src/core/ext/transport/chttp2/transport/internal.h +5 -3
  18. data/src/core/ext/transport/chttp2/transport/parsing.c +4 -3
  19. data/src/core/ext/transport/chttp2/transport/status_conversion.c +8 -2
  20. data/src/core/ext/transport/chttp2/transport/status_conversion.h +1 -1
  21. data/src/core/lib/channel/channel_stack.c +12 -1
  22. data/src/core/lib/channel/channel_stack.h +5 -0
  23. data/src/core/lib/channel/http_client_filter.c +7 -1
  24. data/src/core/lib/debug/trace.c +6 -2
  25. data/src/core/lib/iomgr/error.c +62 -19
  26. data/src/core/lib/iomgr/error.h +10 -6
  27. data/src/core/lib/iomgr/ev_epoll_linux.c +1872 -0
  28. data/src/core/lib/{surface/surface_trace.h → iomgr/ev_epoll_linux.h} +11 -12
  29. data/src/core/lib/iomgr/ev_posix.c +9 -6
  30. data/src/core/lib/iomgr/ev_posix.h +3 -0
  31. data/src/core/lib/iomgr/network_status_tracker.c +121 -0
  32. data/{include/grpc/grpc_zookeeper.h → src/core/lib/iomgr/network_status_tracker.h} +8 -26
  33. data/src/core/lib/iomgr/socket_utils_common_posix.c +22 -0
  34. data/src/core/lib/iomgr/socket_utils_posix.h +3 -0
  35. data/src/core/lib/iomgr/tcp_posix.c +6 -2
  36. data/src/core/lib/iomgr/tcp_server.h +3 -0
  37. data/src/core/lib/iomgr/tcp_server_posix.c +114 -16
  38. data/src/core/lib/iomgr/tcp_server_windows.c +1 -0
  39. data/src/core/lib/iomgr/tcp_windows.c +5 -0
  40. data/src/core/lib/iomgr/udp_server.c +28 -16
  41. data/src/core/lib/iomgr/wakeup_fd_eventfd.c +4 -2
  42. data/src/core/lib/profiling/basic_timers.c +4 -4
  43. data/src/core/lib/security/credentials/composite/composite_credentials.c +4 -3
  44. data/src/core/lib/security/credentials/credentials.c +1 -1
  45. data/src/core/lib/security/credentials/credentials.h +4 -5
  46. data/src/core/lib/security/credentials/fake/fake_credentials.c +2 -2
  47. data/src/core/lib/security/credentials/iam/iam_credentials.c +1 -1
  48. data/src/core/lib/security/credentials/jwt/jwt_credentials.c +7 -6
  49. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.c +6 -4
  50. data/src/core/lib/security/credentials/plugin/plugin_credentials.c +4 -3
  51. data/src/core/lib/security/transport/client_auth_filter.c +10 -7
  52. data/src/core/lib/surface/byte_buffer_reader.c +6 -4
  53. data/src/core/lib/surface/call.c +64 -51
  54. data/src/core/lib/surface/call.h +0 -1
  55. data/src/core/lib/surface/channel.c +10 -8
  56. data/src/core/lib/surface/completion_queue.c +26 -12
  57. data/src/core/lib/surface/completion_queue.h +4 -0
  58. data/src/core/lib/surface/init.c +6 -1
  59. data/src/core/lib/surface/version.c +1 -1
  60. data/src/core/lib/transport/transport.c +62 -29
  61. data/src/core/lib/transport/transport.h +8 -5
  62. data/src/core/lib/transport/transport_op_string.c +14 -3
  63. data/src/ruby/ext/grpc/rb_byte_buffer.c +4 -1
  64. data/src/ruby/ext/grpc/rb_call.c +87 -54
  65. data/src/ruby/ext/grpc/rb_call.h +1 -1
  66. data/src/ruby/ext/grpc/rb_call_credentials.c +1 -30
  67. data/src/ruby/ext/grpc/rb_channel.c +25 -50
  68. data/src/ruby/ext/grpc/rb_channel_credentials.c +1 -31
  69. data/src/ruby/ext/grpc/rb_completion_queue.c +15 -134
  70. data/src/ruby/ext/grpc/rb_completion_queue.h +3 -7
  71. data/src/ruby/ext/grpc/rb_grpc.c +2 -4
  72. data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +2 -0
  73. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +4 -1
  74. data/src/ruby/ext/grpc/rb_server.c +81 -133
  75. data/src/ruby/ext/grpc/rb_server_credentials.c +4 -33
  76. data/src/ruby/lib/grpc/generic/active_call.rb +40 -55
  77. data/src/ruby/lib/grpc/generic/bidi_call.rb +21 -23
  78. data/src/ruby/lib/grpc/generic/client_stub.rb +20 -15
  79. data/src/ruby/lib/grpc/generic/rpc_server.rb +15 -37
  80. data/src/ruby/lib/grpc/generic/service.rb +1 -1
  81. data/src/ruby/lib/grpc/version.rb +1 -1
  82. data/src/ruby/pb/test/client.rb +25 -7
  83. data/src/ruby/pb/test/server.rb +7 -5
  84. data/src/ruby/spec/call_spec.rb +1 -2
  85. data/src/ruby/spec/channel_spec.rb +2 -3
  86. data/src/ruby/spec/client_server_spec.rb +74 -59
  87. data/src/ruby/spec/generic/active_call_spec.rb +66 -86
  88. data/src/ruby/spec/generic/client_stub_spec.rb +27 -48
  89. data/src/ruby/spec/generic/rpc_server_spec.rb +4 -34
  90. data/src/ruby/spec/pb/health/checker_spec.rb +0 -2
  91. data/src/ruby/spec/server_spec.rb +20 -24
  92. metadata +9 -8
  93. data/src/ruby/spec/completion_queue_spec.rb +0 -42
@@ -95,7 +95,7 @@ class FailingService
95
95
  def initialize(_default_var = 'ignored')
96
96
  @details = 'app error'
97
97
  @code = 101
98
- @md = { failed_method: 'an_rpc' }
98
+ @md = { 'failed_method' => 'an_rpc' }
99
99
  end
100
100
 
101
101
  def an_rpc(_req, _call)
@@ -135,8 +135,6 @@ describe GRPC::RpcServer do
135
135
  @pass = 0
136
136
  @fail = 1
137
137
  @noop = proc { |x| x }
138
-
139
- @server_queue = GRPC::Core::CompletionQueue.new
140
138
  end
141
139
 
142
140
  describe '#new' do
@@ -148,28 +146,6 @@ describe GRPC::RpcServer do
148
146
  expect(&blk).not_to raise_error
149
147
  end
150
148
 
151
- it 'can be created with a completion queue override' do
152
- opts = {
153
- server_args: { a_channel_arg: 'an_arg' },
154
- completion_queue_override: @server_queue
155
- }
156
- blk = proc do
157
- RpcServer.new(**opts)
158
- end
159
- expect(&blk).not_to raise_error
160
- end
161
-
162
- it 'cannot be created with a bad completion queue override' do
163
- blk = proc do
164
- opts = {
165
- server_args: { a_channel_arg: 'an_arg' },
166
- completion_queue_override: Object.new
167
- }
168
- RpcServer.new(**opts)
169
- end
170
- expect(&blk).to raise_error
171
- end
172
-
173
149
  it 'cannot be created with invalid ServerCredentials' do
174
150
  blk = proc do
175
151
  opts = {
@@ -294,7 +270,6 @@ describe GRPC::RpcServer do
294
270
  context 'with no connect_metadata' do
295
271
  before(:each) do
296
272
  server_opts = {
297
- completion_queue_override: @server_queue,
298
273
  poll_period: 1
299
274
  }
300
275
  @srv = RpcServer.new(**server_opts)
@@ -309,8 +284,7 @@ describe GRPC::RpcServer do
309
284
  @srv.wait_till_running
310
285
  req = EchoMsg.new
311
286
  blk = proc do
312
- cq = GRPC::Core::CompletionQueue.new
313
- stub = GRPC::ClientStub.new(@host, cq, :this_channel_is_insecure,
287
+ stub = GRPC::ClientStub.new(@host, :this_channel_is_insecure,
314
288
  **client_opts)
315
289
  stub.request_response('/unknown', req, marshal, unmarshal)
316
290
  end
@@ -325,8 +299,7 @@ describe GRPC::RpcServer do
325
299
  @srv.wait_till_running
326
300
  req = EchoMsg.new
327
301
  blk = proc do
328
- cq = GRPC::Core::CompletionQueue.new
329
- stub = GRPC::ClientStub.new(@host, cq, :this_channel_is_insecure,
302
+ stub = GRPC::ClientStub.new(@host, :this_channel_is_insecure,
330
303
  **client_opts)
331
304
  stub.request_response('/an_rpc', req, marshal, unmarshal)
332
305
  end
@@ -422,7 +395,6 @@ describe GRPC::RpcServer do
422
395
  it 'should return RESOURCE_EXHAUSTED on too many jobs', server: true do
423
396
  opts = {
424
397
  server_args: { a_channel_arg: 'an_arg' },
425
- completion_queue_override: @server_queue,
426
398
  pool_size: 1,
427
399
  poll_period: 1,
428
400
  max_waiting_requests: 0
@@ -466,7 +438,6 @@ describe GRPC::RpcServer do
466
438
  end
467
439
  before(:each) do
468
440
  server_opts = {
469
- completion_queue_override: @server_queue,
470
441
  poll_period: 1,
471
442
  connect_md_proc: test_md_proc
472
443
  }
@@ -502,7 +473,6 @@ describe GRPC::RpcServer do
502
473
  context 'with trailing metadata' do
503
474
  before(:each) do
504
475
  server_opts = {
505
- completion_queue_override: @server_queue,
506
476
  poll_period: 1
507
477
  }
508
478
  @srv = RpcServer.new(**server_opts)
@@ -545,7 +515,7 @@ describe GRPC::RpcServer do
545
515
  op = stub.an_rpc(req, return_op: true, metadata: { k1: 'v1', k2: 'v2' })
546
516
  expect(op.metadata).to be nil
547
517
  expect(op.execute).to be_a(EchoMsg)
548
- expect(op.metadata).to eq(wanted_trailers)
518
+ expect(op.trailing_metadata).to eq(wanted_trailers)
549
519
  @srv.stop
550
520
  t.join
551
521
  end
@@ -168,11 +168,9 @@ describe Grpc::Health::Checker do
168
168
  CheckerStub = Grpc::Health::Checker.rpc_stub_class
169
169
 
170
170
  before(:each) do
171
- @server_queue = GRPC::Core::CompletionQueue.new
172
171
  server_host = '0.0.0.0:0'
173
172
  @client_opts = { channel_override: @ch }
174
173
  server_opts = {
175
- completion_queue_override: @server_queue,
176
174
  poll_period: 1
177
175
  }
178
176
  @srv = RpcServer.new(**server_opts)
@@ -43,19 +43,15 @@ describe Server do
43
43
  GRPC::Core::ServerCredentials.new(*load_test_certs)
44
44
  end
45
45
 
46
- before(:each) do
47
- @cq = GRPC::Core::CompletionQueue.new
48
- end
49
-
50
46
  describe '#start' do
51
47
  it 'runs without failing' do
52
- blk = proc { Server.new(@cq, nil).start }
48
+ blk = proc { Server.new(nil).start }
53
49
  expect(&blk).to_not raise_error
54
50
  end
55
51
 
56
52
  it 'fails if the server is closed' do
57
- s = Server.new(@cq, nil)
58
- s.close(@cq)
53
+ s = Server.new(nil)
54
+ s.close
59
55
  expect { s.start }.to raise_error(RuntimeError)
60
56
  end
61
57
  end
@@ -63,19 +59,19 @@ describe Server do
63
59
  describe '#destroy' do
64
60
  it 'destroys a server ok' do
65
61
  s = start_a_server
66
- blk = proc { s.destroy(@cq) }
62
+ blk = proc { s.destroy }
67
63
  expect(&blk).to_not raise_error
68
64
  end
69
65
 
70
66
  it 'can be called more than once without error' do
71
67
  s = start_a_server
72
68
  begin
73
- blk = proc { s.destroy(@cq) }
69
+ blk = proc { s.destroy }
74
70
  expect(&blk).to_not raise_error
75
71
  blk.call
76
72
  expect(&blk).to_not raise_error
77
73
  ensure
78
- s.close(@cq)
74
+ s.close
79
75
  end
80
76
  end
81
77
  end
@@ -84,7 +80,7 @@ describe Server do
84
80
  it 'closes a server ok' do
85
81
  s = start_a_server
86
82
  begin
87
- blk = proc { s.close(@cq) }
83
+ blk = proc { s.close }
88
84
  expect(&blk).to_not raise_error
89
85
  ensure
90
86
  s.close(@cq)
@@ -93,7 +89,7 @@ describe Server do
93
89
 
94
90
  it 'can be called more than once without error' do
95
91
  s = start_a_server
96
- blk = proc { s.close(@cq) }
92
+ blk = proc { s.close }
97
93
  expect(&blk).to_not raise_error
98
94
  blk.call
99
95
  expect(&blk).to_not raise_error
@@ -104,16 +100,16 @@ describe Server do
104
100
  describe 'for insecure servers' do
105
101
  it 'runs without failing' do
106
102
  blk = proc do
107
- s = Server.new(@cq, nil)
103
+ s = Server.new(nil)
108
104
  s.add_http2_port('localhost:0', :this_port_is_insecure)
109
- s.close(@cq)
105
+ s.close
110
106
  end
111
107
  expect(&blk).to_not raise_error
112
108
  end
113
109
 
114
110
  it 'fails if the server is closed' do
115
- s = Server.new(@cq, nil)
116
- s.close(@cq)
111
+ s = Server.new(nil)
112
+ s.close
117
113
  blk = proc do
118
114
  s.add_http2_port('localhost:0', :this_port_is_insecure)
119
115
  end
@@ -125,16 +121,16 @@ describe Server do
125
121
  let(:cert) { create_test_cert }
126
122
  it 'runs without failing' do
127
123
  blk = proc do
128
- s = Server.new(@cq, nil)
124
+ s = Server.new(nil)
129
125
  s.add_http2_port('localhost:0', cert)
130
- s.close(@cq)
126
+ s.close
131
127
  end
132
128
  expect(&blk).to_not raise_error
133
129
  end
134
130
 
135
131
  it 'fails if the server is closed' do
136
- s = Server.new(@cq, nil)
137
- s.close(@cq)
132
+ s = Server.new(nil)
133
+ s.close
138
134
  blk = proc { s.add_http2_port('localhost:0', cert) }
139
135
  expect(&blk).to raise_error(RuntimeError)
140
136
  end
@@ -142,8 +138,8 @@ describe Server do
142
138
  end
143
139
 
144
140
  shared_examples '#new' do
145
- it 'takes a completion queue with nil channel args' do
146
- expect { Server.new(@cq, nil) }.to_not raise_error
141
+ it 'takes nil channel args' do
142
+ expect { Server.new(nil) }.to_not raise_error
147
143
  end
148
144
 
149
145
  it 'does not take a hash with bad keys as channel args' do
@@ -194,14 +190,14 @@ describe Server do
194
190
 
195
191
  describe '#new with an insecure channel' do
196
192
  def construct_with_args(a)
197
- proc { Server.new(@cq, a) }
193
+ proc { Server.new(a) }
198
194
  end
199
195
 
200
196
  it_behaves_like '#new'
201
197
  end
202
198
 
203
199
  def start_a_server
204
- s = Server.new(@cq, nil)
200
+ s = Server.new(nil)
205
201
  s.add_http2_port('0.0.0.0:0', :this_port_is_insecure)
206
202
  s.start
207
203
  s
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: 0.15.0
4
+ version: 1.0.0.pre1
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: 2016-06-25 00:00:00.000000000 Z
11
+ date: 2016-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -197,7 +197,6 @@ files:
197
197
  - include/grpc/grpc_posix.h
198
198
  - include/grpc/grpc_security.h
199
199
  - include/grpc/grpc_security_constants.h
200
- - include/grpc/grpc_zookeeper.h
201
200
  - include/grpc/impl/codegen/alloc.h
202
201
  - include/grpc/impl/codegen/atm.h
203
202
  - include/grpc/impl/codegen/atm_gcc_atomic.h
@@ -219,6 +218,7 @@ files:
219
218
  - include/grpc/impl/codegen/sync_posix.h
220
219
  - include/grpc/impl/codegen/sync_windows.h
221
220
  - include/grpc/impl/codegen/time.h
221
+ - include/grpc/module.modulemap
222
222
  - include/grpc/status.h
223
223
  - include/grpc/support/alloc.h
224
224
  - include/grpc/support/atm.h
@@ -401,6 +401,8 @@ files:
401
401
  - src/core/lib/iomgr/endpoint_pair_windows.c
402
402
  - src/core/lib/iomgr/error.c
403
403
  - src/core/lib/iomgr/error.h
404
+ - src/core/lib/iomgr/ev_epoll_linux.c
405
+ - src/core/lib/iomgr/ev_epoll_linux.h
404
406
  - src/core/lib/iomgr/ev_poll_and_epoll_posix.c
405
407
  - src/core/lib/iomgr/ev_poll_and_epoll_posix.h
406
408
  - src/core/lib/iomgr/ev_poll_posix.c
@@ -421,6 +423,8 @@ files:
421
423
  - src/core/lib/iomgr/iomgr_windows.c
422
424
  - src/core/lib/iomgr/load_file.c
423
425
  - src/core/lib/iomgr/load_file.h
426
+ - src/core/lib/iomgr/network_status_tracker.c
427
+ - src/core/lib/iomgr/network_status_tracker.h
424
428
  - src/core/lib/iomgr/polling_entity.c
425
429
  - src/core/lib/iomgr/polling_entity.h
426
430
  - src/core/lib/iomgr/pollset.h
@@ -610,7 +614,6 @@ files:
610
614
  - src/core/lib/surface/metadata_array.c
611
615
  - src/core/lib/surface/server.c
612
616
  - src/core/lib/surface/server.h
613
- - src/core/lib/surface/surface_trace.h
614
617
  - src/core/lib/surface/validate_metadata.c
615
618
  - src/core/lib/surface/version.c
616
619
  - src/core/lib/transport/byte_stream.c
@@ -709,7 +712,6 @@ files:
709
712
  - src/ruby/spec/channel_credentials_spec.rb
710
713
  - src/ruby/spec/channel_spec.rb
711
714
  - src/ruby/spec/client_server_spec.rb
712
- - src/ruby/spec/completion_queue_spec.rb
713
715
  - src/ruby/spec/generic/active_call_spec.rb
714
716
  - src/ruby/spec/generic/client_stub_spec.rb
715
717
  - src/ruby/spec/generic/rpc_desc_spec.rb
@@ -1179,9 +1181,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
1179
1181
  version: 2.0.0
1180
1182
  required_rubygems_version: !ruby/object:Gem::Requirement
1181
1183
  requirements:
1182
- - - ">="
1184
+ - - ">"
1183
1185
  - !ruby/object:Gem::Version
1184
- version: '0'
1186
+ version: 1.3.1
1185
1187
  requirements: []
1186
1188
  rubyforge_project:
1187
1189
  rubygems_version: 2.5.1
@@ -1209,5 +1211,4 @@ test_files:
1209
1211
  - src/ruby/spec/time_consts_spec.rb
1210
1212
  - src/ruby/spec/channel_credentials_spec.rb
1211
1213
  - src/ruby/spec/call_credentials_spec.rb
1212
- - src/ruby/spec/completion_queue_spec.rb
1213
1214
  - src/ruby/spec/server_spec.rb
@@ -1,42 +0,0 @@
1
- # Copyright 2015, Google Inc.
2
- # All rights reserved.
3
- #
4
- # Redistribution and use in source and binary forms, with or without
5
- # modification, are permitted provided that the following conditions are
6
- # met:
7
- #
8
- # * Redistributions of source code must retain the above copyright
9
- # notice, this list of conditions and the following disclaimer.
10
- # * Redistributions in binary form must reproduce the above
11
- # copyright notice, this list of conditions and the following disclaimer
12
- # in the documentation and/or other materials provided with the
13
- # distribution.
14
- # * Neither the name of Google Inc. nor the names of its
15
- # contributors may be used to endorse or promote products derived from
16
- # this software without specific prior written permission.
17
- #
18
- # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
- # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
- # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
- # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
- # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
- # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
- # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
- # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
- # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
- # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
- # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
-
30
- require 'grpc'
31
-
32
- describe GRPC::Core::CompletionQueue do
33
- before(:example) do
34
- @cq = GRPC::Core::CompletionQueue.new
35
- end
36
-
37
- describe '#new' do
38
- it 'is constructed successufully' do
39
- expect { GRPC::Core::CompletionQueue.new }.not_to raise_error
40
- end
41
- end
42
- end