[
https://issues.apache.org/jira/browse/KAFKA-8947?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16938967#comment-16938967
]
Chris Egerton commented on KAFKA-8947:
--------------------------------------
Thanks to https://issues.apache.org/jira/browse/KAFKA-8945, it's actually
impossible that this (erroneous) behavior has been identified and worked around
by REST extension developers; because of KAFKA-8945, any invocation of
{{ConnectClusterStateImpl.connectorHealth(...)}} with at least one connector
present in the cluster will cause an exception to be thrown. This method is the
only method currently affected by the bug in how {{TaskState}} objects are
instantiated by the framework, so it should be safe to fix this bug without
breaking backwards compatibility with existing REST extensions.
> Connect framework incorrectly instantiates TaskStates for REST extensions
> -------------------------------------------------------------------------
>
> Key: KAFKA-8947
> URL: https://issues.apache.org/jira/browse/KAFKA-8947
> Project: Kafka
> Issue Type: Bug
> Components: KafkaConnect
> Affects Versions: 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.1.1, 2.0.2, 2.3.0, 2.1.2,
> 2.2.1, 2.2.2, 2.4.0, 2.3.1, 2.2.3
> Reporter: Chris Egerton
> Assignee: Chris Egerton
> Priority: Major
>
> The {{TaskState}} class's
> [constructor|https://github.com/apache/kafka/blob/666505b72f1baaf5f37fac4f59fa26d93d833f63/connect/api/src/main/java/org/apache/kafka/connect/health/TaskState.java#L37-L40]
> takes in parameters for the task's ID number, state, worker, and
> (optionally-null) error stack trace, in that order. However, the Connect
> framework's {{ConnectClusterStateImpl}} class instantiates TaskState objects
> with a different ordering of arguments: [ID number, worker, state,
> trace|https://github.com/apache/kafka/blob/36a5aba4ecf56631372ad12d5c67af8fa3de05f8/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/health/ConnectClusterStateImpl.java#L110].
> It's possible that this (erroneous) behavior has already been identified and
> worked around by developers of REST extensions, so it's questionable whether
> a patch PR here is warranted.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)