ableegoldman opened a new pull request #11600:
URL: https://github.com/apache/kafka/pull/11600


   Another source of flakiness we found in the NamedTopologyIntegrationTest was 
an ocasional MissingSourceTopicException that was causing the application to 
shut down. We created all source topics ahead of time in the tests, leading us 
to discover this [race 
condition](https://issues.apache.org/jira/browse/KAFKA-13543) in the consumer 
client which can lead to spurious MissingSourceTopicExceptions when the 
metadata hasn't finished updating after a change in the consumer's subscription.
   
   In addition to finding a workaround for this bug, throwing this 
MissingSourceTopicException and shutting down the entire app is itself a bug in 
the NamedTopology feature -- we should not stop all clients and prevent any 
further processing of the completely valid topologies just because one (or 
more) topologies were added that are missing their source topics. We can just 
remove those topologies from the assignment for the time being, and wait until 
the metadata has finished updating or the user has created the input topics to 
start assigning tasks from them.
   
   So, this PR does two things:
   a) Avoid throwing a MissingSourceTopicException inside the #assign method 
when named topologies are used, and just remove those topologies which are 
missing any of their input topics from the assignment. 
   b) Trigger the uncaught exception handler with a MissingSourceTopicException 
for each of the topologies that are missing topics, but don't shut down the 
thread -- we just want to make sure this issue is made visible to the user.


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

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to