BearHuddleston
8e901ae13f
fix(pm): keep generation leases and install locks out of the dependency tree
...
Every launch of a source install wrote inside the dependency tree: a lease
file in the selected generation (`<generation>/.leases/<uuid>`, for both
`environments/` and `pm-runtime/generations/`), `installs/<key>/.install.lock`
and `pm-runtime/.prepare.lock`. Generation names change with every build, so
a sandbox policy (Landlock/OpenShell, rootless Podman, systemd
`ReadOnlyPaths=`) could not keep the dependencies read-only without a new
exception per build: on a read-only generation `lease_directory` raised
PermissionError.
Leases now live in `installs/<key>/leases/{environments,pm-runtime}/<generation>/`
and the locks in `installs/<key>/locks/{install,prepare}.lock`. Neither path
changes between builds, so a sandbox grants write access to those two
directories and keeps the generations read-only.
- `lease_dirs(generation)` finds the install state from the generation's
parents (`environments/<gen>`, `pm-runtime/generations/<gen>`; a PM
worker's `sys.prefix` is the latter). It returns the new directory first
and the in-generation `.leases` second.
- Processes started on an earlier release keep leasing `<gen>/.leases` and
locking the old files until they exit. The collectors
(`collect_generations`, `collect_runtime_generations`, orphan reclaim)
treat a lease in either place as held, and drop the lease directories of
generations they removed.
- `moved_lock(old, new)` takes the old lock first, then the new one, so an
old process and a new one always contend on one file in one order. An old
lock this process may only read (EACCES/EPERM/EROFS) is flocked through a
read-only descriptor; it is skipped only when it cannot be opened at all.
- `_last_used` also reads the `leases/*/*` mtimes, so a launch still counts
as recent use for orphan reclaim.
- Orphan reclaim unlinks `locks/` with the old `.install.lock`, last: on
Windows an open lock file cannot be unlinked.
`runtime_lock`, `collect_generations` and the other frozen old-updater names
keep their signatures.
Refs #151951
2026-11-20 23:54:30 -06:00
..
2026-11-20 11:19:26 -05:00
2026-11-17 19:10:58 +01:00
2026-11-19 02:35:54 -06:00
2026-11-20 14:42:55 -06:00
2026-11-20 00:30:20 -08:00
2026-11-19 23:56:47 -08:00
2026-11-20 17:36:20 +05:30
2026-11-06 23:02:20 -05:00
2026-11-12 23:36:59 -06:00
2026-11-14 01:03:00 -08:00
2026-11-20 17:36:20 +05:30
2026-11-14 13:22:36 +01:00
2026-11-13 18:45:31 +00:00
2026-11-16 10:12:09 -08:00
2026-11-13 18:45:31 +00:00
2026-11-13 16:54:40 +01:00
2026-11-18 09:36:27 -08:00
2026-11-19 11:00:21 -08:00
2026-11-14 12:04:53 +01:00
2026-11-19 12:35:40 +01:00
2026-11-14 20:51:51 +01:00
2026-11-17 21:09:24 +01:00
2026-11-12 23:35:39 +01:00
2026-11-13 20:21:56 +01:00
2026-11-19 14:20:18 +01:00
2026-11-13 17:58:28 -05:00
2026-11-09 18:06:44 +05:30
2026-11-19 11:00:21 -08:00
2026-11-06 23:02:03 -05:00
2026-11-13 20:37:29 +01:00
2026-11-17 21:09:24 +01:00
2026-11-17 17:51:20 +01:00
2026-11-16 10:29:52 -08:00
2026-11-17 17:51:20 +01:00
2026-11-19 10:36:13 -08:00
2026-11-14 13:15:34 +01:00
2026-11-19 03:31:38 -08:00
2026-11-13 18:45:31 +00:00
2026-11-16 17:43:16 +05:30
2026-11-13 02:36:06 -08:00
2026-11-06 22:59:41 -08:00
2026-11-12 19:55:11 +01:00
2026-11-17 17:51:20 +01:00
2026-11-16 19:21:55 -06:00
2026-11-17 17:51:20 +01:00
2026-11-17 17:51:20 +01:00
2026-11-06 08:46:25 -08:00
2026-11-17 17:51:20 +01:00
2026-11-15 08:20:26 +05:30
2026-11-17 17:51:20 +01:00
2026-11-17 17:51:20 +01:00
2026-11-17 17:51:20 +01:00
2026-11-16 19:21:55 -06:00
2026-11-12 23:40:12 +05:30
2026-11-13 16:21:19 -08:00
2026-11-15 08:20:26 +05:30
2026-11-17 17:51:20 +01:00
2026-11-17 17:51:20 +01:00
2026-11-17 17:51:20 +01:00
2026-11-06 08:46:25 -08:00
2026-11-16 15:23:37 +05:30
2026-11-14 02:52:41 -08:00
2026-11-18 03:40:34 -08:00
2026-11-17 17:51:20 +01:00
2026-11-17 17:51:20 +01:00
2026-11-16 12:19:49 -08:00
2026-11-13 17:50:03 -08:00
2026-11-18 03:40:34 -08:00
2026-11-16 19:21:55 -06:00
2026-11-06 20:23:20 -05:00
2026-11-06 20:23:20 -05:00
2026-11-16 11:28:45 -08:00
2026-11-17 21:42:04 -06:00
2026-11-16 21:57:07 +05:30
2026-11-13 20:20:47 +01:00
2026-11-19 18:12:39 -05:00
2026-11-14 14:33:50 +01:00
2026-11-14 03:45:21 -08:00
2026-11-14 15:35:44 +01:00
2026-11-14 03:45:21 -08:00
2026-11-20 14:33:51 -08:00
2026-11-13 14:38:26 +01:00
2026-11-20 01:55:26 +05:30
2026-11-18 03:40:34 -08:00
2026-11-12 22:39:16 +05:30
2026-11-13 20:21:55 +01:00
2026-11-13 21:23:31 +01:00
2026-11-14 13:09:23 +01:00
2026-11-14 13:09:23 +01:00
2026-11-13 16:51:36 +01:00
2026-11-12 23:40:12 +05:30
2026-11-12 23:40:12 +05:30
2026-11-16 15:40:08 +05:30
2026-11-12 14:09:07 +05:30
2026-11-16 15:40:08 +05:30
2026-11-17 17:51:22 +01:00
2026-11-13 16:42:15 -08:00
2026-11-17 17:51:20 +01:00
2026-11-14 03:58:59 -08:00
2026-11-14 12:50:47 +01:00
2026-11-14 01:03:00 -08:00
2026-11-16 19:21:55 -06:00
2026-11-19 03:31:38 -08:00
2026-11-14 12:05:40 +01:00
2026-11-13 22:55:53 +01:00
2026-11-13 20:20:46 +01:00
2026-11-13 02:36:06 -08:00
2026-11-06 04:08:24 +01:00
2026-11-08 16:47:03 +05:30
2026-11-08 16:47:03 +05:30
2026-11-07 01:17:21 -05:00
2026-11-12 14:09:07 +05:30
2026-11-10 13:36:29 +05:30
2026-11-17 17:51:20 +01:00
2026-11-17 17:51:20 +01:00
2026-11-16 21:57:49 +05:30
2026-11-17 07:20:56 -05:00
2026-11-10 13:36:29 +05:30
2026-11-10 13:36:29 +05:30
2026-11-10 13:36:29 +05:30
2026-11-17 17:51:20 +01:00
2026-11-17 17:51:20 +01:00
2026-11-16 13:55:18 +05:30
2026-11-17 17:51:20 +01:00
2026-11-14 03:43:44 -08:00
2026-11-17 17:51:20 +01:00
2026-11-13 00:27:08 -08:00
2026-11-12 01:17:05 +05:30
2026-11-20 17:36:20 +05:30
2026-11-07 12:01:04 -08:00
2026-11-07 15:15:48 -08:00
2026-11-07 12:01:04 -08:00
2026-11-07 12:01:04 -08:00
2026-11-20 17:36:20 +05:30
2026-11-07 12:01:04 -08:00
2026-11-07 17:54:05 -06:00
2026-11-07 12:01:04 -08:00
2026-11-07 12:01:04 -08:00
2026-11-09 00:56:23 +05:30
2026-11-14 03:43:44 -08:00
2026-11-10 10:40:31 -05:00
2026-11-10 10:40:31 -05:00
2026-11-14 06:08:53 -08:00
2026-11-12 01:17:05 +05:30
2026-11-11 23:20:47 -08:00
2026-11-14 11:37:50 -08:00
2026-11-16 19:21:55 -06:00
2026-11-14 10:50:28 -05:00
2026-11-14 10:40:53 -05:00
2026-11-09 00:56:23 +05:30
2026-11-14 06:33:40 -08:00
2026-11-10 06:25:43 -06:00
2026-11-13 18:45:31 +00:00
2026-11-14 10:50:28 -05:00
2026-11-10 06:25:43 -06:00
2026-11-17 19:10:41 +01:00
2026-11-19 10:48:12 -08:00
2026-11-14 12:05:38 +01:00
2026-11-14 02:23:19 -08:00
2026-11-14 20:30:43 +01:00
2026-11-20 17:36:20 +05:30
2026-11-13 18:45:32 +00:00
2026-11-17 17:51:20 +01:00
2026-11-17 17:51:20 +01:00
2026-11-19 03:31:38 -08:00
2026-11-08 11:59:30 -08:00
2026-11-14 16:16:34 +01:00
2026-11-17 17:51:20 +01:00
2026-11-14 02:38:28 -08:00
2026-11-12 21:12:00 +01:00
2026-11-17 17:51:20 +01:00
2026-11-13 16:51:37 +01:00
2026-11-17 17:51:20 +01:00
2026-11-11 22:44:52 -08:00
2026-11-13 16:51:36 +01:00
2026-11-14 03:44:36 -08:00
2026-11-17 17:51:20 +01:00
2026-11-14 17:16:29 +01:00
2026-11-17 17:51:20 +01:00
2026-11-14 06:08:53 -08:00
2026-11-11 09:28:43 -05:00
2026-11-13 17:49:25 -08:00
2026-11-14 03:44:36 -08:00
2026-11-16 13:56:35 +05:30
2026-11-08 01:26:58 -08:00
2026-11-06 23:02:29 -05:00
2026-11-17 17:51:20 +01:00
2026-11-13 18:45:31 +00:00
2026-11-17 17:51:22 +01:00
2026-11-13 18:45:31 +00:00
2026-11-06 04:08:46 +01:00
2026-11-14 01:03:00 -08:00
2026-11-13 14:40:35 +01:00
2026-11-16 21:58:16 +05:30
2026-11-17 17:51:20 +01:00
2026-11-14 01:24:46 +05:30
2026-11-14 01:03:00 -08:00
2026-11-19 10:48:12 -08:00
2026-11-14 17:07:12 +01:00
2026-11-14 01:03:00 -08:00
2026-11-13 18:45:31 +00:00
2026-11-14 17:07:10 +01:00
2026-11-12 14:09:07 +05:30
2026-11-14 21:03:31 +01:00
2026-11-10 00:49:30 +05:30
2026-11-06 10:41:13 -05:00
2026-11-13 12:58:14 +05:30
2026-11-13 20:21:54 +01:00
2026-11-13 20:34:31 +01:00
2026-11-13 20:21:54 +01:00
2026-11-14 02:38:28 -08:00
2026-11-13 20:21:55 +01:00
2026-11-20 16:38:37 +05:30
2026-11-17 21:42:04 -06:00
2026-11-08 20:09:42 +05:30
2026-11-09 18:06:44 +05:30
2026-11-14 03:42:26 -08:00
2026-11-17 21:42:04 -06:00
2026-11-15 08:20:26 +05:30
2026-11-19 11:00:21 -08:00
2026-11-16 15:40:08 +05:30
2026-11-14 01:03:00 -08:00
2026-11-14 01:03:00 -08:00
2026-11-14 01:03:00 -08:00
2026-11-14 13:22:36 +01:00
2026-11-17 17:51:20 +01:00
2026-11-13 19:23:34 +01:00
2026-11-06 20:39:14 -08:00
2026-11-13 15:30:30 -08:00
2026-11-14 12:46:07 +01:00
2026-11-17 11:27:30 -05:00
2026-11-06 20:22:20 -05:00
2026-11-13 18:45:32 +00:00
2026-11-13 18:45:31 +00:00
2026-11-06 20:48:57 -05:00
2026-11-13 18:45:31 +00:00
2026-11-13 20:47:04 +00:00
2026-11-13 15:30:30 -08:00
2026-11-05 18:28:39 -05:00
2026-11-06 20:22:20 -05:00
2026-11-06 20:48:57 -05:00
2026-11-13 20:47:04 +00:00
2026-11-20 08:06:29 -08:00
2026-11-17 06:41:24 +05:30
2026-11-14 05:45:02 +05:30
2026-11-14 05:45:02 +05:30
2026-11-13 15:30:30 -08:00
2026-11-04 21:58:12 -08:00
2026-11-13 15:30:30 -08:00
2026-11-17 06:41:24 +05:30
2026-11-12 22:23:28 +01:00
2026-11-20 00:30:20 -08:00
2026-11-19 23:56:47 -08:00
2026-11-05 19:16:24 -05:00
2026-11-14 05:45:02 +05:30
2026-11-15 01:22:06 +05:30
2026-11-19 23:56:47 -08:00
2026-11-13 15:30:30 -08:00
2026-11-07 21:35:26 -08:00
2026-11-13 15:30:30 -08:00
2026-11-17 06:41:24 +05:30
2026-11-17 06:41:24 +05:30
2026-11-13 01:44:01 -08:00
2026-11-13 15:30:30 -08:00
2026-11-06 23:27:29 +05:30
2026-11-06 12:57:52 -05:00
2026-11-15 14:02:40 +05:30
2026-11-12 22:23:28 +01:00
2026-11-15 01:22:06 +05:30
2026-11-14 05:45:02 +05:30
2026-11-14 14:33:50 +01:00
2026-11-06 23:04:28 -05:00
2026-11-12 01:17:05 +05:30
2026-11-13 17:48:43 -08:00
2026-11-17 17:51:22 +01:00
2026-11-06 23:27:29 +05:30
2026-11-13 12:58:14 +05:30
2026-11-12 17:16:33 +05:30
2026-11-13 02:36:06 -08:00
2026-11-13 14:30:56 +05:30
2026-11-07 12:01:04 -08:00
2026-11-13 17:48:43 -08:00
2026-11-20 17:23:04 +05:30
2026-11-10 13:26:00 -08:00
2026-11-14 13:22:36 +01:00
2026-11-17 17:51:20 +01:00
2026-11-14 01:03:00 -08:00
2026-11-20 11:28:21 -06:00
2026-11-13 20:21:55 +01:00
2026-11-10 13:26:00 -08:00
2026-11-19 14:20:19 +01:00
2026-11-15 01:58:38 +01:00
2026-11-10 13:36:29 +05:30
2026-11-20 23:54:30 -06:00
2026-11-14 13:22:36 +01:00
2026-11-16 18:09:07 +05:30
2026-11-14 02:37:48 -08:00
2026-11-17 17:51:20 +01:00
2026-11-17 17:51:20 +01:00
2026-11-17 17:51:20 +01:00
2026-11-17 17:51:22 +01:00
2026-11-17 17:51:20 +01:00
2026-11-17 17:51:20 +01:00
2026-11-17 17:51:22 +01:00
2026-11-17 17:51:22 +01:00
2026-11-17 17:51:20 +01:00
2026-11-19 10:48:12 -08:00
2026-11-09 00:56:23 +05:30
2026-11-16 15:40:08 +05:30
2026-11-09 00:56:23 +05:30
2026-11-19 10:48:12 -08:00
2026-11-13 16:54:40 +01:00
2026-11-16 17:43:16 +05:30
2026-11-13 18:16:09 +01:00
2026-11-17 17:51:20 +01:00
2026-11-18 08:52:55 -06:00
2026-11-16 10:12:09 -08:00
2026-11-10 15:44:28 +01:00
2026-11-17 17:51:20 +01:00
2026-11-13 00:47:59 +01:00
2026-11-17 17:51:20 +01:00
2026-11-16 17:43:16 +05:30
2026-11-17 17:51:20 +01:00
2026-11-14 13:15:34 +01:00
2026-11-13 20:46:29 +01:00
2026-11-16 21:57:49 +05:30
2026-11-17 17:51:22 +01:00
2026-11-07 01:17:21 -05:00
2026-11-11 22:40:06 -08:00
2026-11-20 11:28:21 -06:00
2026-11-14 16:16:33 +01:00
2026-11-12 22:39:07 +05:30
2026-11-14 02:23:19 -08:00
2026-11-14 02:23:19 -08:00
2026-11-14 02:23:19 -08:00
2026-11-14 01:11:55 -08:00
2026-11-14 17:07:29 +01:00
2026-11-17 17:51:20 +01:00
2026-11-14 02:23:19 -08:00
2026-11-14 02:23:19 -08:00
2026-11-06 04:08:24 +01:00
2026-11-14 01:11:55 -08:00
2026-11-14 02:23:19 -08:00
2026-11-12 22:23:28 +01:00
2026-11-17 17:51:20 +01:00
2026-11-07 00:01:43 -05:00
2026-11-13 23:49:02 -08:00
2026-11-14 02:23:19 -08:00
2026-11-13 23:49:02 -08:00
2026-11-14 01:11:55 -08:00
2026-11-14 02:23:19 -08:00
2026-11-20 17:36:20 +05:30
2026-11-13 18:45:33 +00:00
2026-11-13 18:45:31 +00:00
2026-11-06 04:08:24 +01:00
2026-11-19 18:12:39 -05:00
2026-11-12 19:29:02 -08:00
2026-11-07 17:54:05 -06:00
2026-11-07 17:54:05 -06:00
2026-11-06 04:08:46 +01:00
2026-11-16 10:29:52 -08:00
2026-11-07 12:01:04 -08:00
2026-11-20 11:19:26 -05:00
2026-11-17 17:51:20 +01:00
2026-11-14 05:44:33 +05:30
2026-11-16 17:43:16 +05:30
2026-11-12 15:56:31 -05:00
2026-11-15 02:14:14 +01:00
2026-11-13 16:51:55 +01:00
2026-11-17 17:51:20 +01:00
2026-11-11 15:26:19 +05:30
2026-11-05 13:08:14 +05:30
2026-11-06 20:39:14 -08:00
2026-11-16 21:57:07 +05:30
2026-11-14 17:11:29 +01:00
2026-11-17 17:51:20 +01:00
2026-11-18 15:12:51 +01:00
2026-11-13 18:45:31 +00:00
2026-11-07 12:01:04 -08:00
2026-11-20 14:42:54 -06:00
2026-11-07 12:01:04 -08:00
2026-11-20 11:19:26 -05:00
2026-11-20 11:19:26 -05:00
2026-11-11 02:49:29 -06:00
2026-11-05 18:26:06 -05:00
2026-11-12 14:16:57 -06:00
2026-11-14 03:49:07 -08:00
2026-11-19 10:48:12 -08:00
2026-11-17 17:51:22 +01:00
2026-11-11 22:10:25 -08:00
2026-11-13 17:51:19 -08:00
2026-11-13 17:48:43 -08:00