aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2015-10-14 15:24:45 -0700
committerGravatar murgatroid99 <mlumish@google.com>2015-10-14 15:24:45 -0700
commit59e339b9d243a2962f37e4080ae2110d32989fd4 (patch)
treefe9d0230bac1a593d2d24caa6dc8499c5faa69d4 /src/ruby
parent60f406ab74cf106c8935dff8528e1b4e0a3f16ef (diff)
Made ruby server stop waiting for calls when it starts getting null calls
Diffstat (limited to 'src/ruby')
-rw-r--r--src/ruby/lib/grpc/generic/rpc_server.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ruby/lib/grpc/generic/rpc_server.rb b/src/ruby/lib/grpc/generic/rpc_server.rb
index 3740ac52da..8dfc9b6763 100644
--- a/src/ruby/lib/grpc/generic/rpc_server.rb
+++ b/src/ruby/lib/grpc/generic/rpc_server.rb
@@ -417,7 +417,12 @@ module GRPC
begin
an_rpc = @server.request_call(@cq, loop_tag, INFINITE_FUTURE)
c = new_active_server_call(an_rpc)
- unless c.nil?
+ if c.nil?
+ # With infinite timeout on request_call, a nil call implies that the
+ # server has shut down. Waiting for another call at that point will
+ # not accomplish anything.
+ break
+ else
mth = an_rpc.method.to_sym
@pool.schedule(c) do |call|
rpc_descs[mth].run_server_method(call, rpc_handlers[mth])