File: src/entrabot/singleton.py
Location: L174-L185 (acquire_singleton_lock)
Category: leak
Priority: low
Description
fd = os.open(...) succeeds, then fcntl.flock(fd, ...) is wrapped in a try that catches only BlockingIOError. Any other OSError (EINTR, EPERM, ENOLCK on a network mount, EIO) propagates with fd still open. Acquisition runs once per process so impact is small, but tests, restart loops, and a future Windows replacement will inherit the pattern; lock file mode 0600 makes the leak slightly more visible to auditors.
Suggested fix
Use try/except OSError (or try/finally) that closes the fd before re-raising anything other than BlockingIOError.
Filed automatically by a thorough code-review pass over src/entrabot/ on 2026-06-13. Internal review id: #35.
File:
src/entrabot/singleton.pyLocation: L174-L185 (acquire_singleton_lock)
Category: leak
Priority: low
Description
fd = os.open(...) succeeds, then fcntl.flock(fd, ...) is wrapped in a try that catches only BlockingIOError. Any other OSError (EINTR, EPERM, ENOLCK on a network mount, EIO) propagates with fd still open. Acquisition runs once per process so impact is small, but tests, restart loops, and a future Windows replacement will inherit the pattern; lock file mode 0600 makes the leak slightly more visible to auditors.
Suggested fix
Use try/except OSError (or try/finally) that closes the fd before re-raising anything other than BlockingIOError.
Filed automatically by a thorough code-review pass over
src/entrabot/on 2026-06-13. Internal review id: #35.