Fix handling of one error in bidi calls, and one interop server method

pull/6886/head
murgatroid99 9 years ago
parent 674f55a9ac
commit 67e2525892
  1. 8
      src/ruby/lib/grpc/generic/bidi_call.rb
  2. 4
      src/ruby/pb/test/server.rb

@ -173,6 +173,14 @@ module GRPC
finished
end
GRPC.logger.debug('bidi-write-loop: finished')
rescue GRPC::Core::CallError => e
# This is almost definitely caused by a status arriving while still
# writing. Don't re-throw the error
GRPC.logger.warn('bidi-write-loop: ended with error')
GRPC.logger.warn(e)
notify_done
@writes_complete = true
finished
rescue StandardError => e
GRPC.logger.warn('bidi-write-loop: failed')
GRPC.logger.warn(e)

@ -188,12 +188,14 @@ class TestTarget < Grpc::Testing::TestService::Service
begin
GRPC.logger.info('interop-server: started receiving')
reqs.each do |req|
resp_size = req.response_parameters[0].size
req.response_parameters.each do |params|
resp_size = params.size
GRPC.logger.info("read a req, response size is #{resp_size}")
resp = cls.new(payload: Payload.new(type: req.response_type,
body: nulls(resp_size)))
q.push(resp)
end
end
GRPC.logger.info('interop-server: finished receiving')
q.push(self)
rescue StandardError => e

Loading…
Cancel
Save