chia7712 commented on code in PR #17957:
URL: https://github.com/apache/kafka/pull/17957#discussion_r1866537550


##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -380,6 +380,14 @@ public CompletableFuture<Void> maybeInitialize() {
 
             // Update state to initializing to avoid any concurrent requests 
to be processed.
             partitionState = SharePartitionState.INITIALIZING;
+        } catch (Exception e) {
+            log.error("Failed to initialize the share partition: {}-{}", 
groupId, topicIdPartition, e);
+            completeInitializationWithException(future, e);
+            return future;
+        } finally {
+            lock.writeLock().unlock();
+        }
+        try {

Review Comment:
   > actually exceptions are getting handled when persister.writeState throws 
exceptions. We have a test case testWriteShareGroupStateWithWriteException in 
SharePartitionTest that verifies this beahviour.
   
   `testWriteShareGroupStateWithWriteException` verify the exception wrapped by 
`CompletableFuture`. However, `persister.writeState` could throw exception 
directly. The exception is not wrapped by `CompletableFuture` 
   
   
https://github.com/apache/kafka/blob/d00f0ecf1a1a082c97564f4b807e7a342472b57a/share/src/main/java/org/apache/kafka/server/share/persister/DefaultStatePersister.java#L82



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