# Stopping a canister before an upgrade

**URL:** <https://forum.dfinity.org/t/stopping-a-canister-before-an-upgrade/33305>\
**Category:** Developers\
**Created:** [July 17, 2024, 1:13am UTC](https://forum.dfinity.org/t/stopping-a-canister-before-an-upgrade/33305 "2024-07-17T01:13:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![qwertytrewq](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/qwertytrewq/32/10423_2.png) [@qwertytrewq](https://forum.dfinity.org/u/qwertytrewq)\
**Post date:** [July 17, 2024, 1:13am UTC](https://forum.dfinity.org/t/stopping-a-canister-before-an-upgrade/33305/1 "2024-07-17T01:13:18Z")

</div>

“[First, the canister must be stopped so it does not accept any new incoming requests.](https://internetcomputer.org/docs/current/tutorials/developer-journey/level-2/2.1-storage-persistence#upgrading-canisters)”

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?

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [July 17, 2024, 8:05am UTC](https://forum.dfinity.org/t/stopping-a-canister-before-an-upgrade/33305/2 "2024-07-17T08:05:27Z")

</div>

From the [spec](https://internetcomputer.org/docs/current/references/ic-interface-spec#ic-install_code):

> 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.
