Open fluffynuts opened 4 years ago
Saw this issue while browsing for stuff to do. Doesn't this commit 79799728d87281aa4b22cc55fbf5b9c1ea263f1a fix this issue? Or does this problem still occur even with the port finder?
I don't see this often, but it's still possible as a race condition, especially if you're setting the TEMPDB_PORT_HINT
environment variable (which is really useful if you'd like to connect to the tempdb with other tools whilst debugging). Basically, we select a random port (or the hinted one), test if it's in use (and if it is, re-roll, or, if using the hint, increment), then try to start up mysql - which is not instantaneous. So if you're using the port hint and run test assemblies in parallel, it's quite possible to trigger this; if you're running without the port hint, it's possible, but a lot less likely. Of course, it's also possible that something else grabs the port in the second or two it takes mysql to get up and listening.
At any rate, it would be neat if, upon mysql failing to start, the tempdb wrapper could interrogate the error log, and if it sees a port conflict, try again with a new port. I just haven't gotten around to it yet, and it's infrequent enough that I haven't had my hand forced.
I've seen a mysql tempdb attempt to start up and fail with this in the error log:
Perhaps TempDbMySql could look for mysql-err.log and try to grok this issue; if found, re-randomize the port and try again.