status: show slot owner (reserving pid / lease name) #2

Closed
opened 2026-07-10 03:15:23 +08:00 by weiwen · 1 comment
Owner

Summary

tatami status should show the owner identity of a reserved slot: the reserving pid for in-use slots, and the lease name for leased slots.

Current behavior

  • Leased slots already print 🔒 held by: {lease_holder} (src/cmd/status.rs:46).
  • In-use slots print only the processes found running inside the slot (⚙️ processes: ...), not the owner_pid/owner_started_at reservation that actually holds the slot.
  • SlotView (src/pool.rs:28) does not expose owner_pid at all, so the reserving pid is unavailable to status even though it is tracked in SlotEntry.

Gap

The two reservation kinds are asymmetric in the UI:

reservation tracked in state surfaced in status
durable lease (lease_holder) yes yes
short-lived owner (owner_pid, owner_started_at) yes no (only child processes shown)

For an in-use slot you can see what is running but not who reserved it. The owning pid may not even appear among processes if it forked and exited or lives outside the slot's process tree.

Proposed change

  • Add owner_pid (and possibly owner_started_at) to SlotView.
  • In status, print the owner for in-use slots, e.g. 👤 owner: pid {owner_pid}, alongside the existing held by line for leases.
  • Structured (--json) output gets the field for free once it is on SlotView.
## Summary `tatami status` should show the owner identity of a reserved slot: the reserving pid for in-use slots, and the lease name for leased slots. ## Current behavior - Leased slots already print `🔒 held by: {lease_holder}` (`src/cmd/status.rs:46`). - In-use slots print only the processes found running inside the slot (`⚙️ processes: ...`), not the `owner_pid`/`owner_started_at` reservation that actually holds the slot. - `SlotView` (`src/pool.rs:28`) does not expose `owner_pid` at all, so the reserving pid is unavailable to `status` even though it is tracked in `SlotEntry`. ## Gap The two reservation kinds are asymmetric in the UI: | reservation | tracked in state | surfaced in `status` | | --- | --- | --- | | durable lease (`lease_holder`) | yes | yes | | short-lived owner (`owner_pid`, `owner_started_at`) | yes | no (only child processes shown) | For an in-use slot you can see *what* is running but not *who* reserved it. The owning pid may not even appear among `processes` if it forked and exited or lives outside the slot's process tree. ## Proposed change - Add `owner_pid` (and possibly `owner_started_at`) to `SlotView`. - In `status`, print the owner for in-use slots, e.g. `👤 owner: pid {owner_pid}`, alongside the existing `held by` line for leases. - Structured (`--json`) output gets the field for free once it is on `SlotView`.
Author
Owner

Opened a PR: #3

Opened a PR: https://forge.weiwen.dev/weiwen/tatami/pulls/3
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
weiwen/tatami#2
No description provided.