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 77fca1aa authored by Ard Schrijvers's avatar Ard Schrijvers

REPO-1915 Make sure to have latest jcr node states instead of possibly stale nodes

parent 075c95c1
...@@ -143,10 +143,15 @@ public class UpdaterExecutionModule implements DaemonModule, EventListener { ...@@ -143,10 +143,15 @@ public class UpdaterExecutionModule implements DaemonModule, EventListener {
@Override @Override
public void run() { 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(); executeUpdatersInQueue();
} catch (LockException e) { } catch (LockException e) {
log.info("Failed to obtain lock, most likely obtained by other cluster node already", 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 { } finally {
synchronized (monitor) { synchronized (monitor) {
task = null; 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