From 6bd50ef07d618b1057c661c76768e6fec0eb5c84 Mon Sep 17 00:00:00 2001 From: Jason Novinger Date: Wed, 5 Aug 2026 14:27:22 -0500 Subject: [PATCH] Fixes #22812: Note ConfirmCollector is intentionally Job-specific --- netbox/netbox/models/deletion.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/netbox/netbox/models/deletion.py b/netbox/netbox/models/deletion.py index a903b7dff..b0600e9e2 100644 --- a/netbox/netbox/models/deletion.py +++ b/netbox/netbox/models/deletion.py @@ -40,6 +40,11 @@ class ConfirmCollector(Collector): object can accumulate thousands of Jobs, each carrying large data/log_entries payloads; materializing them all just to render a confirmation page can exhaust memory (see #22812). Instead, the related Jobs are counted and recorded in `generic_relation_counts`. + + This is intentionally specific to Job, the only high-cardinality GenericRelation in the + data model; it is not a general count-out over every GenericRelation. If another relation + ever needs the same treatment, extend the check in collect() (and the matching write-path + batching in JobsMixin/ScriptModule.delete) rather than assuming this already handles it. """ def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs)