Github user parthchandra commented on a diff in the pull request:

    https://github.com/apache/drill/pull/323#discussion_r49890071
  
    --- Diff: 
exec/memory/base/src/main/java/org/apache/drill/exec/memory/AllocationManager.java
 ---
    @@ -168,20 +213,26 @@ private BufferLedger(BaseAllocator allocator, 
ReleaseListener listener) {
         /**
          * Transfer any balance the current ledger has to the target ledger. 
In the case that the current ledger holds no
          * memory, no transfer is made to the new ledger.
    -     *
          * @param target
          *          The ledger to transfer ownership account to.
          * @return Whether transfer fit within target ledgers limits.
          */
    -    public boolean transferBalance(BufferLedger target) {
    +    public boolean transferBalance(final BufferLedger target) {
           Preconditions.checkNotNull(target);
           Preconditions.checkArgument(allocator.root == target.allocator.root,
               "You can only transfer between two allocators that share the 
same root.");
    +      allocator.assertOpen();
    +
    +      target.allocator.assertOpen();
    +      // if we're transferring to ourself, just return.
    +      if (target == this) {
    +        return true;
    +      }
     
           // since two balance transfers out from the allocator manager could 
cause incorrect accounting, we need to ensure
           // that this won't happen by synchronizing on the allocator manager 
instance.
    --- End diff --
    
    Comment needs to be updated


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to