Skip to content

PET configure timeout kills process, preventing recovery on large workspaces #1274

@karthiknadig

Description

@karthiknadig

PET configure timeout kills process, preventing recovery on large workspaces

Problem: When the PET configure request takes longer than 30 seconds (e.g., on large filesystems with glob patterns like **/.venv), the extension kills the process and restarts it. PET then has to re-process the same configuration from scratch, hitting the same timeout. This burns through all 3 restart attempts, leaving PET permanently dead for the session.

Three specific bugs contribute:

  1. lastConfiguration is written before the request succeeds — if configure fails without triggering a restart, subsequent calls skip sending the configuration entirely.
  2. Killing on configure timeout is counter-productive — it discards any progress PET made during the 30 seconds, forcing a full restart that hits the same timeout.
  3. doRefresh() and resolve() catch blocks redundantly kill the process on configure timeout (already handled inside configure()).

Steps to verify fix:

  1. Open a workspace with a large directory tree and workspaceSearchPaths containing a glob pattern (e.g., **/.venv)
  2. Observe PET logs — first configure timeout should NOT kill the process
  3. Verify the next configure call retries on the same (still-running) process
  4. Verify that after 2 consecutive configure timeouts on the same process, PET IS killed and restarted
  5. Verify lastConfiguration is only cached after a successful configure response
  6. Run unit tests: npm run unittest

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions