Skip to content

Fix stale registry finalizer - #1630

Merged
EmilStenstrom merged 1 commit into
masterfrom
fix/stale-registry-finalizer
May 1, 2026
Merged

EmilStenstrom merged 1 commit into
masterfrom
fix/stale-registry-finalizer

Conversation

@EmilStenstrom

@EmilStenstrom EmilStenstrom commented May 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Avoid keeping registered component classes alive through registry finalizer callbacks
  • Prevent stale finalizers from unregistering newer replacement component classes
  • Add a regression test for reimported component replacement

Fixes #1598

Validation

  • uv run pytest tests/test_registry.py

@EmilStenstrom
EmilStenstrom marked this pull request as ready for review May 1, 2026 17:38
@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

Performance Benchmark Results

Comparing PR changes against master branch:

Benchmarks that have stayed the same:

Change Before [db1f2ee] After [c9f8122] Ratio Benchmark (Parameter)
61.2±0.7ms 61.9±0.9ms 1.01 Components vs Django.timeraw_render_lg_first('django')
219±1ms 218±1ms 1 Components vs Django.timeraw_render_lg_first('django-components')

@EmilStenstrom
EmilStenstrom merged commit 1412383 into master May 1, 2026
16 checks passed
@EmilStenstrom
EmilStenstrom deleted the fix/stale-registry-finalizer branch May 1, 2026 17:40
@elliottneilclark

Copy link
Copy Markdown

Thank you @EmilStenstrom

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.

weakref.finalize causes registry corruption

2 participants