aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xsrc/ruby/.rspec1
-rw-r--r--src/ruby/lib/grpc/generic/rpc_server.rb12
-rw-r--r--src/ruby/spec/client_server_spec.rb3
-rw-r--r--src/ruby/spec/pb/health/checker_spec.rb1
4 files changed, 8 insertions, 9 deletions
diff --git a/src/ruby/.rspec b/src/ruby/.rspec
index 2320752db4..efeee2c1d2 100755
--- a/src/ruby/.rspec
+++ b/src/ruby/.rspec
@@ -1,5 +1,6 @@
-I.
-Ipb
+--backtrace
--require spec_helper
--format documentation
--color
diff --git a/src/ruby/lib/grpc/generic/rpc_server.rb b/src/ruby/lib/grpc/generic/rpc_server.rb
index 38ea333413..3740ac52da 100644
--- a/src/ruby/lib/grpc/generic/rpc_server.rb
+++ b/src/ruby/lib/grpc/generic/rpc_server.rb
@@ -417,18 +417,18 @@ module GRPC
begin
an_rpc = @server.request_call(@cq, loop_tag, INFINITE_FUTURE)
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])
+ end
+ end
rescue Core::CallError, RuntimeError => e
# these might happen for various reasonse. The correct behaviour of
# the server is to log them and continue, if it's not shutting down.
GRPC.logger.warn("server call failed: #{e}") unless stopped?
next
end
- unless c.nil?
- mth = an_rpc.method.to_sym
- @pool.schedule(c) do |call|
- rpc_descs[mth].run_server_method(call, rpc_handlers[mth])
- end
- end
end
@running = false
GRPC.logger.info("stopped: #{self}")
diff --git a/src/ruby/spec/client_server_spec.rb b/src/ruby/spec/client_server_spec.rb
index 387f2baec2..ad0fb26896 100644
--- a/src/ruby/spec/client_server_spec.rb
+++ b/src/ruby/spec/client_server_spec.rb
@@ -28,7 +28,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
require 'grpc'
-require 'spec_helper'
include GRPC::Core
@@ -41,7 +40,7 @@ shared_context 'setup: tags' do
end
def deadline
- Time.now + 2
+ Time.now + 5
end
def server_allows_client_to_proceed
diff --git a/src/ruby/spec/pb/health/checker_spec.rb b/src/ruby/spec/pb/health/checker_spec.rb
index d7b7535cbe..9bc82638c7 100644
--- a/src/ruby/spec/pb/health/checker_spec.rb
+++ b/src/ruby/spec/pb/health/checker_spec.rb
@@ -179,7 +179,6 @@ describe Grpc::Health::Checker do
describe 'running on RpcServer' do
RpcServer = GRPC::RpcServer
- StatusCodes = GRPC::Core::StatusCodes
CheckerStub = Grpc::Health::Checker.rpc_stub_class
before(:each) do