From 1833133be9af742ba44c09c1679394d96d968e59 Mon Sep 17 00:00:00 2001 From: Dries Samyn Date: Fri, 29 Sep 2023 10:54:54 +0100 Subject: [PATCH 1/3] Add flow session timout scheduled task --- gradle.properties | 3 ++- .../scheduler/impl/SchedulerProcessorImpl.kt | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index 4107c61e093..08b01264de8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -46,7 +46,8 @@ commonsTextVersion = 1.10.0 bouncycastleVersion=1.73 # Corda API libs revision (change in 4th digit indicates a breaking change) # Change to 5.0.0.xx-SNAPSHOT to pick up maven local published copy -cordaApiVersion=5.1.0.25-beta+ +#cordaApiVersion=5.1.0.25-beta+ +cordaApiVersion=5.1.0.25-alpha-1695977914369 disruptorVersion=3.4.4 felixConfigAdminVersion=1.9.26 diff --git a/processors/scheduler-processor/src/main/kotlin/net/corda/processors/scheduler/impl/SchedulerProcessorImpl.kt b/processors/scheduler-processor/src/main/kotlin/net/corda/processors/scheduler/impl/SchedulerProcessorImpl.kt index 272c5919b6b..6a8411cb647 100644 --- a/processors/scheduler-processor/src/main/kotlin/net/corda/processors/scheduler/impl/SchedulerProcessorImpl.kt +++ b/processors/scheduler-processor/src/main/kotlin/net/corda/processors/scheduler/impl/SchedulerProcessorImpl.kt @@ -20,7 +20,7 @@ import net.corda.lifecycle.StopEvent import net.corda.lifecycle.createCoordinator import net.corda.orm.JpaEntitiesRegistry import net.corda.processors.scheduler.SchedulerProcessor -import net.corda.schema.Schemas.ScheduledTask.SCHEDULED_TASK_DB_PROCESSOR +import net.corda.schema.Schemas.ScheduledTask import net.corda.schema.configuration.BootConfig import org.osgi.service.component.annotations.Activate import org.osgi.service.component.annotations.Component @@ -51,8 +51,6 @@ class SchedulerProcessorImpl @Activate constructor( companion object { private val logger = LoggerFactory.getLogger(this::class.java.enclosingClass) - - private const val DEDUPLICATION_TABLE_CLEAN_UP_TASK = "deduplication-table-clean-up-task" } private val dependentComponents = DependentComponents.of( @@ -66,7 +64,11 @@ class SchedulerProcessorImpl @Activate constructor( // now just hardcoding schedulers here until CORE-16331 is picked up, when we should take this from config private val schedules = listOf( - Schedule(DEDUPLICATION_TABLE_CLEAN_UP_TASK, 120, SCHEDULED_TASK_DB_PROCESSOR) + Schedule(ScheduledTask.SCHEDULED_TASK_NAME_DB_PROCESSOR, + 120, ScheduledTask.SCHEDULED_TASK_TOPIC_DB_PROCESSOR), + Schedule( + ScheduledTask.SCHEDULED_TASK_NAME_SESSION_TIMEOUT, + 60, ScheduledTask.SCHEDULED_TASK_TOPIC_FLOW_PROCESSOR), ) private var schedulers: Schedulers? = null From 0b367dce2bc125dba64a9b6b979da84563f432c8 Mon Sep 17 00:00:00 2001 From: Dries Samyn Date: Fri, 29 Sep 2023 13:10:59 +0100 Subject: [PATCH 2/3] Revert alpha api version --- gradle.properties | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 08b01264de8..4107c61e093 100644 --- a/gradle.properties +++ b/gradle.properties @@ -46,8 +46,7 @@ commonsTextVersion = 1.10.0 bouncycastleVersion=1.73 # Corda API libs revision (change in 4th digit indicates a breaking change) # Change to 5.0.0.xx-SNAPSHOT to pick up maven local published copy -#cordaApiVersion=5.1.0.25-beta+ -cordaApiVersion=5.1.0.25-alpha-1695977914369 +cordaApiVersion=5.1.0.25-beta+ disruptorVersion=3.4.4 felixConfigAdminVersion=1.9.26 From ba0864b9e32db889576b854b55ce16d0ce4b19ef Mon Sep 17 00:00:00 2001 From: Dries Samyn Date: Fri, 29 Sep 2023 14:00:34 +0100 Subject: [PATCH 3/3] Use constant from API lib. --- .../internal/schedule/DeduplicationTableCleanUpProcessor.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/processors/db-processor/src/main/kotlin/net/corda/processors/db/internal/schedule/DeduplicationTableCleanUpProcessor.kt b/processors/db-processor/src/main/kotlin/net/corda/processors/db/internal/schedule/DeduplicationTableCleanUpProcessor.kt index 90bb14fdf30..2d4ae4ad59a 100644 --- a/processors/db-processor/src/main/kotlin/net/corda/processors/db/internal/schedule/DeduplicationTableCleanUpProcessor.kt +++ b/processors/db-processor/src/main/kotlin/net/corda/processors/db/internal/schedule/DeduplicationTableCleanUpProcessor.kt @@ -8,6 +8,7 @@ import net.corda.messaging.api.records.Record import net.corda.orm.JpaEntitiesSet import net.corda.orm.utils.transaction import net.corda.orm.utils.use +import net.corda.schema.Schemas import net.corda.utilities.debug import net.corda.virtualnode.VirtualNodeInfo import net.corda.virtualnode.read.VirtualNodeInfoReadService @@ -21,9 +22,6 @@ class DeduplicationTableCleanUpProcessor( ) : DurableProcessor { companion object { private val log = LoggerFactory.getLogger(DeduplicationTableCleanUpProcessor::class.java) - - // Need to merge with `SchedulerProcessorImpl.DEDUPLICATION_TABLE_CLEAN_UP_TASK` but there isn't currently a good candidate module - private const val DEDUPLICATION_TABLE_CLEAN_UP_TASK = "deduplication-table-clean-up-task" } override val keyClass: Class @@ -36,7 +34,7 @@ class DeduplicationTableCleanUpProcessor( events .forEach { val taskName = it.key - if (taskName == DEDUPLICATION_TABLE_CLEAN_UP_TASK) { + if (taskName == Schemas.ScheduledTask.SCHEDULED_TASK_NAME_DB_PROCESSOR) { log.debug { "Cleaning up deduplication table for all vnodes" } val startTime = System.nanoTime() virtualNodeInfoReadService.getAll()