|
Turns out, that it is possible for a process other than mysqld to bind socket on mysqld, on IPv4, while the server binds on dual-stack IPv6. This was found by accident, testing the MSI installer, which has the ability to check for a free port (it would reject the port in GUI, when the port is already used ) .
Looks like the logic for checking for free port needs to be taken from server.
This points to be possibility of the port hijacking on Windows 10, even without SO_REUSEADDR. Perhaps we need to use to SO_EXCLUSIVEADDRUSE on the listening socket in the future, alas this can come with some surprises according to documentation, and a possible delays and/or failures at restart , due to "time wait delays"
Also interesting to note, that current logic has worked in the past. Something in TCP stack has changed in Windows 10, relatively recently.
|