Skip to main content
If a container fails, Magic Containers restarts it automatically. You do not configure this behavior. The platform detects the failure in a few seconds.

What counts as a failure

The platform restarts the container in these cases:
  • The main process exits with a non-zero exit code.
  • The application uses more memory than the instance limit, so the platform stops it (out of memory).
  • The startup or liveness health check fails as many times as its failure threshold.
  • The application writes more than 10 GB to ephemeral storage, so the platform evicts the pod.
Exit codes 137 and 143 are an exception. They show that the process stopped after a stop signal, for example during a graceful shutdown. The platform treats these as an intentional stop, and not as a failure.

Delay between the attempts

The platform waits a few seconds before each restart. The delay grows with each attempt: The delay increases by approximately one second per attempt. It does not double.
A container that fails again and again therefore restarts quickly. The platform makes no long pause between the attempts.

When the platform stops the attempts

Each pod has a deadline for the restarts. The default deadline is different for a pod with a persistent volume. When the deadline expires, the platform stops the attempts, and it removes the pod.

How to correct a restart loop

While the platform restarts the container, the application status stays Processing. Open the region, and then the pod, to read the error message and the live logs. For the steps, refer to Troubleshooting. Correct the cause, and then deploy the new image or configuration. The platform creates new pods, and the restarts start again from the first attempt.

Effect on your data

A restart gives the container a new, empty file system. Files in ephemeral storage are lost. Data on a persistent volume stays available.
Last modified on September 8, 2026