Skip to content

Reduce long transaction time in resolution of dropped vulnerabilities

What does this MR do and why?

This MR reduces the transaction duration in the Vulnerabilities::MarkDroppedAsResolvedWorker by restructuring the class to minimise the amount of actions take in the transaction.

This includes building the state transitions before entering the transaction, as well as moving the system note creation to after the bulk insert operations in the transaction.

It would be preferable to keep the system notes in the transaction in case of unexpected failure, but the Note model depends on callbacks which may be complex to handle in a bulk ingestion routine, so we are relying on the success of the transaction to judge that the system notes should successfully create. If further optimisation is needed, a separate MR could attempt to successfully bulk update system notes.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #429012 (closed)

Edited by Lucas Charles

Merge request reports