From 2dbac3d4b49f096bdb8af76dbabb7d290504ed51 Mon Sep 17 00:00:00 2001 From: Oneric Date: Sun, 15 Dec 2024 02:52:15 +0100 Subject: [PATCH] dbg: make sure receiver crashes are logged --- patches/series | 1 + patches/wip_24_dbg_log_receiver_crashes.patch | 31 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 patches/wip_24_dbg_log_receiver_crashes.patch diff --git a/patches/series b/patches/series index 7ecc0fe..07e0c07 100644 --- a/patches/series +++ b/patches/series @@ -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 diff --git a/patches/wip_24_dbg_log_receiver_crashes.patch b/patches/wip_24_dbg_log_receiver_crashes.patch new file mode 100644 index 0000000..a4663f8 --- /dev/null +++ b/patches/wip_24_dbg_log_receiver_crashes.patch @@ -0,0 +1,31 @@ +From 5e5134d27d58801aeb33b360dbdb5048677caa4b Mon Sep 17 00:00:00 2001 +From: Oneric +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) there’s 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 +