From dc51f108328599b61a8402823a1210161eef462f Mon Sep 17 00:00:00 2001 From: Adel El-Beik Date: Thu, 31 Aug 2023 18:33:34 +0100 Subject: [PATCH 1/3] 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 da3c2a2086..1709f896dd 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 @@ -12,6 +12,7 @@ import io.netty.handler.ssl.SslHandshakeTimeoutException import io.netty.handler.ssl.SslProvider 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.config.CertificateStore import net.corda.nodeapi.internal.protonwrapper.netty.createAndInitSslContext @@ -243,6 +244,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() } @@ -265,15 +267,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 8e2115293a3598b825e1fe2393c6c54b51b692f8 Mon Sep 17 00:00:00 2001 From: Ronan Browne Date: Thu, 7 Sep 2023 10:49:33 +0100 Subject: [PATCH 2/3] ES-1313: Update Jenkinsfile for slack channel (#7484) --- .ci/dev/forward-merge/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/dev/forward-merge/Jenkinsfile b/.ci/dev/forward-merge/Jenkinsfile index a7604506ff..caf664db6f 100644 --- a/.ci/dev/forward-merge/Jenkinsfile +++ b/.ci/dev/forward-merge/Jenkinsfile @@ -3,6 +3,6 @@ forwardMerger( targetBranch: 'release/os/4.7', originBranch: 'release/os/4.6', - slackChannel: '#build-team-automated-notifications' + slackChannel: '#c4-forward-merge-bot-notifications' ) From dfe0ed294e7e57bfcbaa466893b99c13422325ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Waldemar=20=C5=BBurowski?= <45210402+wzur-r3@users.noreply.github.com> Date: Thu, 7 Sep 2023 13:39:02 +0100 Subject: [PATCH 3/3] ES-1313: changes for better future forward merges (#7486) * add more comments as a form of documentation * move variable names away from calling pipeline for better experience of future forward merges if pipeline parameters were to change --- .ci/dev/forward-merge/Jenkinsfile | 33 ++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/.ci/dev/forward-merge/Jenkinsfile b/.ci/dev/forward-merge/Jenkinsfile index caf664db6f..2c34b1f7fb 100644 --- a/.ci/dev/forward-merge/Jenkinsfile +++ b/.ci/dev/forward-merge/Jenkinsfile @@ -1,8 +1,31 @@ @Library('corda-shared-build-pipeline-steps@5.1') _ -forwardMerger( - targetBranch: 'release/os/4.7', - originBranch: 'release/os/4.6', - slackChannel: '#c4-forward-merge-bot-notifications' -) +/* + * Forward merge any changes in current branch to the branch with following version. + * + * Please note, the branches names are intentionally separated as variables, to minimised conflicts + * during automated merges for this file. + * + * These variables should be updated when a new version is cut + */ +/** + * the branch name of origin branch, it should match the current branch + * and it acts as a fail-safe inside {@code forwardMerger} pipeline + */ +String originBranch = 'release/os/4.6' + +/** + * the branch name of target branch, it should be the branch with the next version + * after the one in current branch. + */ +String targetBranch = 'release/os/4.7' + +/** + * Forward merge any changes between #originBranch and #targetBranch + */ +forwardMerger( + targetBranch: targetBranch, + originBranch: originBranch, + slackChannel: '#c4-forward-merge-bot-notifications', +)