Skip to content

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

Availability and Testing

Edited by Kamil Trzciński (Back 2025-01-01)

Merge request reports

Loading