Code review comment for lp:~akopytov/percona-xtrabackup/replication-support-in-test-suite-1.6

Revision history for this message
Stewart Smith (stewart) wrote :

On Tue, 12 Jun 2012 07:42:22 -0000, Alexey Kopytov <email address hidden> wrote:
> Yes, I was looking at MTR when implementing get_free_port(). It uses absolutely the same probing method, so it has the same race. The only difference is that MTR tries to get a unique ID for "build thread" with the file locking primitives, which are unavailable in shell. So the XB test suite uses random numbers instead.
>
> But anyway, MTR also "pings" the port and then tries starting the
> server on that port. I think he problem is not that serious in
> reality, with only a few possible concurrent runs, and only a few
> seconds between checking a port and using it.

The lock in MTR should prevent the race though, as only one process is
ever going to get the lock.

We could do the next best thing by putting pid in a file, and if pid
exists, it is in use (for if we fail to cleanup file).

thoughts?

--
Stewart Smith

« Back to merge proposal