A service app runs, restarts with backoff and stops with the app
This page is for app authors. An app whose forge.json declares a service has no web page, so the forge starts its run and keeps it up. It does not wait for an HTTP answer.
What happens
- Start. The forge starts
rununder the same containment as a web app. It does not wait for a health check, so a deploy is live as soon as the process is started. - Restart. When the process exits on its own, the forge starts it again after a pause. The pause is 1 s the first time and doubles with each restart in a row: 1 s, 2 s, 4 s, up to 60 s. A start that fails counts as one more restart.
- Reset. A process that stays up a full 60 s starts the count over, so the next exit pauses 1 s again.
- Stop. Stopping or archiving the app stops the process and its children, and ends the restarting. A stop during a pause also ends it.
Where you see it
After a restart, the app page shows one line under "Deploy and log", and the terminal's Deploys screen shows the same line under the production heading:
service restarting in 4 s after exit code 2 (restart 3, pause doubles up to 60 s)while it waitsservice restarted 3 times after exit code 2once it is running again
Nothing is shown for a service that has never restarted. The deploy's log also records each exit and restart.