Skip to content

Expose an API to write lock the database#1558

Draft
puddly wants to merge 1 commit intozigpy:devfrom
puddly:puddly/database-write-lock-api
Draft

Expose an API to write lock the database#1558
puddly wants to merge 1 commit intozigpy:devfrom
puddly:puddly/database-write-lock-api

Conversation

@puddly
Copy link
Copy Markdown
Collaborator

@puddly puddly commented Feb 26, 2025

For Home Assistant backups to be safe, we should write lock the database during pre_backup and unlock it during post_backup. This will effectively queue all zigpy database writes for many minutes but we don't rely on the database to hold data at runtime, just to act as a store.

home-assistant/core#138544

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 26, 2025

Codecov Report

❌ Patch coverage is 30.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.38%. Comparing base (4a3c058) to head (a028b85).
⚠️ Report is 98 commits behind head on dev.

Files with missing lines Patch % Lines
zigpy/appdb.py 30.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1558      +/-   ##
==========================================
- Coverage   99.44%   99.38%   -0.07%     
==========================================
  Files          58       58              
  Lines       11317    11327      +10     
==========================================
+ Hits        11254    11257       +3     
- Misses         63       70       +7     

☔ View full report in Codecov by Sentry.
📢 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.

@pipiche38
Copy link
Copy Markdown
Contributor

is there a risk that on bellows implementation, we come to a Timeout because the backup will last more than 5 seconds ?

@github-actions
Copy link
Copy Markdown

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions.

@github-actions github-actions Bot added stale and removed stale labels Jan 20, 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.

2 participants