Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
This repository was archived by the owner on May 22, 2025. It is now read-only.

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

Open
@rogalski

Description

@rogalski

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$

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions