You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
denizevrenci
changed the title
C++ client ::mmap gets called with length 0
C++ client ::mmap() gets called with length 0
Apr 9, 2018
denizevrenci
changed the title
C++ client ::mmap() gets called with length 0
C++ client: ::mmap() gets called with length 0
Apr 9, 2018
Thanks @denizevrenci. This is not expected behaviour, it is a bug. I'm surprised we have not seen this before. I've pushed fixes for the C++ and Java implementations.
In C++ client implementation, the constructor of
MemoryMappedFile
calls::fstat()
to get the size of the CnC file. I get a return value of0
so the function does not fail. However, file size obtained from here is also0
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 untilMemoryMappedFile::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?
The text was updated successfully, but these errors were encountered: