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

Option (or default) to wrap up executions before shutting down Sandbox #1477

Open
ryanblock opened this issue Feb 2, 2024 · 0 comments
Open
Labels
enhancement @sandbox @architect/sandbox

Comments

@ryanblock
Copy link
Member

Currently, when Sandbox is ordered to shut down, it does so immediately. This is a pretty nice user experience, as it keeps things moving super fast, especially in tests.

However, sometimes a Lambda may still be executing. Sandbox will shut down, and the spawned process, now without a parent, may start outputting red herring errors to the console.

I'm thinking an option (or change of defaults) to wrap up executions before shutting down might be helpful. Some ideas:

Module

// Immediately terminates
await sandbox.end()

// Wait for all Lambdas to terminate; this could in theory delay shutdown by up to 15 minutes
await sandbox.end({ clean: true })

// Same as above, but force termination after 5 seconds?
await sandbox.end({ clean: true, forceShutdown: 5000 })

CLI

# ctrl-c → Immediately terminates

# ctrl-c
$ There appear to be 3 Lambda processes still running, would you like to wait for them to finish?
> Wait for processes to finish
  Terminate immediately
@ryanblock ryanblock added enhancement @sandbox @architect/sandbox labels Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement @sandbox @architect/sandbox
Development

No branches or pull requests

1 participant