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

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

rhauch commented on pull request #6384: KAFKA-8058: Fix 
ConnectClusterStateImpl.connectors() method
URL: https://github.com/apache/kafka/pull/6384
 
 
   
 
----------------------------------------------------------------
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:
[email protected]


> 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)

Reply via email to