aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby/lib
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2016-06-28 14:14:49 -0700
committerGravatar murgatroid99 <mlumish@google.com>2016-06-28 14:14:49 -0700
commit00338657d949f248e5b978b2c03769f9ae19b53b (patch)
tree6113b39b9119158645b8b7d562ebca0d52665e25 /src/ruby/lib
parent67e2525892c57be3b20d517810c25a5e861cb515 (diff)
Fix bug that occasionally caused a call to be deleted twice
Diffstat (limited to 'src/ruby/lib')
-rw-r--r--src/ruby/lib/grpc/generic/bidi_call.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/ruby/lib/grpc/generic/bidi_call.rb b/src/ruby/lib/grpc/generic/bidi_call.rb
index e2a026cacc..425dc3e519 100644
--- a/src/ruby/lib/grpc/generic/bidi_call.rb
+++ b/src/ruby/lib/grpc/generic/bidi_call.rb
@@ -161,7 +161,15 @@ module GRPC
count += 1
payload = @marshal.call(req)
# Fails if status already received
- @call.run_batch(SEND_MESSAGE => payload)
+ begin
+ @call.run_batch(SEND_MESSAGE => payload)
+ 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)
+ break
+ end
end
GRPC.logger.debug("bidi-write-loop: #{count} writes done")
if is_client
@@ -173,14 +181,6 @@ 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)