Chia-Ping Tsai created KAFKA-21573:
--------------------------------------
Summary: The locks destroyed by handleLogDirFailure get destroyed
again in shutdown
Key: KAFKA-21573
URL: https://issues.apache.org/jira/browse/KAFKA-21573
Project: Kafka
Issue Type: Bug
Reporter: Chia-Ping Tsai
Assignee: Chia-Ping Tsai
{code:java}
[2026-11-17 20:28:44,371] WARN Exception while execution the action
(kafka.server.BrokerServer)java.nio.channels.ClosedChannelException at
java.base/sun.nio.ch.FileLockImpl.release(FileLockImpl.java:58) at
org.apache.kafka.server.util.FileLock.unlock(FileLock.java:80) at
org.apache.kafka.server.util.FileLock.destroy(FileLock.java:88) at
org.apache.kafka.storage.internals.log.LogManager.shutdown(LogManager.java:919)
at kafka.server.BrokerServer.$anonfun$shutdown$23(BrokerServer.scala:945)
at org.apache.kafka.common.utils.Utils.swallow(Utils.java:1043) at
kafka.server.BrokerServer.shutdown(BrokerServer.scala:945) at
kafka.server.KafkaBroker.shutdown(KafkaBroker.scala:102) at
kafka.server.KafkaBroker.shutdown$(KafkaBroker.scala:102) at
kafka.server.BrokerServer.shutdown(BrokerServer.scala:83) at
kafka.server.KafkaRaftServer.$anonfun$shutdown$1(KafkaRaftServer.scala:106) at
kafka.server.KafkaRaftServer.$anonfun$shutdown$1$adapted(KafkaRaftServer.scala:106)
at scala.Option.foreach(Option.scala:437) at
kafka.server.KafkaRaftServer.shutdown(KafkaRaftServer.scala:106) at
kafka.Kafka$.$anonfun$main$3(Kafka.scala:89) at
java.base/java.lang.Thread.run(Thread.java:840)
{code}
handleLogDirFailure destroys the dirLocks but they aren’t removed from the
list. Hence, {{shutdown}} will destroy them again. It won’t hurt the system,
since the locks aren’t used in other cases. However, the scary output still
needs to be eliminated.
Note that the exception also breaks the loop, so the remaining locks are not
destroyed.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)