mbaedke commented on code in PR #2721:
URL: https://github.com/apache/jackrabbit-oak/pull/2721#discussion_r2823011199


##########
oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ChangeProcessor.java:
##########
@@ -460,9 +464,15 @@ public synchronized boolean stopAndWait(int timeOut, 
TimeUnit unit) {
      */
     public synchronized void stop() {
         Validate.checkState(registration != null, "Change processor not 
started");
-        if (running.stop()) {
-            registration.unregister();
-            runningMonitor.leave();
+
+        if (stopFlagSet()) {
+            // Wait until no contentChanged is in the critical section
+            runningLock.lock();

Review Comment:
   My point is that the original code explicitly does _not_ lock before calling 
`registration.unregister()`. 



-- 
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