mirror of
https://github.com/corda/corda.git
synced 2025-01-11 15:32:49 +00:00
[CORDA-2276]: FlowMonitor repeatedly / indefinitely logs flows in the flow hospital. (fix) (#4327)
This commit is contained in:
parent
628aa0b799
commit
4906358aa8
@ -380,7 +380,7 @@ abstract class AbstractNode<S>(val configuration: NodeConfiguration,
|
|||||||
// Shut down the SMM so no Fibers are scheduled.
|
// Shut down the SMM so no Fibers are scheduled.
|
||||||
runOnStop += { smm.stop(acceptableLiveFiberCountOnStop()) }
|
runOnStop += { smm.stop(acceptableLiveFiberCountOnStop()) }
|
||||||
(smm as? StateMachineManagerInternal)?.let {
|
(smm as? StateMachineManagerInternal)?.let {
|
||||||
val flowMonitor = FlowMonitor(smm::snapshot, configuration.flowMonitorPeriodMillis, configuration.flowMonitorSuspensionLoggingThresholdMillis)
|
val flowMonitor = FlowMonitor({ smm.snapshot().filter { flow -> flow !in smm.flowHospital }.toSet() }, configuration.flowMonitorPeriodMillis, configuration.flowMonitorSuspensionLoggingThresholdMillis)
|
||||||
runOnStop += flowMonitor::stop
|
runOnStop += flowMonitor::stop
|
||||||
flowMonitor.start()
|
flowMonitor.start()
|
||||||
}
|
}
|
||||||
@ -391,6 +391,8 @@ abstract class AbstractNode<S>(val configuration: NodeConfiguration,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private operator fun StaffedFlowHospital.contains(flow: FlowStateMachine<*>) = contains(flow.id)
|
||||||
|
|
||||||
/** Subclasses must override this to create a "started" node of the desired type, using the provided machinery. */
|
/** Subclasses must override this to create a "started" node of the desired type, using the provided machinery. */
|
||||||
abstract fun createStartedNode(nodeInfo: NodeInfo, rpcOps: CordaRPCOps, notaryService: NotaryService?): S
|
abstract fun createStartedNode(nodeInfo: NodeInfo, rpcOps: CordaRPCOps, notaryService: NotaryService?): S
|
||||||
|
|
||||||
|
@ -159,6 +159,8 @@ class StaffedFlowHospital(private val flowMessaging: FlowMessaging, private val
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
operator fun contains(flowId: StateMachineRunId) = mutex.locked { flowId in flowPatients }
|
||||||
|
|
||||||
class FlowMedicalHistory {
|
class FlowMedicalHistory {
|
||||||
internal val records: MutableList<MedicalRecord.Flow> = mutableListOf()
|
internal val records: MutableList<MedicalRecord.Flow> = mutableListOf()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user