Make LifecycleEvents exceptions to be fatal
What does this MR do?
Make LifecycleEvents exceptions to be fatal
The execution of LifecycleEvents might result in silently failing and causing application to not be fully loaded.
This ensures that any such exception results in a catastrophic failure: application forced restart.
Related to: gitlab-com/gl-infra/production#3434 (closed). In this example during lifecycle hook we have seen inability to start DB connection, causing the exception to be raised.
Solution
Raise Exception
that will not be caught by Puma
. This will result in restarting the process.
This "fatal" behaviour might be temporarily disabled with USE_FATAL_LIFECYCLE_EVENTS=false
.
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Edited by Kamil Trzciński (Back 2025-01-01)