From 134ff60af8569ed87fb3e73fc8d239c83c474a88 Mon Sep 17 00:00:00 2001 From: Adel El-Beik Date: Thu, 31 Aug 2023 18:33:34 +0100 Subject: [PATCH 1/6] ENT-10694: Switch the noisy SSL handshake to trace logging. But allow it to be enabled again with a system property. --- .../messaging/NodeNettyAcceptorFactory.kt | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/node/src/main/kotlin/net/corda/node/services/messaging/NodeNettyAcceptorFactory.kt b/node/src/main/kotlin/net/corda/node/services/messaging/NodeNettyAcceptorFactory.kt index 9e9c7ca081..69809cafc6 100644 --- a/node/src/main/kotlin/net/corda/node/services/messaging/NodeNettyAcceptorFactory.kt +++ b/node/src/main/kotlin/net/corda/node/services/messaging/NodeNettyAcceptorFactory.kt @@ -9,6 +9,7 @@ import io.netty.handler.ssl.SslHandler import io.netty.handler.ssl.SslHandshakeTimeoutException import net.corda.core.internal.declaredField import net.corda.core.utilities.contextLogger +import net.corda.core.utilities.trace import net.corda.nodeapi.internal.ArtemisTcpTransport import net.corda.nodeapi.internal.protonwrapper.netty.sslDelegatedTaskExecutor import net.corda.nodeapi.internal.setThreadPoolName @@ -131,6 +132,7 @@ class NodeNettyAcceptorFactory : AcceptorFactory { delegatedTaskExecutor: Executor, private val trace: Boolean) : SslHandler(engine, delegatedTaskExecutor) { companion object { + private val nettyLogHandshake = System.getProperty("net.corda.node.services.messaging.nettyLogHandshake")?.toBoolean() ?: false private val logger = contextLogger() } @@ -153,15 +155,31 @@ class NodeNettyAcceptorFactory : AcceptorFactory { remoteAddress } when { - it.isSuccess -> logger.info("SSL handshake completed in ${duration}ms with $peer") - it.isCancelled -> logger.warn("SSL handshake cancelled after ${duration}ms with $peer") + it.isSuccess -> loggerInfo { "SSL handshake completed in ${duration}ms with $peer" } + it.isCancelled -> loggerWarn { "SSL handshake cancelled after ${duration}ms with $peer" } else -> when (it.cause()) { - is ClosedChannelException -> logger.warn("SSL handshake closed early after ${duration}ms with $peer") - is SslHandshakeTimeoutException -> logger.warn("SSL handshake timed out after ${duration}ms with $peer") - else -> logger.warn("SSL handshake failed after ${duration}ms with $peer", it.cause()) + is ClosedChannelException -> loggerWarn { "SSL handshake closed early after ${duration}ms with $peer" } + is SslHandshakeTimeoutException -> loggerWarn { "SSL handshake timed out after ${duration}ms with $peer" } + else -> loggerWarn(it.cause()) {"SSL handshake failed after ${duration}ms with $peer" } } } } } + private fun loggerInfo(msgFn: () -> String) { + if (nettyLogHandshake && logger.isInfoEnabled) { + logger.info(msgFn()) + } + else { + logger.trace { msgFn() } + } + } + private fun loggerWarn(t: Throwable? = null, msgFn: () -> String) { + if (nettyLogHandshake && logger.isWarnEnabled) { + logger.warn(msgFn(), t) + } + else if (logger.isTraceEnabled) { + logger.trace(msgFn(), t) + } + } } } From b0f86e26f94185cdb8fce0bc6e3ccbef495f90ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Waldemar=20=C5=BBurowski?= <45210402+wzur-r3@users.noreply.github.com> Date: Fri, 1 Sep 2023 10:50:47 +0100 Subject: [PATCH 2/6] ES-412: added automatic forward merge for Corda 4 (#7469) * uses an already existing shared pipeline * will start automatic PR creation for changes between 4.6 and 4.7 --- .ci/dev/forward-merge/Jenkinsfile | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .ci/dev/forward-merge/Jenkinsfile diff --git a/.ci/dev/forward-merge/Jenkinsfile b/.ci/dev/forward-merge/Jenkinsfile new file mode 100644 index 0000000000..a7604506ff --- /dev/null +++ b/.ci/dev/forward-merge/Jenkinsfile @@ -0,0 +1,8 @@ +@Library('corda-shared-build-pipeline-steps@5.1') _ + +forwardMerger( + targetBranch: 'release/os/4.7', + originBranch: 'release/os/4.6', + slackChannel: '#build-team-automated-notifications' +) + From 267b500c93b01694e3e9503d4ad6eeb195ba97a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Waldemar=20=C5=BBurowski?= <45210402+wzur-r3@users.noreply.github.com> Date: Fri, 1 Sep 2023 11:56:24 +0200 Subject: [PATCH 3/6] updated forward merged to new branch --- .ci/dev/forward-merge/Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/dev/forward-merge/Jenkinsfile b/.ci/dev/forward-merge/Jenkinsfile index a7604506ff..15bab869d8 100644 --- a/.ci/dev/forward-merge/Jenkinsfile +++ b/.ci/dev/forward-merge/Jenkinsfile @@ -1,8 +1,8 @@ @Library('corda-shared-build-pipeline-steps@5.1') _ forwardMerger( - targetBranch: 'release/os/4.7', - originBranch: 'release/os/4.6', + targetBranch: 'release/os/4.8', + originBranch: 'release/os/4.7', slackChannel: '#build-team-automated-notifications' ) From 3d8636c716c7bdf8a59607f640e9ef46624809dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Waldemar=20=C5=BBurowski?= <45210402+wzur-r3@users.noreply.github.com> Date: Fri, 1 Sep 2023 14:55:04 +0200 Subject: [PATCH 4/6] updated for new branch --- .ci/dev/forward-merge/Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/dev/forward-merge/Jenkinsfile b/.ci/dev/forward-merge/Jenkinsfile index 15bab869d8..48600b1459 100644 --- a/.ci/dev/forward-merge/Jenkinsfile +++ b/.ci/dev/forward-merge/Jenkinsfile @@ -1,8 +1,8 @@ @Library('corda-shared-build-pipeline-steps@5.1') _ forwardMerger( - targetBranch: 'release/os/4.8', - originBranch: 'release/os/4.7', + targetBranch: 'release/os/4.9', + originBranch: 'release/os/4.8', slackChannel: '#build-team-automated-notifications' ) From 3a093ef3244ab1a341f9bd39bd241ae6d3d685aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Waldemar=20=C5=BBurowski?= <45210402+wzur-r3@users.noreply.github.com> Date: Fri, 1 Sep 2023 18:25:46 +0200 Subject: [PATCH 5/6] updated forward merged to new branch --- .ci/dev/forward-merge/Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/dev/forward-merge/Jenkinsfile b/.ci/dev/forward-merge/Jenkinsfile index 48600b1459..64686fcd23 100644 --- a/.ci/dev/forward-merge/Jenkinsfile +++ b/.ci/dev/forward-merge/Jenkinsfile @@ -1,8 +1,8 @@ @Library('corda-shared-build-pipeline-steps@5.1') _ forwardMerger( - targetBranch: 'release/os/4.9', - originBranch: 'release/os/4.8', + targetBranch: 'release/os/4.10', + originBranch: 'release/os/4.9', slackChannel: '#build-team-automated-notifications' ) From 8a01b25684314ada1bf7df7ec9f245834a3fe66f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Waldemar=20=C5=BBurowski?= <45210402+wzur-r3@users.noreply.github.com> Date: Fri, 1 Sep 2023 22:50:29 +0200 Subject: [PATCH 6/6] updated forward merger for current branch * updated originBranch to match current branch * updated targetBranch to match branch with the next version 19:11 --- .ci/dev/forward-merge/Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/dev/forward-merge/Jenkinsfile b/.ci/dev/forward-merge/Jenkinsfile index 64686fcd23..c2da16efe6 100644 --- a/.ci/dev/forward-merge/Jenkinsfile +++ b/.ci/dev/forward-merge/Jenkinsfile @@ -1,8 +1,8 @@ @Library('corda-shared-build-pipeline-steps@5.1') _ forwardMerger( - targetBranch: 'release/os/4.10', - originBranch: 'release/os/4.9', + targetBranch: 'release/os/4.11', + originBranch: 'release/os/4.10', slackChannel: '#build-team-automated-notifications' )