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

broker shutdown hangs when `log.segment.delete.delay.ms` is zero

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.8.0
    • None
    • None

    Description

      see https://github.com/apache/kafka/blob/f22ad6645bfec0b38e820e0090261c9f6b421a74/core/src/main/scala/kafka/log/LogManager.scala#L1154

      If `log.segment.delete.delay.ms` is zero, We call `take` even though the `logsToBeDeleted` is empty, and `KafkaScheduler#shutdown` call `shutdown` rather than `shudownNow` (https://github.com/apache/kafka/blob/trunk/server-common/src/main/java/org/apache/kafka/server/util/KafkaScheduler.java#L134)

      Hence, the thread won't be completed forever, and it blocks the shutdown of broker.

      We should replace the `take` by `poll` since we have checked the element before.

      BTW, the zero is allowed (https://github.com/apache/kafka/blob/f22ad6645bfec0b38e820e0090261c9f6b421a74/storage/src/main/java/org/apache/kafka/storage/internals/log/LogConfig.java#L258)

      Attachments

        Issue Links

          Activity

            People

              yangpoan PoAn Yang
              chia7712 Chia-Ping Tsai
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: