aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby/lib
diff options
context:
space:
mode:
authorGravatar Alex Polcyn <apolcyn@google.com>2016-10-27 17:40:56 +0000
committerGravatar Alex Polcyn <apolcyn@google.com>2016-10-27 17:44:32 +0000
commit419934af6f2a92ead4928f1d256a3e807dd60ac6 (patch)
treec28b95899f46e6770dfe0e3af5c67dc6bea61cdf /src/ruby/lib
parentc5d447eb30814377c4be4d514524b48a36589015 (diff)
increase max thread pool size in benchmarks and fix shutdown ordering
Diffstat (limited to 'src/ruby/lib')
-rw-r--r--src/ruby/lib/grpc/generic/rpc_server.rb5
1 files changed, 3 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..1e70aba403 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
@@ -124,10 +125,10 @@ module GRPC
return if @running_state != :running
transition_running_state(:stopping)
end
+ @pool.shutdown
+ @pool.wait_for_termination(@poll_period)
deadline = from_relative_time(@poll_period)
@server.close(deadline)
- @pool.shutdown
- @pool.wait_for_termination
end
def running_state