Skip to content

Warm path: defer clone-manager construction past the fast-attach check #145

Description

@blooop

Question

Every warm launch pays for machinery it never uses: _get_clone_manager() runs at dl.py:2313, before the get_workspace_state fast-attach check at dl.py:2338 — reading config.toml, reading metadata.json twice (storage.py:90 and :106 via exclusive()), taking the shared metadata.json.lock flock, mkdir'ing repos_dir, and running migrate_cache — and then the warm path attaches without ever touching the clone manager. Defer its construction until a code path actually needs it, so a warm dl <ws> -- <cmd> does no metadata I/O and takes no metadata lock.

Notes:

  • Failing test first: on a warm launch (workspace state Running), no open/read of metadata.json and no acquisition of metadata.json.lock (mock at the storage/locks seam, or extend the spawn-count-style pinning approach).
  • The cold path must construct it exactly as today — existing tests stay green; the spawn-count sequences in test/test_devpod_spawn_counts.py must not change.
  • Watch call-order assumptions: parse_owner_repo_branch/default-branch resolution at dl.py:2319 uses the clone manager when the spec has no @branch — a bare-spec warm launch may still need it; only the paths that don't must skip it. Laziness (construct on first use) is likely simpler than reordering.
  • CI green (pixi run ci, check py310).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions