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

Improve gitops run context handling #2851

Merged
merged 2 commits into from
Oct 11, 2022
Merged

Improve gitops run context handling #2851

merged 2 commits into from
Oct 11, 2022

Conversation

ozamosi
Copy link
Contributor

@ozamosi ozamosi commented Oct 11, 2022

This contains 2 changes:

  • It makes all of pkg/run take a context, rather than make up its own.

This allows us to do proper context handling. This PR doesn't do very good context handling, but it does sufficient context handling so that file uploads stop when hitting ctrl+c.

In other words, once you hit ctrl+c, the watcher's context will immediately abort, and thus no more transfers will happen. We might still print a warning or two about the closed context which can be improved with follow-up patches, but this means I no longer need to wait a long time for the watcher to finish before I can use the bootstrap UI.

  • It moves the signal handler as early as possible. If I hit ctrl+c before everything is booted up we would before just exit, which when I'm impatient would leave me with a left-behind bucket. Now we will always run through the cleanup routines.

@ozamosi ozamosi requested a review from a team October 11, 2022 13:52
@ozamosi ozamosi force-pushed the context branch 2 times, most recently from 5991e72 to e5f3511 Compare October 11, 2022 14:15
Robin Sonefors added 2 commits October 11, 2022 15:22
Before this, hitting ctrl+c in the middle of syncing would just keep
printing error messages from the sync process about the bucket not
responding which is not exactly unexpected when the frontend process
has deleted the bucket.

Now hitting ctrl+c in the "wrong" place will interrupt uploading and
syncing - granted, it will still look ugly in places with messages
about "context cancelled", but it will stop immediately.
This means I can hit ctrl+c while the bucket is still installing, and
still reach the bootstrap wizard.
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