-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
Decref CacheFileRegion after read is done not before #102848
Conversation
Hi @tlrx, I've created a changelog YAML for you. |
Pinging @elastic/es-distributed (Team:Distributed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tlrx only thing to fix is the title, CacheFileRegion is what you decrement here :) |
🤦🏻 Thanks for noticing! |
When assertions are enabled, could we fill regions with junk on release? That would make it easier to catch this kind of thing I think. |
CI failures are #102575 |
Probably, I take the point. Thanks for the suggestion! |
Thanks Armin! |
The CacheFileRegion instance is decref before the read operation is executed, meaning that the SharedBytes.IO instance can return to the pool of free regions, being polled and written by another thread for another cache file region, before the first read is effectively completed (and will return incorrect bytes).
The CacheFileRegion instance is decref before the read operation is executed, meaning that the SharedBytes.IO instance can return to the pool of free regions, being polled and written by another thread for another cache file region, before the first read is effectively completed (and will return incorrect bytes).
The CacheFileRegion instance is decref before the read operation is executed, meaning that the SharedBytes.IO instance can return to the pool of free regions, being polled and written for another cache file region by another thread, before the first read is effectively completed (and will return incorrect bytes).