-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3178: feat: add PoolNoodle to manage firecracker jails r=sprutton1 a=sprutton1 PoolNoodle lives! When using Firecracker, this will spin up a background thread responsible for ensuring that jails are available for consumption for functions. It favors creating new jails from the total available and will instead clean up old jails if none are available. ``` /// Starts the loop responsible for jail lifetimes. The loop works by: /// 1. Check if we have fewer ready jails than the `[MINUMUM_JAIL_PERCENTAGE]` of `[pool_size]` /// 2. If so, go get an unprepared jail and prepare it! /// 3. If not, check if there are any jails that need to be cleaned. /// 4. If so, clean them and move them to `[unprepared]` so they can be made ready. /// 5. If not, do nothing! ``` I am _certain_ there are edge cases here that I have not covered. Feel free to bring them up in the PR. The biggest obvious issue is "what if we run out of jails?". This is a real issue we have today. PoolNoodle should help mitigate it some, but it's not bulletproof. I definitely see a more robust implementation involving changing how we think about pooling altogether (and whether or not Deadpool is right for our needs here). I think this will get us by for now, though. Also, this is still leveraging the old bash scripts to do the jail prep/clean. Porting these over to rust is a non-trivial undertaking, so I'd like to push that out a bit. ```rust --------------------------------------------------------------------- --------------------------------------------------------------------- ---------------------------:::::::::::::::::::::--------------------- ---------------------:::::::::::::::::::::-------::::::-------------- -----------------:::::::::::::::::::==========------::::::----------- ----#*+#-----::::::::::::::::::::::::---:::--==++++-:::::::::-------- ---+#%`@@#----::::::::::::::::::===========++++***#*=::::::::::::-----` --=+*`@@@@@*::::::::::::::::::::========++++****###*=::::::::::::::---` --=`@@@@@@@@%+::::::::::::::::::-=======+++++**###%#+:::::::::::::::--` ----=`@@@@@@@@%=:::::::::::::::::=========++++*###%#+-::::::::::::::::` ------#`@@@@@@@@%-:::::::::::::::-....:===:....:*#%#+-::::::::::::::::` -----:::#`@@@@@@@@%-::::::::::::..:-=.::+.:=**:-==%#*=::::::::::::::::` ----::::::%`@@@@@@@@%=::::::::::.-#%@@--=.#%@@#*#*%%*=::::::::::::::::` ---:::::::::`@@@@@@@@@%=::::::..:-*@@***#+-+####*%%%#+::::::::::::::::` -:::::::::::%`@@@@@@@@@@%#:.......+***#%%###**#%%%%%#+::::::::::::::::` :::::::::::*#**#`@@@@@@@@@%:......=+*#%%%%%@%#%%%%%%#*-:::::::::::::::` ::::::::::#`@*+**%@@@@@@@@@=......:++*******####%%%%%*=:::::::::::::::` :::::::::::=%##%`@@@#%@%@@+........++++******###%%%%%*=:::::::::::::::` :::::::::::=+*#`@@%#%%%%@*.........++++++*****###%%%%#+.::::::::::::::` ::::::::::=++===+*%*===+=.........++++++*****####%%%#**=::::::::::::: :::::::::===++++*#`@*+++**=........-+++++******###%%%%#%###*-:::::::::` ::::::::-++===*%`@@@@%%%##:........++++++******###%%%%%%%###**+:::::::` :::::::::*%***%`@@@@@%%%#:.......=+=+++++******####%%%%#%###****+:::::` ::::::::::*`@@@@@@@%%%%%#......-+==+++*********####%%%%+:.=##****+-:::` :::::::::::::%`@@@-%%%%%#*:.:++++++************####%%%%+::::-***+**-::` --::::::::::::::::-#%%%###********#-**********####%%%#*.:::::**++**-: --::::::::::::::::::*#%%%#######*:..**********####%%%#*.:::::=*++**=: ---:::::::::::::::::::-#%%###*-.....**********#####%%##::::::=*++**+: ---::::::::::::::::::::::::::.......+*********#####%%%#-:::::+++**#=: ---::::::::::::::::::::::::::::.....-********######%%%#+::::*++**##:: ----:::::::::::::::::::::::::::::::::#*******######%%%#*****++**##=:: ------::::::::::::::::::::::::::::::.********######%%%%##**+***#%=::: ---------::::::::::::::::::::::::::::********######%%%%%*****##%-:::: ---------::::::::::::::::::::::::::::+*******######%%%%%#**##%=:::--- ----------:::::::::::::::::::::::::::-#*****#######%%%%%-:+#=::::---- :------------:::::::::::::::::::::::::##****#######%%%%%+:::::::----- =:----------::::::::::::::::::::::::::*#***########%%%%%*::::::------ ``` Co-authored-by: Scott Prutton <[email protected]>
- Loading branch information
Showing
12 changed files
with
389 additions
and
103 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.