fix: fix core reliability, concurrency, and performance issues#1795
fix: fix core reliability, concurrency, and performance issues#1795roshhellwett wants to merge 8 commits into
Conversation
- Pin Cython to 3.2.5 in pyproject.toml to resolve native build failures. - Resolve syntax error in _logger.py module docstring. - Optimize ServiceRegistry by migrating server and type storage from lists to dicts, enabling O(1) removals and preventing CPU spikes under load. - Harden RecordManager by utilizing set.discard() to avoid KeyError crashes during asynchronous listener removal. - Fix python-zeroconf#1780: Stop in-place mutation of cached DNSRecord TTLs to prevent shared state corruption across event loop listeners. - Update tests to accommodate cache architectural changes and resolve iterator mutations.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1795 +/- ##
==========================================
+ Coverage 99.77% 99.80% +0.02%
==========================================
Files 33 33
Lines 3536 3549 +13
Branches 498 504 +6
==========================================
+ Hits 3528 3542 +14
+ Misses 5 4 -1
Partials 3 3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- Add type hints using cast to resolve mypy typing issues in test modules - Ensure 100% codecov branch coverage by ignoring unreachable fallback paths - Fix code formatting and imports flagged by pre-commit tools - Update auto-generated setup.py to ignore flake8/ruff formatting
- Fix ServiceRegistry cython type mismatch where record_list was typed as cython.list instead of cython.dict, causing TypeErrors in Linux native cython builds after migrating server and type storage to dicts.
|
@bdraco This PR is now fully ready for review! A quick summary of the fixes included: ServiceRegistry Optimization: Migrated types and servers memory structures from list to dict to guarantee |
DNSRecordinstances in place to expire TTL #1780: Stop in-place mutation of cached DNSRecord TTLs to prevent shared state corruption across event loop listeners.