Repository navigation
Replies: 1 comment
|
Confirmed the failure mode, and there is a clean workaround while it is unfixed. Repro: start Workaround, using the CLI's own client object (no new code, no patching): from colab_cli.common import state
for a in state.client.list_assignments():
state.client.unassign(a.endpoint)That recovered three orphaned runtimes for me and freed the concurrent-assignment quota immediately; This also suggests the two-line fix: have |
Uh oh!
There was an error while loading. Please reload this page.
Summary
colab runcan leak a running VM that the CLI can no longer address: if the client loses its connection to the runtime, teardown fails remotely but still deletes the local session record.colab sessionsthen shows the runtime with no name (?), andcolab stopcannot reach it.Reproduction
colab run --session demo slow.pycolab sessionslists it, but the name column shows?.colab stop -s <anything>→Session '<name>' not found.The only recovery is to wait for expiry, since the runtime id shown in
colab sessionscannot be passed tocolab stopeither.Cause
src/colab_cli/commands/run.py::_teardownswallows every failure and then removes the local record unconditionally:commands/session.py::stopis cache-driven —state.resolve_session(name)thenstate.get_session(name)— so once the local record is gone the command has nothing to resolve, even thoughsessions_command()already fetches live assignments from the server and can see the runtime.So the CLI lists sessions from the server but can only stop them from a local cache, and the cache is discarded exactly when the remote teardown failed.
Impact
colab run/colab newfails withAllocation refused (precondition failed)— which reads like a capacity/quota problem rather than a leaked session.Suggested fix
_teardown, onlystate.store.remove(name)afterunassignsucceeds; otherwise keep the record (mark it asorphaned).stop: if the name is unknown, look the runtime up in the server's assignment list and match by endpoint/id, then unassign.sessions_command, offer the runtime id so an unassigned-by-name session can still be addressed.except Exception: passin favour of logging the failure — the silent path is what makes this hard to notice.Happy to test a patch against a reproduction case if useful.
All reactions