You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "mbien (via GitHub)" <gi...@apache.org> on 2023/05/08 15:14:23 UTC

[GitHub] [maven-indexer] mbien commented on a diff in pull request #314: Ensure that the producer thread doesn't indefinitely block on the queue

mbien commented on code in PR #314:
URL: https://github.com/apache/maven-indexer/pull/314#discussion_r1187568526


##########
indexer-core/src/main/java/org/apache/maven/index/updater/IndexDataReader.java:
##########
@@ -232,9 +240,15 @@ private IndexDataReadResult readIndexMT(IndexWriter w, IndexingContext context)
         }
 
         if (!errors.isEmpty()) {
-            IOException exception = new IOException("Error during load of index");
-            errors.forEach(exception::addSuppressed);
-            throw exception;
+            if (errors.stream().allMatch(ex -> ex instanceof IOException || ex instanceof InterruptedException)) {
+                IOException exception = new IOException("Error during load of index");
+                errors.forEach(exception::addSuppressed);
+                throw exception;
+            } else {
+                RuntimeException exception = new RuntimeException("Error during load of index");
+                errors.forEach(exception::addSuppressed);
+                throw exception;
+            }
         }

Review Comment:
   I thought it is probably better to rethrow non-checked exceptions as RT exception (?)



-- 
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: issues-unsubscribe@maven.apache.org

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