mirror of
https://github.com/ParrotXray/Mantis.git
synced 2026-08-24 19:00:27 +09:00
Log dropped CSV rows in TrafficLogger instead of silent discard
log_row() previously swallowed TrySendError::Full and Disconnected with no diagnostic, so a slow writer thread or a dead writer thread (e.g. after a failed date-rotation reopen) silently truncated the training CSV with no visible trace. Mirrors the existing SuricataEngine::inject() channel-full logging pattern. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0138PxtKH73hqxv7h1oaoSdS
This commit is contained in:
parent
48f1747de3
commit
d8de89e930
@ -204,8 +204,12 @@ impl TrafficLogger {
|
||||
fn log_row(&self, record: Vec<String>) {
|
||||
match self.sender.try_send(record) {
|
||||
Ok(_) => {}
|
||||
Err(TrySendError::Full(_)) => {}
|
||||
Err(TrySendError::Disconnected(_)) => {}
|
||||
Err(TrySendError::Full(_)) => {
|
||||
log!(MLLog::TrafficLogChannelFull);
|
||||
}
|
||||
Err(TrySendError::Disconnected(_)) => {
|
||||
log!(MLLog::TrafficLogChannelDisconnected);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,6 +78,12 @@ loggable! {
|
||||
#[error("CSV rotated to: {path}")]
|
||||
TrafficLogRotated { path: String } => tracing::Level::INFO,
|
||||
|
||||
#[error("Traffic log channel full; dropping CSV row (writer thread falling behind)")]
|
||||
TrafficLogChannelFull => tracing::Level::WARN,
|
||||
|
||||
#[error("Traffic log channel disconnected; CSV recording has stopped")]
|
||||
TrafficLogChannelDisconnected => tracing::Level::ERROR,
|
||||
|
||||
#[error("Timing [{src}]: feature={feature_ms}ms buffer={buffer_ms}ms tensor={tensor_ms}ms onnx={onnx_ms}ms")]
|
||||
InferenceTiming { src: String, feature_ms: u64, buffer_ms: u64, tensor_ms: u64, onnx_ms: u64 } => tracing::Level::DEBUG,
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user