dylwylie opened a new pull request #10356:
URL: https://github.com/apache/druid/pull/10356


   
   ### Description
   
   The size check in LimitedBufferHashGrouper can overflow and hence pass 
inadvertently. This results in the limited grouper being used when the buffer 
is too small and so the buffer.limit call within init fails with an 
IllegalArgumentException. 
   
   This is likely to only occur at large limits which aren't common but we've 
seen it occur on our production cluster. The following test added to 
LimitedBufferHashGrouperTest fails prior to this commit and passes after, I'm 
not sure it's useful enough to include in the commit itself but included here 
for anyone interested
   
   `  @Test
     public void testBufferTooSmallOverflowingLimit()
     {
       expectedException.expect(IAE.class);
       expectedException.expectMessage("LimitedBufferHashGrouper initialized 
with insufficient buffer capacity");
       final TestColumnSelectorFactory columnSelectorFactory = 
GrouperTestUtil.newColumnSelectorFactory();
       // Bucket size for the grouper is 28 bytes
       int limitToOverflow = Integer.MAX_VALUE / Integer.BYTES / 28;
       makeGrouper(columnSelectorFactory, 10000, 50000, limitToOverflow);
     }
   `
   
   
   This PR has:
   - [x] been self-reviewed.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to