code.onehippo.org is currently readonly. We are migrating to code.bloomreach.com, please continue working there on Monday 14/12. See: https://docs.bloomreach.com/display/engineering/GitLab

Commit 9722cc19 authored by Ard Schrijvers's avatar Ard Schrijvers

REPO-1918 [Backport 11.2] Make sure to have latest jcr node states instead of possibly stale nodes

(cherry picked from commit 77fca1aa)
parent 3b0456f4
......@@ -143,10 +143,15 @@ public class UpdaterExecutionModule implements DaemonModule, EventListener {
@Override
public void run() {
try (LockResource lock = lockManager.lock(UPDATE_PATH)){
try (LockResource ignore = lockManager.lock(UPDATE_PATH)){
// make sure to trigger a JCR cluster sync after the lock is obtained to make sure the
// #executeUpdatersInQueue does not happen agains stale jcr nodes
session.refresh(false);
executeUpdatersInQueue();
} catch (LockException e) {
log.info("Failed to obtain lock, most likely obtained by other cluster node already", e);
} catch (RepositoryException e) {
log.error("RepositoryException while refreshing session.", e);
} finally {
synchronized (monitor) {
task = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment