Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32214030
D13608.1765151008.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D13608.1765151008.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
@@ -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
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 7, 11:43 PM (7 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5846466
Default Alt Text
D13608.1765151008.diff (1 KB)
Attached To
Mode
D13608: [tunnelbroker] Ignore connection error messages handled elsewhere
Attached
Detach File
Event Timeline
Log In to Comment