[ https://issues.apache.org/jira/browse/KAFKA-19054?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Matthias J. Sax resolved KAFKA-19054. ------------------------------------- Fix Version/s: 4.1.0 4.0.1 Resolution: Fixed > StreamThread exception handling with SHUTDOWN_APPLICATION may trigger a tight > loop with MANY logs > ------------------------------------------------------------------------------------------------- > > Key: KAFKA-19054 > URL: https://issues.apache.org/jira/browse/KAFKA-19054 > Project: Kafka > Issue Type: Bug > Components: streams > Affects Versions: 2.8.0 > Reporter: Boquan Tang > Assignee: HongYi Chen > Priority: Minor > Labels: newbie > Fix For: 4.1.0, 4.0.1 > > > When configured with SHUTDOWN_APPLICATION for uncaught exception handler: > {code:java} > kafkaStreams.setUncaughtExceptionHandler(e -> > StreamsUncaughtExceptionHandler.StreamThreadExceptionResponse.SHUTDOWN_APPLICATION); > {code} > The kafka streams application may fall in a tight loop where inside > StreamThread#runLoop() > {code:java} > while (isRunning() || taskManager.rebalanceInProgress()) { //continue > to loop because rebalanceInProgress even though the thread is already > PENDING_SHUTDOWN > try { > checkForTopologyUpdates(); > // If we received the shutdown signal while waiting for a > topology to be added, we can > // stop polling regardless of the rebalance status since we > know there are no tasks left > if (!isRunning() && topologyMetadata.isEmpty()) { > log.info("Shutting down thread with empty topology."); > break; > } > maybeSendShutdown(); > // omitted code, returns very quickly because consumer#poll > will return immediately due to it receiving shutdown request > } > {code} > Inside maybeSendShutdown(), logs are printed to flood the log. We received > more than 13k logs in a short period of 50ms. > Please add logic to avoid the tight loop. Thank you. -- This message was sent by Atlassian Jira (v8.20.10#820010)