I can confirm it is a race: Using a script that is starting two IOCs in parallel, we can see the effect happening about 1 out of 50 times.
When rsrv starts, there is a window between checking and getting exclusive access so that further checks fail.
As Torsten pointed out, only active listening sockets prevent another bind() with SO_REUSEADDR set on the sockets. From the socket(7) manpage:
SO_REUSEADDRIndicates that the rules used in validating addresses supplied in a bind(2) call should allow reuse of local addresses. For AF_INET sockets this means that a socket may bind, except when there is an active listening socket bound to the address.
If the second IOC calls bind() before the first IOC called listen(), the second bind() will succeed and the second IOC will fail later when it calls listen(). Currently it decides to go deaf (suspend the receiving thread) at that point, but it really should go back to the phase of testing bind() instead.
I'll create a LP bug for this.
Cheers,
~Ralph