Skip to content

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

Merged
ogrisel merged 2 commits into
joblib:masterfrom
cakedev0:fix-register-cache
Oct 30, 2026
Merged

ogrisel merged 2 commits 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 Outdated
"""
# 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).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It seems you're right. Should I remove it in the other test too in this PR?

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ogrisel
ogrisel merged commit f0816e4 into joblib:master Oct 30, 2026
26 checks passed
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.

3 participants