Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3341592
D13608.id44905.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D13608.id44905.diff
View Options
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
@@ -82,7 +82,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:?}");
});
@@ -139,6 +142,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
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 22, 11:20 PM (18 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2563050
Default Alt Text
D13608.id44905.diff (1 KB)
Attached To
Mode
D13608: [tunnelbroker] Ignore connection error messages handled elsewhere
Attached
Detach File
Event Timeline
Log In to Comment