Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Offline region download hits Mapbox API rate limits for sprites #5821

Closed
dpieri opened this issue Jul 28, 2016 · 3 comments
Closed

Offline region download hits Mapbox API rate limits for sprites #5821

dpieri opened this issue Jul 28, 2016 · 3 comments
Assignees
Labels

Comments

@dpieri
Copy link

dpieri commented Jul 28, 2016

Platform: Android
Mapbox SDK version: 4.1.0

Steps to trigger behavior

  1. Create a new offline region of any size using a style that relies on Mapbox-hosted sprites and tilesets.
  2. Start downloading it.
  3. Watch for error message Failed to load sprite: HTTP status code 429

Expected behavior

SDK does not trigger API rate limits.

Actual behavior

Sometimes, but not always, you see the 429 response, which must mean that the SDK is kicking off requests faster than the API allows.

Question

We are killing the offline download whenever an error occurs. For errors like this, does the SDK retry downloading the asset after reporting the 429 response, or is killing on the first error the correct way to handle them?

@1ec5
Copy link
Contributor

1ec5 commented Jul 31, 2016

I’m seeing the same thing on iOS, and it’s leading to a crash: #5827.

@1ec5
Copy link
Contributor

1ec5 commented Aug 2, 2016

As a temporary measure, we’ve increased the rate limit on non-tile resources (including sprites) on the server side.

@jfirebaugh
Copy link
Contributor

Currently, a 429 response produces a response.error value of Error::Reason::Other, which is not retried.

We need to add an enumeration value to Response::Error::Reason representing a rate-limiting situation, include the value of any Retry-After response header somewhere (with a fallback to the non-standard x-rate-limit-reset header used by Mapbox APIs), and handle this situation in OnlineFileRequest by retrying according to the specified Retry-After value or a reasonable default.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants