hyrise / hyrise-v1

HYRISE In-Memory Hybrid Storage Engine (archived, now developed in hyrise/hyrise repo)
https://github.com/hyrise/hyrise
MIT License
88 stars 44 forks source link

Server should fail if port is not available #347

Closed mrks closed 10 years ago

mrks commented 10 years ago

If I start Hyrise with --port=1234 and that port is taken, Hyrise should fail and exit. I cannot think of a use case where I would want Hyrise to take port 1235. Hyrise just taking another port will cause issues with benchmarks/tests/... that expect it to start on the given port.

This has caused a number of issues in the past and a lot of wasted time with scripts that did not use hyrise_server.port. I believe that it should not be required from users to deal with this unexpected behavior.

kaihowl commented 10 years ago

+1 Hyrise should exit with some non-zero exit code.

bastih commented 10 years ago

The other way around has been much more trouble for our CI system, where you would have to otherwise use arbitrary port numbering schemes which makes it difficult to run tests in parallel. I'm certainly open to a patch that allows to specify an optional parameter to find the first open port after --port=val and make the described behavior the default.

bastih commented 10 years ago

Also, such "fixed" ports prevent easy working of two people on the same machine.

mrks commented 10 years ago

Why not let the OS pick the port (which it does if you bind the server to port 0) unless --port is set?

mrks commented 10 years ago

About two people on the same machine: In that case, they will have to chose their own ports. At least they will know that there are conflicts and will not unknowingly interfere with each other

kaihowl commented 10 years ago

I can't think of a valid use case involving two people running separate hyrise instances. If two people actually want to use two instances, they just have coordinate who uses which port. Seems easy and reasonable to me.

On Apr 9, 2014, at 3:47 PM, Sebastian Hillig notifications@github.com wrote:

Also, such "fixed" ports prevent easy working of two people on the same machine.

— Reply to this email directly or view it on GitHub.

bastih commented 10 years ago

bind(0) sounds like a good solution to me, I wasn't fully aware of that one. Wrap it up in a patch and write the ".port" file and we're good to go.

CI testing always involves an unknown number of running parallel instances, so this is a must, not an optional feature.

mrks commented 10 years ago

Merci :)