Skip to content

Commit 4ff1e64

Browse files
committed
log and warn
1 parent d17a4f7 commit 4ff1e64

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

libsql-server/src/http/user/listen.rs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ use axum::response::{
1414
use axum_extra::extract::Query;
1515
use futures::{Stream, StreamExt};
1616
use hyper::HeaderMap;
17+
use log::{debug, warn};
1718
use serde::{Deserialize, Serialize};
1819
use std::boxed::Box;
1920
use std::convert::Infallible;
2021
use std::pin::Pin;
2122
use std::time::Duration;
2223
use tokio_stream::wrappers::errors::BroadcastStreamRecvError;
24+
use tracing::{debug, warn};
2325

2426
use super::db_factory::namespace_from_headers;
2527
use super::AppState;
@@ -149,9 +151,29 @@ async fn listen_stream(
149151
},
150152
Err(BroadcastStreamRecvError::Lagged(n)) => {
151153
LISTEN_EVENTS_DROPPED.increment(n as u64);
154+
warn!(
155+
namespace = %namespace,
156+
table = %table,
157+
dropped_events = n,
158+
"Lagged event in listen stream"
159+
);
152160
yield AggregatorEvent::Error(LAGGED_MSG);
153161
},
154-
_ => {}
162+
Err(e) => {
163+
warn!(
164+
namespace = %namespace,
165+
table = %table,
166+
error = %e,
167+
"Unexpected error in listen stream"
168+
);
169+
},
170+
_ => {
171+
debug!(
172+
namespace = %namespace,
173+
table = %table,
174+
"Filtered out message in listen stream"
175+
);
176+
}
155177
}
156178
}
157179
}

0 commit comments

Comments
 (0)