grpc 1.6.2-x86-mingw32 → 1.6.4-x86-mingw32

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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2cf3364bb563cea598fb48c00c95c948c6bb7d7d
4
- data.tar.gz: 15c8699c906ec72e388dff07da7efaf6f57b5d45
3
+ metadata.gz: 16fda43dafcfed35687bf4baaa346970f575f8ff
4
+ data.tar.gz: afb1acdae6d200869ad6b33d7dd8da26d4ba5ec0
5
5
  SHA512:
6
- metadata.gz: 128a361335b0d59b18b1fd7cc241019e5d57b664101e8040d7dd1b7f38946f2f8f1e3f08bb01383c8a6ac9f895cde7bc6142a0abeccd75b34672ae36304d056a
7
- data.tar.gz: 329bd870c918b2ea06af5ecfac5fc2a7f12271a48aa9e836209ab1ddf84dd5450e21e3e6925568788ff4389710f5d29ce8142d3ca786e054120fd3ea255aced6
6
+ metadata.gz: 9283f66aafd2a9ab6bb2f0a1474f53145dd9fae61e40fb506006a5d96ec5573588c50df3140ac661cc90ba99763c671f5a504b6c855f7d8c6c62872ed9451202
7
+ data.tar.gz: 6ddcd97764ee5c998a010dd017db1d4c110992b6a06c1b7dd93ec52ea2ebf6d60852cb4079a63e602a2a0d68520db9d93d52996fcdabe43e9290b5370c4890e1
data/grpc_c.32.ruby CHANGED
Binary file
data/grpc_c.64.ruby CHANGED
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -19,10 +19,18 @@ require 'google/rpc/status_pb'
19
19
  module GRPC
20
20
  # GoogleRpcStatusUtils provides utilities to convert between a
21
21
  # GRPC::Core::Status and a deserialized Google::Rpc::Status proto
22
+ # Returns nil if the grpc-status-details-bin trailer could not be
23
+ # converted to a GoogleRpcStatus due to the server not providing
24
+ # the necessary trailers.
25
+ # Raises an error if the server did provide the necessary trailers
26
+ # but they fail to deseriliaze into a GoogleRpcStatus protobuf.
22
27
  class GoogleRpcStatusUtils
23
28
  def self.extract_google_rpc_status(status)
24
29
  fail ArgumentError, 'bad type' unless status.is_a? Struct::Status
25
- Google::Rpc::Status.decode(status.metadata['grpc-status-details-bin'])
30
+ grpc_status_details_bin_trailer = 'grpc-status-details-bin'
31
+ return nil if status.metadata[grpc_status_details_bin_trailer].nil?
32
+ Google::Rpc::Status.decode(
33
+ status.metadata[grpc_status_details_bin_trailer])
26
34
  end
27
35
  end
28
36
  end
@@ -14,5 +14,5 @@
14
14
 
15
15
  # GRPC contains the General RPC module.
16
16
  module GRPC
17
- VERSION = '1.6.2'
17
+ VERSION = '1.6.4'
18
18
  end
@@ -31,12 +31,11 @@ describe 'conversion from a status struct to a google protobuf status' do
31
31
  expect(exception.message.include?('bad type')).to be true
32
32
  end
33
33
 
34
- it 'fails with some error if the header key is missing' do
34
+ it 'returns nil if the header key is missing' do
35
35
  status = Struct::Status.new(1, 'details', key: 'val')
36
36
  expect(status.metadata.nil?).to be false
37
- expect do
38
- GRPC::GoogleRpcStatusUtils.extract_google_rpc_status(status)
39
- end.to raise_error(StandardError)
37
+ expect(GRPC::GoogleRpcStatusUtils.extract_google_rpc_status(
38
+ status)).to be(nil)
40
39
  end
41
40
 
42
41
  it 'fails with some error if the header key fails to deserialize' do
@@ -221,3 +220,73 @@ describe 'receving a google rpc status from a remote endpoint' do
221
220
  status_from_exception)).to eq(rpc_status)
222
221
  end
223
222
  end
223
+
224
+ # A test service that fails without explicitly setting the
225
+ # grpc-status-details-bin trailer. Tests assumptions about value
226
+ # of grpc-status-details-bin on the client side when the trailer wasn't
227
+ # set explicitly.
228
+ class NoStatusDetailsBinTestService
229
+ include GRPC::GenericService
230
+ rpc :an_rpc, EchoMsg, EchoMsg
231
+
232
+ def an_rpc(_, _)
233
+ fail GRPC::Unknown
234
+ end
235
+ end
236
+
237
+ NoStatusDetailsBinTestServiceStub = NoStatusDetailsBinTestService.rpc_stub_class
238
+
239
+ describe 'when the endpoint doesnt send grpc-status-details-bin' do
240
+ def start_server
241
+ @srv = GRPC::RpcServer.new(pool_size: 1)
242
+ @server_port = @srv.add_http2_port('localhost:0',
243
+ :this_port_is_insecure)
244
+ @srv.handle(NoStatusDetailsBinTestService)
245
+ @server_thd = Thread.new { @srv.run }
246
+ @srv.wait_till_running
247
+ end
248
+
249
+ def stop_server
250
+ expect(@srv.stopped?).to be(false)
251
+ @srv.stop
252
+ @server_thd.join
253
+ expect(@srv.stopped?).to be(true)
254
+ end
255
+
256
+ before(:each) do
257
+ start_server
258
+ end
259
+
260
+ after(:each) do
261
+ stop_server
262
+ end
263
+
264
+ it 'should receive nil when we extract try to extract a google '\
265
+ 'rpc status from a BadStatus exception that didnt have it' do
266
+ stub = NoStatusDetailsBinTestServiceStub.new("localhost:#{@server_port}",
267
+ :this_channel_is_insecure)
268
+ begin
269
+ stub.an_rpc(EchoMsg.new)
270
+ rescue GRPC::Unknown => e
271
+ rpc_status = GRPC::GoogleRpcStatusUtils.extract_google_rpc_status(
272
+ e.to_status)
273
+ end
274
+ expect(rpc_status).to be(nil)
275
+ end
276
+
277
+ it 'should receive nil when we extract try to extract a google '\
278
+ 'rpc status from an op views status object that didnt have it' do
279
+ stub = NoStatusDetailsBinTestServiceStub.new("localhost:#{@server_port}",
280
+ :this_channel_is_insecure)
281
+ op = stub.an_rpc(EchoMsg.new, return_op: true)
282
+ begin
283
+ op.execute
284
+ rescue GRPC::Unknown => e
285
+ status_from_exception = e.to_status
286
+ end
287
+ expect(GRPC::GoogleRpcStatusUtils.extract_google_rpc_status(
288
+ status_from_exception)).to be(nil)
289
+ expect(GRPC::GoogleRpcStatusUtils.extract_google_rpc_status(
290
+ op.status)).to be nil
291
+ end
292
+ end
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.6.2
4
+ version: 1.6.4
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - gRPC Authors
8
8
  autorequire:
9
9
  bindir: src/ruby/bin
10
10
  cert_chain: []
11
- date: 2017-09-22 00:00:00.000000000 Z
11
+ date: 2017-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf