refactor(measurement): enhance ICMP engine's async integration and robustness

Ensure IcmpEngine initializes within a Tokio runtime, improve timestamp validation, and refine probe management.
This commit is contained in:
Nils Andreas Svee committed 2026-10-08 14:15:14 +07:00
1 parent 89c7d75947
commit c7b283d761
2 files changed
+18 -13

No files matched your search

+6 -2
View File
@@ -243,6 +243,8 @@ fn wait_for_exit(error_rx: &flume::Receiver<anyhow::Error>) -> anyhow::Result<()
}
fn run(settings: &Settings) -> anyhow::Result<()> {
let rt = tokio::runtime::Runtime::new().unwrap();
if settings.advanced_settings.dry_run {
info!("*** MONITORING MODE ACTIVE — qdisc rates will NOT be changed ***");
}
@@ -252,7 +254,10 @@ fn run(settings: &Settings) -> anyhow::Result<()> {
let (ie_txt, _) = flume::unbounded();
let (binding_tx, binding_rx) = flume::unbounded();
let engine = IcmpEngine::new(start_time, &settings.network, ie_txt, binding_rx)?;
let engine = {
let _guard = rt.enter();
IcmpEngine::new(start_time, &settings.network, ie_txt, binding_rx)?
};
binding_tx.send(vec![IcmpBinding::new(
MeasurementStream {
id: MeasurementStreamId(0),
@@ -265,7 +270,6 @@ fn run(settings: &Settings) -> anyhow::Result<()> {
},
)])?;
let rt = tokio::runtime::Runtime::new().unwrap();
rt.spawn(engine.run());
let ReflectorSetup {