From 2b7615e0143c97d913c373a3ceea7a83d34c3130 Mon Sep 17 00:00:00 2001 From: Riccardo Busetti Date: Wed, 24 Jul 2024 14:06:33 +0200 Subject: [PATCH] Fix --- relay-server/src/services/spooler/envelope_stack/sqlite.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/relay-server/src/services/spooler/envelope_stack/sqlite.rs b/relay-server/src/services/spooler/envelope_stack/sqlite.rs index b4e75a6ec7..d84997179f 100644 --- a/relay-server/src/services/spooler/envelope_stack/sqlite.rs +++ b/relay-server/src/services/spooler/envelope_stack/sqlite.rs @@ -128,6 +128,10 @@ impl SQLiteEnvelopeStack { "failed to spool envelopes to disk", ); + // When early return here, we are acknowledging that the elements that we popped from + // the buffer are lost. We are doing this on purposes, since if we were to have a + // database corruption during runtime, and we were to put the values back into the buffer + // we will end up with an infinite cycle. return Err(SQLiteEnvelopeStackError::DatabaseError(err)); }