dbg: make sure receiver crashes are logged

This commit is contained in:
Oneric 2024-12-15 02:52:15 +01:00
parent 49920c2498
commit 2dbac3d4b4
2 changed files with 32 additions and 0 deletions

View file

@ -50,3 +50,4 @@ wip_20_federation-incoming-improve-link_resolve-retry-decis.patch
wip_21_nodeinfo-lower-log-level-of-regular-actions-to-debug.patch
wip_22_rich_media-lower-log-level-of-update.patch
wip_23_Don-t-spam-logs-about-deleted-users.patch
wip_24_dbg_log_receiver_crashes.patch

View file

@ -0,0 +1,31 @@
From 5e5134d27d58801aeb33b360dbdb5048677caa4b Mon Sep 17 00:00:00 2001
From: Oneric <oneric@oneric.stub>
Date: Sun, 15 Dec 2024 02:50:20 +0100
Subject: [PATCH] tmp/dbg: make sure crashes in receiver are actually logged
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Rarely (once a day or so) theres still a ReceiverWorker excception
showing up in prometheus stats without any corresponding log message
---
lib/pleroma/workers/receiver_worker.ex | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/pleroma/workers/receiver_worker.ex b/lib/pleroma/workers/receiver_worker.ex
index cffdd8584..3c24c02ac 100644
--- a/lib/pleroma/workers/receiver_worker.ex
+++ b/lib/pleroma/workers/receiver_worker.ex
@@ -51,5 +51,9 @@ def perform(%Job{args: %{"op" => "incoming_ap_doc", "params" => params}}) do
Logger.error("Unexpected AP doc error: (raw) #{inspect(e)} from #{inspect(params)}")
{:error, e}
end
+ rescue
+ err ->
+ Logger.error(Exception.format(:error, err, __STACKTRACE__))
+ {:error, :crash}
end
end
--
2.39.5