You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by jo...@apache.org on 2026/02/27 08:47:53 UTC
(sling-org-apache-sling-distribution-journal) branch master updated: SLING-13112 add current package ID to the thread name (#182)
This is an automated email from the ASF dual-hosted git repository.
joerghoh 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 8b03028 SLING-13112 add current package ID to the thread name (#182)
8b03028 is described below
commit 8b030283c4f93747b2ea625d13e264530b6d0038
Author: Jörg Hoh <jo...@users.noreply.github.com>
AuthorDate: Fri Feb 27 09:47:44 2026 +0100
SLING-13112 add current package ID to the thread name (#182)
---
.../org/apache/sling/distribution/journal/bookkeeper/BookKeeper.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/main/java/org/apache/sling/distribution/journal/bookkeeper/BookKeeper.java b/src/main/java/org/apache/sling/distribution/journal/bookkeeper/BookKeeper.java
index 0e5d14b..e9f97ac 100644
--- a/src/main/java/org/apache/sling/distribution/journal/bookkeeper/BookKeeper.java
+++ b/src/main/java/org/apache/sling/distribution/journal/bookkeeper/BookKeeper.java
@@ -154,6 +154,8 @@ public class BookKeeper {
*/
public void importPackage(PackageMessage pkgMsg, long offset, Date createdTime, Date importStartTime) throws DistributionException {
log.debug("Importing distribution package {} at offset={}", pkgMsg, offset);
+ String threadNameOrig = Thread.currentThread().getName();
+ Thread.currentThread().setName(threadNameOrig + " (" + pkgMsg.getPkgId() + ")");
try (Timer.Context context = subscriberMetrics.getImportedPackageDuration().time();
ResourceResolver importerResolver = getServiceResolver(SUBSERVICE_IMPORTER)) {
// Execute the pre-processor
@@ -182,6 +184,7 @@ public class BookKeeper {
failure(pkgMsg, offset, createdTime, e);
} finally {
subscriberMetrics.clearCurrentImport();
+ Thread.currentThread().setName(threadNameOrig);
}
}