Skip to content

FIX register() misses libraries listed before it was called - #287

Open
cakedev0 wants to merge 1 commit into
joblib:masterfrom
cakedev0:fix-register-cache
Open

cakedev0 wants to merge 1 commit into
joblib:masterfrom
cakedev0:fix-register-cache

Conversation

@cakedev0

Copy link
Copy Markdown
Contributor

Since #249, libraries that no controller matches are cached as unsupported for the lifetime of the process. register() doesn't clear that cache, or the one behind get_cached_controller(), so a custom controller never finds a library that was listed before it was registered:

threadpool_info()       # any call, by any package
register(MyController)  # its library was already loaded
threadpool_info()       # 3.7.0: MyController's library is listed; master: missing

This regression hasn't been released, so there is no changelog entry.

🤖 Generated with Claude Code

Clear the cache of unmatched libraries, and the controller returned by
get_cached_controller(), when a new controller is registered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread tests/test_cache.py
"""
# Run in a subprocess to keep the registered controller out of the other
# tests:
path = os.path.dirname(os.path.dirname(__file__))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The custom env seems unnecessary (I think it got copied from some other test, which probably doesn't need it either).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants