From f21e230c3100464db408089ec1b60b022bc14797 Mon Sep 17 00:00:00 2001 From: Conal Smith Date: Tue, 5 Sep 2023 16:18:50 +0100 Subject: [PATCH 1/8] CORE-16879 - replace max retry attempts with max retry window duration --- .../java/net/corda/schema/configuration/FlowConfig.java | 2 +- .../corda/schema/configuration/flow/1.0/corda.flow.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) 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..41cde1b910 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 @@ -9,7 +9,7 @@ private FlowConfig() { public static final String SESSION_TIMEOUT_WINDOW = "session.timeout"; 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..d639c0570d 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 @@ -11,12 +11,12 @@ "type": "object", "default": {}, "properties": { - "maxRetryAttempts": { - "description": "The maximum number of times Corda retries a transient error before failing the flow. A value of zero disables retries.", + "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": 1000, - "default": 5 + "maximum": 2147483647, + "default": 120000 }, "maxRetryDelay": { "description": "The maximum delay in milliseconds before Corda schedules a retry.", From 60a3f80fae8c06ed5bf8ff362d8e3e22cab94e92 Mon Sep 17 00:00:00 2001 From: Conal Smith Date: Tue, 5 Sep 2023 16:33:05 +0100 Subject: [PATCH 2/8] CORE-16879 - update api revision --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index f53ffc0dc2..0bd76fe270 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 = 888 # Main kotlinVersion = 1.8.21 From 9cf0ae64f6fb9f69ebcd546c626cdf5fbf9e9689 Mon Sep 17 00:00:00 2001 From: Conal Smith Date: Thu, 7 Sep 2023 14:25:10 +0100 Subject: [PATCH 3/8] CORE-16879 - new version for flow config --- .../configuration/flow/1.0/corda.flow.json | 8 +- .../configuration/flow/1.1/corda.flow.json | 98 +++++++++++++++++++ 2 files changed, 102 insertions(+), 4 deletions(-) create mode 100644 data/config-schema/src/main/resources/net/corda/schema/configuration/flow/1.1/corda.flow.json 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 d639c0570d..6e88aed16e 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 @@ -11,12 +11,12 @@ "type": "object", "default": {}, "properties": { - "maxRetryWindowDuration": { - "description": "The duration in milliseconds after a transient error that Corda retries a flow before failing it. A value of zero disables retries.", + "maxRetryAttempts": { + "description": "The maximum number of times Corda retries a transient error before failing the flow. A value of zero disables retries.", "type": "integer", "minimum": 0, - "maximum": 2147483647, - "default": 120000 + "maximum": 1000, + "default": 5 }, "maxRetryDelay": { "description": "The maximum delay in milliseconds before Corda schedules a retry.", diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/flow/1.1/corda.flow.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/flow/1.1/corda.flow.json new file mode 100644 index 0000000000..0b91dd5ec2 --- /dev/null +++ b/data/config-schema/src/main/resources/net/corda/schema/configuration/flow/1.1/corda.flow.json @@ -0,0 +1,98 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://corda.r3.com/net/corda/schema/configuration/flow/1.1/corda.flow.json", + "title": "Corda Flow Configuration Schema", + "description": "Configuration schema for the flow section.", + "type": "object", + "default": {}, + "properties": { + "processing": { + "description": "Settings for flow pipeline processing.", + "type": "object", + "default": {}, + "properties": { + "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": 120000 + }, + "maxRetryDelay": { + "description": "The maximum delay in milliseconds before Corda schedules a retry.", + "type": "integer", + "minimum": 1000, + "maximum": 2147483647, + "default": 16000 + }, + "maxFlowSleepDuration": { + "description": "The maximum delay in milliseconds before Corda schedules a periodic wake-up.", + "type": "integer", + "minimum": 1000, + "maximum": 2147483647, + "default": 900000 + }, + "cleanupTime": { + "description": "The length of time in milliseconds that the flow mapper holds onto its state for a flow that has finished. This value should be at least 2 times larger than the session.p2pTTL.", + "type": "integer", + "minimum": 1000, + "maximum": 2147483647, + "default": 600000 + } + }, + "additionalProperties": false + }, + "session": { + "description": "Settings for flow sessions.", + "type": "object", + "default": {}, + "properties": { + "timeout": { + "description": "The length of time in milliseconds that Corda waits when no message has been received from a counterparty before causing the session to error.", + "type": "integer", + "minimum": 1000, + "maximum": 2147483647, + "default": 1800000 + }, + "p2pTTL": { + "description": "The TTL set in milliseconds. This is added to the current time and set on messages passed to the P2P layer to send to a counterparty. Messages received with a TTL timestamp set in the past will be discarded.", + "type": "integer", + "minimum": 10000, + "maximum": 2147483647, + "default": 300000 + }, + "cleanupTime": { + "description": "The length of time in milliseconds that the flow mapper holds onto its state for a session after the session has finished. This value should be at least 2 times larger than the session.p2pTTL", + "type": "integer", + "minimum": 10000, + "maximum": 2147483647, + "default": 600000 + } + }, + "additionalProperties": false + }, + "event": { + "description": "Settings for external events within a flow.", + "type": "object", + "default": {}, + "properties": { + "messageResendWindow": { + "description": "The length of time in milliseconds that Corda waits before resending unprocessed external events.", + "type": "integer", + "minimum": 1000, + "maximum": 2147483647, + "default": 60000 + }, + "maxRetries": { + "description": "The maximum number of times Corda retries a request before returning an exception.", + "type": "integer", + "minimum": 0, + "maximum": 2147483647, + "default": 5 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false +} \ No newline at end of file From 069f23f6875b6e44a687cf0b58ef36bbf0c27338 Mon Sep 17 00:00:00 2001 From: Conal Smith Date: Thu, 7 Sep 2023 14:43:48 +0100 Subject: [PATCH 4/8] CORE-16879 - update config to 5.1 --- .../schema/configuration/flow/{1.1 => 5.1}/corda.flow.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename data/config-schema/src/main/resources/net/corda/schema/configuration/flow/{1.1 => 5.1}/corda.flow.json (99%) diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/flow/1.1/corda.flow.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/flow/5.1/corda.flow.json similarity index 99% rename from data/config-schema/src/main/resources/net/corda/schema/configuration/flow/1.1/corda.flow.json rename to data/config-schema/src/main/resources/net/corda/schema/configuration/flow/5.1/corda.flow.json index 0b91dd5ec2..1afe56746e 100644 --- a/data/config-schema/src/main/resources/net/corda/schema/configuration/flow/1.1/corda.flow.json +++ b/data/config-schema/src/main/resources/net/corda/schema/configuration/flow/5.1/corda.flow.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://corda.r3.com/net/corda/schema/configuration/flow/1.1/corda.flow.json", + "$id": "https://corda.r3.com/net/corda/schema/configuration/flow/5.1/corda.flow.json", "title": "Corda Flow Configuration Schema", "description": "Configuration schema for the flow section.", "type": "object", From 5e6c136f4f075cd2be7e52e66acb2b1b152d7eca Mon Sep 17 00:00:00 2001 From: Conal Smith Date: Thu, 7 Sep 2023 17:59:54 +0100 Subject: [PATCH 5/8] CORE-16879 - revert to add non-breaking property to 1.0 schema --- .../configuration/flow/1.0/corda.flow.json | 7 ++ .../configuration/flow/5.1/corda.flow.json | 98 ------------------- 2 files changed, 7 insertions(+), 98 deletions(-) delete mode 100644 data/config-schema/src/main/resources/net/corda/schema/configuration/flow/5.1/corda.flow.json 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..d1c33eb194 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": 120000 + }, "maxRetryDelay": { "description": "The maximum delay in milliseconds before Corda schedules a retry.", "type": "integer", diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/flow/5.1/corda.flow.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/flow/5.1/corda.flow.json deleted file mode 100644 index 1afe56746e..0000000000 --- a/data/config-schema/src/main/resources/net/corda/schema/configuration/flow/5.1/corda.flow.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://corda.r3.com/net/corda/schema/configuration/flow/5.1/corda.flow.json", - "title": "Corda Flow Configuration Schema", - "description": "Configuration schema for the flow section.", - "type": "object", - "default": {}, - "properties": { - "processing": { - "description": "Settings for flow pipeline processing.", - "type": "object", - "default": {}, - "properties": { - "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": 120000 - }, - "maxRetryDelay": { - "description": "The maximum delay in milliseconds before Corda schedules a retry.", - "type": "integer", - "minimum": 1000, - "maximum": 2147483647, - "default": 16000 - }, - "maxFlowSleepDuration": { - "description": "The maximum delay in milliseconds before Corda schedules a periodic wake-up.", - "type": "integer", - "minimum": 1000, - "maximum": 2147483647, - "default": 900000 - }, - "cleanupTime": { - "description": "The length of time in milliseconds that the flow mapper holds onto its state for a flow that has finished. This value should be at least 2 times larger than the session.p2pTTL.", - "type": "integer", - "minimum": 1000, - "maximum": 2147483647, - "default": 600000 - } - }, - "additionalProperties": false - }, - "session": { - "description": "Settings for flow sessions.", - "type": "object", - "default": {}, - "properties": { - "timeout": { - "description": "The length of time in milliseconds that Corda waits when no message has been received from a counterparty before causing the session to error.", - "type": "integer", - "minimum": 1000, - "maximum": 2147483647, - "default": 1800000 - }, - "p2pTTL": { - "description": "The TTL set in milliseconds. This is added to the current time and set on messages passed to the P2P layer to send to a counterparty. Messages received with a TTL timestamp set in the past will be discarded.", - "type": "integer", - "minimum": 10000, - "maximum": 2147483647, - "default": 300000 - }, - "cleanupTime": { - "description": "The length of time in milliseconds that the flow mapper holds onto its state for a session after the session has finished. This value should be at least 2 times larger than the session.p2pTTL", - "type": "integer", - "minimum": 10000, - "maximum": 2147483647, - "default": 600000 - } - }, - "additionalProperties": false - }, - "event": { - "description": "Settings for external events within a flow.", - "type": "object", - "default": {}, - "properties": { - "messageResendWindow": { - "description": "The length of time in milliseconds that Corda waits before resending unprocessed external events.", - "type": "integer", - "minimum": 1000, - "maximum": 2147483647, - "default": 60000 - }, - "maxRetries": { - "description": "The maximum number of times Corda retries a request before returning an exception.", - "type": "integer", - "minimum": 0, - "maximum": 2147483647, - "default": 5 - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false -} \ No newline at end of file From fb8e4bc8f63fa06848b76b6d524ee05754aadeaf Mon Sep 17 00:00:00 2001 From: Conal Smith Date: Thu, 7 Sep 2023 22:55:51 +0100 Subject: [PATCH 6/8] CORE-16879 - add back in the FlowConfig for the max retry attempts --- .../src/main/java/net/corda/schema/configuration/FlowConfig.java | 1 + 1 file changed, 1 insertion(+) 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 41cde1b910..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 @@ -9,6 +9,7 @@ private FlowConfig() { public static final String SESSION_TIMEOUT_WINDOW = "session.timeout"; 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"; From df9cf5520fe174f0570f10d49996fd91081d85f5 Mon Sep 17 00:00:00 2001 From: James Higgs Date: Fri, 8 Sep 2023 13:01:05 +0100 Subject: [PATCH 7/8] CORE-16879: Update API version to correct value --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 0bd76fe270..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 = 888 +cordaApiRevision = 19 # Main kotlinVersion = 1.8.21 From eff386a18b0c2f4a9a9312befca8618a97d42cac Mon Sep 17 00:00:00 2001 From: James Higgs Date: Fri, 8 Sep 2023 13:25:12 +0100 Subject: [PATCH 8/8] CORE-16879: Make default 5 minutes --- .../net/corda/schema/configuration/flow/1.0/corda.flow.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 d1c33eb194..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 @@ -23,7 +23,7 @@ "type": "integer", "minimum": 0, "maximum": 2147483647, - "default": 120000 + "default": 300000 }, "maxRetryDelay": { "description": "The maximum delay in milliseconds before Corda schedules a retry.",