You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
check_escalations scans every open ticket in one uncommitted transaction with no batching (contrary to docs/principles/performance-scalability.md at scale), and one ticket raising a non-AccessError (e.g. a ValidationError from a ticket constraint) aborts the entire hourly run for all subsequent tickets — there is no per-ticket isolation. The per-ticket rule re-search is already hoisted (PR #415 review fixes). Remaining work:
Batch the ticket scan (queue_job or windowed processing per the performance principle).
Precompute per-owner allowed-ticket sets (tickets.with_user(owner)._filtered_access("write")) once per pass — keeping the original sequence, id iteration order: routing is first-match-wins and escalation is last-writer-wins, so any owner-grouped loop changes which rule wins and the final ticket state (this is why the restructure proposed in PR security(grm): evaluate rules as their owner, scope portal tickets, guard entry points (#379, #380, #381) #415's review thread was not taken as written).
Per-ticket error isolation: wrap the per-ticket body so one failing ticket logs and continues instead of killing the pass.
From the PR #415 review thread on grm_escalation_rule.py:511.
check_escalationsscans every open ticket in one uncommitted transaction with no batching (contrary todocs/principles/performance-scalability.mdat scale), and one ticket raising a non-AccessError(e.g. aValidationErrorfrom a ticket constraint) aborts the entire hourly run for all subsequent tickets — there is no per-ticket isolation. The per-ticket rule re-search is already hoisted (PR #415 review fixes). Remaining work:tickets.with_user(owner)._filtered_access("write")) once per pass — keeping the originalsequence, iditeration order: routing is first-match-wins and escalation is last-writer-wins, so any owner-grouped loop changes which rule wins and the final ticket state (this is why the restructure proposed in PR security(grm): evaluate rules as their owner, scope portal tickets, guard entry points (#379, #380, #381) #415's review thread was not taken as written).From the PR #415 review thread on
grm_escalation_rule.py:511.