[
https://issues.apache.org/jira/browse/KAFKA-15768?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Bill Bejeck updated KAFKA-15768:
--------------------------------
Fix Version/s: 4.4.0
> StateQueryResult#getOnlyPartitionResult should not throw for FailedQueryResult
> ------------------------------------------------------------------------------
>
> Key: KAFKA-15768
> URL: https://issues.apache.org/jira/browse/KAFKA-15768
> Project: Kafka
> Issue Type: Bug
> Components: streams
> Reporter: Matthias J. Sax
> Assignee: Gavin Wang
> Priority: Major
> Fix For: 4.4.0
>
>
> Calling `StateQueryResult#getOnlyPartitionResult` crashes with an incorrect
> `IllegalArgumentException` if any result is a `FailedQueryResult` (and even
> if there is only a single FailedQueryResult).
> The issue is the internal `filter(r -> r.getResult() != 0)` step, that
> blindly (and incorrectly) calls `getResult`.
> Given the semantics of `getOnlyPartitionResult` we should not care if the
> result is SuccessQueryResult or FailedQueryResult, but only check if there is
> a single result or not. (The user has no means to avoid getting the
> underlying error otherwise.)
> Side-note: why does `FailedQueryResult#getResult` throw an
> IllegalArgumentException (there is no argument passed into the method – it
> should rather be an `IllegalStateException` – but I guess we would need a KIP
> for this fix?)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)