fix: survive runtime-proxy token expiry (~1h) instead of pruning live sessions - #146
Closed
mikewong23571 wants to merge 2 commits into
Closed
mikewong23571 wants to merge 2 commits into
mikewong23571 wants to merge 2 commits into
Conversation
… sessions - common: State.refresh_session() re-reads fresh token/url from list_assignments - exec/repl/console: on 401/404 refresh credentials + persist (exit 2, no prune); only prune when no live assignment matches server-side - runtime: resolve JupyterSubprotocol from wsclient submodule (jkc>=1.0 dropped the top-level re-export), omit kwarg when unavailable - connect probe wrapped in daemon-thread wall-clock timeout (45s) so a wedged kernel connect can never hang the CLI
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
… 5xx) + missing import
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The runtime-proxy token expires after ~1h while the VM assignment stays alive.
colab execthen gets 401/404, prints 'Session appears to be lost', deletes the local session entry — every later command says 'Session not found' although the VM is still running (visible in the Colab web UI). Re-creating sessions piles up live assignments untilTooManyAssignmentsError(412).Fix
State.refresh_session(): fetch fresh token/url vialist_assignments()(verified: it hands out a fresh 3600s token) and update the stored session in place.runtime.py: top-leveljupyter_kernel_client.JupyterSubprotocolcrashes on jkc>=1.0 (moved intowsclient); resolve defensively and omit the kwarg when unavailable.Tested end-to-end: corrupted stored token → exec prints refresh message, keeps session, persists fresh credentials → re-run reconnects.