Skip to content

Disable ClusterShardingHealthCheck after configured duration post member-up#2785

Merged
pjfanning merged 4 commits intoapache:mainfrom
pjfanning:copilot/copy-akka-core-pr-31864-changes
Mar 24, 2026
Merged

Disable ClusterShardingHealthCheck after configured duration post member-up#2785
pjfanning merged 4 commits intoapache:mainfrom
pjfanning:copilot/copy-akka-core-pr-31864-changes

Conversation

@pjfanning
Copy link
Copy Markdown
Member

part of #2730

akka/akka-core#31864

ClusterShardingHealthCheck would fail indefinitely if a new entity type added in a rolling update hadn't registered with the coordinator yet, stalling the rollout. The fix disables the health check (returns true) after a configurable duration once the cluster member is Up.

Changes

  • ClusterShardingHealthCheckSettings: Added disableAfter: FiniteDuration parameter; deprecated 2-arg constructor kept for binary compatibility
  • ClusterShardingHealthCheck: Tracks startedTimestamp when member first becomes Up; bypasses shard region checks once disabled-after has elapsed
  • reference.conf: New disabled-after = 10s under pekko.cluster.sharding.healthcheck
  • Tests: Updated existing tests to 3-arg constructor; added "always pass after disabled-after" test using a real cluster provider to verify the clock only starts post-MemberStatus.Up
  • Docs: Added note explaining the rolling-update rationale

Behaviour

disabled-after = 10s  # default; set to infinite to restore old behaviour

Clock starts only after selfMember.status leaves Joining/Removed. Checks before that are unaffected. Once the deadline is exceeded, the check short-circuits to true without contacting the shard region.

@pjfanning pjfanning added this to the 2.0.0-M2 milestone Mar 23, 2026
Copy link
Copy Markdown
Member

@He-Pin He-Pin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@pjfanning pjfanning merged commit 550ea4b into apache:main Mar 24, 2026
9 checks passed
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.

3 participants