You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Lucy Liu (Jira)" <ji...@apache.org> on 2026/09/15 21:20:00 UTC

[jira] [Assigned] (KAFKA-21103) Kafka Streams might lose a thread unnoticed

     [ https://issues.apache.org/jira/browse/KAFKA-21103?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lucy Liu reassigned KAFKA-21103:
--------------------------------

    Assignee: Lucy Liu

> Kafka Streams might lose a thread unnoticed
> -------------------------------------------
>
>                 Key: KAFKA-21103
>                 URL: https://issues.apache.org/jira/browse/KAFKA-21103
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>            Reporter: Matthias J. Sax
>            Assignee: Lucy Liu
>            Priority: Major
>
> KS allows to register an uncaught-exception-handler, which has a REPLACE_THREAD return code.
> However, it's possible that starting up the new thread fails, and such an error is swallowed silently, letting the user think the thread was restarted even if it was not.
> This is especially bad for single-threaded clients, which would stay in state RUNNING and not transitioning into DEAD or ERROR.
> A known workaround is to inspect IQ metadata – when the thread dies, it's correctly removed there.
> In `KafkaStreams#replaceStreamThread()` we call `addStreamsThread()` but ignore it's returned Optional. We should check if the Optional is empty or not, and either retry, or somehow surface the error otherwise (throwing an exception might also work, which we would need to catch elsewhere, and re-triggering the handler?)
> Depending how we want to fix this, a KIP might be needed?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)