Routing
Failover when a create fails
ComputeSDK team · Published
When you create a sandbox, the router walks your ordered list of providers. If one fails to create the sandbox, for any reason, it tries the next. You get the first sandbox that starts.
How the walk works
- The router builds the list from your order (recommended, cheapest or custom), your allowed and excluded providers and sizes, and any per-request
onlyorignore. - It tries one provider at a time, in order. Providers are tried one after another, not in parallel.
- The first successful create wins. The response includes the sandbox ID and the provider that runs it.
- If every provider fails, the request returns
502with every attempt and its error.
When every provider fails
HTTP/1.1 502 Bad Gateway
{
"error": "<why placement failed>",
"details": {
"attempts": [
{ "provider": "<first provider>", "error": "<its error>" },
{ "provider": "<next provider>", "error": "<its error>" }
]
}
}Each attempt names the provider and why it failed, so you can tell capacity, an outage or your own rules apart.
What failover does not do
It does not move running sandboxes. Failover happens only while a sandbox is being created. A sandbox that is already running stays on its provider; if that provider goes down, create a new sandbox and the router places it on the next provider that works.
See how each provider is doing in the reliability benchmark, or query it with the CLI from the providers page.