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

Bug in socket server shutdown logic makes the broker hang on shutdown until it has to be killed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 0.8.0
    • None
    • network

    Description

      The current shutdown logic of the server shuts down the io threads first, followed by acceptor and finally processor threads. The shutdown API of io threads enqueues a special AllDone command into the common request queue. It shuts down the io thread when it dequeues this special all done command. What can happen is that while this shutdown command processing is happening on the io threads, the network/processor threads can still accept new connections and requests and will add those new requests to the request queue. That means, more requests can be enqueued after the AllDone command. What happens is that after the io threads have shutdown, there is no thread available to dequeue from the request queue. So the processor threads can hang while adding new requests to a full request queue, thereby blocking the server from shutting down.

      Attachments

        1. kafka-749-v1.patch
          7 kB
          Neha Narkhede
        2. kafka-749-v2.patch
          3 kB
          Neha Narkhede

        Activity

          People

            nehanarkhede Neha Narkhede
            nehanarkhede Neha Narkhede
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified