-
-
Notifications
You must be signed in to change notification settings - Fork 336
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
Starting/stopping listeners on a single port in a tight loop crashes ranch_listener_sup #74
Comments
@essen bump. |
I got a variant of this where I get an already_started when a listener should have been stopped. I will investigate tomorrow and try to put a fix in the next version. |
I don't think I can do anything for your particular error. It happens even if I set {reuseaddr, true}. It still happens in R17 although the actual error is different, you get a {error, eaddrinuse} error instead. For testing I'd suggest using {port, 0} to get a port number dynamically and/or avoid restarting everything all the time (your tests will run faster that way too). Closing this ticket though. Thanks! |
Could you elaborate on what exactly is causing the error though? |
I have no idea. I suppose the OS doesn't immediately allow the socket to be reused and if you try to reuse it too quickly you get that error, but as this is out of the realm of the things I can fix I didn't investigate further. |
... And the other issue I noticed was actually an issue in the test suite itself. Sorry for the noise on that one. |
This is kind of corner-case behavior, but thought you might want to know.
Observed on current master (c1d0c45) and tag
0.8.3
, running R15B03.Starting and then immediately stopping ranch listeners seems to cause a crash (I know the modules make no sense, it's just there to pass the
code:ensure_loaded/1
):The key to reproducing this is a fairly large pool size and a single port, which might mean this is something to do with the OS not being happy about binding sockets so intensively. So hopefully you can reproduce it.
I bumped into this, because I was running lots of small tests where cowboy was stopped and started on each one of them multiple times and had undeterministic failures.
The text was updated successfully, but these errors were encountered: