Skip to content

fix(gamedata): log fio transport errors at warning in refresh tasks - #76

Merged
jplacht merged 1 commit into
mainfrom
fix/75-fio-timeout-log-level
Oct 3, 2026
Merged

jplacht merged 1 commit into
mainfrom
fix/75-fio-timeout-log-level

Conversation

@jplacht

@jplacht jplacht commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

What and why

Found by /error-review: during an FIO slowdown, 58 planet_refresh_failed events in 24h were httpx.ReadTimeouts logged at error level with a traceback. The failure is expected and already handled (the planet is retried after 15 minutes, and fio_request_failed logs the timeout as a warning), so the error level only flooded the error views.

Changes

  • gamedata_refresh_planet and gamedata_refresh_user_fiodata: httpx.TransportError (timeouts, dropped connections, RemoteProtocolError) now goes to a logger.warning branch next to the existing HTTPStatusError one. Event names and fields unchanged; update_refresh_result(error=...) retry bookkeeping unchanged. Anything else still goes to logger.exception.
  • Tests: a ReadTimeout case in both log-level tests; the planet test also asserts the row is retrying with error_count == 1 and a next_retry_at.
  • CLAUDE.md: the refresh-failure logging rule now mentions transport errors.

Timeouts are unchanged. gamedata_refresh_planet_infrastructure and gamedata_refresh_cxpc keep logging every failure with logger.exception (they have no warning branch today).

How it was verified

  • uv run ruff check, uv run ruff format --check, uv run ty check --exclude "**/migrations/*.py": pass
  • uv run pytest: 813 passed; the two new ReadTimeout cases fail without the fix

Closes #75

🤖 Generated with Claude Code

- planet and user FIO refresh log httpx.TransportError (timeouts, dropped
  connections) as a warning without traceback; retry bookkeeping unchanged
- tests cover a ReadTimeout in both tasks, incl. the planet retry state
- CLAUDE.md logging rule updated to match

Closes #75

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codacy-production

codacy-production Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

🟢 Coverage 100.00% diff coverage · +0.00% coverage variation

Metric Results
Coverage variation ✅ +0.00% coverage variation (-1.00%)
Diff coverage ✅ 100.00% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (93510e8) 4891 4681 95.71%
Head commit (9114fb5) 4895 (+4) 4685 (+4) 95.71% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#76) 4 4 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@jplacht
jplacht merged commit 56c2521 into main Oct 3, 2026
9 checks passed
@jplacht
jplacht deleted the fix/75-fio-timeout-log-level branch October 3, 2026 06:49
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.

FIO planet refresh timeouts logged at error level

1 participant