Closed weisslj closed 7 years ago
Please disregard this pull request until I have figured out why the test case failed. I will push a fix to this branch as soon as possible.
Hi,
The error is a bug with the testsuite. It happens on Travis only, because VMs can be really slow probably. I don't found time to work on it for now. But this is unrelated with your patch. I guess that by restarting the job, it will pass.
Hi @capflam,
I also believe that it is a bug with the testsuite, I am currently trying to find it. Without Travis about 2 out of 100 runs of make test
trigger badbind
.
Hi @weisslj,
I've finally merged your pull request. I had no time to find the bug in the testsuite. It's annoying but not critical. And your pull request was good enough to be merged. Thanks.
OK, thanks! I spent some time after my comment to find out why the test suite fails, without success.
Since df1d7bf Yaws does not really open port 0 anymore, but tries to open one from 49152 onwards. This leads to "badbind" errors when e.g. executing multiple separate common test runs which use Yaws repeatedly.
With this patch port 0 is opened instead, the port number retrieved, and closed again. This still is not completely safe, as the port could be taken by another application in the short time Yaws tries to listen on it again, but in practice I could not reproduce badbind errors.
This approach leaves all advantages of df1d7bf, but also respects the local range for dynamic ports if specified, see http://stackoverflow.com/a/924337.
Here is a test program which illustrates the problem. With this patch it runs continuously, without it stops with "badbind":