cziegeler commented on a change in pull request #5:
URL: 
https://github.com/apache/sling-org-apache-sling-rewriter/pull/5#discussion_r795427398



##########
File path: 
src/main/java/org/apache/sling/rewriter/impl/TransformerFactoryServiceTracker.java
##########
@@ -58,8 +62,11 @@ public TransformerFactoryServiceTracker(final BundleContext 
bc, final String ser
     @Override
     public Object addingService(ServiceReference reference) {
         final boolean isGlobal = isGlobal(reference);
+        LOGGER.debug("Adding service {}, isGlobal={}", reference, isGlobal);
         if ( isGlobal ) {
-            this.cacheIsValid = false;
+            synchronized (this) {

Review comment:
       I think just synchronizing the change of the flag is not enough; this 
needs to be synchronized with the state change (registering the service 
reference in the tracker). The same for removal.
   I have the feeling that it is easier to rewrite this outdated code completely




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to