Skip to content

fix: fix core reliability, concurrency, and performance issues#1795

Open
roshhellwett wants to merge 4 commits into
python-zeroconf:masterfrom
roshhellwett:master
Open

fix: fix core reliability, concurrency, and performance issues#1795
roshhellwett wants to merge 4 commits into
python-zeroconf:masterfrom
roshhellwett:master

Conversation

@roshhellwett

Copy link
Copy Markdown
  • 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 robustness: cache mutates shared DNSRecord instances in place to expire TTL #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.

roshhellwett and others added 2 commits June 16, 2026 12:51
- 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

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.20690% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.69%. Comparing base (d68897b) to head (6236346).

Files with missing lines Patch % Lines
src/zeroconf/_cache.py 80.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1795      +/-   ##
==========================================
- Coverage   99.77%   99.69%   -0.09%     
==========================================
  Files          33       33              
  Lines        3536     3550      +14     
  Branches      498      505       +7     
==========================================
+ Hits         3528     3539      +11     
- Misses          5        6       +1     
- Partials        3        5       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@roshhellwett roshhellwett changed the title Fix core reliability, concurrency, and performance issues fix: fix core reliability, concurrency, and performance issues Jun 16, 2026
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.

robustness: cache mutates shared DNSRecord instances in place to expire TTL

1 participant