Add osu API backoff for beatmap requests#40
Open
cmyui wants to merge 9 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Retry-Afteror the 60 second default probe interval.osubodies before caching so a 200 HTML/error page cannot be saved to S3Notes
Production log check
429 Too Many Requestslog occurrences before the first fix, with a peak hourly bucket around 9.8k5edb61ato production fromfix/osu-api-backoff-beatmaps5edb61adeploy: 26.osufiles saved to S3, zero invalid.osubody cache skips, zero v1.osufetch failures, and zero circuit opens.osuobjects from S3; all started withosu file format v14, had[General]and[Metadata]sections, were not HTML, and MD5-matchedbeatmaps.beatmap_md5ValueError: osu api is down, zero ASGI exception storm signatures, zero CheesegullNotImplementedError/fallback spam, and local limiter skips mostly under 100ms; this suggests burst smoothing under the 600/min cap rather than long outage-style starvationTests
python3 -m unittest discover testspython3 -m py_compile app/usecases/osu_files.py tests/test_osu_files.py app/adapters/osu_api_v1.pypython3 -m py_compile app/adapters/osu_api_backoff.py app/adapters/osu_api_v1.py app/adapters/osu_api_v2/api.py app/oauth.py tests/test_osu_api_backoff.pypython3 -m py_compile app/usecases/cheesegull_beatmaps.py tests/test_cheesegull_beatmaps.py app/adapters/osu_mirrors/__init__.py app/adapters/osu_mirrors/backends/osu_direct.py app/repositories/beatmap_mirror_requests.py tests/test_osu_mirrors.pypython3 -m mypy app/adapters/osu_api_backoff.py app/adapters/osu_api_v1.py app/oauth.py app/adapters/osu_api_v2/api.py