diff --git a/services/flysim/crates/fly-session/src/coordinator.rs b/services/flysim/crates/fly-session/src/coordinator.rs index 9111061..6357801 100644 --- a/services/flysim/crates/fly-session/src/coordinator.rs +++ b/services/flysim/crates/fly-session/src/coordinator.rs @@ -6123,6 +6123,14 @@ mod admission_race_tests { }; let stop = AtomicBool::new(false); let torn = AtomicBool::new(false); + // The hammer must never find the queue's empty initial state (no pulse, nothing + // pending), which is a legitimate admission, not a torn commit: on a loaded box it + // can run before the first iteration below sets the state up (PERF-01 saw it once). + { + let mut state = queue.lock(); + state.in_flight = vec![in_flight.clone()]; + state.set_remaining(&agent, Some(0.0)); + } std::thread::scope(|scope| { scope.spawn(|| { while !stop.load(Ordering::Relaxed) { diff --git a/services/flysim/crates/fly-session/src/worker.rs b/services/flysim/crates/fly-session/src/worker.rs index 52bd332..4a18bcc 100644 --- a/services/flysim/crates/fly-session/src/worker.rs +++ b/services/flysim/crates/fly-session/src/worker.rs @@ -165,7 +165,7 @@ pub struct HandlerCtx<'a> { /// How a domain request reached the shell, and so where its attachments are. pub enum Incoming { /// A bus request delivery: the attachments are the delivery's. - Bus(flybus::Request), + Bus(Box), /// The in-process local lane ([`LocalLane`]): the caller's own handles, in memory or /// sealed, handed over without a bus message. Local(Vec<(String, flybus::Artifact)>), @@ -620,7 +620,7 @@ async fn run(shell: Arc>, mut service: flybus::Servi _ => {} } shell - .admit(method, request, Incoming::Bus(incoming), Answer::Bus(responder)) + .admit(method, request, Incoming::Bus(Box::new(incoming)), Answer::Bus(responder)) .await; } shell.drain().await;