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

Source task source offset reads can block graceful shutdown

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0.2, 1.1.1, 2.0.1, 2.1.1, 2.3.0, 2.2.1, 2.4.0, 2.5.0
    • 2.0.2, 2.1.2, 2.2.3, 2.5.0, 2.3.2, 2.4.1
    • connect
    • None

    Description

      When source tasks request source offsets from the framework, this results in a call to Future.get() with no timeout. In distributed workers, the future is blocked on a successful read to the end of the source offsets topic, which in turn will poll that topic indefinitely until the latest messages for every partition of that topic have been consumed.

      This normally completes in a reasonable amount of time. However, if the connectivity between the Connect worker and the Kafka cluster is degraded or dropped in the middle of one of these reads, it will block until connectivity is restored and the request completes successfully.

      If a task is stopped (due to a manual restart via the REST API, a rebalance, worker shutdown, etc.) while blocked on a read of source offsets during its start method, not only will it fail to gracefully stop, but the framework will not even invoke its stop method until its start method (and, as a result, the source offset read request) has completed. This prevents the task from being able to clean up any resources it has allocated and can lead to OOM errors, excessive thread creation, and other problems.

       

      I've confirmed that this affects every release of Connect back through 1.0 at least; I've tagged the most recent bug fix release of every major/minor version from then on in the Affects Version/s field to avoid just putting every version in that field.

      Attachments

        Issue Links

          Activity

            People

              ChrisEgerton Chris Egerton
              ChrisEgerton Chris Egerton
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: