refactor(health.akka): review polish (internal decision helper, role guard, factory results, test coverage) + fix SPEC §4 gate description
This commit is contained in:
@@ -150,7 +150,10 @@ plug it into `MapHealthChecks` options and also call it from custom endpoints.
|
||||
|
||||
`IActiveNodeGate` is a single-property interface (`bool IsActiveNode { get; }`) that expresses
|
||||
whether the current node should accept write / active-role requests. The default implementation,
|
||||
`AkkaActiveNodeGate`, delegates to `ActiveNodeHealthCheck`. A `RequireActiveNode()` extension on
|
||||
`AkkaActiveNodeGate`, reads cluster state **directly**: `IsActiveNode` returns `true` iff the
|
||||
`ActorSystem` is available, `SelfMember.Status == Up`, and the node is the cluster leader. It is
|
||||
null-guarded and returns `false` when the `ActorSystem` is not yet ready (safe default during
|
||||
startup). It does **not** resolve `ActiveNodeHealthCheck` from DI. A `RequireActiveNode()` extension on
|
||||
`IEndpointConventionBuilder` attaches a policy that short-circuits with `503 Service Unavailable`
|
||||
on standby nodes.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user