Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add server port flag and explanation to example #119

Merged
merged 1 commit into from
Mar 22, 2021

Conversation

codeblooded
Copy link
Contributor

The C++ workers in grpc/grpc rely on a server to find available ports when no explicit port is given. Unfortunately, this script relies on Python's subprocess package. The subprocess package has some compatibility issues with Docker, creating an issue where the port server could not start.

To temporarily resolve this problem, this commit explicitly introduces a --server_port flag in the run section of the server for the C++ example LoadTest YAML file. Specifying this flag disables the need for a port server, bypassing the problematic code.

The C++ workers in grpc/grpc rely on a server to find available ports
when no explicit port is given. Unfortunately, this script relies on
Python's subprocess package. The subprocess package has some
compatibility issues with Docker, creating an issue where the port
server could not start.

To temporarily resolve this problem, this commit explicitly introduces a
--server_port flag in the run section of the server for the C++ example
LoadTest YAML file. Specifying this flag disables the need for a port
server, bypassing the problematic code.
@codeblooded codeblooded added the bug Something isn't working label Mar 19, 2021
@codeblooded codeblooded self-assigned this Mar 19, 2021
Copy link
Collaborator

@wanlin31 wanlin31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also have tried this with pre-built cxx workers, worked just great!

@wanlin31
Copy link
Collaborator

Do you want to add a release tag on this one?

@codeblooded
Copy link
Contributor Author

Do you want to add a release tag on this one?

I'm not sure. It solves the problem, but it's just an example configuration change. It's more of a workaround. I'll merge and let @paulosjca add the release notes label if he feels it's appropriate. I'm indifferent.

@codeblooded codeblooded merged commit 5f7eefe into grpc:master Mar 22, 2021
@jtattermusch
Copy link
Collaborator

@codeblooded @wanlin31
I haven't looked into the C++ port server issue in detail, but this tip might come handy:

  • the grpc build allows one to build with the GRPC_PORT_ISOLATED_RUNTIME define.
    https://github.com/grpc/grpc/blob/86f93801e5d452cff40d6958d21a8eb211da0654/test/core/util/port_isolated_runtime_environment.cc#L29
    The semantics is basically "we know we're gonna be running in environment where port collision is not going to happen (e.g. under docker container), so instead of using port server, simply pick a port randomly".
  • if running port_server under docker is a problem (I wouldn't be surprised), we can build C++ qps_worker with GRPC_PORT_ISOLATED_RUNTIME=1 and that will eliminate the need for specifying the --server_port arg?
  • if we decide to use this workaround (leaving up to you), there should a be a comment somewhere that explains what's being done and why.

We use this for some of our tests that we know are running in an isolated environment:
https://github.com/grpc/grpc/blob/03adef1d3cb6a796f9a910794dfbcea48f510ba8/tools/remote_build/rbe_common.bazelrc#L43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants