grpc 1.9.1-x86-linux → 1.10.0.pre1-x86-linux

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.

@@ -244,9 +244,9 @@ module GRPC
244
244
  fail 'Cannot stop before starting' if @running_state == :not_started
245
245
  return if @running_state != :running
246
246
  transition_running_state(:stopping)
247
+ deadline = from_relative_time(@poll_period)
248
+ @server.shutdown_and_notify(deadline)
247
249
  end
248
- deadline = from_relative_time(@poll_period)
249
- @server.close(deadline)
250
250
  @pool.stop
251
251
  end
252
252
 
@@ -416,8 +416,11 @@ module GRPC
416
416
  end
417
417
  end
418
418
  # @running_state should be :stopping here
419
- @run_mutex.synchronize { transition_running_state(:stopped) }
420
- GRPC.logger.info("stopped: #{self}")
419
+ @run_mutex.synchronize do
420
+ transition_running_state(:stopped)
421
+ GRPC.logger.info("stopped: #{self}")
422
+ @server.close
423
+ end
421
424
  end
422
425
 
423
426
  def new_active_server_call(an_rpc)
Binary file
@@ -14,5 +14,5 @@
14
14
 
15
15
  # GRPC contains the General RPC module.
16
16
  module GRPC
17
- VERSION = '1.9.1'
17
+ VERSION = '1.10.0.pre1'
18
18
  end
@@ -707,7 +707,7 @@ Args = Struct.new(:default_service_account, :host, :host_override,
707
707
  :oauth_scope, :port, :secure, :test_case,
708
708
  :use_test_ca)
709
709
 
710
- # validates the the command line options, returning them as a Hash.
710
+ # validates the command line options, returning them as a Hash.
711
711
  def parse_args
712
712
  args = Args.new
713
713
  args.host_override = 'foo.test.google.fr'
@@ -211,7 +211,7 @@ class TestTarget < Grpc::Testing::TestService::Service
211
211
  end
212
212
  end
213
213
 
214
- # validates the the command line options, returning them as a Hash.
214
+ # validates the command line options, returning them as a Hash.
215
215
  def parse_options
216
216
  options = {
217
217
  'port' => nil,
@@ -550,7 +550,8 @@ describe 'the http client/server' do
550
550
 
551
551
  after(:example) do
552
552
  @ch.close
553
- @server.close(deadline)
553
+ @server.shutdown_and_notify(deadline)
554
+ @server.close
554
555
  end
555
556
 
556
557
  it_behaves_like 'basic GRPC message delivery is OK' do
@@ -583,7 +584,8 @@ describe 'the secure http client/server' do
583
584
  end
584
585
 
585
586
  after(:example) do
586
- @server.close(deadline)
587
+ @server.shutdown_and_notify(deadline)
588
+ @server.close
587
589
  end
588
590
 
589
591
  it_behaves_like 'basic GRPC message delivery is OK' do
@@ -48,7 +48,8 @@ describe GRPC::ActiveCall do
48
48
  end
49
49
 
50
50
  after(:each) do
51
- @server.close(deadline)
51
+ @server.shutdown_and_notify(deadline)
52
+ @server.close
52
53
  end
53
54
 
54
55
  describe 'restricted view methods' do
@@ -83,7 +83,12 @@ def sanity_check_values_of_accessors(op_view,
83
83
  op_view.deadline.is_a?(Time)).to be(true)
84
84
  end
85
85
 
86
- describe 'ClientStub' do
86
+ def close_active_server_call(active_server_call)
87
+ active_server_call.send(:set_input_stream_done)
88
+ active_server_call.send(:set_output_stream_done)
89
+ end
90
+
91
+ describe 'ClientStub' do # rubocop:disable Metrics/BlockLength
87
92
  let(:noop) { proc { |x| x } }
88
93
 
89
94
  before(:each) do
@@ -96,7 +101,10 @@ describe 'ClientStub' do
96
101
  end
97
102
 
98
103
  after(:each) do
99
- @server.close(from_relative_time(2)) unless @server.nil?
104
+ unless @server.nil?
105
+ @server.shutdown_and_notify(from_relative_time(2))
106
+ @server.close
107
+ end
100
108
  end
101
109
 
102
110
  describe '#new' do
@@ -230,7 +238,15 @@ describe 'ClientStub' do
230
238
 
231
239
  it 'should receive UNAVAILABLE if call credentials plugin fails' do
232
240
  server_port = create_secure_test_server
233
- th = run_request_response(@sent_msg, @resp, @pass)
241
+ server_started_notifier = GRPC::Notifier.new
242
+ th = Thread.new do
243
+ @server.start
244
+ server_started_notifier.notify(nil)
245
+ # Poll on the server so that the client connection can proceed.
246
+ # We don't expect the server to actually accept a call though.
247
+ expect { @server.request_call }.to raise_error(GRPC::Core::CallError)
248
+ end
249
+ server_started_notifier.wait
234
250
 
235
251
  certs = load_test_certs
236
252
  secure_channel_creds = GRPC::Core::ChannelCredentials.new(
@@ -249,17 +265,18 @@ describe 'ClientStub' do
249
265
  end
250
266
  creds = GRPC::Core::CallCredentials.new(failing_auth)
251
267
 
252
- unauth_error_occured = false
268
+ unavailable_error_occured = false
253
269
  begin
254
270
  get_response(stub, credentials: creds)
255
271
  rescue GRPC::Unavailable => e
256
- unauth_error_occured = true
272
+ unavailable_error_occured = true
257
273
  expect(e.details.include?(error_message)).to be true
258
274
  end
259
- expect(unauth_error_occured).to eq(true)
275
+ expect(unavailable_error_occured).to eq(true)
260
276
 
261
- # Kill the server thread so tests can complete
262
- th.kill
277
+ @server.shutdown_and_notify(Time.now + 3)
278
+ th.join
279
+ @server.close
263
280
  end
264
281
 
265
282
  it 'should raise ArgumentError if metadata contains invalid values' do
@@ -493,6 +510,7 @@ describe 'ClientStub' do
493
510
  p 'remote_send failed (allowed because call expected to cancel)'
494
511
  ensure
495
512
  c.send_status(OK, 'OK', true)
513
+ close_active_server_call(c)
496
514
  end
497
515
  end
498
516
  end
@@ -659,6 +677,7 @@ describe 'ClientStub' do
659
677
  end
660
678
  # can't fail since initial metadata already sent
661
679
  server_call.send_status(@pass, 'OK', true)
680
+ close_active_server_call(server_call)
662
681
  end
663
682
 
664
683
  def verify_error_from_write_thread(stub, requests_to_push,
@@ -809,6 +828,7 @@ describe 'ClientStub' do
809
828
  replys.each { |r| c.remote_send(r) }
810
829
  c.send_status(status, status == @pass ? 'OK' : 'NOK', true,
811
830
  metadata: server_trailing_md)
831
+ close_active_server_call(c)
812
832
  end
813
833
  end
814
834
 
@@ -819,6 +839,7 @@ describe 'ClientStub' do
819
839
  expected_inputs.each { |i| expect(c.remote_read).to eq(i) }
820
840
  replys.each { |r| c.remote_send(r) }
821
841
  c.send_status(status, status == @pass ? 'OK' : 'NOK', true)
842
+ close_active_server_call(c)
822
843
  end
823
844
  end
824
845
 
@@ -844,6 +865,7 @@ describe 'ClientStub' do
844
865
  end
845
866
  c.send_status(status, status == @pass ? 'OK' : 'NOK', true,
846
867
  metadata: server_trailing_md)
868
+ close_active_server_call(c)
847
869
  end
848
870
  end
849
871
 
@@ -862,6 +884,7 @@ describe 'ClientStub' do
862
884
  c.remote_send(resp)
863
885
  c.send_status(status, status == @pass ? 'OK' : 'NOK', true,
864
886
  metadata: server_trailing_md)
887
+ close_active_server_call(c)
865
888
  end
866
889
  end
867
890
 
@@ -880,6 +903,7 @@ describe 'ClientStub' do
880
903
  c.remote_send(resp)
881
904
  c.send_status(status, status == @pass ? 'OK' : 'NOK', true,
882
905
  metadata: server_trailing_md)
906
+ close_active_server_call(c)
883
907
  end
884
908
  end
885
909
 
@@ -36,45 +36,60 @@ describe Server do
36
36
 
37
37
  it 'fails if the server is closed' do
38
38
  s = new_core_server_for_testing(nil)
39
+ s.shutdown_and_notify(nil)
39
40
  s.close
40
41
  expect { s.start }.to raise_error(RuntimeError)
41
42
  end
42
43
  end
43
44
 
44
- describe '#destroy' do
45
+ describe '#shutdown_and_notify and #destroy' do
45
46
  it 'destroys a server ok' do
46
47
  s = start_a_server
47
- blk = proc { s.destroy }
48
+ blk = proc do
49
+ s.shutdown_and_notify(nil)
50
+ s.destroy
51
+ end
48
52
  expect(&blk).to_not raise_error
49
53
  end
50
54
 
51
55
  it 'can be called more than once without error' do
52
56
  s = start_a_server
53
57
  begin
54
- blk = proc { s.destroy }
58
+ blk = proc do
59
+ s.shutdown_and_notify(nil)
60
+ s.destroy
61
+ end
55
62
  expect(&blk).to_not raise_error
56
63
  blk.call
57
64
  expect(&blk).to_not raise_error
58
65
  ensure
66
+ s.shutdown_and_notify(nil)
59
67
  s.close
60
68
  end
61
69
  end
62
70
  end
63
71
 
64
- describe '#close' do
72
+ describe '#shutdown_and_notify and #close' do
65
73
  it 'closes a server ok' do
66
74
  s = start_a_server
67
75
  begin
68
- blk = proc { s.close }
76
+ blk = proc do
77
+ s.shutdown_and_notify(nil)
78
+ s.close
79
+ end
69
80
  expect(&blk).to_not raise_error
70
81
  ensure
71
- s.close(@cq)
82
+ s.shutdown_and_notify(nil)
83
+ s.close
72
84
  end
73
85
  end
74
86
 
75
87
  it 'can be called more than once without error' do
76
88
  s = start_a_server
77
- blk = proc { s.close }
89
+ blk = proc do
90
+ s.shutdown_and_notify(nil)
91
+ s.close
92
+ end
78
93
  expect(&blk).to_not raise_error
79
94
  blk.call
80
95
  expect(&blk).to_not raise_error
@@ -87,6 +102,7 @@ describe Server do
87
102
  blk = proc do
88
103
  s = new_core_server_for_testing(nil)
89
104
  s.add_http2_port('localhost:0', :this_port_is_insecure)
105
+ s.shutdown_and_notify(nil)
90
106
  s.close
91
107
  end
92
108
  expect(&blk).to_not raise_error
@@ -94,6 +110,7 @@ describe Server do
94
110
 
95
111
  it 'fails if the server is closed' do
96
112
  s = new_core_server_for_testing(nil)
113
+ s.shutdown_and_notify(nil)
97
114
  s.close
98
115
  blk = proc do
99
116
  s.add_http2_port('localhost:0', :this_port_is_insecure)
@@ -108,6 +125,7 @@ describe Server do
108
125
  blk = proc do
109
126
  s = new_core_server_for_testing(nil)
110
127
  s.add_http2_port('localhost:0', cert)
128
+ s.shutdown_and_notify(nil)
111
129
  s.close
112
130
  end
113
131
  expect(&blk).to_not raise_error
@@ -115,6 +133,7 @@ describe Server do
115
133
 
116
134
  it 'fails if the server is closed' do
117
135
  s = new_core_server_for_testing(nil)
136
+ s.shutdown_and_notify(nil)
118
137
  s.close
119
138
  blk = proc { s.add_http2_port('localhost:0', cert) }
120
139
  expect(&blk).to raise_error(RuntimeError)
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.9.1
4
+ version: 1.10.0.pre1
5
5
  platform: x86-linux
6
6
  authors:
7
7
  - gRPC Authors
8
8
  autorequire:
9
9
  bindir: src/ruby/bin
10
10
  cert_chain: []
11
- date: 2018-02-13 00:00:00.000000000 Z
11
+ date: 2018-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -336,12 +336,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
336
336
  version: '2.6'
337
337
  required_rubygems_version: !ruby/object:Gem::Requirement
338
338
  requirements:
339
- - - ">="
339
+ - - ">"
340
340
  - !ruby/object:Gem::Version
341
- version: '0'
341
+ version: 1.3.1
342
342
  requirements: []
343
343
  rubyforge_project:
344
- rubygems_version: 2.7.5
344
+ rubygems_version: 2.7.6
345
345
  signing_key:
346
346
  specification_version: 4
347
347
  summary: GRPC system in Ruby