mbaedke commented on code in PR #2721:
URL: https://github.com/apache/jackrabbit-oak/pull/2721#discussion_r2812855590
##########
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:
At first glance, this is exactly what to original method avoids (JavaDoc:
"...this method returns immediately without waiting for pending listeners to
complete...").
--
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]