Skip to content

fix(aggregator): Add auto-retry logic on SSL error #3887

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 30, 2025

Conversation

vincent-pochet
Copy link
Collaborator

Context

Many calls to external aggregators are failing with errors like OpenSSL::SSL::SSLError, leading to a failure of caller service. Most of the time this error is just a transient "bad luck" error and can just be retries automatically.

The Lago HTTP client is lacking the ability to retry the query automatically on this kind of error

Description

This PR adds a new reties_on keyword argument on the LagoHttpClient to allow us to define a list of error class that can be rescued and retried automatically.
For now, it reties 3 times at most before re-raising the error, if it's not enough, we might extend this approach to allow us to define the number of retries for each type of error.

This PR also plug this system in the base http_client of aggregator services

@vincent-pochet vincent-pochet force-pushed the fix-auto-retries-ssl-errors branch 8 times, most recently from f809934 to 5569ca4 Compare June 30, 2025 09:21
@vincent-pochet vincent-pochet force-pushed the fix-auto-retries-ssl-errors branch from 5569ca4 to 066a8df Compare June 30, 2025 09:30
@vincent-pochet vincent-pochet merged commit e491283 into main Jun 30, 2025
14 checks passed
@vincent-pochet vincent-pochet deleted the fix-auto-retries-ssl-errors branch June 30, 2025 09:35
diegocharles pushed a commit that referenced this pull request Jul 11, 2025
## Context

Many calls to external aggregators are failing with errors like
`OpenSSL::SSL::SSLError`, leading to a failure of caller service. Most
of the time this error is just a transient "bad luck" error and can just
be retries automatically.

The Lago HTTP client is lacking the ability to retry the query
automatically on this kind of error

## Description

This PR adds a new `reties_on` keyword argument on the `LagoHttpClient`
to allow us to define a list of error class that can be rescued and
retried automatically.
For now, it reties 3 times at most before re-raising the error, if it's
not enough, we might extend this approach to allow us to define the
number of retries for each type of error.

This PR also plug this system in the base http_client of aggregator
services
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.

2 participants