From 5d4f52e02b15dce60f42212e2dd538c4b4578d59 Mon Sep 17 00:00:00 2001 From: Riccardo Busetti Date: Tue, 27 Aug 2024 16:09:30 +0200 Subject: [PATCH] Add back check --- relay-server/src/endpoints/common.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/relay-server/src/endpoints/common.rs b/relay-server/src/endpoints/common.rs index 16fdc5d416..22196079eb 100644 --- a/relay-server/src/endpoints/common.rs +++ b/relay-server/src/endpoints/common.rs @@ -349,6 +349,13 @@ pub async fn handle_envelope( ) } + // TODO(jjbayer): Remove this check once spool v1 is removed. + if state.memory_checker().check_memory().is_exceeded() { + // NOTE: Long-term, we should not reject the envelope here, but spool it to disk instead. + // This will be fixed with the new spool implementation. + return Err(BadStoreRequest::QueueFailed); + }; + let mut managed_envelope = ManagedEnvelope::new( envelope, state.outcome_aggregator().clone(),