Uploaded image for project: 'Apache Storm'
  1. Apache Storm
  2. STORM-2940

Set the CAPACITY value of LoadAwareShuffleGrouping dynamically

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0
    • None

    Description

      We have seen exceptions from workers 

      java.lang.IllegalArgumentException: bound must be positive
      

      The stack trace points to LoadAwareShuffleGrouping.java#L234:

      //in case we didn't fill in enough
      for (; currentIdx < CAPACITY; currentIdx++) {
      prepareChoices[currentIdx] = prepareChoices[random.nextInt(currentIdx)];
      }
      

      This is because in some situation, 

      int count = (int) ((indexAndWeights.weight / (double) weightSum) * CAPACITY);
      

      the above code will be 0 during the whole for-loop. For example, when there are more than 1000 (which is CAPACITY) downstream tasks, say 1001, and each task has weight 1.  Then for every target task, count =(int) ( (1 / 1001.0) * 1000) = 0.

       

      Attachments

        Issue Links

          Activity

            People

              ethanli Ethan Li
              ethanli Ethan Li
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 50m
                  1h 50m