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:10:50 UTC

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

mbien opened a new pull request, #314:
URL: https://github.com/apache/maven-indexer/pull/314

   The consumer Threads can quit early when an exception occurs. In that case the consumer will usually block on `put` once the queue is full without a chance to recover.
   
   This change clears the queue and shuts the executor service down as soon an exception is caught.


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


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

Posted by "mbien (via GitHub)" <gi...@apache.org>.
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


[GitHub] [maven-indexer] cstamas merged pull request #314: [MINDEXER-188] Ensure that the producer thread doesn't indefinitely block on the queue

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas merged PR #314:
URL: https://github.com/apache/maven-indexer/pull/314


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