Skip to content

fix(prowlarr): give manual search a 90 s budget; slow answers don't open the breaker - #128

Open
davidcoulson wants to merge 1 commit into
Shoshuo:mainfrom
davidcoulson:dc/prowlarr-search-budget
Open

davidcoulson wants to merge 1 commit into
Shoshuo:mainfrom
davidcoulson:dc/prowlarr-search-budget

Conversation

@davidcoulson

Copy link
Copy Markdown

What does this PR do?

Prowlarr manual search returned no results, and showed Prowlarr as down everywhere, whenever indexers were slow. A search fans out to every enabled indexer and only answers once the slowest one replies. With a dozen indexers that takes 7–20 s, but the search went through the client's default 8 s timeout, so:

  • most searches came back empty;
  • the read timeout opened the cross-request circuit breaker, so Prowlarr showed as down on every page for the breaker window.

This applies the #41 rule from RadarrClient to ProwlarrClient:

  • Search gets a 90 s budget (ProwlarrClient::SEARCH_TIMEOUT). Every other Prowlarr call keeps the 8 s default.
  • Only connect-level failures open the breaker (connection refused, DNS, connect timeout). A read timeout after a successful connect now fails only that call.

Type of change

Definition of Done checklist

  • The feature works end-to-end, tested manually in a running container. I've run it on my install (16 indexers) since 1.2.0, and it's now in my 1.3.0-based build.
  • No console.log, dd(), var_dump, TODO, FIXME leftover
  • Comments are in English
  • Zero credentials in code, commits, logs, or docs
  • At least one unit test for new business logic
  • If this is a bug fix: a regression test that reproduces the bug is included (ProwlarrClientTimeoutTest: a slow search uses the search budget, and a read timeout doesn't open the breaker while a connect failure does)
  • make check passes (PHP lint, Twig lint, lint:container, PHPUnit 1268 tests, all passing)
  • If an entity was modified: n/a
  • CHANGELOG.md updated under [Unreleased]
  • README.md: no user-facing behaviour change beyond the fix

Notes for the reviewer

🤖 Generated with Claude Code

…pen the breaker

Prowlarr search fans out to every indexer (7–20 s with ~16 indexers), but
used the default 8 s timeout: results came back empty, and the read timeout
marked Prowlarr down for every request in the breaker window. Mirror the
Shoshuo#41 rule from RadarrClient: only connect-level failures open the breaker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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