Rescue StaleObjectError when bridge status is reset

What does this MR do and why?

Rescue StaleObjectError when bridge status is reset

Ci::Pipeline#reset_source_bridge! is called in several places during pipeline processing, and these calls can happen concurrently. This can cause a StaleObjectError when updating the status of the bridge, particularly for pipelines that have many jobs starting at once.

Errors raised during processing can leave pipelines and their jobs in an inconsistent state, so we now rescue StaleObjectError. When retrying an entire pipeline we surface this error to the user to allow them to retry, however for individual jobs we take no action as this means the bridge has already been updated and processing has continued.

References

#573539

Screenshots or screen recordings

Before After

How to set up and validate locally

See steps to reproduce.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Tiger Watson

Merge request reports

Loading