Skip to content

Make git_cacher resilient to connection timeouts#1221

Merged
anfimovdm merged 1 commit into
masterfrom
fix-git-cacher-timeout
May 12, 2026
Merged

Make git_cacher resilient to connection timeouts#1221
anfimovdm merged 1 commit into
masterfrom
fix-git-cacher-timeout

Conversation

@anfimovdm
Copy link
Copy Markdown
Contributor

GiteaClient.make_request only caught ClientConnectorError and ServerDisconnectedError, so a ConnectionTimeoutError (or any other ClientConnectionError subclass) propagated up, cancelled the asyncio.gather in git_cacher.run, killed the process and triggered a container restart loop.

  • Broaden the retry catch to aiohttp.ClientConnectionError and asyncio.TimeoutError so timeouts are retried like other transient network errors.
  • Return [] explicitly after exhausting retries; the function used to fall off the end and return None, which crashed the caller with TypeError on items.extend(None).
  • Use return_exceptions=True on the gather calls in git_cacher so a single bad repo or organization is skipped instead of taking the whole cacher down.

GiteaClient.make_request only caught ClientConnectorError and
ServerDisconnectedError, so a ConnectionTimeoutError (or any other
ClientConnectionError subclass) propagated up, cancelled the
asyncio.gather in git_cacher.run, killed the process and triggered
a container restart loop.

- Broaden the retry catch to aiohttp.ClientConnectionError and
  asyncio.TimeoutError so timeouts are retried like other transient
  network errors.
- Return [] explicitly after exhausting retries; the function used to
  fall off the end and return None, which crashed the caller with
  TypeError on items.extend(None).
- Use return_exceptions=True on the gather calls in git_cacher so a
  single bad repo or organization is skipped instead of taking the
  whole cacher down.
@anfimovdm anfimovdm merged commit 41daf5d into master May 12, 2026
2 of 3 checks passed
@anfimovdm anfimovdm deleted the fix-git-cacher-timeout branch May 12, 2026 16:34
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