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. 12
      src/ruby/pb/test/server.rb

@ -173,6 +173,14 @@ module GRPC
finished finished
end end
GRPC.logger.debug('bidi-write-loop: finished') 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 rescue StandardError => e
GRPC.logger.warn('bidi-write-loop: failed') GRPC.logger.warn('bidi-write-loop: failed')
GRPC.logger.warn(e) GRPC.logger.warn(e)

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

Loading…
Cancel
Save