Prevent redudant finalisations of segmented exports
What does this MR do and why?
Prevent redundant finalisation of segmented exports by checking for the presence of an exported file, and implementing a lease lock to exit finalisation early if one is already running.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
You need to make the execution of the VulnerabilitiesExport::ExportService#finalise method visible somehow. Binding.irb or just a puts message you can find in the logs.
Without this MR, you'll see that execution approximately as many times as there are segmented exports. With this fix, it should only occur once.
Relates to #469408 (closed)
Edited by Gregory Havenga