From 3837aea3f6d4119a666acd5ff166fc011bb621b2 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Wed, 4 Dec 2024 20:03:09 +0100 Subject: [PATCH] try to add config --- remote/src/main/resources/reference.conf | 5 +++++ .../apache/pekko/remote/artery/ArterySettings.scala | 7 +++++++ .../remote/artery/InboundQuarantineCheck.scala | 3 ++- .../remote/artery/OutboundIdleShutdownSpec.scala | 13 ++++++++----- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/remote/src/main/resources/reference.conf b/remote/src/main/resources/reference.conf index 9049be1ef11..4c4edff858e 100644 --- a/remote/src/main/resources/reference.conf +++ b/remote/src/main/resources/reference.conf @@ -850,6 +850,11 @@ pekko { # limit there will be extra performance and scalability cost. log-frame-size-exceeding = off + # If set to "on", InboundQuarantineCheck will propagate harmless quarantine events. + # This is the legacy behavior. Users who see these harmless quarantine events lead + # to problems can set this to "off" to suppress them (https://github.com/apache/pekko/pull/1555). + propagate-harmless-quarantine-events = on + advanced { # Maximum serialized message size, including header data. diff --git a/remote/src/main/scala/org/apache/pekko/remote/artery/ArterySettings.scala b/remote/src/main/scala/org/apache/pekko/remote/artery/ArterySettings.scala index 85c54c74bcd..271403e9de0 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/artery/ArterySettings.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/artery/ArterySettings.scala @@ -105,6 +105,13 @@ private[pekko] final class ArterySettings private (config: Config) { */ val Version: Byte = ArteryTransport.HighestVersion + /** + * If set to true, harmless quarantine events are propagated in InboundQuarantineCheck. + * Background is in https://github.com/apache/pekko/pull/1555 + */ + val PropagateHarmlessQuarantineEvents: Boolean = + getBoolean("propagate-harmless-quarantine-events") + object Advanced { val config: Config = getConfig("advanced") import config._ diff --git a/remote/src/main/scala/org/apache/pekko/remote/artery/InboundQuarantineCheck.scala b/remote/src/main/scala/org/apache/pekko/remote/artery/InboundQuarantineCheck.scala index b06940dfe9f..c6d20941497 100644 --- a/remote/src/main/scala/org/apache/pekko/remote/artery/InboundQuarantineCheck.scala +++ b/remote/src/main/scala/org/apache/pekko/remote/artery/InboundQuarantineCheck.scala @@ -45,7 +45,8 @@ private[remote] class InboundQuarantineCheck(inboundContext: InboundContext) env.association match { case OptionVal.Some(association) => if (association.associationState.isQuarantined(env.originUid)) { - if (association.associationState.quarantinedButHarmless(env.originUid)) { + if (!inboundContext.settings.PropagateHarmlessQuarantineEvents + && association.associationState.quarantinedButHarmless(env.originUid)) { log.info( "Message [{}] from [{}#{}] was dropped. " + "The system is quarantined but the UID is known to be harmless.", diff --git a/remote/src/test/scala/org/apache/pekko/remote/artery/OutboundIdleShutdownSpec.scala b/remote/src/test/scala/org/apache/pekko/remote/artery/OutboundIdleShutdownSpec.scala index c57350a745e..2fd55301363 100644 --- a/remote/src/test/scala/org/apache/pekko/remote/artery/OutboundIdleShutdownSpec.scala +++ b/remote/src/test/scala/org/apache/pekko/remote/artery/OutboundIdleShutdownSpec.scala @@ -33,11 +33,14 @@ import pekko.testkit.TestProbe class OutboundIdleShutdownSpec extends ArteryMultiNodeSpec(s""" pekko.loglevel=INFO - pekko.remote.artery.advanced.stop-idle-outbound-after = 1 s - pekko.remote.artery.advanced.connection-timeout = 2 s - pekko.remote.artery.advanced.remove-quarantined-association-after = 1 s - pekko.remote.artery.advanced.compression { - actor-refs.advertisement-interval = 5 seconds + pekko.remote.artery.propagate-harmless-quarantine-events = off + pekko.remote.artery.advanced { + stop-idle-outbound-after = 1 s + connection-timeout = 2 s + remove-quarantined-association-after = 1 s + compression { + actor-refs.advertisement-interval = 5 seconds + } } """) with ImplicitSender with Eventually {