You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cs...@apache.org on 2026/03/24 09:42:07 UTC
(sling-org-apache-sling-distribution-journal) branch master updated: SLING-11026: Use dedicated threadpool for distribution journal services (#179)
This is an automated email from the ASF dual-hosted git repository.
cschneider pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-journal.git
The following commit(s) were added to refs/heads/master by this push:
new 03de81f SLING-11026: Use dedicated threadpool for distribution journal services (#179)
03de81f is described below
commit 03de81f00418c2fbe5e901e4ec7cf5cadfb654df
Author: Bhavik Kothari <20...@users.noreply.github.com>
AuthorDate: Tue Mar 24 15:12:02 2026 +0530
SLING-11026: Use dedicated threadpool for distribution journal services (#179)
Co-authored-by: Bhavik Kothari <bk...@users.noreply.github.com>
---
.../journal/impl/discovery/DiscoveryService.java | 3 ++-
.../impl/precondition/StagingPrecondition.java | 3 ++-
.../journal/queue/impl/PubQueueProviderImpl.java | 3 ++-
.../journal/shared/DistributionThreadPool.java | 27 ++++++++++++++++++++++
4 files changed, 33 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/sling/distribution/journal/impl/discovery/DiscoveryService.java b/src/main/java/org/apache/sling/distribution/journal/impl/discovery/DiscoveryService.java
index ff806e2..36254d5 100644
--- a/src/main/java/org/apache/sling/distribution/journal/impl/discovery/DiscoveryService.java
+++ b/src/main/java/org/apache/sling/distribution/journal/impl/discovery/DiscoveryService.java
@@ -40,6 +40,7 @@ import org.apache.sling.distribution.journal.messages.LogMessage;
import org.apache.sling.distribution.journal.messages.SubscriberConfig;
import org.apache.sling.distribution.journal.messages.SubscriberState;
import org.apache.sling.distribution.journal.shared.AgentId;
+import org.apache.sling.distribution.journal.shared.DistributionThreadPool;
import org.apache.sling.distribution.journal.shared.PublisherConfigurationAvailable;
import org.apache.sling.distribution.journal.shared.Topics;
import org.osgi.framework.BundleContext;
@@ -164,7 +165,7 @@ public class DiscoveryService implements Runnable {
Dictionary<String, Object> props = new Hashtable<>();
props.put(PROPERTY_SCHEDULER_CONCURRENT, false);
props.put(PROPERTY_SCHEDULER_PERIOD, 5L); // every 5 seconds
- props.put(Scheduler.PROPERTY_SCHEDULER_THREAD_POOL, "content-distribution");
+ props.put(Scheduler.PROPERTY_SCHEDULER_THREAD_POOL, DistributionThreadPool.THREAD_POOL_NAME);
reg = context.registerService(Runnable.class.getName(), this, props);
}
diff --git a/src/main/java/org/apache/sling/distribution/journal/impl/precondition/StagingPrecondition.java b/src/main/java/org/apache/sling/distribution/journal/impl/precondition/StagingPrecondition.java
index ff1733b..5faa7c7 100644
--- a/src/main/java/org/apache/sling/distribution/journal/impl/precondition/StagingPrecondition.java
+++ b/src/main/java/org/apache/sling/distribution/journal/impl/precondition/StagingPrecondition.java
@@ -25,6 +25,7 @@ import org.apache.commons.io.IOUtils;
import org.apache.sling.commons.scheduler.Scheduler;
import org.apache.sling.distribution.journal.MessagingProvider;
import org.apache.sling.distribution.journal.messages.PackageStatusMessage.Status;
+import org.apache.sling.distribution.journal.shared.DistributionThreadPool;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Deactivate;
@@ -40,7 +41,7 @@ import org.slf4j.LoggerFactory;
property = {
"name=staging",
PROPERTY_SCHEDULER_CONCURRENT + ":Boolean=false",
- Scheduler.PROPERTY_SCHEDULER_THREAD_POOL + ":String=content-distribution",
+ Scheduler.PROPERTY_SCHEDULER_THREAD_POOL + ":String=" + DistributionThreadPool.THREAD_POOL_NAME,
PROPERTY_SCHEDULER_PERIOD + ":Long=" + 24 * 60 * 60, // 1 day
})
public class StagingPrecondition implements Precondition, Runnable {
diff --git a/src/main/java/org/apache/sling/distribution/journal/queue/impl/PubQueueProviderImpl.java b/src/main/java/org/apache/sling/distribution/journal/queue/impl/PubQueueProviderImpl.java
index 851f6b5..224177d 100644
--- a/src/main/java/org/apache/sling/distribution/journal/queue/impl/PubQueueProviderImpl.java
+++ b/src/main/java/org/apache/sling/distribution/journal/queue/impl/PubQueueProviderImpl.java
@@ -53,6 +53,7 @@ import org.apache.sling.distribution.journal.queue.OffsetQueue;
import org.apache.sling.distribution.journal.queue.PubQueueProvider;
import org.apache.sling.distribution.journal.queue.QueueState;
import org.apache.sling.distribution.journal.shared.AgentId;
+import org.apache.sling.distribution.journal.shared.DistributionThreadPool;
import org.apache.sling.distribution.queue.DistributionQueueItem;
import org.apache.sling.distribution.queue.spi.DistributionQueue;
import org.osgi.framework.BundleContext;
@@ -122,7 +123,7 @@ public class PubQueueProviderImpl implements PubQueueProvider, Runnable {
Dictionary<String, Object> props = new Hashtable<>();
props.put(PROPERTY_SCHEDULER_CONCURRENT, false);
props.put(PROPERTY_SCHEDULER_PERIOD, 12*60*60L); // every 12 h
- props.put(Scheduler.PROPERTY_SCHEDULER_THREAD_POOL, "content-distribution");
+ props.put(Scheduler.PROPERTY_SCHEDULER_THREAD_POOL, DistributionThreadPool.THREAD_POOL_NAME);
reg = context.registerService(Runnable.class.getName(), this, props);
}
diff --git a/src/main/java/org/apache/sling/distribution/journal/shared/DistributionThreadPool.java b/src/main/java/org/apache/sling/distribution/journal/shared/DistributionThreadPool.java
new file mode 100644
index 0000000..3f8b3ce
--- /dev/null
+++ b/src/main/java/org/apache/sling/distribution/journal/shared/DistributionThreadPool.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.distribution.journal.shared;
+
+public class DistributionThreadPool {
+
+ public static final String THREAD_POOL_NAME = "org-apache-sling-distribution";
+
+ private DistributionThreadPool() {
+ }
+}