Skip to content

fix(node): give maintenance RPCs a timeout longer than node-serviced's - #978

Merged
T3ST3ST3R0N merged 1 commit into
devfrom
fix/maintenance-rpc-timeout
Oct 8, 2026
Merged

T3ST3ST3R0N merged 1 commit into
devfrom
fix/maintenance-rpc-timeout

Conversation

@T3ST3ST3R0N

@T3ST3ST3R0N T3ST3ST3R0N commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

With split roles, the API process relays update_node_api, update_core and update_geofiles to the node worker over NATS RPC. Those calls used the default node RPC timeout, NATS_NODE_RPC_TIMEOUT, which is 30 s.

The worker waits for node-serviced, which runs the pg-node command for up to 5 minutes (docker pulls, downloads). So the API reported an error while the update kept running.

Change

The three maintenance RPCs (NodeOperation._update_node_api_remote, _update_core_remote, _update_geofiles_remote) pass timeout=340. That is above node-serviced's 5 minute deadline and the bridge's own 330 s maintenance timeout from PasarGuard/node_bridge_py #23.

All-in-one deployments don't use this path and are unaffected.

Tests

  • New tests/test_node_maintenance_rpc_timeout.py: the three RPCs pass a timeout above node-serviced's 300 s deadline. It failed before the change (timeout=None).
  • tests/api/test_node.py passes.
  • ruff check and ruff format --check are clean.

Follow-up

The all-in-one path (the bridge call itself, 10 s by default) is fixed in PasarGuard/node_bridge_py #23. It reaches the panel once that is released and pasarguard-node-bridge is bumped here.

Summary by CodeRabbit

  • Bug Fixes
    • Remote node maintenance operations now allow more time to complete, reducing the chance that updates to the node API, core services, or geofiles time out before the node finishes processing them. These operations can now wait longer than the node’s 300-second servicing deadline.

In split roles the API relays update_node_api, update_core and
update_geofiles to the node worker over NATS RPC with the default node
RPC timeout (30 s). The worker waits for node-serviced, which runs the
pg-node command for up to 5 minutes, so the API reported an error while
the update kept running.

These three RPCs now wait 340 s, above node-serviced's deadline and the
bridge's own 330 s maintenance timeout.
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3c26aff0-cdfa-4927-acc4-c2650ff1de72
📥 Commits

Reviewing files that changed from the base of the PR and between 6372404 and 926f427.

📒 Files selected for processing (2)
  • app/operation/node.py
  • tests/test_node_maintenance_rpc_timeout.py

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.


Walkthrough

The three remote node maintenance RPCs now use a shared 340-second timeout. A test verifies that each RPC timeout exceeds the 300-second node-serviced deadline.

Changes

Node maintenance RPC timeouts

Layer / File(s) Summary
Set and verify maintenance RPC timeouts
app/operation/node.py, tests/test_node_maintenance_rpc_timeout.py
Defines a shared 340-second timeout and applies it to the node API, core, and geofiles RPCs. The test checks that each RPC uses a timeout greater than 300 seconds.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: m03ed

Merge Risk: ⚪ Minimal · up to 926f4

The three split-role maintenance calls now have 340 seconds to complete. The reviewed changes establish no actionable merge-blocking risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: increasing maintenance RPC timeouts beyond the node-serviced deadline.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

A rabbit checks the timeout clock,
Three calls wait past the deadline mark.
The node API, core, and files,
Each get time for longer trials.
The test confirms they wait in style.

Comment @coderabbitai help to get the list of available commands.

@T3ST3ST3R0N
T3ST3ST3R0N merged commit 38d2e71 into dev Oct 8, 2026
18 checks passed
@T3ST3ST3R0N
T3ST3ST3R0N deleted the fix/maintenance-rpc-timeout branch October 22, 2026 12:34
Free-Guy-IR added a commit to Free-Guy-IR/panel that referenced this pull request Nov 2, 2026
… to ff6e596

Every Port queue line in the panel and side-repository ledgers now says
`security: yes` or `security: no`. Security: c9b445a (passkey client rename),
eb50bfd, PasarGuard#938, PasarGuard#940, PasarGuard#942, the cryptography 50.0.2 security release, and the ten
commits of upstream's PasarGuard#979 permission-leak batch (user list scopes, API-key
permissions, HWID visibility, users.read, the Telegram inline search), which no
branch ports yet.

Checked with git ls-remote on 2026-10-09: upstream dev moved to ff6e596. The
PasarGuard#979 batch, the node RPC fixes (PasarGuard#977, PasarGuard#978), the core-deletion restart (PasarGuard#934),
dashboard fixes (PasarGuard#852, PasarGuard#907, PasarGuard#949, PasarGuard#952), performance changes (PasarGuard#945, PasarGuard#853, PasarGuard#855) and
the merged dependabot bumps (ruff, uvloop, fastapi) join the queue; the ruff and
uvloop conditional waivers ended when upstream merged them. Waived: PasarGuard#980 and its
branch commit (the Telegram notifier workflow the fork deleted) and the superseded
fastapi dependabot head b021d6f. The refs snapshot records the five new heads.
Fork core-kit main 90701408 now contains upstream d2ecb5bd, so that ledger is empty.
No side repository gained an upstream commit since 2026-10-07.
Free-Guy-IR added a commit to Free-Guy-IR/panel that referenced this pull request Nov 3, 2026
…rd#978 and PasarGuard#1085 as ported by their B-NODE cherry-picks and take them off the port queue
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