-
Notifications
You must be signed in to change notification settings - Fork 154
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
Behavior when starting server on a used port #98
Comments
Yeah, good call. Thanks! |
Is anyone working on this? If not, I will work on a patch for this issue this weekend. Just want to make sure I don't duplicate other people's work :) |
I tried to do something, but I wasn't satisfied with it. If I remember well what I found, the start_listener in dynamo/lib/dynamo/cowboy.ex will return the same as gen_tcp from OTP : http://erlang.org/doc/man/gen_tcp.html. What I had done was to show a warning in the console, not cancel the whole thing. The port will be used by dynamo once freed, so I figured there was not reason to make it crash. I won't have time to work on this again soon, but I hope this helps! |
@jnl 👍 |
I tried to reproduce this and found that dynamo never attached to the conflicted port after killing the conflicting application. (The other comments here indicate they observed the opposite.)
If I run I am new to elixir, so it may be that my local set-up is misbehaving and dynamo should continue trying to attach to a bound port. If that's the case I'll try to get my local env in shape before adding any new behavior. When there is a port conflict, Dynamo.Cowboy.start_listener returns:
I'm not too familiar with ranch/cowboy, but should this (or any :error from :cowboy.start_http/s) be a terminal condition for dynamo start-up? Obviously logging the condition would be nice regardless. |
@akappen Oddly enough, I see the same as you now. The "mix server" won't re-attach on its own, despite what I noted before. In this case, I second your suggestion to make this a fatal error. I see no point in adding complexity to dynamo simply to retry the port, it should simply fail I think. |
Addresses issue #98, used port when starting dynamo
Fixed on master, thanks @jni- |
So, I'm not sure exactly what the behavior is supposed to be but I started the server with
mix server
and I forgot I had ajekyll
server running already on port 4000. The dynamo server started just fine and didn't complain but when I visitedlocalhost:4000
the jekyll page showed up.Shouldn't dynamo complain that the port is in use?
On the other hand, all I had to do was shut the jekyll app down and dynamo served just fine without restarting.
The text was updated successfully, but these errors were encountered: