From d3f98ae4f12488d38c7739d34e1659ef8a529fdf Mon Sep 17 00:00:00 2001 From: acamilo Date: Wed, 23 Sep 2026 08:33:06 +0000 Subject: [PATCH] flysim: stop the bus runtime under the publisher at shutdown, not the router first Shutting the router down first raced the last publish and logged a refusal on every clean stop. The publisher ends on its own when the watch sender goes; the edge sees the socket close either way. --- services/flysim/crates/flysim/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/flysim/crates/flysim/src/lib.rs b/services/flysim/crates/flysim/src/lib.rs index 335f949..fe47337 100644 --- a/services/flysim/crates/flysim/src/lib.rs +++ b/services/flysim/crates/flysim/src/lib.rs @@ -184,7 +184,9 @@ pub fn run(config: Config) -> Result<()> { notifier.notify("STOPPING=1\n"); drop(sim); if let Some((bus_runtime, bus)) = bus_runtime { - bus.router.shutdown(); + // The publisher ends by itself once the watch sender is gone; stopping the runtime under + // it, rather than the router first, keeps a last in-flight publish from being logged as + // a refusal. The edge sees the socket close either way. drop(bus); bus_runtime.shutdown_timeout(std::time::Duration::from_secs(1)); }