Skip to content

fix: a lock left with an unrecorded child is recovered after a reboot - #6635

Merged
janicduplessis merged 3 commits into
mainfrom
fix/6618-release-claim-after-reboot
Nov 28, 2026
Merged

janicduplessis merged 3 commits into
mainfrom
fix/6618-release-claim-after-reboot

Conversation

@janicduplessis

@janicduplessis janicduplessis commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

Description

A claim whose child record is {"record":null} (Stim started a process and was killed before recording which one) is never recovered, even after a reboot has ended every process it could stand for. The workspace stays "in use", and the only way out is a manual rm. I found four such claims from 2026-11-11 and 2026-11-12 on a machine rebooted on 2026-11-18.

Solution

Such a claim now reads as free when its owner is gone and the owner's process token records an earlier boot. Within one boot nothing changes. This changes the rule in LLP 0007, which the maintainer approved.

It stays refused when either boot id cannot be read, when only the Linux PID namespace differs, and on Windows, whose tokens carry no boot id. A child marker that is not an explicit null also stays refused.

Risk:

The change is in claimLiveness, so it applies to every claim kind. A pending child is written by the claim's own process; the exceptions are two paths in stimd/logs/claim.ts that mark an older claim pending, both Windows only.

A Stim home shared between machines or kernels would read the other side's claim as from an earlier boot. Nothing in a claim names its machine, and Stim already reaps another claim whose owner pid it cannot find, so LLP 0007 records this as outside the rule.

Test plan

  • macOS: ran readClaimSet from this branch, read only, on the four real claims. Each reads dead; on main each reads unresolved.

Fixes #6618

@janicduplessis janicduplessis added area: cli packages/stim-cli, including its README and guide area: docs docs/ and root documents labels Nov 28, 2026
@janicduplessis janicduplessis added review: ai-approved A fresh AI review found nothing left to fix ci-full run the macOS, Windows, Desktop and license jobs on this pull request labels Nov 28, 2026
@janicduplessis
janicduplessis marked this pull request as ready for review November 28, 2026 14:55
@janicduplessis
janicduplessis merged commit 79f2cc7 into main Nov 28, 2026
93 of 99 checks passed
@janicduplessis
janicduplessis deleted the fix/6618-release-claim-after-reboot branch November 28, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli packages/stim-cli, including its README and guide area: docs docs/ and root documents ci-full run the macOS, Windows, Desktop and license jobs on this pull request review: ai-approved A fresh AI review found nothing left to fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A null-child claim from a previous boot keeps a workspace in use until removed by hand

1 participant