Skip to content

Make LifecycleEvents exceptions to be fatal

Kamil Trzciński requested to merge make-lifecycle-hooks-to-be-fatal into master

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

Merge request reports