Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-6943

ClusterDistributionManager.SerialQueuedExecutorPool.getThrottledSerialExecutor has issues in logic



    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • messaging
    • None


      The logic of getThrottledSerialExecutor has the following issues:

      1. It reads the stat in three different places. One of those is outside the loop but that seems wrong. Each time it is used inside the loop to calculate how long to sleep it should be using the current value.
      2. It is compared against two different constants. To get in the loop it must be greater than TOTAL_SERIAL_QUEUE_THROTTLE. To exit the loop it must be >= to TOTAL_SERIAL_QUEUE_BYTE_LIMIT. This seems wrong but it might be correct.
      3. The constant TOTAL_SERIAL_QUEUE_THROTTLE is calculated from SERIAL_QUEUE_BYTE_LIMIT. This looks like a copy and past mistake. I think it should be TOTAL_SERIAL_QUEUE_BYTE_LIMIT
      4. It looks like the intent of this code is to block message senders if we currently have more than TOTAL_SERIAL_QUEUE_BYTE_LIMIT message bytes queued up for sending. But the whole sleep calculation is scary. If we want this throttling then it seems like instead of sleeping we should wait until we see the value go below a threshold. We can make this event driven since it is our code that will decrement the value as messages are removed from the queue.


        Issue Links



              Unassigned Unassigned
              kaslami Kamilla Aslami
              0 Vote for this issue
              1 Start watching this issue