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/07/21 09:21:09 UTC

(sling-org-apache-sling-servlets-resolver) 01/01: SLING-13266 avoid race on shutdown

This is an automated email from the ASF dual-hosted git repository.

joerghoh pushed a commit to branch SLING-13266
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-servlets-resolver.git

commit 227098b7bedd52a8835170f6eccacb7dad0bf302
Author: Joerg Hoh <jo...@apache.org>
AuthorDate: Tue Jul 21 11:20:53 2026 +0200

    SLING-13266 avoid race on shutdown
---
 .../sling/servlets/resolver/internal/bundle/BundledScriptTracker.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/servlets/resolver/internal/bundle/BundledScriptTracker.java b/src/main/java/org/apache/sling/servlets/resolver/internal/bundle/BundledScriptTracker.java
index 16c2ccb..858ca4d 100644
--- a/src/main/java/org/apache/sling/servlets/resolver/internal/bundle/BundledScriptTracker.java
+++ b/src/main/java/org/apache/sling/servlets/resolver/internal/bundle/BundledScriptTracker.java
@@ -130,8 +130,9 @@ public class BundledScriptTracker implements BundleTrackerCustomizer<List<Servic
         bt.open();
     }
 
+    // synchronized against refreshDispatcher so a concurrent refresh cannot re-publish dispatchers after shutdown
     @Deactivate
-    protected void deactivate() {
+    protected synchronized void deactivate() {
         BundleTracker<List<ServiceRegistration<Servlet>>> bt = tracker.getAndSet(null);
         if (bt != null) {
             bt.close();