Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-3811

AtomicRemainder incorrectly accounts for transferred allocations

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      when an allocator takes ownership of a buffer, AtomicRemainder.forceGet(int) is called to account for the extra memory of the buffer, but when the allocator exceeds it's maximum allocated memory it accounts for it incorrectly. In the following code, availableShared.andAndGet(size) should actually receive -size:

      public boolean forceGet(long size) {
          if (get(size, this.applyFragmentLimit)) {
            return true;
          } else {
            availableShared.addAndGet(size);
            if (parent != null) {
              parent.forceGet(size);
            }
            return false;
          }
        }
      

      I was able to reproduce the issue in a simple unit test

      Attachments

        1. DRILL-3811.1.patch.txt
          6 kB
          Abdel Hakim Deneche

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            cchang@maprtech.com Chun Chang
            adeneche Abdel Hakim Deneche
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment