adixitconfluent commented on code in PR #17957:
URL: https://github.com/apache/kafka/pull/17957#discussion_r1867182171
##########
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:
@chia7712 @apoorvmittal10 , I've moved the `try-catch` check from
`persister.readState/persister.writeState` to `DefaultStatePersister
readState/writeState` methods. Had a discussion with @smjn regarding the scope
of try catch block within `readState/writeState` methods, `validate(request)`
could only throw such exception. Other exceptions were already being handled by
the returned future.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]