From ae0bf745059005a1c5f07c3589c88a257329a8e2 Mon Sep 17 00:00:00 2001 From: ConnelMcGovern Date: Wed, 23 Mar 2022 16:50:37 +0000 Subject: [PATCH 01/13] INFRA-1743 Activate C4 email notifications Open source and Ent --- .ci/dev/regression/Jenkinsfile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.ci/dev/regression/Jenkinsfile b/.ci/dev/regression/Jenkinsfile index a603ef13af..db4afdadbe 100644 --- a/.ci/dev/regression/Jenkinsfile +++ b/.ci/dev/regression/Jenkinsfile @@ -409,6 +409,22 @@ pipeline { } } } + failure { + script { + def statusSymbol = '\u274c' + if (isReleaseTag || isReleaseBranch || isReleaseCandidate) { + emailext subject: "$statusSymbol " + '$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!', + body: '${SCRIPT, template="groovy-html.template"}', + recipientProviders: [ + [$class: 'CulpritsRecipientProvider'], + [$class: 'RequesterRecipientProvider'] + ], + mimeType: 'text/html', + replyTo: '$DEFAULT_REPLYTO', + to: "adel.el-beik@r3.com" + } + } + } cleanup { deleteDir() /* clean up our workspace */ } From f89cb76309f84c9659abc276db134695474d8517 Mon Sep 17 00:00:00 2001 From: Adel El-Beik Date: Fri, 1 Apr 2022 16:40:19 +0100 Subject: [PATCH 02/13] ENT-6629: Update hibernate version to match ent. --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 359588cb1f..589a760b30 100644 --- a/build.gradle +++ b/build.gradle @@ -99,7 +99,7 @@ buildscript { ext.hamkrest_version = '1.7.0.0' ext.jopt_simple_version = '5.0.2' ext.jansi_version = '1.18' - ext.hibernate_version = '5.4.3.Final' + ext.hibernate_version = '5.4.32.Final' ext.h2_version = '1.4.199' // Update docs if renamed or removed. ext.rxjava_version = '1.3.8' ext.dokka_version = '0.10.1' From c53b0af9976bd4b49726709a5433b266fcb74360 Mon Sep 17 00:00:00 2001 From: Adel El-Beik Date: Mon, 11 Apr 2022 12:21:49 +0100 Subject: [PATCH 03/13] ENT-6748: Make sure correct artemis is picked up, and don't rely on cache. --- build.gradle | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build.gradle b/build.gradle index 589a760b30..91a4b96c32 100644 --- a/build.gradle +++ b/build.gradle @@ -380,6 +380,12 @@ allprojects { repositories { mavenLocal() + // Prevents cache giving use the wrong artemis + mavenCentral { + content { + includeGroup 'org.apache.activemq' + } + } // Use system environment to activate caching with Artifactory, // because it is actually easier to pass that during parallel build. // NOTE: it has to be a name of a virtual repository with all From 415c06861675751751cb4d30576c495bee426d39 Mon Sep 17 00:00:00 2001 From: Ronan Browne Date: Tue, 12 Apr 2022 13:56:06 +0100 Subject: [PATCH 04/13] ENT-6753 update base images --- docker/src/docker/Dockerfile | 2 +- docker/src/docker/Dockerfile-debug | 2 +- docker/src/docker/DockerfileAL | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/src/docker/Dockerfile b/docker/src/docker/Dockerfile index 84200d542b..b87898e1d2 100644 --- a/docker/src/docker/Dockerfile +++ b/docker/src/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM azul/zulu-openjdk:8u312 +FROM azul/zulu-openjdk:8u322 ## Add packages, clean cache, create dirs, create corda user and change ownership RUN apt-get update && \ diff --git a/docker/src/docker/Dockerfile-debug b/docker/src/docker/Dockerfile-debug index a1175c989c..6f69c0b2d5 100644 --- a/docker/src/docker/Dockerfile-debug +++ b/docker/src/docker/Dockerfile-debug @@ -1,4 +1,4 @@ -FROM azul/zulu-openjdk:8u312 +FROM azul/zulu-openjdk:8u322 ## Add packages, clean cache, create dirs, create corda user and change ownership RUN apt-get update && \ diff --git a/docker/src/docker/DockerfileAL b/docker/src/docker/DockerfileAL index 8c5ccd46ff..eee206714b 100644 --- a/docker/src/docker/DockerfileAL +++ b/docker/src/docker/DockerfileAL @@ -1,4 +1,4 @@ -FROM amazoncorretto:8u312-al2 +FROM amazoncorretto:8u322-al2 ## Add packages, clean cache, create dirs, create corda user and change ownership RUN yum -y install bash && \ From b331a421b2c5bf47b1c8504cae2eeeef70f7d9f3 Mon Sep 17 00:00:00 2001 From: Dimos Raptis Date: Fri, 22 Apr 2022 15:40:28 +0100 Subject: [PATCH 05/13] ENT-6579 - Upgrade netty --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 91a4b96c32..dec14ebc1c 100644 --- a/build.gradle +++ b/build.gradle @@ -80,7 +80,7 @@ buildscript { ext.djvm_version = constants.getProperty("djvmVersion") ext.deterministic_rt_version = constants.getProperty('deterministicRtVersion') ext.okhttp_version = '3.14.2' - ext.netty_version = '4.1.68.Final' + ext.netty_version = '4.1.76.Final' ext.tcnative_version = constants.getProperty("tcnativeVersion") ext.typesafe_config_version = constants.getProperty("typesafeConfigVersion") ext.fileupload_version = '1.4' From fa607024c285e0b9870fb05e61492648092c565e Mon Sep 17 00:00:00 2001 From: Adel El-Beik Date: Wed, 23 Mar 2022 13:45:21 +0000 Subject: [PATCH 06/13] ENT-6743: Contains method of flow hospital now correctly returns if flow is in hospital. Historic patient records not used. --- .../statemachine/StaffedFlowHospital.kt | 13 +---------- .../statemachine/RetryFlowMockTest.kt | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/node/src/main/kotlin/net/corda/node/services/statemachine/StaffedFlowHospital.kt b/node/src/main/kotlin/net/corda/node/services/statemachine/StaffedFlowHospital.kt index 519b2bd3d5..0548af8a4b 100644 --- a/node/src/main/kotlin/net/corda/node/services/statemachine/StaffedFlowHospital.kt +++ b/node/src/main/kotlin/net/corda/node/services/statemachine/StaffedFlowHospital.kt @@ -103,17 +103,6 @@ class StaffedFlowHospital(private val flowMessaging: FlowMessaging, * Flows should be removed from [flowsInHospital] when they have completed a successful transition. */ private val flowsInHospital = ConcurrentHashMap() - - /** - * Returns true if the flow is currently being treated in the hospital. - * The differs to flows with a medical history (which can accessed via [StaffedFlowHospital.contains]). - */ - @VisibleForTesting - internal fun flowInHospital(runId: StateMachineRunId): Boolean { - // The .keys avoids https://youtrack.jetbrains.com/issue/KT-18053 - return runId in flowsInHospital.keys - } - private val mutex = ThreadBox(object { /** * Contains medical history of every flow (a patient) that has entered the hospital. A flow can leave the hospital, @@ -347,7 +336,7 @@ class StaffedFlowHospital(private val flowMessaging: FlowMessaging, } } - operator fun contains(flowId: StateMachineRunId) = mutex.locked { flowId in flowPatients } + operator fun contains(flowId: StateMachineRunId) = flowId in flowsInHospital.keys override fun close() { hospitalJobTimer.cancel() diff --git a/node/src/test/kotlin/net/corda/node/services/statemachine/RetryFlowMockTest.kt b/node/src/test/kotlin/net/corda/node/services/statemachine/RetryFlowMockTest.kt index 2e4ccdecc2..bd6b3fcd93 100644 --- a/node/src/test/kotlin/net/corda/node/services/statemachine/RetryFlowMockTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/statemachine/RetryFlowMockTest.kt @@ -6,6 +6,7 @@ import net.corda.core.flows.Destination import net.corda.core.flows.FlowInfo import net.corda.core.flows.FlowLogic import net.corda.core.flows.FlowSession +import net.corda.core.flows.HospitalizeFlowException import net.corda.core.flows.InitiatedBy import net.corda.core.flows.InitiatingFlow import net.corda.core.flows.KilledFlowException @@ -29,6 +30,7 @@ import net.corda.testing.node.internal.MessagingServiceSpy import net.corda.testing.node.internal.TestStartedNode import net.corda.testing.node.internal.enclosedCordapp import net.corda.testing.node.internal.newContext +import net.corda.testing.node.internal.startFlow import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatExceptionOfType import org.h2.util.Utils @@ -47,6 +49,7 @@ import java.util.concurrent.Semaphore import java.util.concurrent.TimeUnit import kotlin.test.assertEquals import kotlin.test.assertFailsWith +import kotlin.test.assertFalse import kotlin.test.assertNotNull import kotlin.test.assertNull @@ -324,6 +327,25 @@ class RetryFlowMockTest { } } + class HospitalizeThenSucceedFlow : FlowLogic() { + companion object { + var runs = 0 + var flowRetried = Semaphore(0) + var flowWillReturn = Semaphore(0) + } + + @Suspendable + override fun call(): Boolean { + if (runs == 0) { + runs++ + throw HospitalizeFlowException("Hospitalize on first run") + } + flowRetried.release() + flowWillReturn.acquire() + return true + } + } + @InitiatingFlow class UnbalancedSendAndReceiveFlow(private val other: Party) : FlowLogic() { From c1002697c733369d8779a2e15fdb905a093ca4c8 Mon Sep 17 00:00:00 2001 From: Adel El-Beik Date: Mon, 25 Apr 2022 11:30:24 +0100 Subject: [PATCH 07/13] ENT-6743: Reverted RetryFlowMockTest as the retry op only available on ENT. --- .../statemachine/RetryFlowMockTest.kt | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/node/src/test/kotlin/net/corda/node/services/statemachine/RetryFlowMockTest.kt b/node/src/test/kotlin/net/corda/node/services/statemachine/RetryFlowMockTest.kt index bd6b3fcd93..2e4ccdecc2 100644 --- a/node/src/test/kotlin/net/corda/node/services/statemachine/RetryFlowMockTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/statemachine/RetryFlowMockTest.kt @@ -6,7 +6,6 @@ import net.corda.core.flows.Destination import net.corda.core.flows.FlowInfo import net.corda.core.flows.FlowLogic import net.corda.core.flows.FlowSession -import net.corda.core.flows.HospitalizeFlowException import net.corda.core.flows.InitiatedBy import net.corda.core.flows.InitiatingFlow import net.corda.core.flows.KilledFlowException @@ -30,7 +29,6 @@ import net.corda.testing.node.internal.MessagingServiceSpy import net.corda.testing.node.internal.TestStartedNode import net.corda.testing.node.internal.enclosedCordapp import net.corda.testing.node.internal.newContext -import net.corda.testing.node.internal.startFlow import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatExceptionOfType import org.h2.util.Utils @@ -49,7 +47,6 @@ import java.util.concurrent.Semaphore import java.util.concurrent.TimeUnit import kotlin.test.assertEquals import kotlin.test.assertFailsWith -import kotlin.test.assertFalse import kotlin.test.assertNotNull import kotlin.test.assertNull @@ -327,25 +324,6 @@ class RetryFlowMockTest { } } - class HospitalizeThenSucceedFlow : FlowLogic() { - companion object { - var runs = 0 - var flowRetried = Semaphore(0) - var flowWillReturn = Semaphore(0) - } - - @Suspendable - override fun call(): Boolean { - if (runs == 0) { - runs++ - throw HospitalizeFlowException("Hospitalize on first run") - } - flowRetried.release() - flowWillReturn.acquire() - return true - } - } - @InitiatingFlow class UnbalancedSendAndReceiveFlow(private val other: Party) : FlowLogic() { From cd591a50cd9fa2b89f0be7fe1821d0546f1a91af Mon Sep 17 00:00:00 2001 From: Connel McGovern <100574906+mcgovc@users.noreply.github.com> Date: Mon, 9 May 2022 13:22:38 +0100 Subject: [PATCH 08/13] INFRA-1743 E-mail & Slack notifications --- .ci/dev/regression/Jenkinsfile | 47 ++++++++++------------------------ 1 file changed, 14 insertions(+), 33 deletions(-) diff --git a/.ci/dev/regression/Jenkinsfile b/.ci/dev/regression/Jenkinsfile index db4afdadbe..e0a3dbf62c 100644 --- a/.ci/dev/regression/Jenkinsfile +++ b/.ci/dev/regression/Jenkinsfile @@ -3,6 +3,7 @@ * Jenkins pipeline to build Corda OS release branches and tags. * PLEASE NOTE: we DO want to run a build for each commit!!! */ +@Library('corda-shared-build-pipeline-steps') /** * Sense environment @@ -41,17 +42,6 @@ def nexusIqStageChoices = [nexusDefaultIqStage].plus( 'operate' ].minus([nexusDefaultIqStage])) -/** - * define an empty teamsWebHookURL and if it is a Release Branch - * then set it for the Corda 4 Jenkins Connector - */ -def teamsWebHookURL = "" -if (isReleaseBranch || isReleaseTag){ - withCredentials([string(credentialsId: 'ms-teams-webhook', variable: 'webhook_url')]) { - teamsWebHookURL = "$webhook_url" - } -} - /** * Common Gradle arguments for all Gradle executions */ @@ -75,18 +65,6 @@ pipeline { parallelsAlwaysFailFast() timeout(time: 6, unit: 'HOURS') timestamps() - office365ConnectorWebhooks([[ - name : "Corda 4 Jenkins Connector", - notifyBackToNormal : true, - startNotification : false, - notifyFailure : true, - notifySuccess : true, - notifyNotBuilt : false, - notifyAborted : false, - notifyRepeatedFailure: true, - notifyUnstable : true, - url : "${teamsWebHookURL}" - ]]) } parameters { @@ -104,6 +82,7 @@ pipeline { CORDA_ARTIFACTORY_USERNAME = "${env.ARTIFACTORY_CREDENTIALS_USR}" CORDA_BUILD_EDITION = "${buildEdition}" DOCKER_URL = "https://index.docker.io/v1/" + EMAIL_RECIPIENTS = credentials('corda4-email-recipient') } stages { @@ -409,19 +388,21 @@ pipeline { } } } + success { + script { + sendSlackNotifications("good", "BUILD PASSED", false, "#corda-corda4-open-source-build-notifications") + } + } + unstable { + script { + sendSlackNotifications("warning", "BUILD UNSTABLE - Unstable Builds are likely a result of Nexus Sonar Scanner violations", false, "#corda-corda4-open-source-build-notifications") + } + } failure { script { - def statusSymbol = '\u274c' + sendSlackNotifications("danger", "BUILD FAILURE", true, "#corda-corda4-open-source-build-notifications") if (isReleaseTag || isReleaseBranch || isReleaseCandidate) { - emailext subject: "$statusSymbol " + '$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!', - body: '${SCRIPT, template="groovy-html.template"}', - recipientProviders: [ - [$class: 'CulpritsRecipientProvider'], - [$class: 'RequesterRecipientProvider'] - ], - mimeType: 'text/html', - replyTo: '$DEFAULT_REPLYTO', - to: "adel.el-beik@r3.com" + sendEmailNotifications("${env.EMAIL_RECIPIENTS}") } } } From 855a0207745555d1ae29debe85848daca3ed4302 Mon Sep 17 00:00:00 2001 From: Connel McGovern <100574906+mcgovc@users.noreply.github.com> Date: Mon, 9 May 2022 16:15:42 +0100 Subject: [PATCH 09/13] Update Jenkinsfile --- .ci/dev/regression/Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/dev/regression/Jenkinsfile b/.ci/dev/regression/Jenkinsfile index e0a3dbf62c..131eb4370d 100644 --- a/.ci/dev/regression/Jenkinsfile +++ b/.ci/dev/regression/Jenkinsfile @@ -390,12 +390,12 @@ pipeline { } success { script { - sendSlackNotifications("good", "BUILD PASSED", false, "#corda-corda4-open-source-build-notifications") + sendSlackNotifications("good", "BUILD PASSED", true, "#corda-corda4-open-source-build-notifications") } } unstable { script { - sendSlackNotifications("warning", "BUILD UNSTABLE - Unstable Builds are likely a result of Nexus Sonar Scanner violations", false, "#corda-corda4-open-source-build-notifications") + sendSlackNotifications("warning", "BUILD UNSTABLE - Unstable Builds are likely a result of Nexus Sonar Scanner violations", true, "#corda-corda4-open-source-build-notifications") } } failure { From ad5193f135d3f1a4bad6ebd7e3aa76f4509bfdbc Mon Sep 17 00:00:00 2001 From: Adel El-Beik Date: Tue, 10 May 2022 13:46:48 +0100 Subject: [PATCH 10/13] ENT-6636: Removing commons-codec - not used, at least not as a compile time dep. --- node/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/node/build.gradle b/node/build.gradle index 0b4a47213d..3e247a5ed5 100644 --- a/node/build.gradle +++ b/node/build.gradle @@ -206,7 +206,6 @@ dependencies { // BFT-Smart dependencies compile 'com.github.bft-smart:library:master-v1.1-beta-g6215ec8-87' - compile 'commons-codec:commons-codec:1.13' // Java Atomix: RAFT library compile 'io.atomix.copycat:copycat-client:1.2.3' From 5e9358c2c0d97494df074ce9803e24b29e277134 Mon Sep 17 00:00:00 2001 From: Connel McGovern <100574906+mcgovc@users.noreply.github.com> Date: Wed, 11 May 2022 14:14:28 +0100 Subject: [PATCH 11/13] NOTICK Remove Slack tagging on successful/unstable builds --- .ci/dev/regression/Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/dev/regression/Jenkinsfile b/.ci/dev/regression/Jenkinsfile index 131eb4370d..e0a3dbf62c 100644 --- a/.ci/dev/regression/Jenkinsfile +++ b/.ci/dev/regression/Jenkinsfile @@ -390,12 +390,12 @@ pipeline { } success { script { - sendSlackNotifications("good", "BUILD PASSED", true, "#corda-corda4-open-source-build-notifications") + sendSlackNotifications("good", "BUILD PASSED", false, "#corda-corda4-open-source-build-notifications") } } unstable { script { - sendSlackNotifications("warning", "BUILD UNSTABLE - Unstable Builds are likely a result of Nexus Sonar Scanner violations", true, "#corda-corda4-open-source-build-notifications") + sendSlackNotifications("warning", "BUILD UNSTABLE - Unstable Builds are likely a result of Nexus Sonar Scanner violations", false, "#corda-corda4-open-source-build-notifications") } } failure { From 9259522a14114a950e0a603504d534fbb5e18c22 Mon Sep 17 00:00:00 2001 From: Adel El-Beik Date: Mon, 16 May 2022 18:16:54 +0100 Subject: [PATCH 12/13] ENT-6480: Upgraded caffeine to 2.9.3. --- constants.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/constants.properties b/constants.properties index 44f83464ee..73d05b7410 100644 --- a/constants.properties +++ b/constants.properties @@ -27,7 +27,7 @@ typesafeConfigVersion=1.3.4 jsr305Version=3.0.2 artifactoryPluginVersion=4.16.1 snakeYamlVersion=1.19 -caffeineVersion=2.7.0 +caffeineVersion=2.9.3 metricsVersion=4.1.0 metricsNewRelicVersion=1.1.1 djvmVersion=1.1.1 From d6fc10e632092a736c263d509c8f80237cc9d296 Mon Sep 17 00:00:00 2001 From: Viktor Kolomeyko Date: Wed, 18 May 2022 15:15:06 +0100 Subject: [PATCH 13/13] ENT-6784: Change special provisions for Artemis Server logging (#7174) As a side effect of enabling warnings for Artemis was the following messages to be produced in the Node's log: ``` [WARN ] 2022-05-16T14:53:01,203Z [main] core.server. - AMQ222165: No Dead Letter Address configured for queue rpc.server in AddressSettings [WARN ] 2022-05-16T14:53:01,203Z [main] core.server. - AMQ222166: No Expiry Address configured for queue rpc.server in AddressSettings ... [WARN ] 2022-05-16T14:53:01,885Z [Thread-1 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$6@70eb0c59)] core.server. - AMQ222165: No Dead Letter Address configured for queue p2p.inbound.DL5WQBEduTfiTzdLkg7iXcz5vY4oaJNdJr7Y4xaLvYszPj in AddressSettings [WARN ] 2022-05-16T14:53:01,885Z [Thread-1 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$6@70eb0c59)] core.server. - AMQ222166: No Expiry Address configured for queue p2p.inbound.DL5WQBEduTfiTzdLkg7iXcz5vY4oaJNdJr7Y4xaLvYszPj in AddressSettings ``` To suppress them a dedicated filter been added. The change to logging configuration been tested locally using out-of-process integration tests. --- config/dev/log4j2.xml | 6 +++++- testing/test-common/src/main/resources/log4j2-test.xml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/config/dev/log4j2.xml b/config/dev/log4j2.xml index 171832c040..fda43c56e6 100644 --- a/config/dev/log4j2.xml +++ b/config/dev/log4j2.xml @@ -202,7 +202,11 @@ - + + + + + diff --git a/testing/test-common/src/main/resources/log4j2-test.xml b/testing/test-common/src/main/resources/log4j2-test.xml index 5edab5035f..f6a24d2f5b 100644 --- a/testing/test-common/src/main/resources/log4j2-test.xml +++ b/testing/test-common/src/main/resources/log4j2-test.xml @@ -90,7 +90,11 @@ - + + + + +