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
Possible race condition in get_free_port #16754
Comments
This may be a symptom of how Servo's integration with the webdriver server is different from other browsers. My understanding is that other browsers have a separate server that spawns instances of the browser, whereas Servo has the server integrated directly into each instance of the browser. If there are multiple threads starting multiple browsers, maybe we could use a mutex inside this code to avoid the race. |
I do wonder if every usage of This code has annoyed me for a long time, because it seems prone to raciness and there are multiple ways this could fail (heck, some other process could open that port!). It would definitely be nice to fix this more generally, though I don't really know how… |
From @georgeroman in #16819:
So reopening for everywhere else. |
And for those wondering why we don't just use port "0" (i.e., let the system assign us a port): this is used when we need to pass an argument in (typically as a subprocess command-line argument) giving the port to use. |
I am experimenting with WebDriver in Servo and came across with what might be a race condition in the
get_free_port
function. That is, sometimes whenwptrunner
runs the tests in parallel, two webdriver instances get assigned the same port.You can find all the details here: servo/servo#22619 (comment).
The text was updated successfully, but these errors were encountered: