Skip to content

Timeout occurs when making nested requests in development mode #229

@heyZeus

Description

@heyZeus

Please describe the issue

When running in development Rails env, requesting multiple internal GRPC requests on the same server, to the same server, results in a timeout.

How to Reproduce

A process will make a request to GRPCServerA for to Endpoint1.
In Endpoint1, make a request to GRPCServerA for Endpoint2.

Endpoint2 will timeout, but you will see in the logs that it did execute and the response was blocked. I can see in the stacktrace, that's it's waiting here.

/gems/grpc-1.72.0-arm64-darwin/src/ruby/lib/grpc/generic/active_call.rb:119:in `synchronize'
/gems/grpc-1.72.0-arm64-darwin/src/ruby/lib/grpc/generic/active_call.rb:119:in `send_initial_metadata'
/gems/grpc-1.72.0-arm64-darwin/src/ruby/lib/grpc/generic/active_call.rb:216:in `send_status'
/gems/grpc-1.72.0-arm64-darwin/src/ruby/lib/grpc/generic/rpc_desc.rb:198:in `send_status'
/gems/grpc-1.72.0-arm64-darwin/src/ruby/lib/grpc/generic/rpc_desc.rb:134:in `rescue in run_server_method'
/gems/grpc-1.72.0-arm64-darwin/src/ruby/lib/grpc/generic/rpc_desc.rb:117:in `run_server_method'
/gems/grpc-1.72.0-arm64-darwin/src/ruby/lib/grpc/generic/rpc_server.rb:459:in `block in loop_handle_server_calls'
/gems/grpc-1.72.0-arm64-darwin/src/ruby/lib/grpc/generic/rpc_server.rb:138:in `block in loop_execute_jobs'
/gems/grpc-1.72.0-arm64-darwin/src/ruby/lib/grpc/generic/rpc_server.rb:135:in `loop'
/gems/grpc-1.72.0-arm64-darwin/src/ruby/lib/grpc/generic/rpc_server.rb:135:in `loop_execute_jobs'
/gems/grpc-1.72.0-arm64-darwin/src/ruby/lib/grpc/generic/rpc_server.rb:84:in `block (2 levels) in start'
/gems/grpc-1.72.0-arm64-darwin/src/ruby/lib/grpc/generic/rpc_server.rb:83:in `catch'
/gems/grpc-1.72.0-arm64-darwin/src/ruby/lib/grpc/generic/rpc_server.rb:83:in `block in start'

What should happen?

The call to Endpoint2 should complete and not timeout.

Anything else we should know?

This does not occur in production mode. It looks like this bug occurs because of reloading. Unfortunately, there doesn't appear to be a way to disable reloading in development mode. If there was something in the configuration or environment variable to disable reloading that would be nice.

  • gRPC version - 1.7.2
  • Ruby version - 3.2.8
  • OS - MacOSX 14.5
  • Does it occur at certain traffic volumes, payload size, etc. - This happens all of the time there is a request within a request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions