start-os
start-os copied to clipboard
[feat]: new Server Status "Shutting Down / Restarting"
Prerequisites
- [X] I have searched for existing issues that already suggest this feature, without success.
Describe the Feature Request
The minimum time to shut down Embassy is always the longest sigterm-timeout of its services. Yet the shutdown/restart endpoints are synchronous. As such, the user can be left looking at a blocking spinner for multiple minutes while Embassy shuts down. Also, refreshing the page during the request could case undesirable behavior. I believe this warrants a new server status of "Shutting Down".
Describe the Use Case
User clicks Shutdown/Restart, and instead of getting a blocking spinner, they will be directed to a special page/modal that displays the shutdown progress of each service, similar to the experience of server backups. The user would not be able to leave this page, even upon refresh.
Describe Preferred Solution
- Convert shutdown/restart endpoints to async
- Add "shutting-down" status to ServerStatus enum
- continue to report revisions during shutdown process
- FE will direct user to special page where they can observe the shutdown process
- When final service completes its stop sequence, FE will display a "shutdown complete" message and continue polling as usual. If the Embassy comes back up, it will be in "Running" status, which will cause the FE to direct back to the normal experience.
Describe Alternatives
No response
Anything else?
No response
I love the idea of showing the status of each service. This would go well with a "sigkill" button as well
I also noticed that the shutdown sound never plays. Should I create a new issue for that?
are you sure that it wasn't just still shutting down? Could have been a patch-db deadlock or a service taking a while to shutdown
What is the maximum time it can take for the server to shut down? If it is sufficiently long we should give feedback both when the request is accepted and before the box goes down.
if there are no deadlocks, can take as long as the longest sigterm-timeout. If there is a deadlock, obviously it can take forever
I've rarely had shutdown complete faster than a few minutes, and I've never actually heard the shutdown noise play. The only time it shuts down in under 5m is when there are no services running and few services installed. About half the time it hangs indefinitely
Sounds like an actual issue, not just an artifact of extended termination of services.
@MattDHill Do you want me to create a new issue?
Yes please. This is a feature request. If there's a bug with shutdown, it needs to be a P1 ticket.
Need both shutting down and restarting state. FE will have an overlay greying out background. FE needs to be careful about state synchronization, don't show status of service until it has gotten a patch - apply the patch before it says reconnected.
Bug in patch db: UI will only update the connection status when a new patch comes in. Switch this knowledge to patch db if we are connected at all. Each source will need to track itself, so it can be picked up by in UI.
A successful websocket or polling should set the status connection to true. As soon as a poll succeeds, try to switch back to websockets.
Also, we shouldn’t allow users to interact with StartOS UI after clicking RESTART
I suggest that after clicking restart the screen should be locked with a progress bar indicating that the server is restarting.
We can go safe with something like that:
Go bold with something more like this:
Or something funny like this: