Can an actors mailbox “fill up” and reject new messages?
Between each pair of canisters, there is a queue of outstanding messages. If this queue is full, then canisters will not be allowed to create new messages.
Note that the IC has guaranteed responses so we want to make sure that when a canister is trying to produce a response, it never hits the full queue issue. Hence, when a canister tries to produce a request, we reserve a slot for the eventual response. So a canister should only experience the full queue error when trying to produce a request.
- Is it possible to upgrade a canister while it still has messages to process? If so, do those messages remain enqueued or is the queue purged?
A canister can always be upgraded regardless of how many messages it has in its input queues. However, in practice, it is generally hard to write applications that one can upgrade and still be able to make sense of old messages. More specifically, if a canister sends a request to another canister, it may create some state locally to help process the eventual response. If the canister is upgraded before the response comes back, making sense of the state might be a difficult problem to solve.
Hence, we have the feature to “stop” a canister. We generally recommend that the controller of a canister should first stop it and only try to upgrade a stopped canister. When you stop a canister, it stops processing new requests (just responses) and when it has processed all responses, it becomes stopped.
I hope this helps.