very fast at protocol indexer with flexible filtering, xrpc queries, cursor-backed event stream, and more, built on fjall
rust fjall at-protocol atproto indexer
59
fork

Configure Feed

Select the types of activity you want to include in your feed.

[firehose] treat every upgrade error as throttle reason

dawn 5c5bef95 786af756

+3 -10
+3 -10
src/ingest/firehose.rs
··· 4 4 use crate::state::AppState; 5 5 use crate::util::throttle::ThrottleHandle; 6 6 use crate::util::{ 7 - WatchEnabledExt, is_io_error_their_fault, is_status_their_fault, is_timeout, is_tls_cert_error, 7 + WatchEnabledExt, is_io_error_their_fault, is_timeout, is_tls_cert_error, 8 8 is_tls_error_their_fault, 9 9 }; 10 10 use jacquard_common::IntoStatic; ··· 16 16 use std::time::Duration; 17 17 use tokio::sync::watch; 18 18 use tokio_websockets::Error as WsError; 19 - use tokio_websockets::upgrade::Error as WsUpgradeError; 20 19 use tracing::{Span, debug, error, info, trace, warn}; 21 20 use url::Url; 22 21 ··· 31 30 WsError::Rustls(e) if is_tls_error_their_fault(e) => return true, 32 31 WsError::Io(e) if is_io_error_their_fault(e) || is_tls_cert_error(e) => return true, 33 32 WsError::CannotResolveHost => return true, 34 - WsError::Upgrade(WsUpgradeError::DidNotSwitchProtocols(status)) 35 - if (*status >= 400 && *status < 500) // its not my fault :) 36 - || (*status >= 200 && *status < 300) 37 - || is_status_their_fault(*status) => 38 - { 39 - return true; 40 - } 41 - WsError::Protocol(_) | WsError::PayloadTooLong { .. } => return true, 33 + // we treat every upgrade error as error because uh too bad so sad, im not doing anything wrong 34 + WsError::Protocol(_) | WsError::PayloadTooLong { .. } | WsError::Upgrade(_) => return true, 42 35 _ => {} 43 36 } 44 37