DRILL-3811: AtomicRemainder incorrectly accounts for transferred allo…#163
DRILL-3811: AtomicRemainder incorrectly accounts for transferred allo…#163adeneche wants to merge 2 commits intoapache:masterfrom
Conversation
There was a problem hiding this comment.
I was surprised this compiled; in one of my recent patches, I had removed the "public" from TopLevelAllocator, but it seems to have come back. It was removed to force people to use RootAllocatorFactory.newRoot() instead of using the TopLevelAllocator constructor directly. Can you please remove the public from TopLevelAllocator again, and replace this constructor here and on the next line with RootAllocatorFactory.newRoot()?
|
Just one comment, otherwise +1 (non-binding). |
|
TopLevelAllocator's constructor is not public but because the unit test is in the same package it was able to access the constructor anyway. Fixed the test to use RootAllocatorFactory instead |
There was a problem hiding this comment.
Since this will be subtracting size bytes, should there be a check for availableShared >=0 ? I am not quite sure what's supposed to happen if this value drops below 0 at this point...
There was a problem hiding this comment.
It can become negative if the allocator takes ownership of a buffer and exceeds it's maximum allocated memory. Negative values are handled properly, at least that's my understanding
There was a problem hiding this comment.
It is likely handled..I will defer to Chris on that.
There was a problem hiding this comment.
This call is used when transferring ownership from the RPC layer to a receiving fragment -- and you can't refuse it -- the RPC layer has to hand it off. The problem is that the accounting for buffer ownership transfer and sharing is questionable in the original allocator. This is probably the best that can be done for now.
|
+1 . |
…cations this closes apache#163
…cations this closes apache#163
…cations