Skip to content

RAL-192: lock holders found by open descriptor when the locking pid is gone - #279

Merged
Castor-o7 merged 1 commit into
mainfrom
ral-192
Nov 14, 2026
Merged

Castor-o7 merged 1 commit into
mainfrom
ral-192

Conversation

@Castor-o7

Copy link
Copy Markdown
Owner

From RAL-191's first live run on Murph (issues log 1.86): every dsm-heavy slot's holder by /proc/locks was a pid that had exited. /proc/locks keeps the pid of the process that took the flock, dsm-heavy's own bash; under systemd 261 exec systemd-run --scope doesn't leave the job on that pid, and the job's processes hold the lock by the inherited open file description. So lock_holder::read walked a process that didn't exist, and stalls' stopped-holder (RAL-75) and possibly-hung (RAL-163) checks never prompted for a dsm-heavy job.

  • lock_holder::read: when a holder /proc/locks names has exited or doesn't have the file open, every user-space process's /proc/<pid>/fd is read for a link naming the lock file whose target has its device and inode; the holders are the topmost of those (whose parent doesn't hold it too). The row says found_by and keeps kernel_holders, with unreadable_processes when some couldn't be read (kernel threads aren't counted).
  • None found: the lock can't be read, a blind spot naming the kernel's pid and how many processes' open files couldn't be read; never "no holder" (fails --prompts-only, RAL-174).
  • The brief's in_flight (RAL-191) shows the same fields.
  • Tests: topmost unit test; a service test where a shell takes the lock, starts sleep 60 with the descriptor and exits: the holder is the sleep's pid, found by descriptor, kernel pid kept, and both possibly_hung_lock_holder and (after SIGSTOP) stopped_lock_holder prompt for it.
  • Live, read-only, on Murph with this build: 10 held slots, each holder now the real job (pid, cwd, command matching ps), e.g. slot 6 silent-dhole → 500306 in ~/.cache/silent-dhole, where /proc/locks said 500391 (gone). Docs: stalls.md, brief.md, roadmap.

🤖 Generated with Claude Code

…s gone

/proc/locks names the process that took a lock; dsm-heavy's bash takes the
slot and execs systemd-run --scope, and under systemd 261 the job doesn't keep
that pid, so every dsm-heavy holder read as a pid that had exited, and stalls'
stopped and possibly-hung checks never prompted for one (issues log 1.86).
When the kernel's holder is gone or doesn't have the file open, the holders
are the topmost processes with an open descriptor on it, by device and inode
through /proc/<pid>/fd; the row says found_by and keeps kernel_holders; none
found is a blind spot naming how many processes couldn't be read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Castor-o7
Castor-o7 merged commit 2ab47eb into main Nov 14, 2026
5 checks passed
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.

1 participant