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

resource leak due to not close KeyValueIterator implemented instances

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.1.0
    • streams
    • None

    Description

      Found there are "many" KeyValueIterator implemented instances don't explicitly get closed, which will cause resource leak.

      From the java doc in KeyValueIterator:

      * Users must call its {@code close} method explicitly upon completeness to release resources

       

      This issue mostly happen in tests because we usually query state store to get result iterator, and then do verification, but forgot close it. This issue also appear in the example code in our developer guide docs.

       

      I'll use try-with-resource to fix them. To avoid huge PR created, I split this bug into 3 sub-tasks.

      Attachments

        Activity

          People

            showuon Luke Chen
            showuon Luke Chen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: