From 752496d91fdab81a9bf15d2d81fd6bfd55dfe136 Mon Sep 17 00:00:00 2001 From: VMSolidus Date: Mon, 1 Jun 2026 11:04:34 -0400 Subject: [PATCH] Hard Del Tracking Tweaks (#22570) The typical hard del costs 300ms of time, but Hard Dels only get reported to the Sentry logs if they exceed 500ms, which only an extremely tiny minority of them ever get past. In actual practice we only need to ignore the hard dels that are under 200ms because only the two "Roundstart subsystem hard dels" will ever be below that number and can be ignored. ALL other hard dels should be reported with the details required to fix them, especially so that I can have actually usable information about what is causing them and what I need to fix. --- code/controllers/subsystems/garbage.dm | 14 +++++++++++++- ...hellfirejag-sentry-hard-del-tracking-tweaks.yml | 4 ++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 html/changelogs/hellfirejag-sentry-hard-del-tracking-tweaks.yml diff --git a/code/controllers/subsystems/garbage.dm b/code/controllers/subsystems/garbage.dm index 37e9b91fa51..9ec3886daa6 100644 --- a/code/controllers/subsystems/garbage.dm +++ b/code/controllers/subsystems/garbage.dm @@ -306,6 +306,18 @@ SUBSYSTEM_DEF(garbage) if (time > 0.1 SECONDS) postpone(time) + + // Standard sentry logging for hard dels other than the two subsystems that will always hard del every round + var/sentry_threshold = 0.25 SECONDS + if (time > sentry_threshold && SSsentry) + SSsentry.capture_message( + "Hard delete: [type]", + "warning", + "garbage", + tags = list("datum_type" = "[type]"), + extra = list("ref_id" = refID, "time_ms" = tick_usage, "details" = detail) + ) + var/threshold = 0.5 // Used to be CONFIG_GET(number/hard_deletes_overrun_threshold) if (threshold && (time > threshold SECONDS)) if (!(type_info.qdel_flags & QDEL_ITEM_ADMINS_WARNED)) @@ -318,7 +330,7 @@ SUBSYSTEM_DEF(garbage) "warning", "garbage", tags = list("datum_type" = "[type]"), - extra = list("ref_id" = refID, "time_ms" = tick_usage) + extra = list("ref_id" = refID, "time_ms" = tick_usage, "details" = detail) ) type_info.hard_deletes_over_threshold++ var/overrun_limit = 0 // Used to be CONFIG_GET(number/hard_deletes_overrun_limit) diff --git a/html/changelogs/hellfirejag-sentry-hard-del-tracking-tweaks.yml b/html/changelogs/hellfirejag-sentry-hard-del-tracking-tweaks.yml new file mode 100644 index 00000000000..29ad7772b7e --- /dev/null +++ b/html/changelogs/hellfirejag-sentry-hard-del-tracking-tweaks.yml @@ -0,0 +1,4 @@ +author: Hellfirejag +delete-after: True +changes: + - rscadd: "Tweaked the hard delete logging sensitivity to correctly catch and record typical hard dels to the sentry logs. They will also now provide more usable information in order to help find where the memory leaks are coming from."