aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2015-10-15 18:48:33 -0700
committerGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2015-10-15 18:48:33 -0700
commit5e2db5b518097e9f3b3926543c8d73ef57046552 (patch)
treec81d5ba8aa5af41b5175110d81c91bb00a053428 /src
parent3573e96d4967d9b20eaf13e86a616989ab43aee3 (diff)
parentaad1a34b4fd152c32c907641f3f9bb8f3fb54d54 (diff)
Merge pull request #3841 from murgatroid99/ruby_test_timeout
Make ruby RpcServer stop waiting for calls when it gets null calls
Diffstat (limited to 'src')
-rw-r--r--src/ruby/.rubocop.yml6
-rw-r--r--src/ruby/lib/grpc/generic/rpc_server.rb2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/ruby/.rubocop.yml b/src/ruby/.rubocop.yml
index 312bdca384..dd57ab6082 100644
--- a/src/ruby/.rubocop.yml
+++ b/src/ruby/.rubocop.yml
@@ -9,3 +9,9 @@ AllCops:
- 'bin/math_services.rb'
- 'pb/grpc/health/v1alpha/*'
- 'pb/test/**/*'
+
+Metrics/CyclomaticComplexity:
+ Max: 8
+
+Metrics/PerceivedComplexity:
+ Max: 8
diff --git a/src/ruby/lib/grpc/generic/rpc_server.rb b/src/ruby/lib/grpc/generic/rpc_server.rb
index 3740ac52da..228c500672 100644
--- a/src/ruby/lib/grpc/generic/rpc_server.rb
+++ b/src/ruby/lib/grpc/generic/rpc_server.rb
@@ -416,6 +416,8 @@ module GRPC
until stopped?
begin
an_rpc = @server.request_call(@cq, loop_tag, INFINITE_FUTURE)
+ break if (!an_rpc.nil?) && an_rpc.call.nil?
+
c = new_active_server_call(an_rpc)
unless c.nil?
mth = an_rpc.method.to_sym