You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/03/07 00:23:00 UTC

[jira] [Commented] (KAFKA-8058) ConnectRestExtensionContext does not return list of connectors from its ConnectClusterState

    [ https://issues.apache.org/jira/browse/KAFKA-8058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16786245#comment-16786245 ] 

ASF GitHub Bot commented on KAFKA-8058:
---------------------------------------

C0urante commented on pull request #6384: KAFKA-8058: Fix ConnectClusterStateImpl.connectors() method
URL: https://github.com/apache/kafka/pull/6384
 
 
   This makes the `ConnectClusterStateImpl.connectors()` method synchronous, whereas before it was implicitly asynchronous with no way to tell whether it had completed or not.
   
   More detail can be found in the [Jira](https://issues.apache.org/jira/browse/KAFKA-8058).
   
   Tested manually. Seems like a light enough change that even unit tests would be overkill, but if reviewers feel differently tests can be added.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> ConnectRestExtensionContext does not return list of connectors from its ConnectClusterState
> -------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-8058
>                 URL: https://issues.apache.org/jira/browse/KAFKA-8058
>             Project: Kafka
>          Issue Type: Bug
>          Components: KafkaConnect
>    Affects Versions: 2.0.0, 2.0.1, 2.1.0, 2.1.1
>            Reporter: Chris Egerton
>            Assignee: Chris Egerton
>            Priority: Major
>
> Title is not entirely accurate, but describes the most common way this bug presents itself.
> The [ConnectClusterStateImpl|https://github.com/apache/kafka/blob/ab00c51b6362b41071ae32611ebf698ba9c221ee/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/health/ConnectClusterStateImpl.java] used by Kafka Connect to provide cluster information to REST extensions makes an asynchronous call to [Herder.connectors(...)|https://github.com/apache/kafka/blob/ab00c51b6362b41071ae32611ebf698ba9c221ee/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Herder.java#L70] in its  [connectors()|https://github.com/apache/kafka/blob/ab00c51b6362b41071ae32611ebf698ba9c221ee/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/health/ConnectClusterStateImpl.java#L46] method that populates a list of connector names, then immediately returns that list of connector names. If the list is read soon after it is returned, it's possible it will be empty or at least not completely populated.
> Since the method is implicitly synchronous (no callback logic is involved in its parameters or return values, and there is no documentation indicating asynchronous behavior for the [ConnectClusterState.connectors()|https://github.com/apache/kafka/blob/ab00c51b6362b41071ae32611ebf698ba9c221ee/connect/api/src/main/java/org/apache/kafka/connect/health/ConnectClusterState.java#L28-L34] method), this should be remedied by adding a wait for the Herder.connectors(...) method to complete in the ConnectClusterStateImpl.connectors() method.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)