[ 
https://issues.apache.org/jira/browse/KAFKA-16588?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chia-Ping Tsai updated KAFKA-16588:
-----------------------------------
    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])

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

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)


> broker shutdown hangs when `log.segment.delete.delay.ms` is zero 
> -----------------------------------------------------------------
>
>                 Key: KAFKA-16588
>                 URL: https://issues.apache.org/jira/browse/KAFKA-16588
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Chia-Ping Tsai
>            Assignee: Chia-Ping Tsai
>            Priority: Minor
>
> 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])



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to