Skip to content

[correctness/medium] SlackClient._call() retries only timeouts, not other httpx transport errors #71

Description

@tomharris

SlackClient._call()'s retry loop catches only httpx.TimeoutException. Other transport errors —
ConnectError (DNS failure, connection refused), ReadError/WriteError (connection reset),
RemoteProtocolError — are siblings under httpx.TransportError, not subclasses of
TimeoutException, so they bypass the retry entirely and abort the sync on first occurrence.

Location: devrag/utils/slack_client.py:83-97

Suggested fix:

Widen the caught exception to the common base:

            try:
                resp = self._client.post(endpoint, data=data)
            except httpx.TransportError:
                if last:
                    raise
                time.sleep(self._backoff(attempt))
                continue

httpx.TransportError covers TimeoutException, ConnectError, ReadError, WriteError, and
RemoteProtocolError. If a narrower set is preferred, catch the explicit tuple instead. Consider
applying the same widening to GitHubClient._request() and JiraClient._request(), which have
related retry gaps.

Source: Surfaced by /engineer-agent audit-code (June run); re-verified by hand against HEAD d97b2eb on 2026-07-15, confidence high.

Metadata

Metadata

Assignees

No one assigned

    Labels

    auditSurfaced by /engineer-agent audit-codeaudit:correctnessAudit finding: correctness

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions