Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ and listed with their assets on the

### Fixed

- The daemon log says why a lane whose worktree went is not removed at once:
`lane_forget_deferred` said "it is being started" also when a removal of
the same lane was under way already, or a move.
- Docs: a viewer of a shared lane reads its containers' logs, as it has
since 0.11.0 (the node answers them itself); the docs and notes of 0.15.0
said otherwise.
Expand Down
16 changes: 14 additions & 2 deletions crates/devstack-daemon/src/lanes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,11 @@ pub struct Lanes {
remote: Mutex<BTreeMap<String, Arc<RemoteLane>>>,
/// Starts on a node and moves under way, or failed lately.
moves: Mutex<BTreeMap<String, LaneMove>>,
/// Lanes being started right now, so one is not started twice.
/// Lanes being started, moved or forgotten right now, so one is not
/// started twice.
pending: Mutex<BTreeSet<String>>,
/// Of `pending`, the lanes being forgotten: what a second forget says.
forgetting: Mutex<BTreeSet<String>>,
/// Whom each lane is shared with, where its owner said so (ADR-0035);
/// else `[lanes] share`. They may view it too (ADR-0040, amended
/// 2026-10-20). Kept in `.devstack/lane-shares.json`.
Expand Down Expand Up @@ -693,6 +696,7 @@ impl Lanes {
remote: Mutex::new(BTreeMap::new()),
moves: Mutex::new(BTreeMap::new()),
pending: Mutex::new(BTreeSet::new()),
forgetting: Mutex::new(BTreeSet::new()),
shares: Mutex::new(shares),
profiles: Mutex::new(BTreeMap::new()),
handover: Mutex::new(Handover::default()),
Expand Down Expand Up @@ -979,13 +983,21 @@ impl Lanes {
// Held for the whole of it: a start that comes in meanwhile is
// refused ("is being started"), and finds the lane gone after.
if !self.pending.lock().unwrap().insert(name.to_string()) {
// `pending` is a start's, a move's or another forget's: say whose.
let busy = if self.forgetting.lock().unwrap().contains(name) {
"it is being removed already"
} else {
"it is being started or moved"
};
crate::diag::info(
"lane_forget_deferred",
serde_json::json!({ "lane": name, "why": "it is being started" }),
serde_json::json!({ "lane": name, "why": busy }),
);
return;
}
self.forgetting.lock().unwrap().insert(name.to_string());
self.forget_claimed(name, why);
self.forgetting.lock().unwrap().remove(name);
self.pending.lock().unwrap().remove(name);
self.announce();
}
Expand Down