You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by GitBox <gi...@apache.org> on 2022/01/24 14:27:34 UTC

[GitHub] [sling-org-apache-sling-distribution-journal] bdelacretaz commented on a change in pull request #96: improved the message of the RuntimeException

bdelacretaz commented on a change in pull request #96:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal/pull/96#discussion_r790795483



##########
File path: src/main/java/org/apache/sling/distribution/journal/queue/impl/PubQueueCache.java
##########
@@ -152,7 +152,11 @@ private void fetchIfNeeded(long requestedMinOffset) throws InterruptedException
             // run head pollers concurrently.
             boolean locked = headPollerLock.tryLock(MAX_FETCH_WAIT_MS, MILLISECONDS);
             if (! locked) {
-                throw new RuntimeException("Gave up fetching queue state");
+                String msg = String.format(
+                        "Gave up fetching the queue state after %d ms because another thread holds the lock "
+                                + "(requested offset = %d, cached min offset=%d",

Review comment:
       Isn't the closing parenthesis missing in the generated message?




-- 
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: commits-unsubscribe@sling.apache.org

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