You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
session prune: the retained path removes files and the directory by name after validation #463
Found in the council review for #453 (PR #465). The code is unchanged from main. PR #455 documents the rmdir window as a known limit.
removeRetainedDirectory in packages/core/src/session-retention.ts validates each retained file, then removes it with dir.unlinkChild(name), by name. A writer that replaces xvfb.log between the check and the unlink loses the replacement, and prune still reports the id. The coordination path already checks each file's identity before removal, through unlinkOwnedFile.
Both paths end with rmdirIfEmpty(root.resolve(id)), also by name. Suppose a concurrent prune removes the directory after the identity check, and a first permit caller that stalled past teardown recreates an empty directory with the same id. This rmdir then removes the new directory. The caller fails closed on its next step, so no data is lost and no input is delivered.
No legitimate writer touches a retained directory after teardown, so the file case needs a stray local process. POSIX has no rmdir by inode. One approach for the directory: rename it to a unique name in the sessions root, check the renamed entry's device and inode, and only then remove it.
Remove retained files only while their identity matches the validated one, as the coordination path does
Decide whether to close the rmdir window or keep it as a documented limit
Activity