Merge pull request #1329 from Alfresco/feature/MNT-22712_MetadataTrackerNPE_20x

MNT-22712 Fix metadata tracker NPE
This commit is contained in:
Tom Page
2022-02-01 13:37:59 +00:00
committed by GitHub

View File

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