Skip to content
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

Never retry any of the failed requests #826

Closed
danigutierrezayuso opened this issue Sep 20, 2023 · 1 comment
Closed

Never retry any of the failed requests #826

danigutierrezayuso opened this issue Sep 20, 2023 · 1 comment
Assignees
Labels
type:enhancement New features or improvements to existing features.

Comments

@danigutierrezayuso
Copy link
Contributor

We've integrated the Snowplow sdk on a project where we don't want to retry any of the failed requests.

We've configured the tracker so it doesn't retry any of the failed requests with HTTP error status codes, using customRetryForStatusCodes on the EmitterConfiguration. But we're still seeing that all the requests that failed because of a timeout or any other connection error are being saved to the database and the tracker tries to send them again.

It would be great to have a way to define on that EmitterConfiguration that we don't want to retry any of the failed requests. Something like:

EmitterConfiguration()
    .retryFailedRequests(false)

Changing the implementation of the shouldRetry function on RequestResult class returning this value directly when it's set.

We want to avoid having traffic peaks with a lot of events being sent at the same time, for example after fixing an issue on the snowplow server. And right now there is no way to configure the tracker to do that.

Does this change make sense to you?

Thanks!!

@danigutierrezayuso danigutierrezayuso added the type:enhancement New features or improvements to existing features. label Sep 20, 2023
@matus-tomlein
Copy link
Contributor

Hi @danigutierrezayuso, I think this makes sense! Adding a retryFailedRequests option to the EmitterConfiguration would be a good way to go about it. I'll add this to our backlog, but also very happy to receive a contributions for this!

In case you are looking for a temporary workaround – one approach would be to create a custom NetworkConnection implementation that always returns a successful status code no matter whether the request failed or not. You can then pass this into NetworkConfiguration: https://snowplow.github.io/snowplow-ios-tracker/documentation/snowplowtracker/networkconfiguration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement New features or improvements to existing features.
Projects
None yet
Development

No branches or pull requests

2 participants