Skip to content

Commit 999c8dd

Browse files
committed
ctrlc is not built after rebasing
1 parent aa16170 commit 999c8dd

File tree

23 files changed

+183
-82
lines changed

23 files changed

+183
-82
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ tracing = { version = "0.1.41", features = [
6464
"attributes",
6565
], default-features = false }
6666
tracing-subscriber = { version = "0.3.19", default-features = false }
67+
ctrlc = { version = "3.4", features = ["termination"] }
6768

6869
[profile.profiling]
6970
inherits = "release"

examples/rust/cycle-benchmark/src/bin/cycle_bench.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,16 @@ mod direct_sockets {
236236
worker_assignments: app_config.worker_assignments().remove(&agent_id).unwrap(),
237237
timeout: Duration::from_secs(10),
238238
endpoint: endpoint(&app_config, signalling),
239-
activity_agent_map: app_config.activity_worker_map().iter().map(|(act_id, w_id)| (*act_id, app_config.worker_agent_map().get(w_id).copied().unwrap())).collect(),
239+
activity_agent_map: app_config
240+
.activity_worker_map()
241+
.iter()
242+
.map(|(act_id, w_id)| {
243+
(
244+
*act_id,
245+
app_config.worker_agent_map().get(w_id).copied().unwrap(),
246+
)
247+
})
248+
.collect(),
240249
}
241250
}
242251

