Skip to content

auto-stop-idle/autostop.py ignores open terminal sessions #90

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

Open
rogalski opened this issue Jul 21, 2022 · 4 comments
Open

auto-stop-idle/autostop.py ignores open terminal sessions #90

rogalski opened this issue Jul 21, 2022 · 4 comments

Comments

@rogalski
Copy link

Bug:
When JupyterLab is open, but terminal sessions are used instead of notebook sessions, instance may get incorrectly shut down despite being actively used.

Debug:

  1. autostop.py uses sessions API: https://github.com/aws-samples/amazon-sagemaker-notebook-instance-lifecycle-config-samples/blob/master/scripts/auto-stop-idle/autostop.py#L88
  2. Jupyter exposes info about notebooks and terminals under separate APIs:
  1. Activity on terminal never gets picked up by autostop.py which may result in premature shutdown

Caveats:

  • Newer Jupyter versions expose last activity timestamp in terminal API
  • Version available currently in AWS od not expose this information

From my manual check 5 minutes ago:

sh-4.2$ curl -k https://localhost:8443/api/terminals/1
{"name": "1"}sh-4.2$
@rogalski rogalski changed the title autostop.py ignores open terminal sessions auto-stop-idle/autostop.py ignores open terminal sessions Jul 21, 2022
@nethraui
Copy link

nethraui commented Nov 7, 2022

Do you have any fix for this?

@rvencu
Copy link

rvencu commented Mar 25, 2023

bumping up this issue

@takeru1205
Copy link

I opened PR that monitor notebook and terminal session!
Please check this out!

@dmlause
Copy link
Contributor

dmlause commented Mar 1, 2024

Thank you @takeru1205 - I left a comment on the PR.

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

No branches or pull requests

5 participants