For various reasons your application can terminate abruptly. Two cases of crash may happen:
They are detected directly when you deploy your application, if it crashes before binding the allocated network port, your deployment fails.
The former version of your application keeps running.
Two situations are the most common causes of runtime crashes:
- Runtime error of your application (uncaught exception, segfault of a library/runtime)
- Temporary error of an external resource
When a runtime crash occurred we automatically restart your container. If your application stopped again in the 5 minutes after being restarted, we won’t restart it directly, but 5 minutes later.
- 5 additional minutes are added after each crash in the 5 first minutes of runtime.
- A crash which occures after 5 minutes has no effect on the cool down
This limitation has been setup in order to avoid the situation when an application try to boot and crashes immediately.
A limit of 12 restart operations exist. It means that after 6 hours and 30 minutes, your application will not be accessible anymore (The last cool-off duration is 1 hour).
How do I know my app has crashed?
When such an event occurred, you’ll receive notifications, as well as your collaborators for the concerned application. You’ll receive a notification after the 2nd, 5th and 12th crashes (following the restart policy detailed previously).
It means that if your app crashed once for a temporary reason, it will be automatically restarted. If it does not crash anymore, you will not receive an email. But if it crashes in a loop, you’ll get a notification in the minute.
You’ll also find the ‘crash’ events in your app timeline on the dashboard.
What to do?
We strongly advise you to look at the logs of your application using the web dashboard or by using the CLI tool.
According to the information gathered, you should then modify your application to fix the issues which lead to this instability.
After a successful deployment, a manual restart, or scaling of your application, we cancel any queued restart job, and the cool down time after the next crash is resetted.
Don’t hesitate to contact us at firstname.lastname@example.org.