use advisory file lock for the RGB runtime lock#88
Conversation
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 Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
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! |
|
@zoedberg As explanation: Android and iOS use SIGKILL sometimes to terminate a process. This will leave a stale lockfile. |
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.