You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Chia-Ping Tsai (Jira)" <ji...@apache.org> on 2025/09/05 18:10:00 UTC

[jira] [Created] (KAFKA-19676) EpochState should override close to avoid throwing IOException

Chia-Ping Tsai created KAFKA-19676:
--------------------------------------

             Summary: EpochState should override close to avoid throwing IOException
                 Key: KAFKA-19676
                 URL: https://issues.apache.org/jira/browse/KAFKA-19676
             Project: Kafka
          Issue Type: Improvement
            Reporter: Chia-Ping Tsai
            Assignee: Chia-Ping Tsai


All subclasses of EpochState do not throw an IOException when closing, so catching it is unnecessary. We could override close to remove the IOException declaration and streamline the code

{code:java}
        if (state != null) {
            try {
                state.close();
            } catch (IOException e) {
                throw new UncheckedIOException(
                    "Failed to transition from " + state.name() + " to " + newState.name(), e);
            }
        }
{code}




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