Skip to content

use advisory file lock for the RGB runtime lock#88

Open
berserker-systems wants to merge 2 commits into
RGB-Tools:masterfrom
deedsats:s/lock
Open

use advisory file lock for the RGB runtime lock#88
berserker-systems wants to merge 2 commits into
RGB-Tools:masterfrom
deedsats:s/lock

Conversation

@berserker-systems

Copy link
Copy Markdown
Contributor

Replace the presence-based lockfile (created on acquire, removed on drop) with an OS advisory lock held for the runtime's lifetime. The kernel releases it automatically when the process dies, so a crash/kill no longer leaves a stale lock that must be deleted on start, which also restored proper mutual exclusion.

Replace the presence-based lockfile (created on acquire, removed on
drop) with an OS advisory lock held for the runtime's lifetime. The
kernel releases it automatically when the process dies, so a crash/kill
no longer leaves a stale lock that must be deleted on start, which also
restored proper mutual exclusion.
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.42857% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 95.71%. Comparing base (1e6353d) to head (22715d0).

Files with missing lines Patch % Lines
src/utils.rs 96.42% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #88      +/-   ##
==========================================
- Coverage   95.74%   95.71%   -0.03%     
==========================================
  Files          23       23              
  Lines       12835    12848      +13     
==========================================
+ Hits        12289    12298       +9     
- Misses        546      550       +4     
Flag Coverage Δ
rust 95.71% <96.42%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@zoedberg

Copy link
Copy Markdown
Member

Thanks for this PR. We're currently a bit swamped, so we won't be able to review this right away. We plan to dive into it in a couple of weeks and will follow up then. Really appreciate your patience!

@berserker-systems

berserker-systems commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

@zoedberg
No worries and thank you for the notice.

As explanation: Android and iOS use SIGKILL sometimes to terminate a process. This will leave a stale lockfile.
At the moment, we remove it manually when the process starts. In my opinion this PR is the correct approach to handle the situation.

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