Description
In C++ client implementation, the constructor of MemoryMappedFile
calls ::fstat()
to get the size of the CnC file. I get a return value of 0
so the function does not fail. However, file size obtained from here is also 0
if I start the driver while the Aeron directory does not exist and start the clients immediately (under 0.1 s) after that. If I wait for 1 s before starting the clients, the probability drops; however, I still occasionally get the resulting exception.
When I checked the call stack, previously Aeron::mapCncFile()
gets called. Here the function waits until MemoryMappedFile::getFileSize()
returns a non-negative value. However, it does not wait to get a positive filesize.
Is this expected behaviour? In that case, what do I need to do to ensure I do not get an exception without an arbitrary wait period between Aeron driver and client startup?