Description
We are seeing one of our services fail to start up in our CI environment several times a day due to what we believe is a race condition between the MediaDriver starting, and writing it's contents to CncFileDescriptor (the service that fails is the first one we start after the MediaDriver).
CommonContext.isDriverActive is throwing an IllegalStateException because the CnC version it expects does not match the version in CncFileDescriptor; the version in the CncFileDescriptor is coming back as 0.
Looking at the code in MediaDriver.conclude(), we believe the issue lies here:
The file is being created and then populated, and we believe the MappedByteBuffer being passed into CommonContext.isDriverActive is not null but the data has not been written to it, hence the 0 CnC version.
We are looking at creating a PR where a temporary file is used for creation and population, and then copy to where the CncFileDescriptor should be.
We are running the Java (Client and MediaDriver) 1.3.0 version.