Let’s assume that there are 3 method call invocations on a canister say m1, m2 and m3 and in that order. Now assume m2 involves a cross subnet canister invocation. I understand m3 won’t execute before m2 is done. But what happens if m2 times out. Clearly we can’t proceed as m3 may depend on m2. So what is the recourse here? Thanks in advance.
From the perspective of the execution environment, once m2 sends out the XNet call, m2 is considered completed and execution can proceed with m3. The response to the XNet call will be considered a separate message and will not block m3 from executing
Thanks for the response. So m3 should not depend on m2? Is that something that dapp author needs to worry about?
Furthermore what happens if the remote call times out? Is it upto the Dapp developer to manage this and retry? Does the XNET protocol automatically retry?
If m2 didn’t process because it timed out waiting for inclusion in a block then it is up to the client to retry m2 if it is important. And if m3 should only be processed after m2 has fully completed, then the client should wait with submitting m3 until m2 has fully processed.
Your canister is guaranteed to receive exactly one response. If the receiving subnet has not accepted the call after 5 minutes (haven’t heard of such a situation yet TBH), then the replica will produce an error to return to the calling canister. It is then up to the canister to decide what to do with that information. It can retry, return an error, or do something else
It’s clear that handling such scenarios requires careful design by the Dapp developer. If m3 depends on m2, it’s essential to ensure m3 is not submitted until m2 is fully processed, as Severin mentioned.