Overview
When Containers exit, Aptible automatically restarts them from a pristine state. As a result, any changes to the filesystem will be undone (e.g., PID files will be deleted, etc.). As a user, the implication is that if a Container starts properly, Aptible can automatically recover it. To modify this behavior, see Disabling filesystem wipes below. Whenever a Container exits and Container Recovery is initiated, Aptible logs the following messages and forwards them to your Log Drains. Note that these logs may not be contiguous; there may be additional log lines between them.container recovery initiated
. This is because the lines container has started
and container has exited
will be logged during the normal, healthy Release Lifecycle.
If an App is continuously restarting, Aptible will throttle recovery to a rate of one attempt every 2 minutes.
Cases where Container Recovery will not work
Container Recovery restarts Containers that exit, so if an app crashes but the Container does not exit, then Container Recovery can’t help. Here’s an example Procfile demonstrating this issue:my-app
is running in the background, the Container will not exit when my-app
exits. Instead, it would exit if tail
exited.
To ensure Container Recovery effectively keeps an App up, make sure that:
- Each Container is only running one App.
- The one App each Container is supposed to run is running in the foreground.
Disabling filesystem wipes
Container Recovery automatically restarting containers with a pristine filesystem maximizes the odds of a Container coming back up when recovered and mimics what happens when restarting an App usingaptible restart
.
Set the APTIBLE_DO_NOT_WIPE
Configuration variable on an App to any non-null value (e.g., set it to 1
) to prevent the filesystem from being wiped (assuming it is designed to handle being restarted properly).