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

windsock-cloud-docker: cleanup running processes when killed #1358

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

rukai
Copy link
Member

@rukai rukai commented Oct 17, 2023

Refactor windsock-cloud-docker so that it cleans up the in progress cargo command.
Its very common to want to kill cargo while its building if I change my mind.
Currently when I do that to windsock-cloud-docker it leaves a stray cargo process running in the background which will:

  • block new cargo compilations until the original cargo finishes compiling
  • eventually proceed to spin up AWS resources, without me being aware

This is quite problematic.

To fix this I:

  1. refactored windsock-cloud-docker to be async
  2. split all the logic between a Container::new() and Container::run_windsock methods
  3. then used tokio::select to allow sigint (ctrl-c) to terminate an in progress run + run cleanup code.
    Doing this without async is quite difficult as we would need to refactor commands to be nonblocking, better to just go async at that point than manually dealing with non blocking commands.

The actual logic of setting up the container and running windsock remains the same, its just all asyncified.

This PR also removes an unrelated stray TODO which had already been addressed in a previous PR.

@rukai rukai requested a review from conorbros October 17, 2023 03:34
@rukai rukai merged commit 7f1f6a2 into shotover:main Oct 17, 2023
39 checks passed
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.

3 participants