Skip to content

[NEEDS CODE REVIEWER] fix: Handle failed status requests in SABnzbd check_connected - #361

Open
lolimmlost wants to merge 1 commit into
ManiMatter:devfrom
lolimmlost:fix/sabnzbd-check-connected-resilience
Open

lolimmlost wants to merge 1 commit into
ManiMatter:devfrom
lolimmlost:fix/sabnzbd-check-connected-resilience

Conversation

@lolimmlost

Copy link
Copy Markdown
Collaborator

Summary

Mirrors the qBit fix from #342 (just approved) for the same bug class in SABnzbd.

Previously, an HTTP error from SABnzbd's status endpoint (e.g. a 500) would raise out of make_request and crash decluttarr entirely. Now the error is caught and treated as a disconnected client, so the cycle is skipped and retried next run.

Before: SAB returns 500 → HTTPError propagates up through check_connected → _check_client_connection_status → _download_clients_connected → removal_jobs → run_jobs → main → process exits, container restart-loops.

After: SAB returns 500 → caught locally → warning logged → False returned → that client is skipped this cycle, other clients/instances continue, next cycle retries.

Same shape as #342 — granular per-client handling, not a broad top-level catch.

Test plan

Smoke tested four paths against the patched check_connected:

  • HTTPError (500) → returns False, warning logged, no crash
  • Connected ({"status": True}) → returns True
  • Missing status key → returns False
  • Invalid JSON (response.json() raises) → returns False

Full test suite: 198/198 passing.

Notes

🤖 Generated with Claude Code

@lolimmlost
lolimmlost requested a review from Dark3clipse May 14, 2026 22:05
@ManiMatter ManiMatter changed the title fix: Handle failed status requests in SABnzbd check_connected [NEEDS CODE REVIEWER] fix: Handle failed status requests in SABnzbd check_connected Jun 20, 2026
@ManiMatter

Copy link
Copy Markdown
Owner

@jrhager84 would you be ok to review this?

@jrhager84

Copy link
Copy Markdown
Collaborator

Yeah - It's on the docket for this week.

@ManiMatter
ManiMatter requested review from jrhager84 and removed request for Dark3clipse July 13, 2026 17:36
Mirrors the qBit fix from ManiMatter#342. Previously, an HTTP error from SABnzbd's
status endpoint (e.g. a 500 from a misbehaving SAB instance) would
raise out of make_request and crash decluttarr entirely.

Now the error is caught and treated as a disconnected client, so the
cycle is skipped and retried next run — matching the behavior for qBit
in ManiMatter#342.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@lolimmlost
lolimmlost force-pushed the fix/sabnzbd-check-connected-resilience branch from 5cc3218 to ad45d47 Compare September 29, 2026 20:58
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