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
Commit a9f4902
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -253,7 +253,7 @@ instead. [docs/cli.md](docs/cli.md) has the full `--rm` contract, including whic
253
253
|`dl --ls`| List every workspace |
254
254
|`dl --ls --json`| The same, machine-readable, with what each workspace would lose if deleted |
255
255
|`dl --ls --size`| Add what deleting each one would free. Opt-in: it walks every file |
256
-
|`dl --prune`| Remove the clone directories no workspace opens any more, the agent git worktrees inside the clones it keeps, and the volumes of workspaces devpod has forgotten |
256
+
|`dl --prune`| Remove the clone directories no workspace opens any more, the agent git worktrees inside the clones it keeps, and the volumes and launch locks of workspaces devpod has forgotten |
257
257
|`dl --reconcile`| Re-point workspaces whose recorded source folder went missing. Deletes nothing |
258
258
|`dl --purge`| Remove devlaunch's own workspaces and caches |
259
259
|`dl --install`| Install shell completions, and the `dl-herdr-shell` name a herdr pane opens through |
@@ -405,7 +405,7 @@ different jobs:
405
405
406
406
| Command | Takes | Leaves |
407
407
|---|---|---|
408
-
|`dl --prune`| Clone directories no workspace opens, collectable agent git worktrees inside the ones it keeps, and the volumes of workspaces devpod no longer lists | Every workspace, container and image |
408
+
|`dl --prune`| Clone directories no workspace opens, collectable agent git worktrees inside the ones it keeps, and the volumes and launch locks of workspaces devpod no longer lists | Every workspace, container and image |
409
409
|`dl --purge`| The workspaces devlaunch created, and its caches | Workspaces it did not create, each named with its source before it asks |
410
410
|`dl --reconcile`| Nothing | Repairs records that stopped matching the disk |
Copy file name to clipboardExpand all lines: docs/cleanup.md
+54-2Lines changed: 54 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -304,8 +304,9 @@ until now nothing removed them: measured on one host, **52 clone directories for
304
304
all-or-nothing: the only way to get the 4 GB back was to destroy the 7.86 GB
305
305
too, and every bare cache with it.
306
306
307
-
`dl --prune` removes exactly the clone directories no live workspace opens, and
308
-
reclaims the Docker volumes of workspaces devpod no longer lists. It never
307
+
`dl --prune` removes exactly the clone directories no live workspace opens,
308
+
reclaims the Docker volumes of workspaces devpod no longer lists, and reclaims
309
+
the launch locks of workspaces devpod no longer lists. It never
309
310
deletes a devpod workspace, a container or an image, never
310
311
touches a repo's `.bare` cache (0.08 GB for seven repos, and it is what makes
311
312
the next clone of a repo fast), and never looks outside
@@ -637,6 +638,57 @@ walk of a 12000-file environment, and the listing is a read-only command people
637
638
run casually; a derivative is never a reason a site stands, so the listing loses
638
639
no answer by not asking.
639
640
641
+
#### The per-workspace launch locks
642
+
643
+
Two `dl` runs launching one workspace serialize on a lock file under
644
+
`<cache>/devlaunch/launch-locks/<workspace-id>.lock`. It is empty: the only thing
645
+
it carries is the `flock` the kernel holds on it while a launch is inside its
646
+
critical section, and the kernel drops that when the process ends, however it
647
+
ends.
648
+
649
+
Until [#575](https://github.com/blooop/devlaunch/issues/575) nothing removed one.
650
+
Every workspace ever launched left an entry and no removal path took it away, so
651
+
the directory only ever grew: measured on one host, **18 of 26 entries named no
652
+
workspace `devpod list` still returns**, against 8 live workspaces, the oldest
653
+
three weeks old. `dl <ws> rm` did not reach them, `--prune` did not, and
654
+
`--purge` only did because it removes the whole cache directory. That is zero
655
+
bytes of disk and it is still the thing worth fixing: a directory that only grows
656
+
is one nobody can read as a description of anything.
657
+
658
+
`--prune` reclaims them now, on the same plan and the same `y/N` as everything
659
+
above, and the precondition is the volumes' precondition: no workspace `devpod
660
+
list` returns carries that id.
661
+
662
+
| artifact | who reclaims it | what makes that safe |
663
+
| --- | --- | --- |
664
+
|`<cache>/devlaunch/launch-locks/<id>.lock`|`--prune`, and `--purge` with the rest of the cache | no workspace devpod lists carries that id, re-asked under the acting pass's own listing, **and** nothing holds the lock at the moment of the unlink |
665
+
|`~/.devpod/contexts/<ctx>/locks/<id>.workspace.lock`| nobody, deliberately | it is devpod's lock, taken by processes devlaunch does not run. See below |
666
+
667
+
**Why unlinking a lock file needed a change to how they are taken.** Removing an
668
+
`flock`'d file is the classic self-defeating move: a process that opened the old
669
+
inode still holds a lock nobody else can see, while new arrivals lock a fresh
670
+
file at the same path and walk straight past it, and two `devpod up`s of one
671
+
workspace then run against each other. That hazard is the reason the rule used to
672
+
be that no lock file is ever deleted. What replaced the rule is a check at the
673
+
other end: an acquisition now hands back a guard only for the inode the path
674
+
*still names*, so a run whose file went out from under it queues again against
675
+
the live one instead of believing itself alone. The unlink itself is performed
676
+
while holding the lock, and never blocks for it, so a launch inside its critical
677
+
section keeps its file and the sweep says so rather than waiting.
678
+
679
+
A lock a launch is holding is left standing and is not counted as a failure. It
680
+
is the guard working, the run still ends 0, and the next `--prune` finds it free.
681
+
682
+
**devpod's own lock is not devlaunch's to reclaim.** The same measurement found
683
+
70 of 78 stale entries under `~/.devpod/contexts/default/locks`, and they stay.
684
+
It is the same file `dl <ws> kill` is careful never to unlink, for the same
685
+
reason: the revalidation above is a promise devlaunch makes to itself about a
686
+
file only devlaunch opens, and devpod makes no such promise about this one. A
687
+
`dl` that removed it would be deciding that another program's mutual exclusion is
688
+
devlaunch's to break. The file devpod does leave stale, and which `kill` does
689
+
remove, is the busy marker beside it, which is a plain file and not a lock at
690
+
all.
691
+
640
692
#### The disk neither command frees
641
693
642
694
Both commands end on the same line, in the same words:
0 commit comments