examples/rust/mini-adas/BUILD.bazel

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,8 @@ rust_library(
2424
"src/lib.rs",
2525
],
2626
crate_features = [
27-
<<<<<<< HEAD
2827
"com_linux_shm",
2928
"signalling_relayed_tcp",
30-
=======
31-
"com_iox2",
32-
"signalling_direct_tcp",
33-
>>>>>>> 9f85924 ( handling shutdown and termination signallingin all signalling modes)
3429
],
3530
crate_name = "mini_adas",
3631
proc_macro_deps = [

examples/rust/mini-adas/src/activities/components.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,10 @@ impl Activity for EmergencyBraking {
335335

336336
#[instrument(name = "EmergencyBraking shutdown")]
337337
fn shutdown(&mut self) {
338-
debug!("Shutting down EmergencyBraking activity {}", self.activity_id);
338+
debug!(
339+
"Shutting down EmergencyBraking activity {}",
340+
self.activity_id
341+
);
339342
}
340343
}
341344

@@ -387,7 +390,10 @@ impl Activity for BrakeController {
387390

388391
#[instrument(name = "BrakeController shutdown")]
389392
fn shutdown(&mut self) {
390-
debug!("Shutting down BrakeController activity {}", self.activity_id);
393+
debug!(
394+
"Shutting down BrakeController activity {}",
395+
self.activity_id
396+
);
391397
}
392398
}
393399

@@ -433,7 +439,10 @@ impl Activity for EnvironmentRenderer {
433439

434440
#[instrument(name = "EnvironmentRenderer shutdown")]
435441
fn shutdown(&mut self) {
436-
debug!("Shutting down EnvironmentRenderer activity {}", self.activity_id);
442+
debug!(
443+
"Shutting down EnvironmentRenderer activity {}",
444+
self.activity_id
445+
);
437446
}
438447
}
439448

@@ -483,7 +492,10 @@ impl Activity for SteeringController {
483492

484493
#[instrument(name = "SteeringController shutdown")]
485494
fn shutdown(&mut self) {
486-
debug!("Shutting down SteeringController activity {}", self.activity_id);
495+
debug!(
496+
"Shutting down SteeringController activity {}",
497+
self.activity_id
498+
);
487499
}
488500
}
489501

feo-time/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
# SPDX-License-Identifier: Apache-2.0
1212
# *******************************************************************************
1313

14-
1514
load(
1615
"@rules_rust//rust:defs.bzl",
1716
"rust_binary",

feo/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ edition = "2021"
55

66
[dependencies]
77
feo-com = { workspace = true }
8-
ctrlc = { version = "3.4", features = ["termination"] }
98
feo-log = { workspace = true }
109
feo-time = { workspace = true }
1110
feo-tracing = { workspace = true }
@@ -15,6 +14,7 @@ postcard = { workspace = true, features = [
1514
"experimental-derive",
1615
], optional = true }
1716
serde = { workspace = true, optional = true }
17+
ctrlc = { workspace = true}
1818

1919
[dev-dependencies]
2020
feo-logger = { workspace = true }

feo/src/agent/direct/primary.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ use crate::worker::Worker;
2626
use alloc::boxed::Box;
2727
use alloc::vec::Vec;
2828
use core::time::Duration;
29+
use ctrlc;
2930
use feo_log::info;
3031
use std::collections::HashMap;
31-
use std::thread::{self, JoinHandle};
3232
use std::sync::{atomic::AtomicBool, Arc};
33+
use std::thread::{self, JoinHandle};
3334

3435
/// Configuration of the primary agent
3536
pub struct PrimaryConfig {
@@ -68,7 +69,8 @@ impl Primary {
6869
recorder_ids,
6970
endpoint,
7071
timeout,
71-
activity_agent_map, ..
72+
activity_agent_map,
73+
..
7274
} = config;
7375

7476
// Create worker threads first so that the connector of the scheduler can connect
@@ -165,7 +167,10 @@ impl Primary {
165167
// We can now safely join our local worker threads.
166168
for th in self.worker_threads.drain(..) {
167169
if let Err(e) = th.join() {
168-
feo_log::error!("A local worker thread in the primary agent panicked: {:?}", e);
170+
feo_log::error!(
171+
"A local worker thread in the primary agent panicked: {:?}",
172+
e
173+
);
169174
}
170175
}
171176

feo/src/agent/direct/primary_mpsc.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ use crate::worker::Worker;
2424
use alloc::boxed::Box;
2525
use alloc::vec::Vec;
2626
use core::time::Duration;
27+
use ctrlc;
2728
use feo_log::{debug, info};
2829
use std::collections::HashMap;
29-
use std::thread::{self, JoinHandle};
3030
use std::sync::{atomic::AtomicBool, Arc};
31+
use std::thread::{self, JoinHandle};
3132

3233
/// Configuration of the primary agent
3334
pub struct PrimaryConfig {
@@ -136,7 +137,10 @@ impl Primary {
136137

137138
for th in self.worker_threads.drain(..) {
138139
if let Err(e) = th.join() {
139-
feo_log::error!("A local worker thread in the primary agent panicked: {:?}", e);
140+
feo_log::error!(
141+
"A local worker thread in the primary agent panicked: {:?}",
142+
e
143+
);
140144
}
141145
}
142146
debug!("Primary agent finished");

feo/src/agent/direct/secondary.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ impl Secondary {
8888
})
8989
.collect();
9090

91-
Self { id: config.id, worker_threads }
91+
Self {
92+
id: config.id,
93+
worker_threads,
94+
}
9295
}
9396

9497
/// Run the agent
@@ -101,7 +104,6 @@ impl Secondary {
101104
}
102105
}
103106

104-
105107
debug!("Secondary with ID {:?} finished", self.id);
106108
}
107109
}

feo/src/agent/relayed/primary.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ use crate::worker::Worker;
2525
use alloc::boxed::Box;
2626
use alloc::vec::Vec;
2727
use core::time::Duration;
28+
use ctrlc;
2829
use feo_log::{debug, info};
2930
use std::collections::HashMap;
30-
use std::thread::{self, JoinHandle};
3131
use std::sync::{atomic::AtomicBool, Arc};
32+
use std::thread::{self, JoinHandle};
3233

3334
/// Configuration of the primary agent
3435
pub struct PrimaryConfig {

0 commit comments

Comments
 (0)