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

cziegeler pushed a commit to branch http-4.x
in repository https://gitbox.apache.org/repos/asf/felix-dev.git


The following commit(s) were added to refs/heads/http-4.x by this push:
     new 8fb0ec2d38 FELIX-6620 : Avoid update of service registry on shutdown
8fb0ec2d38 is described below

commit 8fb0ec2d38fdbd06730e11cdb1150f41614a0237
Author: Carsten Ziegeler <[email protected]>
AuthorDate: Sun Jul 23 09:56:12 2023 +0200

    FELIX-6620 : Avoid update of service registry on shutdown
---
 .../internal/whiteboard/WhiteboardManager.java     | 26 +++++++++++-----------
 http/bridge/pom.xml                                |  2 +-
 http/jetty/pom.xml                                 |  2 +-
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git 
a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/WhiteboardManager.java
 
b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/WhiteboardManager.java
index 6832efb4af..5dcab3dc0c 100644
--- 
a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/WhiteboardManager.java
+++ 
b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/WhiteboardManager.java
@@ -199,11 +199,11 @@ public final class WhiteboardManager
                         // nothing to do
                     }
                 }, props);
-        addTracker(new FilterTracker(this.httpBundleContext, this));
-        addTracker(new ListenersTracker(this.httpBundleContext, this));
         addTracker(new PreprocessorTracker(this.httpBundleContext, this));
-        addTracker(new ResourceTracker(this.httpBundleContext, this));
+        addTracker(new ListenersTracker(this.httpBundleContext, this));
         addTracker(new ServletContextHelperTracker(this.httpBundleContext, 
this));
+        addTracker(new FilterTracker(this.httpBundleContext, this));
+        addTracker(new ResourceTracker(this.httpBundleContext, this));
         addTracker(new ServletTracker(this.httpBundleContext, this));
 
         this.plugin.register();
@@ -224,27 +224,27 @@ public final class WhiteboardManager
      */
     public void stop()
     {
+        this.webContext = null;
+        this.serviceRuntime.unregister();
         this.plugin.unregister();
+
+        if (this.defaultContextRegistration != null)
+        {
+            this.defaultContextRegistration.unregister();
+            this.defaultContextRegistration = null;
+        }
+
         for(final ServiceTracker<?, ?> t : this.trackers)
         {
             t.close();
         }
         this.trackers.clear();
 
-        this.serviceRuntime.unregister();
-
         this.preprocessorHandlers = Collections.emptyList();
         this.contextMap.clear();
         this.servicesMap.clear();
         this.failureStateHandler.clear();
         this.registry.reset();
-
-        if (this.defaultContextRegistration != null)
-        {
-            this.defaultContextRegistration.unregister();
-            this.defaultContextRegistration = null;
-        }
-        this.webContext = null;
     }
 
     public void sessionDestroyed(@NotNull final HttpSession session, final 
Set<String> contextNames)
@@ -470,7 +470,7 @@ public final class WhiteboardManager
                             if ( first )
                             {
                                 this.deactivate(handler);
-                                activateNext = true;
+                                activateNext = this.webContext != null;
                             }
                             break;
                         }
diff --git a/http/bridge/pom.xml b/http/bridge/pom.xml
index b4bfbc19d7..26a868540c 100644
--- a/http/bridge/pom.xml
+++ b/http/bridge/pom.xml
@@ -143,7 +143,7 @@
         <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.http.base</artifactId>
-            <version>4.2.8</version>
+            <version>4.2.9-SNAPSHOT</version>
         </dependency>
     </dependencies>
 
diff --git a/http/jetty/pom.xml b/http/jetty/pom.xml
index 639385d72c..4cc4cf3ef2 100644
--- a/http/jetty/pom.xml
+++ b/http/jetty/pom.xml
@@ -401,7 +401,7 @@
         <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.http.base</artifactId>
-            <version>4.2.8</version>
+            <version>4.2.9-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>commons-fileupload</groupId>

Reply via email to