[
https://issues.apache.org/jira/browse/SLING-13105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18057766#comment-18057766
]
Christian Schneider commented on SLING-13105:
---------------------------------------------
What the doc says is that we do not interrupt jobs that are in Oak code.
So I think the cases above are fine.
> Review all occurrences of InterruptedException
> ----------------------------------------------
>
> Key: SLING-13105
> URL: https://issues.apache.org/jira/browse/SLING-13105
> Project: Sling
> Issue Type: Improvement
> Components: Content Distribution
> Affects Versions: Content Distribution Journal Core 0.5.0
> Reporter: Joerg Hoh
> Priority: Major
>
> I see a few occurrences of ThreadInterruptedExceptions being thrown and
> handled by Thread.interrupt(), although in
> [DistributionJournal.deactivate()|https://github.com/apache/sling-org-apache-sling-distribution-journal/blob/4ff1af58dff42e97e6f58793472b84163a086d32/src/main/java/org/apache/sling/distribution/journal/impl/subscriber/DistributionSubscriber.java#L228-L234]
> states this:
> {noformat}
> /*
> * Note that we don't interrupt blocking calls using
> Thread.interrupt()
> * because interrupts can stop the Apache Oak repository.
> *
> * See SLING-9340, OAK-2609 and
> * https://jackrabbit.apache.org/oak/docs/dos_and_donts.html
> */
> {noformat}
> We should review all instances of this and find a way to handle these cases
> better.
> {noformat}
> $ grep -ri ".interrupt()" src/main/java
> src/main/java/org/apache/sling/distribution/journal/impl/publisher/QueueCacheSeeder.java:
> Thread.currentThread().interrupt();
> src/main/java/org/apache/sling/distribution/journal/impl/publisher/QueueCacheSeeder.java:
> Thread.currentThread().interrupt();
> src/main/java/org/apache/sling/distribution/journal/impl/publisher/DistributionPublisher.java:
> Thread.currentThread().interrupt();
> src/main/java/org/apache/sling/distribution/journal/impl/subscriber/DistributionSubscriber.java:
> * Note that we don't interrupt blocking calls using
> Thread.interrupt()
> src/main/java/org/apache/sling/distribution/journal/impl/subscriber/DistributionSubscriber.java:
> Thread.currentThread().interrupt();
> src/main/java/org/apache/sling/distribution/journal/shared/Delay.java:
> Thread.currentThread().interrupt();
> src/main/java/org/apache/sling/distribution/journal/shared/ExponentialBackOff.java:
> Thread.currentThread().interrupt();
> src/main/java/org/apache/sling/distribution/journal/bookkeeper/BookKeeper.java:
> Thread.currentThread().interrupt();
> src/main/java/org/apache/sling/distribution/journal/queue/impl/PubQueueProviderImpl.java:
> Thread.currentThread().interrupt();
> {noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)