Elektrine lite

← Feed

@azonenberg@ioc.exchange

2026-10-28 06:16 UTC

I'm looking for a mutex-type tool I can run in a distributed system on a LAN to arbitrate access to a shared resource that only supports a single user at a time. What's the easiest way to do this? At a high level what I want to do is have a shell script running in multiple CI jobs that does * acquire lock, blocking if necessary * run tests that require shared resource * release lock If the tests fail or hang and the CI VM is forcibly terminated by the scheduler, this needs to (by a socket timeout, TCP RST, or similar) release the mutex within a reasonable time frame.

Replies (2)

  • @azonenberg@ioc.exchange 2026-10-28 06:17

    It is also acceptable to have the mutex lifecycle attached to the test binary itself, i.e. each test case accessing the resource will lock the mutex, block if not available, then release it when the socket is closed (or sooner if it's done before exiting)

    Open ##5295832

  • @8bit@social.lol 2026-10-28 06:29

    @azonenberg@ioc.exchange are you using a specific CI system that you could leverage or do you want to avoid any CI lock-in? I've only used this in Jenkins but there's a lockable resource plugin that works how you've described and we use it across different pipelines. I imagine there are equivalents for most other CI systems

    Open ##5295838