mirror of https://github.com/apache/nifi.git
NIFI-2975: Only start expiring FlowFiles after FlowFile Repository has been restored
This closes #1274. Signed-off-by: Bryan Bende <bbende@apache.org>
This commit is contained in:
parent
92f17a995b
commit
9d6ca6e1e6
|
@ -484,7 +484,6 @@ public class FlowController implements EventAccess, ControllerServiceProvider, R
|
|||
// PRIMARY_NODE_ONLY is deprecated, but still exists to handle processors that are still defined with it (they haven't been re-configured with executeNode = PRIMARY).
|
||||
processScheduler.setSchedulingAgent(SchedulingStrategy.PRIMARY_NODE_ONLY, timerDrivenAgent);
|
||||
processScheduler.setSchedulingAgent(SchedulingStrategy.CRON_DRIVEN, quartzSchedulingAgent);
|
||||
processScheduler.scheduleFrameworkTask(new ExpireFlowFiles(this, contextFactory), "Expire FlowFiles", 30L, 30L, TimeUnit.SECONDS);
|
||||
|
||||
startConnectablesAfterInitialization = new ArrayList<>();
|
||||
startRemoteGroupPortsAfterInitialization = new ArrayList<>();
|
||||
|
@ -699,6 +698,11 @@ public class FlowController implements EventAccess, ControllerServiceProvider, R
|
|||
|
||||
flowFileRepository.loadFlowFiles(this, maxIdFromSwapFiles + 1);
|
||||
|
||||
// Begin expiring FlowFiles that are old
|
||||
final ProcessContextFactory contextFactory = new ProcessContextFactory(contentRepository, flowFileRepository,
|
||||
flowFileEventRepository, counterRepositoryRef.get(), provenanceRepository);
|
||||
processScheduler.scheduleFrameworkTask(new ExpireFlowFiles(this, contextFactory), "Expire FlowFiles", 30L, 30L, TimeUnit.SECONDS);
|
||||
|
||||
// now that we've loaded the FlowFiles, this has restored our ContentClaims' states, so we can tell the
|
||||
// ContentRepository to purge superfluous files
|
||||
contentRepository.cleanup();
|
||||
|
|
Loading…
Reference in New Issue