Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 21 additions & 19 deletions lading/src/bin/captool/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub enum Error {
#[expect(clippy::too_many_lines)]
#[expect(
clippy::expect_used,
reason = "FIXME: line read and JSON deserialization should surface as Error variants rather than panicking; tracked for follow-up. Task join panics are intentional propagation of inner panics."
reason = "Remaining .expect() sites are on tokio::task::JoinHandle; a JoinError fires only when the blocking task itself panicked, and we intentionally propagate that inner panic."
)]
async fn main() -> Result<(), Error> {
tracing_subscriber::fmt()
Expand Down Expand Up @@ -137,12 +137,14 @@ async fn main() -> Result<(), Error> {
};

let lines_vec: Vec<Line> = lines
.map(|l| {
let line_str = l.expect("failed to read line");
serde_json::from_str(&line_str).expect("failed to deserialize line")
.map(|l| -> Result<Line, Error> {
let line_str = l?;
Ok(serde_json::from_str(&line_str)?)
})
.collect()
.await;
.collect::<Vec<Result<Line, Error>>>()
.await
.into_iter()
.collect::<Result<Vec<_>, _>>()?;

analyze::jsonl::list_metrics(&lines_vec)
}
Expand Down Expand Up @@ -190,12 +192,14 @@ async fn main() -> Result<(), Error> {
};

let lines_vec: Vec<Line> = lines
.map(|l| {
let line_str = l.expect("failed to read line");
serde_json::from_str(&line_str).expect("failed to deserialize line")
.map(|l| -> Result<Line, Error> {
let line_str = l?;
Ok(serde_json::from_str(&line_str)?)
})
.collect()
.await;
.collect::<Vec<Result<Line, Error>>>()
.await
.into_iter()
.collect::<Result<Vec<_>, _>>()?;

analyze::jsonl::analyze_metric(&lines_vec, metric_name)
}
Expand Down Expand Up @@ -233,7 +237,7 @@ async fn main() -> Result<(), Error> {

#[expect(
clippy::expect_used,
reason = "FIXME: line read and JSON deserialization should surface as Error variants rather than panicking; tracked for follow-up. Task join panics are intentional propagation of inner panics."
reason = "Remaining .expect() site is on tokio::task::JoinHandle; a JoinError fires only when the blocking task itself panicked, and we intentionally propagate that inner panic."
)]
async fn validate_capture(capture_path_str: &str, min_seconds: Option<u64>) -> Result<(), Error> {
let capture_path = path::Path::new(capture_path_str);
Expand Down Expand Up @@ -272,16 +276,14 @@ async fn validate_capture(capture_path_str: &str, min_seconds: Option<u64>) -> R
either::Either::Left(LinesStream::new(reader.lines()))
};

let mut lines_vec = Vec::new();
let mut lines_stream = lines.map(|l| {
let line_str = l.expect("failed to read line");
let line: Line =
serde_json::from_str(&line_str).expect("failed to deserialize line");
line
let mut lines_vec: Vec<Line> = Vec::new();
let mut lines_stream = lines.map(|l| -> Result<Line, Error> {
let line_str = l?;
Ok(serde_json::from_str(&line_str)?)
});

while let Some(line) = lines_stream.next().await {
lines_vec.push(line);
lines_vec.push(line?);
}

jsonl::validate_lines(&lines_vec, min_seconds)
Expand Down
10 changes: 1 addition & 9 deletions lading/src/generator/file_gen/logrotate_fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,6 @@ impl Server {
///
/// Function will error if block cache cannot be built.
///
/// # Panics
///
/// Function will panic if the filesystem cannot be started.
#[expect(
clippy::expect_used,
reason = "FIXME: fuse_mount2 spawn failure should propagate as an Error variant rather than panic; tracked for follow-up"
)]
pub fn new(
_: generator::General,
config: Config,
Expand Down Expand Up @@ -242,8 +235,7 @@ impl Server {
];

// Mount the filesystem in the background
let background_session = spawn_mount2(fs, config.mount_point, &options)
.expect("Failed to mount FUSE filesystem");
let background_session = spawn_mount2(fs, config.mount_point, &options)?;

Ok(Self {
shutdown,
Expand Down
Loading