Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow disconnecting Fly runtime during initialization #2776

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

jonatanklosko
Copy link
Member

@jonatanklosko jonatanklosko commented Sep 9, 2024

Sometimes connecting may take quite a bit, and the user may realise that they want to change the config. Instead of waiting for the connection to finish, this allows them to hit "Disconnect".

Runtime.connect is already designed to return a pid that the session monitors. When the disconnect happens while connecting, the session is going to kill that process directly. For the Fly runtime, we have an additional watcher that eagerly deletes the machine in such case (if created).

Initially I thought about extending Runtime.disconnect to handle connecting state, but we would need to keep track of pid in each runtime struct and also have more duplication. Since the session already expects pid responsible for connecting, I think a direct kill is fine. // EDIT: I've just realised an added benefit of the current approach is that the same cleanup is triggered if something else fails during initialization (e.g. setting up the proxy).

Copy link

github-actions bot commented Sep 9, 2024

Uffizzi Preview deployment-56031 was deleted.

@jonatanklosko jonatanklosko merged commit 2eb5963 into main Sep 9, 2024
7 checks passed
@jonatanklosko jonatanklosko deleted the jk-runtime-abort-init branch September 9, 2024 14:27
@jonatanklosko jonatanklosko mentioned this pull request Sep 9, 2024
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants