[codex] Bound certificate task scheduling#21
Merged
Conversation
Review Summary by QodoBound certificate task scheduling with active window limits
WalkthroughsDescription• Implement bounded task scheduling for certificate processing - Limits concurrent active tasks to max(CERT_FETCH_CONCURRENCY, PDF_FETCH_CONCURRENCY) - Schedules new tasks as each completes instead of starting all at once - Preserves original output order despite concurrent execution • Add comprehensive test for bounded task scheduling behavior - Validates maximum concurrent tasks never exceeds window size - Verifies all modules are processed exactly once - Confirms output order matches input order - Ensures stats accumulate correctly from bounded tasks Diagramflowchart LR
A["All modules queued"] --> B["Schedule up to task_window tasks"]
B --> C["Process tasks concurrently"]
C --> D["Task completes"]
D --> E["Schedule next pending module"]
E --> F["Maintain output order"]
F --> G["Return results"]
File Changes1. scraper.py
|
Code Review by Qodo
1. Orphan tasks on exception
|
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
Fixes the per-certificate timeout scheduler introduced in the previous PR so timeout accounting starts only for a bounded active task window instead of for every certificate at once.
The artifact builder now keeps at most
max(CERT_FETCH_CONCURRENCY, PDF_FETCH_CONCURRENCY)certificate tasks active, schedules another task as each completes, and still preserves the original output order.Validation
venv/bin/python -m py_compile scraper.py test_scraper.py validate_api.pyvenv/bin/python test_scraper.pyvenv/bin/python validate_api.pygit diff --check