From d4b81e25c0f8ec6e8d57f1c6ba1a27ba7d8060e1 Mon Sep 17 00:00:00 2001 From: Conal Smith <68279385+conalsmith-r3@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:35:13 +0100 Subject: [PATCH] CORE-16879 - replace max retry attempts with max retry window duration (#1236) Updates the config used to handle transient exceptions to instead use a time window. Changes to transient exception handling mean that it is possible to exhaust a retry count very rapidly in low load scenarios. By changing to a time window solution instead, the flow code will wait a suitable amount of time before failing a flow. Co-authored-by: James Higgs --- .../java/net/corda/schema/configuration/FlowConfig.java | 1 + .../corda/schema/configuration/flow/1.0/corda.flow.json | 7 +++++++ gradle.properties | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/data/config-schema/src/main/java/net/corda/schema/configuration/FlowConfig.java b/data/config-schema/src/main/java/net/corda/schema/configuration/FlowConfig.java index 57359f35ab..67e75825d6 100644 --- a/data/config-schema/src/main/java/net/corda/schema/configuration/FlowConfig.java +++ b/data/config-schema/src/main/java/net/corda/schema/configuration/FlowConfig.java @@ -10,6 +10,7 @@ private FlowConfig() { public static final String SESSION_P2P_TTL = "session.p2pTTL"; public static final String SESSION_FLOW_CLEANUP_TIME = "session.cleanupTime"; public static final String PROCESSING_MAX_RETRY_ATTEMPTS = "processing.maxRetryAttempts"; + public static final String PROCESSING_MAX_RETRY_WINDOW_DURATION = "processing.maxRetryWindowDuration"; public static final String PROCESSING_MAX_RETRY_DELAY = "processing.maxRetryDelay"; public static final String PROCESSING_MAX_FLOW_SLEEP_DURATION = "processing.maxFlowSleepDuration"; public static final String PROCESSING_FLOW_CLEANUP_TIME = "processing.cleanupTime"; diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/flow/1.0/corda.flow.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/flow/1.0/corda.flow.json index 6e88aed16e..8c0cfbfcd3 100644 --- a/data/config-schema/src/main/resources/net/corda/schema/configuration/flow/1.0/corda.flow.json +++ b/data/config-schema/src/main/resources/net/corda/schema/configuration/flow/1.0/corda.flow.json @@ -18,6 +18,13 @@ "maximum": 1000, "default": 5 }, + "maxRetryWindowDuration": { + "description": "The duration in milliseconds after a transient error that Corda retries a flow before failing it. A value of zero disables retries.", + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "default": 300000 + }, "maxRetryDelay": { "description": "The maximum delay in milliseconds before Corda schedules a retry.", "type": "integer", diff --git a/gradle.properties b/gradle.properties index f53ffc0dc2..c879bfa8ff 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ cordaProductVersion = 5.1.0 # NOTE: update this each time this module contains a breaking change ## NOTE: currently this is a top level revision, so all API versions will line up, but this could be moved to ## a per module property in which case module versions can change independently. -cordaApiRevision = 18 +cordaApiRevision = 19 # Main kotlinVersion = 1.8.21