Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-10899

Closing check Before Producer's BufferPool allocat memory

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.8.0
    • None
    • producer
    • None

    Description

      #9817   Closing check Before Producer's BufferPool allocat memory

      According to the idea of #7967, it made BufferPool support closing.
      Now, there are two places in the BufferPool#allocate() method to judge the 'closed' flag. One is when 'lock' is acquired, and the other is when 'condition' is awakened.

      However, if the memory is allocated outside the 'lock' code block after 'freeup',
      Therefore, it is possible for another thread to modify the 'closed' flag, causing this part of memory to be allocated in vain.

      So two modifications have been made,
      One is to add the 'volatile' modifier before 'closed',
      One is to determine whether to 'closed' before allocating memory.

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              unlizhao lizhao
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: