Closed belleny90 closed 2 years ago
Hi @belleny90, can you confirm you're using the latest version of the extension? We've tested this scenario and it works as expected. In idle_checker
, line, we check for the flag. If this flag is not set, it goes to the other elif
statements, including the one you mentioned. Let us know if you're still facing this issue.
Hi @durgasury, yes I am using the latest version. I've seen that the flag is taken care of in the line you mentioned. The problem is, that the if-statement in this line also assumes num_sessions < 1. Hence, if notebooks are running we have num_sessions >= 1 and it goes to the last elif-block - no matter of num_terminals and the flag "keep-terminals". The last block does not contain the check for the flag or num_terminals and shuts down the application including image terminals after closing all notebooks.
Gotcha! When a session AND a terminal is open, seems to kill both. If only the terminal is open, it is retained. I'll check what the design is and update the extension accordingly. Thanks for clarifying.
Exactly, thank you! I also opened a pull request today, which simply adds needed checks to solve this issue. However it could also be useful to reorganize the whole if/elif-logic.
Thanks @belleny90 , I've tested the code and merged it in the PR mentioned above. Closing this issue.
The problem is located in idle_checker.py: https://github.com/aws-samples/sagemaker-studio-auto-shutdown-extension/blob/main/sagemaker_studio_autoshutdown/idle_checker.py
When the IdleChecker is shutting down any notebooks in its method "is_idle" because num_sessions > 0, it does not check if any terminals are open and if the "keep_terminals"-flag is set to true. As a result the whole application including terminals is shut down even though image terminals should have been kept alive.