Start and shutdown
The lifecylce of the container is managed by Kubernetes. The container itself is stateless, therefore it can be shutdown or restarted at any point in time if a downtime is acceptable.
If the container is shutdown or restarted, any events that are currently processed are dropped.
Graceful shutdown
A graceful shutdown helps the application finishes ongoing tasks before it stops.
When you stop the application, it waits for a set time before shutting down. This wait time is controlled by a variable HostSettings__ShutdownTimeoutSeconds, which defaults to 30 seconds but can be changed.
Exit codes
After shutdown, the application will exit with a code to show what happened. These codes help you or support teams understand how the app stopped:
-
None (0)– The application shut down cleanly with no issues. -
Timeout (1)– Shutdown exceeded the configured timeout (e.g., 30 seconds) before tasks could finish. -
ShutdownError (2)– An error occurred while shutting down, such as a failure in resource cleanup.