glimmerveen commented on code in PR #419:
URL: https://github.com/apache/felix-dev/pull/419#discussion_r2086146138


##########
scr/src/main/java/org/apache/felix/scr/impl/ComponentRegistry.java:
##########
@@ -138,6 +142,17 @@ public ComponentRegistry( final ScrConfiguration 
scrConfiguration, final ScrLogg
         m_componentHoldersByPid = new HashMap<>();
         m_componentsById = new HashMap<>();
 
+        ScheduledThreadPoolExecutor threadPoolExecutor = new 
ScheduledThreadPoolExecutor(1, new ThreadFactory()
+        {
+            @Override
+            public Thread newThread(Runnable r)
+            {
+                return new Thread(r, "SCR Component Registry");
+            }
+        });
+        threadPoolExecutor.setKeepAliveTime(10, TimeUnit.SECONDS);

Review Comment:
   Would you be open to maintaining a minimum keep alive of 500ms? The 
suggested change would, with a very short timeout of 10ms, cause the thread to 
be cleaned up almost as fast/often as with the current Timer approach.
   
   Something along the lines of:
   
   `threadPoolExecutor.setKeepAliveTime(Math.max(500, 
m_configuration.serviceChangecountTimeout()*2), TimeUnit.MILLISECONDS);`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@felix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to