Repository navigation
cluster: ignore stale DOWN work for removed hosts - #1035
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughHost lifecycle processing ignores removed hosts during UP and DOWN handling. DOWN callbacks check removal state and event generation. A per-host lock serializes callback dispatch with removal. Tests cover queued work, stale metadata indexing, callback removal, and concurrent removal. Sequence Diagram(s)sequenceDiagram
participant Cluster
participant Executor
participant Host
participant DownCallbackLock
participant Callbacks
Cluster->>Executor: submit DOWN processing
Executor->>Cluster: run queued DOWN processing
Cluster->>DownCallbackLock: acquire for callback dispatch
DownCallbackLock->>Host: check removal state and event generation
Host-->>DownCallbackLock: return lifecycle state
DownCallbackLock->>Callbacks: invoke callback if checks pass
Cluster->>DownCallbackLock: acquire before removal
DownCallbackLock->>Host: mark down and clear pending-addition state
Suggested reviewers: Priority: ➖ Normal Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Host removal now waits for an in-flight DOWN callback to finish. The updated documentation warns that executor waits can stall callbacks; no unresolved merge-blocking risk remains. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change prevents stale DOWN work from acting on removed hosts. However, removal now depends on application callbacks returning: a callback that waits synchronously for removal-related work can stall cleanup. This is a conditional availability risk, not a demonstrated privilege or authentication bypass. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
c43ea8b to
a67d046
Compare
ebaf2e9 to
933d57f
Compare
933d57f to
984d505
Compare
nikagra
left a comment
There was a problem hiding this comment.
LGTM, one Minor on removal now waiting for user callbacks.
Executor-backed DOWN processing can outlive host removal and notify callbacks or publish a reconnector after removal completes. Fence queued and restarted work with the Host terminal state. Order DOWN callbacks with removal, stop policy fan-out after reentrant removal, and reject UP handoff for a removed object. Document that custom callbacks must not wait on cluster executor work while removal waits for them. Fixes #1034
ebe3aa2 to
8e6ad8e
Compare
Problem
Executor-backed DOWN handling can outlive host removal. Stale work could notify policies, sessions, the control connection, and listeners; install a reconnector; and later enter UP handling for a terminal
Host.Fix
Scope
This PR fixes only #1034. It does not handle:
No public API, wire-protocol, or compatibility behavior changes.
Fixes #1034
Testing
TZ=UTC uv run pytest -q tests/unit— 1388 passed, 40 skipped, 158 subtests passedTZ=UTC uv run pytest -q tests/unit/test_cluster.py— 161 passed, 8 subtests passed after review changesgit diff --checkPre-review checklist
./docs/source/. (Not applicable: internal lifecycle fix.)Fixes:annotations to PR description.