Fix bridge cache rewarm rate limiting - #345
Merged
Merged
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
Production impact
Kithe bridge runs have failed since August 18 because cache rewarm requests were anonymous: the first 10 requests succeeded, then the remaining requests received HTTP 429 responses. Any rewarm error marks the bridge run failed and prevents its successful watermark from advancing. This change routes those requests through the existing unlimited server API-key tier without introducing a new secret or bypass.
Testing
make lint-checkpytest backend/tests/services/test_bridge_cache_refresh.py backend/tests/middleware/test_rate_limit_integration.py(13 passed)pytest backend/tests/services/test_bridge_sync_service.py backend/tests/tasks/test_bridge_sync_task.py backend/tests/services/test_api_key_service.py(46 passed)make test-fast PARALLEL_WORKERS=4 WALLCLOCK_TIMEOUT_SECONDS=900(1,864 passed, 127 skipped, 1 xpassed; two Elasticsearch setup errors caused by the stopped local service)pytest backend/tests/elasticsearch/test_client.py -qafter starting Elasticsearch (4 passed, 2 skipped)