gharris1727 commented on code in PR #12984:
URL: https://github.com/apache/kafka/pull/12984#discussion_r1059537788


##########
connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java:
##########
@@ -712,8 +733,16 @@ KafkaBasedLog<String, byte[]> 
setupAndCreateKafkaBasedLog(String topic, final Wo
     }
 
     private void sendPrivileged(String key, byte[] value) {
+        sendPrivileged(key, value, null);
+    }
+
+    private void sendPrivileged(String key, byte[] value, Callback<Void> 
callback) {
         if (!usesFencableWriter) {
-            configLog.send(key, value);

Review Comment:
   > Edit 2: Although now with these changes, there's an inconsistency between 
different APIs since deleteConnectorConfig, putTaskConfigs and a couple of 
other methods are still using null callbacks.
   
   Rather than rewriting all of the `ConfigBackingStore` methods to accept 
callbacks (making them look async), maybe we can terminate the producer 
callbacks in the `KafkaConfigBackingStore` and keep the `ConfiBackingStore` 
methods synchronous. I think this has other advantages, especially for the 
`putConnectorConfig`, where we can enforce that the producer send completes 
before the `readToEnd()`.
   
   It appears that the original signatures for the `ConfigBackingStore` 
provided a synchronous API. The javadocs don't mention what exceptions are 
thrown, but there are some methods which already throw exceptions, such as 
those coming from the readToEnd() calls. We could certainly throw exceptions 
rather than propagate them via callbacks.
   
   In fact, the only `*BackingStore` method which was already async was 
`OffsetBackingStore::set(Map, Callback)`, which appears was only written that 
way to log errors (no change in control flow, retries, etc). That method is now 
involved in some callback hell in ConnectorOffsetBackingStore used for EOS 
source that could also be rewritten to be synchronous. (I don't think this is 
in-scope for this PR and is just an interesting lateral refactor)



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