Skip to content
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

DM-38425: Switch to websockets #248

Merged
merged 2 commits into from
May 11, 2023
Merged

DM-38425: Switch to websockets #248

merged 2 commits into from
May 11, 2023

Commits on May 11, 2023

  1. Switch to websockets

    httpx-ws seems unable to talk to Jupyter labs. Connecting to a wss
    URL returns a 400 error and connecting to an https URL returns a
    timeout error, both without any error messages on the server side
    that I can find. Switch to the websockets library instead, which was
    already successfully in use by noteburst.
    
    websockets unfortunately doesn't use the underlying httpx AsyncClient,
    so requires copying some headers from an AsyncClient request to get
    the authentication information.
    
    Move the creation of the lab session into the JupyterLabSession
    context manager so that the calling convention is less awkward (no
    extra await in the middle of the context manager invocation). This
    code uses an explicit context manager because when using one
    generated with asynccontextmanager the WebSocket wasn't closed until
    garbage collection, at which point the AsyncClient was already closed
    and the lab session couldn't be deleted. This approach allows tighter
    control over exactly when the lab session is deleted.
    rra committed May 11, 2023
    Configuration menu
    Copy the full SHA
    b26ff51 View commit details
    Browse the repository at this point in the history
  2. Add timeouts to CI operations

    rra committed May 11, 2023
    Configuration menu
    Copy the full SHA
    54fb8c0 View commit details
    Browse the repository at this point in the history