Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-28240

NettyShuffleMetricFactory#RequestedMemoryUsageMetric#getValue may throw ArithmeticException when the total segments of NetworkBufferPool is 0

    XMLWordPrintableJSON

Details

    Description

      In a single vertex job, the network memory can be set to 0 since the job doesn't need it, and in this case the totalNumberOfMemorySegments of the NetworkBufferPool will also be 0.

      While the NettyShuffleMetricFactory#RequestedMemoryUsageMetric#getValue uses the totalNumberOfMemorySegments of NetworkBufferPool as divisor without validating, so an ArithmeticException will be thrown when the totalNumberOfMemorySegments is 0.

      Since 0 network memory is in fact valid for a single vertex job, I suppose the RequestedMemoryUsageMetric#getValue should check if the devisor is 0, and return 0 as the usage directly in such cases.

      Attachments

        Issue Links

          Activity

            People

              pltbkd Gen Luo
              pltbkd Gen Luo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: