Merge pull request #1299 from Alfresco/fix/MNT-22712-npe-in-solr-metadata-tracking

MNT-22712 introduced synchronized method

(cherry picked from commit 756d771373128e93fffb2ef390e39b67a28bb1d2)
This commit is contained in:
George Evangelopoulos
2022-01-31 16:15:44 +00:00
committed by Tom Page
parent 5f04b97757
commit a90d443828
@@ -222,18 +222,7 @@ public abstract class AbstractTracker implements Tracker
assert(assertTrackerStateRemainsNull());
}
if(this.state == null)
{
this.state = getTrackerState();
LOGGER.debug("[{} / {} / {}] Global Tracker State set to: {}", coreName, trackerId, iterationId, this.state.toString());
this.state.setRunning(true);
}
else
{
continueState();
this.state.setRunning(true);
}
updateTrackerState(iterationId);
infoSrv.registerTrackerThread();
@@ -275,6 +264,21 @@ public abstract class AbstractTracker implements Tracker
}
}
private synchronized void updateTrackerState(String iterationId) {
if(this.state == null)
{
this.state = getTrackerState();
LOGGER.debug("[{} / {} / {}] Global Tracker State set to: {}", coreName, trackerId, iterationId, this.state.toString());
}
else
{
continueState();
}
this.state.setRunning(true);
}
/**
* At the end of the tracking method, the {@link TrackerState} should be turned off.
* However, during a rollback (that could be started by another tracker) the {@link TrackerState} instance