CORDA-1564 Clean up old sessions when retrying flows. (#3278)

This commit is contained in:
Rick Parker 2018-05-31 18:43:50 +01:00 committed by GitHub
parent 74fd5b9e9d
commit 51c359c48d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -354,6 +354,10 @@ class SingleThreadedStateMachineManager(
null null
} }
externalEventMutex.withLock { externalEventMutex.withLock {
// Remove any sessions the old flow has.
for (sessionId in getFlowSessionIds(currentState.checkpoint)) {
sessionToFlow.remove(sessionId)
}
if (flow != null) addAndStartFlow(flowId, flow) if (flow != null) addAndStartFlow(flowId, flow)
// Deliver all the external events from the old flow instance. // Deliver all the external events from the old flow instance.
val unprocessedExternalEvents = mutableListOf<ExternalEvent>() val unprocessedExternalEvents = mutableListOf<ExternalEvent>()