Development#37
Merged
Merged
Conversation
- Add DomainRateLimiter with per-domain semaphore, delay+jitter, and retry - Parse and respect Retry-After headers on 429/503 responses - Exponential backoff: 1s, 2s, 4s with jitter - Reduce sites_max_concurrency cap from 500 to 50 - New config: request_delay_ms, request_jitter_ms, per_domain_concurrency, retry_max_attempts - 37 new tests, 180/180 passing Closes #31
fix: add per-domain rate limiting, jitter, and backoff to scanners
style: remove unused import and variable in test_rate_limiter
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.
What changed
New rate_limiter.py module:
Per-domain asyncio.Semaphore — limits concurrent requests to the same hostname (default: 3)
Configurable minimum inter-request delay with jitter (default: 200ms ± 100ms)
Exponential backoff on 429/503 responses (1s → 2s → 4s, max 3 retries)
Retry-After header parsing (both seconds and HTTP-date formats)
Config hardening:
sites_max_concurrency cap reduced from 500 → 50
New env vars: OSINT_D2_REQUEST_DELAY_MS, OSINT_D2_REQUEST_JITTER_MS, OSINT_D2_PER_DOMAIN_CONCURRENCY, OSINT_D2_RETRY_MAX_ATTEMPTS
Both runners updated: sherlock_runner.py and site_lists/runner.py now use global semaphore + per-domain semaphore + temporal delay + retry with backoff.
Acceptance criteria met:
✅ Configurable minimum delay with jitter between requests to the same domain
✅ sites_max_concurrency max reduced to 50
✅ Retry-After headers parsed and respected
✅ Documentation warns about responsible concurrency settings
Tests: 37 new tests, 180/180 total passing with zero regressions.