aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby
diff options
context:
space:
mode:
authorGravatar apolcyn <apolcyn@google.com>2016-10-28 14:51:51 -0700
committerGravatar GitHub <noreply@github.com>2016-10-28 14:51:51 -0700
commit086e28d5f5eba09576c18cef075a3434de2caaa7 (patch)
tree2200a7fe3de132837175073baee05565312a7cc4 /src/ruby
parent15b04e41f15a9a023fdc3f0bb8f5d5764af8e465 (diff)
parent287b760e9779270f675959eeded2ace029354217 (diff)
Merge pull request #8539 from apolcyn/fix_ruby_bm_crashes_master
increase max thread pool size in benchmarks and fix shutdown ordering
Diffstat (limited to 'src/ruby')
-rw-r--r--src/ruby/lib/grpc/generic/rpc_server.rb3
-rw-r--r--src/ruby/qps/server.rb4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/ruby/lib/grpc/generic/rpc_server.rb b/src/ruby/lib/grpc/generic/rpc_server.rb
index 7dbcb7d479..57f99c8ce6 100644
--- a/src/ruby/lib/grpc/generic/rpc_server.rb
+++ b/src/ruby/lib/grpc/generic/rpc_server.rb
@@ -54,6 +54,7 @@ module GRPC
DEFAULT_MAX_WAITING_REQUESTS = 60
# Default poll period is 1s
+ # Used for grpc server shutdown and thread pool shutdown timeouts
DEFAULT_POLL_PERIOD = 1
# Signal check period is 0.25s
@@ -127,7 +128,7 @@ module GRPC
deadline = from_relative_time(@poll_period)
@server.close(deadline)
@pool.shutdown
- @pool.wait_for_termination
+ @pool.wait_for_termination(@poll_period)
end
def running_state
diff --git a/src/ruby/qps/server.rb b/src/ruby/qps/server.rb
index d0c2073dd1..6175855cd9 100644
--- a/src/ruby/qps/server.rb
+++ b/src/ruby/qps/server.rb
@@ -63,7 +63,9 @@ class BenchmarkServer
cred = :this_port_is_insecure
end
# Make sure server can handle the large number of calls in benchmarks
- @server = GRPC::RpcServer.new(pool_size: 100, max_waiting_requests: 100)
+ # TODO: @apolcyn, if scenario config increases total outstanding
+ # calls then will need to increase the pool size too
+ @server = GRPC::RpcServer.new(pool_size: 1024, max_waiting_requests: 1024)
@port = @server.add_http2_port("0.0.0.0:" + port.to_s, cred)
@server.handle(BenchmarkServiceImpl.new)
@start_time = Time.now