-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add --cleanup-level switch for choice of fast exit
While cleanly exiting threads and running all destructors in Rust is good for peace of mind and Valgrind, it is slower than just calling exit() and letting the OS clean up. In order to prevent the new graceful exit mechanics from slowing down typical runs, this adds a new switch `--cleanup-level`. The default is `--cleanup-level 1`, which will exit at basically the same time that Firecracker would quit previously. It uses libc::exit() to do so (since that's what it used before), but there may be reasons to change to Rust's std::process:exit(), if the code that runs is important. The new clean exit is done by `--cleanup-level 2`. This will join all threads and exit at the topmost main() level, so that all the Firecracker code is off the stack. An added mode which doesn't run any cleanup at all is given for `--cleanup-level 0`. This may or may not be useful, but it would be the fastest way to quit. Because a strange URL had been added to the API thread for internal use in clean shutdown, this hides that facility unless cleanup-level 2 is being used.
- Loading branch information
Showing
5 changed files
with
140 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters