Skip to content

test: cover that harmless quarantine does not trigger DownSelfQuarantinedByRemote - #3550

Open
pjfanning wants to merge 1 commit into
apache:mainfrom
pjfanning:quarantine-harmless-downself
Open

pjfanning wants to merge 1 commit into
apache:mainfrom
pjfanning:quarantine-harmless-downself

Conversation

@pjfanning

Copy link
Copy Markdown
Member

Motivation

Port of akka/akka-core#32117 (backport of akka/akka-core#32050, issue akka/akka-core#31095). That fix stopped InboundQuarantineCheck replying with a Quarantined control message for later inbound messages from a harmlessly quarantined (gracefully shut down) node, which made the remote node down itself via DownSelfQuarantinedByRemote - notably during a network partition.

Pekko already stops propagating harmless quarantines by default: #1555 added pekko.remote.artery.propagate-harmless-quarantine-events = off, and QuarantinedTimestamp.harmless / newQuarantined(harmless) already exist, so no MiMa filters are needed. What was missing was the multi-jvm coverage of the end-to-end cluster scenario.

Modification

  • DowningWhenOtherHasQuarantinedThisActorSystemSpec: ported the Akka rewrite. Quarantines second directly via RARP(system).provider.quarantine(...) instead of relying on split brain resolver timing, asserts second receives ThisActorSystemQuarantinedEvent and terminates within 5 s (shorter than stable-after, so it is not normal downing), adds a fourth node and a new case "not be triggered by another node shutting down during network partition" - the actual #31095 scenario. Pekko's Artery pending guard and ThrottlerTransportAdapter.Direction usage are kept.
  • Association / InboundQuarantineCheck: log at info when a Quarantined control message is sent, and mention "Harmless quarantine." in the harmless quarantine log message, matching Akka. Log-only.
  • TestContext: pass harmless = false explicitly, as in Akka.

Result

Multi-jvm coverage of the DownSelfQuarantinedByRemote scenarios, including harmless quarantine during a network partition. No behavioural change beyond log messages.

Tests

  • sbt "project cluster" "MultiJvm/testOnly org.apache.pekko.cluster.DowningWhenOtherHasQuarantinedThisActorSystem" - 4 nodes, 4 tests each, all passed
  • sbt "remote/testOnly org.apache.pekko.remote.artery.HarmlessQuarantineSpec org.apache.pekko.remote.artery.OutboundIdleShutdownSpec org.apache.pekko.remote.artery.RemoteMessageSerializationSpec" - 14 passed
  • native scalafmt run on the changed files
  • MiMa not run: no signature changes

References

Refs #1555 - port of akka/akka-core#32117 (the InboundQuarantineCheck fix was already present). Akka source is Apache-2.0 licensed as of 2023-09-20.

…inedByRemote

Motivation:
akka/akka-core#32117 (backport of akka/akka-core#32050, issue akka/akka-core#31095)
fixed InboundQuarantineCheck replying with a Quarantined control message
for later inbound messages from a harmlessly quarantined (gracefully
shut down) node, which made the remote node down itself via
DownSelfQuarantinedByRemote. Pekko already stops propagating harmless
quarantines by default (apache#1555, propagate-harmless-quarantine-events =
off), but the multi-jvm coverage for this scenario was missing.

Modification:
- DowningWhenOtherHasQuarantinedThisActorSystemSpec: quarantine the
  second node directly instead of relying on split brain resolver
  timing, add a fourth node and a test that a node shutting down during
  a network partition does not trigger ThisActorSystemQuarantinedEvent
  on the surviving side.
- Association / InboundQuarantineCheck: log at info when a Quarantined
  control message is sent, and mention "Harmless quarantine" in the
  harmless quarantine log message, matching Akka.
- TestContext: pass harmless = false explicitly.

Result:
Multi-jvm coverage of the DownSelfQuarantinedByRemote scenarios,
including harmless quarantine during a network partition. No
behavioural change beyond log messages.

Tests:
- sbt "project cluster" "MultiJvm/testOnly org.apache.pekko.cluster.DowningWhenOtherHasQuarantinedThisActorSystem" (4 nodes, 4 tests each, all passed)
- sbt "remote/testOnly org.apache.pekko.remote.artery.HarmlessQuarantineSpec org.apache.pekko.remote.artery.OutboundIdleShutdownSpec org.apache.pekko.remote.artery.RemoteMessageSerializationSpec" (14 passed)
- native scalafmt run on the changed files

References:
Refs apache#1555 - port of akka/akka-core#32117 (the InboundQuarantineCheck fix was already present)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant