Repository navigation
Cache IO plugin discovery instead of rescanning for every handler - #2156
Merged
zariiii9003 merged 2 commits intoNov 26, 2026
Merged
Conversation
Collaborator
AI Review: Cache IO plugin discovery (#2156)Context
Tests
Verdictrequest changes |
Contributor
Author
|
Thanks — agreed. I moved the two factory checks into |
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.
Restore caching of successful reader/writer plugin discovery, following the approach proposed in #2155. Repeated
Logger()/LogReader()construction currently scans installed entry points every time, even when no plugins exist.The two regression checks now live in the existing
ReaderWriterExtensionTest. Each warms up a public factory, then verifies that three more handler constructions do not rescan entry points. They do not depend on cache internals or fake plugins. Both fail against the original production implementation and pass with the fix.Validation after the review update:
tox -e py: 676 passed, 126 skipped, 43 subtests passed on Python 3.12.git diff --checkpass. This update changes only tests; the earlier production revision passedtox -e lint,type,docsusing Python 3.14.The initial scan still costs time.
functools.cachecan also run the initial function more than once for simultaneous cold calls; this patch removes repeated scans after discovery, without adding a locking policy. I have not claimed to reproduce or eliminate the reporter's nine-bus frame loss.Fixes #2155's repeated-discovery regression. Prepared with AI assistance; the tests and measurements were executed locally.