diff --git a/node/src/main/kotlin/net/corda/node/services/statemachine/MultiThreadedStateMachineManager.kt b/node/src/main/kotlin/net/corda/node/services/statemachine/MultiThreadedStateMachineManager.kt index ad14c1c36d..cc05ea8b9d 100644 --- a/node/src/main/kotlin/net/corda/node/services/statemachine/MultiThreadedStateMachineManager.kt +++ b/node/src/main/kotlin/net/corda/node/services/statemachine/MultiThreadedStateMachineManager.kt @@ -265,6 +265,9 @@ class MultiThreadedStateMachineManager( override fun signalFlowHasStarted(flowId: StateMachineRunId) { concurrentBox.concurrent { startedFutures.remove(flowId)?.set(Unit) + flows[flowId]?.let { flow -> + changesPublisher.onNext(StateMachineManager.Change.Add(flow.fiber.logic)) + } } } @@ -571,7 +574,6 @@ class MultiThreadedStateMachineManager( Fiber.unparkDeserialized(flow.fiber, scheduler) } } - changesPublisher.onNext(StateMachineManager.Change.Add(flow.fiber.logic)) } } diff --git a/node/src/main/kotlin/net/corda/node/services/statemachine/SingleThreadedStateMachineManager.kt b/node/src/main/kotlin/net/corda/node/services/statemachine/SingleThreadedStateMachineManager.kt index e1f308f881..78c666f985 100644 --- a/node/src/main/kotlin/net/corda/node/services/statemachine/SingleThreadedStateMachineManager.kt +++ b/node/src/main/kotlin/net/corda/node/services/statemachine/SingleThreadedStateMachineManager.kt @@ -264,6 +264,9 @@ class SingleThreadedStateMachineManager( override fun signalFlowHasStarted(flowId: StateMachineRunId) { mutex.locked { startedFutures.remove(flowId)?.set(Unit) + flows[flowId]?.let { flow -> + changesPublisher.onNext(StateMachineManager.Change.Add(flow.fiber.logic)) + } } } @@ -574,7 +577,6 @@ class SingleThreadedStateMachineManager( Fiber.unparkDeserialized(flow.fiber, scheduler) } } - changesPublisher.onNext(StateMachineManager.Change.Add(flow.fiber.logic)) } } }