Prevent state machine transition skipping
What does this MR do and why?
When an exception occurs during an after_commit operation, the Ci::Build#drop! can get the wrong from state for its callbacks because catch_exceptions in the state machine gem rolls back the in-memory attribute.
I.e.
-
#run!fails in anafter_commithook -
build.statusbecomespendingin memory (but after areset, so the lock version is up-to-date!) -
#drop!seespendingand skips theuntrackoperation that was supposed to delete the running build
See #590004 (comment 3090419055) for more details.
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 Hordur Freyr Yngvason