Repository navigation
fix(sessions)!: make session retirement permanent - #2348
Open
gauravch-code wants to merge 1 commit into
Open
gauravch-code wants to merge 1 commit into
gauravch-code wants to merge 1 commit into
Conversation
Persist retirement independently of error scores and cover session and pool restoration. BREAKING CHANGE: Retired sessions cannot become usable again after mark_good().
This branch has not been deployed
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.
Description
Keep retired sessions from becoming usable again when
mark_good()lowers their error score. A session explicitly retired after a blocked request should not be handed out again by the pool, including after saving and restoring the pool.SessionModel.Falsewhen loading older saved state.retire()calls leave the error score unchanged.Issues
Closes #2312
Testing
retire()followed bymark_good()(error score 3.0 -> 2.5). Two regression tests failed before the fix.uv run pytest tests/unit/sessions tests/unit/crawlers/_basic -q --timeout=90: 193 passed, 1 existing skip on Windows / Python 3.12.13.--python-platform linux.The default Windows repository-wide type check reports three errors in the unchanged
tests/unit/_utils/test_system.pyinvolvingForkContext,ForkServerContext, andBaseContext.Process. Full unit and platform end-to-end suites were not run.Checklist