Repository navigation
fix(node): verify broken backend health before reattaching - #1009
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
Walkthrough
ChangesNode Attachment
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The change checks backend stats before reattaching a node whose backend looks broken, so a failed probe stops the attachment from being marked healthy and the existing recovery path can run. No concrete merge-blocking defect was found. Pre-merge checks |
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
… not reattached while the probe fails RED on b8e5a6d61: 3 failed, 1 passed (the healthy-backend guard). Upstream 7487b4d (PasarGuard#1009) ships without a test.
…rd#978 and PasarGuard#1085 as ported by their B-NODE cherry-picks and take them off the port queue
…d#1009 attach path reads, and pin concurrent reconnects of a broken backend to the probe result The cherry-pick of upstream PasarGuard#1009 (e612185) makes _attach_if_running read pg_node.get_health() before connecting. The real bridge node always has it; the HealthyNode double in test_node_multicore did not, so the AttributeError was swallowed by the attach path's except and the test saw a Start instead of an attach. The assertion is unchanged; the double now answers HEALTHY, records that health was read before connect, and has no get_backend_stats, so a healthy node that got probed would still fail the test.
…multicore healthy-node test double, not the code
Summary
When a WireGuard interface disappears, the node can still report
started=truewhile backend stats fail. Recovery previously trusted that flag and marked the attachment healthy without recreating the interface.Check backend stats before reattaching when either the local health or the lifecycle observation is broken. A failed probe keeps the attachment from claiming success and lets the existing recovery path send Start. Recovered backends still attach without restarting, and healthy sibling attachments keep their existing behavior.
Refs #1007. Addresses the confirmed WireGuard recovery failure; the separately reported Xray inbound failure has not been reproduced.
Type of change
Checklist
Testing
python -m pytest tests/test_node_start_timeout.py tests/test_node_reconnect_recovery.py tests/test_node_manager_sync.py tests/test_node_manager.py tests/test_node_sync.py -q --disable-warnings: 42 passed.ruff check --no-fix app/operation/node.py,ruff format --check app/operation/node.py, andgit diff --checkpassed.Screenshots
Not applicable.
Notes for reviewers
Only
app/operation/node.pychanges (7 added lines). No test, documentation, dependency, or schema files are included. Validation used mocked node RPCs; no live Linux node was modified.Summary by CodeRabbit