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

KafkaLog4jAppender deadlocks when idempotence is enabled

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.1.0, 3.0.0, 3.0.1
    • 3.3.0
    • log
    • None

    Description

      KafkaLog4jAppender instantiates a KafkaProducer to append log entries to a Kafka topic. The producer.send operation may need to acquire locks during its execution. This can result in deadlocks when a log entry from the producer network thread is also at a log level that results in the entry being appended to a Kafka topic (KAFKA-6415).

      https://github.com/apache/kafka/pull/11691 enables idempotence by default, and it introduced another place where the producer network thread can hit a deadlock. When calling TransactionManger#maybeAddPartition, the producer network thread will wait on the TransactionManager lock, and a deadlock can happen if TransactionManager also logs at INFO level. This is causing system test failures in log4j_appender_test.py

      Similar to KAFKA-6415, a workaround will be setting log level to WARN for TransactionManager in VerifiableLog4jAppender.

       

      Attachments

        Issue Links

          Activity

            People

              yyu1993 Yang Yu
              yyu1993 Yang Yu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: