[control] Start and resolver (QC nits): the live tree goes through the same rules as an apply before control writes it to the engines, and a guard frees an edge name lookup's entry and thread on every way out, a panic included

This commit is contained in:
2026-11-22 19:04:38 +01:00
parent 6f259e410a
commit 7f733102bf
2 changed files with 52 additions and 16 deletions
+18 -2
View File
@@ -130,12 +130,28 @@ impl Resolver {
.spawn({
let key = key.clone();
move || {
// Removes the name's entry and frees the thread's place on every way out, a
// panic in the resolver included: the next request for the name starts a
// new lookup instead of joining a dead one.
struct Done {
inflight: Arc<Inflight>,
key: (String, u16),
_permit: OwnedSemaphorePermit,
}
impl Drop for Done {
fn drop(&mut self) {
lock(&self.inflight).remove(&self.key);
}
}
let _done = Done {
inflight,
key: key.clone(),
_permit: permit,
};
let answer = lookup(&key.0, key.1)
.map(Arc::new)
.map_err(|e| (e.kind(), e.to_string()));
let _ = tx.send(Some(answer));
lock(&inflight).remove(&key);
drop(permit);
}
});
if let Err(e) = spawned {