Page MenuHomePhabricator

D13608.id.diff
No OneTemporary

D13608.id.diff

diff --git a/services/tunnelbroker/src/amqp.rs b/services/tunnelbroker/src/amqp.rs
--- a/services/tunnelbroker/src/amqp.rs
+++ b/services/tunnelbroker/src/amqp.rs
@@ -85,7 +85,10 @@
async fn new() -> Result<Self, lapin::Error> {
let conn = create_connection().await?;
conn.on_error(|err| {
- // TODO: we should filter out some IOErrors here to avoid spamming alerts
+ if should_ignore_error(&err) {
+ debug!("Ignored AMQP Lapin error: {err:?}");
+ return;
+ }
error!(errorType = error_types::AMQP_ERROR, "Lapin error: {err:?}");
});
@@ -218,6 +221,26 @@
}
}
+fn should_ignore_error(err: &lapin::Error) -> bool {
+ use lapin::Error as E;
+ use std::io::ErrorKind;
+
+ if is_connection_error(err) {
+ return true;
+ }
+
+ if let E::IOError(io_error) = err {
+ return match io_error.kind() {
+ // Suppresses: "Socket was readable but we read 0.""
+ // We handle this by auto-reconnecting
+ ErrorKind::ConnectionAborted => true,
+ _ => false,
+ };
+ }
+
+ false
+}
+
pub fn is_connection_error(err: &lapin::Error) -> bool {
matches!(
err,

File Metadata

Mime Type
text/plain
Expires
Sat, Oct 5, 5:46 AM (8 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2235896
Default Alt Text
D13608.id.diff (1 KB)

Event Timeline