cmccabe commented on a change in pull request #11577:
URL: https://github.com/apache/kafka/pull/11577#discussion_r765467726



##########
File path: 
metadata/src/main/java/org/apache/kafka/controller/QuorumController.java
##########
@@ -251,6 +254,36 @@ public QuorumController build() throws Exception {
         }
     }
 
+    class ConfigResourceExistenceChecker implements Consumer<ConfigResource> {

Review comment:
       > We should add a comment that this thing should only be called by the 
event queue thread.
   
   Sounds good, will add.
   
   > Also, it might be nicer in terms of control flow to return an ApiError 
instance instead of throwing exceptions. Since these are all unchecked errors, 
the caller has to know to capture one and convert it to an ApiError
   
   I did do that for a bunch of other controller code, but over time I've been 
converting it to use exceptions. The problem is that there are a lot of places 
where exceptions can be thrown, so you always end up setting up a catch block 
anyway. If there's no catch block there will inevitably be a bug where 
something is thrown and not caught.
   
   I wish we were using a language like Rust or Go where exceptions were 
reserved for logic errors, but it's unfortunately not the case. So, when in 
Rome...




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