Skip to main content
Version: Next

Graceful-Shutdown

The CDR Platform implements graceful shutdown which allows all services to complete pending requests and reject new requests during the shutdown process.

The addition of a graceful shutdown ensures that any in flight or outstanding requests are processed.

Sync API and Async API​

The API's leverage the ASP.NET Core graceful shutdown logic, more information can be found here. The default value is set to 60 seconds, which is the amount of time after the server begins shutting down before connections are forcefully closed.

Kestrel will wait for the duration of the timeout for any ongoing request processing to complete before terminating the connection. No new connections or requests will be accepted during this time.

It is possible that some tasks may continue to run after the shutdown timeout has elapsed, this is outlined in the Microsoft documentation.

"However, tasks aren't abandoned after cancellation is requested — the caller awaits all tasks to complete."

Engine​

The Engine service is a hosted service which enable custom actions in the lifecycle of the service, more information can be found here. It will ensure that all requests are completed within the default time of 5 seconds once the shutdown process has begun. Once the default time has been exceeded the service will be terminated no matter what.