Skip to content

server: implement the current_activity interface #611

@oliver-sanders

Description

@oliver-sanders

Jupyter Server extension applications may implement a current_activity interface.

This is used to inform Jupyter Server of any activity with the extension for the purposes of implementing the shutdown_no_activity_timeout which is a handy way of killing idle servers.

https://github.com/jupyter-server/jupyter_server/blob/b85c15b5678cd6ea9de28e4f547bc0dfef0a69c7/jupyter_server/extension/application.py#L449-L451

In Cylc UI Server, we would consider "activity" to mean GraphQL queries or active websocket connections. So this would require listing active websocket connections which is an issue which will also need to be solved for #585 and #597.

There are currently two caveats to this approach:

  1. Currently, if a client disconnects, the server might not find out about this until the next update is sent to the client.
    • This means that websocket connections may remain alive indefinitely if no workflows are active.
    • This can be resolved by configuring a websocket ping interval, however, we are currently waiting for an upstream fix to go in before we can do this.
    • websockets: configure default ping interval #557
  2. The Cylc UI app may remain active as long as it is open somewhere in a browser tab.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions