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

Refactor StreamThread to take advantage of new ConsumerRebalanceListener exception handling

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.0
    • Fix Version/s: 2.6.0
    • Component/s: streams
    • Labels:
      None

      Description

      As part of KIP-429 we solved the long-standing issue where exceptions thrown during the ConsumerRebalanceListener's callbacks were swallowed, and changed the behavior so that these exceptions are now bubbled all the way up to the Consumer#poll call.

      Because of the original behavior, any exceptions thrown during task creation, suspension, closure, etc. had to be caught by the rebalance listener and passed on to the calling StreamThread by setting a "rebalanceException" field. This then has to be checked after every polling loop.

      We should refactor this in light of the new & fixed behavior, so that we can simply catch rebalance exceptions thrown from poll rather than check for them explicitly after every call. This has the additional benefit of being able to react to it immediately (whereas currently we have to go through the remainder of the entire `StreamThread#runOnce` loop before we notice the exception.

        Attachments

          Activity

            People

            • Assignee:
              bchen225242 Boyang Chen
              Reporter:
              ableegoldman A. Sophie Blee-Goldman
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: