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

Fix FetchResponse#`fetchData` and `forgottenTopics`: Assignment of lazy-initialized members should be the last step with double-checked locking

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 3.0.1
    • 3.3.0
    • clients
    • None

    Description

      Double-checked locking can be used for lazy initialization of volatile fields, but only if field assignment is the last step in the synchronized block. Otherwise, you run the risk of threads accessing a half-initialized object.

      The problem is consistent with KAFKA-13777

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lyunk YunKui Lu
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: