Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cloudhub-2/modules/ROOT/pages/ch2-deploy.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ After a successful restart, the replica status is `STARTED` and the replica can

When you stop, restart, update, redeploy, or terminate an application, CloudHub 2.0 tries to delete it from Mule. To make sure inflight messages are delivered, there's a five-minute timeout period. After that period, CloudHub 2.0 shuts down the whole instance. This grace period applies to the application instance, not to the runtime. The runtime uses its own configuration for shutdown. By default, the runtime grace period is five seconds.

For more information about shutdown timeout behavior and how CloudHub 2.0 handles long-running flows, see xref:ch2-understand-app-restart.adoc#shutdown-timeout-behavior[Shutdown Timeout Behavior].


== See Also

Expand Down
27 changes: 21 additions & 6 deletions cloudhub-2/modules/ROOT/pages/ch2-understand-app-restart.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,33 @@

CloudHub 2.0 restarts your Mule applications during infrastructure failure or maintenance, security patching, replica crashes, or replica rebalancing.

The CloudHub 2.0 infrastructure gracefully shuts down by draining connections, transitioning traffic to a new instance of your application replica before terminating the older instance. If your application configuration sets the `shutdownTimeout` attribute, the grace period is twice the configured value, up to 12 hours maximum. By default, `shutdownTimeout` is five seconds. See xref:mule-runtime::global-settings-configuration.adoc#global-configurations-reference[Global Configurations Reference].
The CloudHub 2.0 infrastructure gracefully shuts down by draining connections, transitioning traffic to a new instance of your application replica before terminating the older instance.

This grace period applies only to application restarts triggered by infrastructure maintenance. For a user-triggered stop or restart, if your application configuration sets the `shutdownTimeout` attribute to a value greater than 2 minutes and 30 seconds, the total shutdown grace period is 5 minutes. Otherwise, the grace period is twice the configured `shutdownTimeout` value.
To ensure business resiliency, design your application to be idempotent and deploy across multiple replicas with xref:ch2-clustering.adoc[clustering] enabled with a layer of persistence (xref:object-store::index.adoc[Object Store v2]).

[source,javascript,linenums]
[[shutdown-timeout-behavior]]
== Shutdown Timeout Behavior

CloudHub 2.0 overrides the Mule runtime's default `shutdownTimeout` value to avoid disruption for long-running flows. By default, the Mule runtime sets `shutdownTimeout` to five seconds. CloudHub 2.0 extends the shutdown grace period to accommodate applications that require more time to complete in-flight processing.

For infrastructure-triggered restarts (such as infrastructure failure, maintenance, security patching, or replica rebalancing):

* CloudHub 2.0 provides a grace period of twice the configured `shutdownTimeout` value, up to a maximum of 12 hours.
* If no custom `shutdownTimeout` is configured, CloudHub 2.0 applies a 12-hour maximum grace period to ensure long-running flows complete without disruption.

For user-triggered restarts (such as stop, restart, update, redeploy, or terminate actions):

* If your application configuration sets the `shutdownTimeout` attribute to a value greater than 2 minutes and 30 seconds, the total shutdown grace period is 5 minutes.
* Otherwise, the grace period is twice the configured `shutdownTimeout` value.

You can optionally configure the `shutdownTimeout` attribute in your Mule application configuration. See xref:mule-runtime::global-settings-configuration.adoc#global-configurations-reference[Global Configurations Reference].

[source,xml,linenums]
----
<mule ...>
<configuration shutdownTimeout="150000" /> <!-- This sets shutdownTimeout to 2 minutes, 30 seconds. Default is 5 seconds. -->
</mule>
----

To ensure business resiliency, design your application to be idempotent and deploy across multiple replicas with xref:ch2-clustering.adoc[clustering] enabled with a layer of persistence (xref:object-store::index.adoc[Object Store v2]).
----

== Considerations

Expand Down