Skip to content

Retry status_forcelist omits Cloudflare origin errors (520-524), so 522s from api.paddle.com are never retried #157

Description

@yudelevi

Client.build_request_session configures retries with:

# paddle_billing/Client.py:213
retries = Retry(total=self.retry_count, backoff_factor=1, status_forcelist=[429, 500, 502, 503, 504])

api.paddle.com is served through Cloudflare, which returns 520–524 for origin-side problems (522 = origin connection timeout). None of those are in status_forcelist, so they get zero retries even though they are exactly the transient class retries exist for — retry_count defaults to 3 but never applies.

Observed in production (SDK 1.15.0, Python 3.14) on a customer lookup:

Request failed: 522 Server Error: <none> for url: https://api.paddle.com/customers?email=...

The <none> reason phrase is itself a tell that the response came from Cloudflare rather than the Paddle application.

Expected: transient Cloudflare origin errors are retried with backoff like other transient failures.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions