From 03fc19876de683e3c8b4ca3ddc71af6c9756b07a Mon Sep 17 00:00:00 2001 From: Alexander Polcyn Date: Tue, 22 Nov 2016 14:24:49 -0800 Subject: [PATCH] wait for write loop to finish at end of ruby read loop, on client side calls --- src/ruby/lib/grpc/generic/bidi_call.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ruby/lib/grpc/generic/bidi_call.rb b/src/ruby/lib/grpc/generic/bidi_call.rb index 75ddff0bfd9..2b882313f2c 100644 --- a/src/ruby/lib/grpc/generic/bidi_call.rb +++ b/src/ruby/lib/grpc/generic/bidi_call.rb @@ -208,6 +208,10 @@ module GRPC GRPC.logger.debug('bidi-read-loop: finished') @reads_complete = true finished + # Make sure that the write loop is done done before finishing the call. + # Note that blocking is ok at this point because we've already received + # a status + @enq_th.join if is_client end end end