-
Notifications
You must be signed in to change notification settings - Fork 103
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
Difficult to call self during integration test #245
Comments
Related: #87 |
This is related to trouble @peter-edge has encountered in building multi-process integration tests that need to listen on 0 and cross-communicate the port. It is almost like cases like this need a placement and service discovery system to direct traffic to tasks on ephemeral ports. How does Mesos hand-off a port to a task? Does it listen on 0, pass the address to the child process through an environment variable, expect the client to listen on the same port with SO_REUSEPORT, then at some point in the future release the socket? |
I think we might solve this specific case by having transport.Inbound implement a method that returns a peer chooser for its own address. tch := tchannel.NewTransport()
tchIn := tchIn.NewInbound()
rpc := yarpc.New(
"myservice",
Inbounds: []transport.Inbound{tchIn},
Outbounds: transport.Outbounds{
"myservice": tchIn.Loopback(),
},
)
rpc.Start() |
I’ve asked our Mesos friends how they manage the hand-off of ports to tasks. They reserve a block of high ports just under the ephemeral range, like 30,000 and up and Mesos meters these out to tasks. I’ll make note on Peter’s get ports PR. |
Closing based on @peter-edge's comment. |
For integration testing, a common desire will be to use a random port when listening, and to then configure an outbound for calling yourself. Currently, this isn't possible:
In the above solution,
7777
is the wrong port, but it's not possible to get the random port created when start was called on the inbound...Options:
None of these options are very satisfying...
The text was updated successfully, but these errors were encountered: