Stopping a canister before an upgrade

First, the canister must be stopped so it does not accept any new incoming requests.

This can be understood in two ways:

  1. I need to explicitly stop a canister before running an upgrade.
  2. Issuing upgrading command first stops the canister and only then upgrades it.

Whichever of the two interpretations is correct?

1 Like

From the spec:

Some canisters may not be able to make sense of callbacks after upgrades; these should be stopped first, to wait for all outstanding callbacks, or be uninstalled first, to prevent outstanding callbacks from being invoked (by marking the corresponding call contexts as deleted). It is expected that the canister admin (or their tooling) does that separately.