Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make PUT /instance/state 503 when waiting to init
Also, I noticed that the `PUT /instance/state` API route would return a `NoInstance` error when trying to change the state returned a `VmError::WaitingToInitialize`, which seemed potentially bad: this would result in a sled-agent that tries to send a state change request to a still-initializing VM to believe it's Permanently Gone, and mark it as `Failed`, tear down the zone, and so on. Which seems rude of it! I don't think this is likely to be a problem in practice since IIRC both sled-agent and Nexus will not try to send state change requests to instances that they understand to be still initializing, but it seemed good to not return the INSTANCE IS PERMANENTLY GONE error code here. Now, we return a 503, so the sled-agent will just know it needs to wait for a bit.
- Loading branch information