aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby/lib
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2018-06-28 00:12:02 -0700
committerGravatar ncteisen <ncteisen@gmail.com>2018-06-28 00:12:02 -0700
commit8db7788d46fcdf9f35e8708e3b04bc4753f9f288 (patch)
treed321282205f58aa6dad45c29f4c3ab9331553436 /src/ruby/lib
parent0d878eae6cedf32e6e77e02f4c29ec232b41eb63 (diff)
parent28512108da77ccbc7954642c71312425744dfe19 (diff)
Merge branch 'master' of https://github.com/grpc/grpc into serialization
Diffstat (limited to 'src/ruby/lib')
-rw-r--r--src/ruby/lib/grpc/generic/active_call.rb26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/ruby/lib/grpc/generic/active_call.rb b/src/ruby/lib/grpc/generic/active_call.rb
index 86240814bd..688726ef4a 100644
--- a/src/ruby/lib/grpc/generic/active_call.rb
+++ b/src/ruby/lib/grpc/generic/active_call.rb
@@ -120,7 +120,7 @@ module GRPC
@send_initial_md_mutex.synchronize do
return if @metadata_sent
@metadata_to_send.merge!(new_metadata)
- @metadata_tag = ActiveCall.client_invoke(@call, @metadata_to_send)
+ ActiveCall.client_invoke(@call, @metadata_to_send)
@metadata_sent = true
end
end
@@ -322,18 +322,22 @@ module GRPC
# @return [Enumerator] if no block was given
def each_remote_read_then_finish
return enum_for(:each_remote_read_then_finish) unless block_given?
- begin
- loop do
- resp = remote_read
- if resp.nil? # the last response was received
- receive_and_check_status
- break
+ loop do
+ resp =
+ begin
+ remote_read
+ rescue GRPC::Core::CallError => e
+ GRPC.logger.warn("In each_remote_read_then_finish: #{e}")
+ nil
end
- yield resp
- end
- ensure
- set_input_stream_done
+
+ break if resp.nil? # the last response was received
+ yield resp
end
+
+ receive_and_check_status
+ ensure
+ set_input_stream_done
end
# request_response sends a request to a GRPC server, and returns the