aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby/lib
diff options
context:
space:
mode:
authorGravatar Michael Lumish <mlumish@google.com>2015-11-12 14:10:08 -0800
committerGravatar Michael Lumish <mlumish@google.com>2015-11-12 14:10:08 -0800
commit75065d4b1f47ab3bf9e0e4fa3f3f6368db1fc4c7 (patch)
treec157d8f6742e66f4ad15cc2d3c9db48bfb2e1be7 /src/ruby/lib
parent05e466e35f759dd8f204d51ea33b082bd19ec037 (diff)
parenta082435e064014300c1fa9d1c3becbe2a41b0be8 (diff)
Merge pull request #4106 from tbetbetbe/grpc_ruby_fix_flaky_ruby_interop_test
Grpc ruby fix flaky ruby interop test
Diffstat (limited to 'src/ruby/lib')
-rw-r--r--src/ruby/lib/grpc/generic/rpc_server.rb19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/ruby/lib/grpc/generic/rpc_server.rb b/src/ruby/lib/grpc/generic/rpc_server.rb
index 228c500672..0e318bd53b 100644
--- a/src/ruby/lib/grpc/generic/rpc_server.rb
+++ b/src/ruby/lib/grpc/generic/rpc_server.rb
@@ -418,11 +418,11 @@ module GRPC
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
- @pool.schedule(c) do |call|
- rpc_descs[mth].run_server_method(call, rpc_handlers[mth])
+ active_call = new_active_server_call(an_rpc)
+ unless active_call.nil?
+ @pool.schedule(active_call) do |ac|
+ c, mth = ac
+ rpc_descs[mth].run_server_method(c, rpc_handlers[mth])
end
end
rescue Core::CallError, RuntimeError => e
@@ -442,6 +442,7 @@ module GRPC
# allow the metadata to be accessed from the call
handle_call_tag = Object.new
an_rpc.call.metadata = an_rpc.metadata # attaches md to call for handlers
+ GRPC.logger.debug("call md is #{an_rpc.metadata}")
connect_md = nil
unless @connect_md_proc.nil?
connect_md = @connect_md_proc.call(an_rpc.method, an_rpc.metadata)
@@ -454,9 +455,11 @@ module GRPC
# Create the ActiveCall
GRPC.logger.info("deadline is #{an_rpc.deadline}; (now=#{Time.now})")
rpc_desc = rpc_descs[an_rpc.method.to_sym]
- ActiveCall.new(an_rpc.call, @cq,
- rpc_desc.marshal_proc, rpc_desc.unmarshal_proc(:input),
- an_rpc.deadline)
+ c = ActiveCall.new(an_rpc.call, @cq,
+ rpc_desc.marshal_proc, rpc_desc.unmarshal_proc(:input),
+ an_rpc.deadline)
+ mth = an_rpc.method.to_sym
+ [c, mth]
end
protected