Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ client: ::mmap() gets called with length 0 #499

Closed
denizevrenci opened this issue Apr 9, 2018 · 2 comments
Closed

C++ client: ::mmap() gets called with length 0 #499

denizevrenci opened this issue Apr 9, 2018 · 2 comments
Labels

Comments

@denizevrenci
Copy link
Contributor

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?

@denizevrenci denizevrenci changed the title C++ client ::mmap gets called with length 0 C++ client ::mmap() gets called with length 0 Apr 9, 2018
@denizevrenci denizevrenci changed the title C++ client ::mmap() gets called with length 0 C++ client: ::mmap() gets called with length 0 Apr 9, 2018
@mjpt777 mjpt777 added the bug label Apr 9, 2018
@mjpt777
Copy link
Contributor

mjpt777 commented 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.

@denizevrenci
Copy link
Contributor Author

Thank you for the quick fix.

@mjpt777 mjpt777 closed this as completed Apr 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants