Skip to content

ImportProfiles (batch) still races under parallel execution — no flock like ImportProfile #6448

Description

@maruiz93

What happens

Functional tests fail on main with unsupported provider type or profile errors despite PRs #6421 and #6437 fixing the same race in ImportProfile (singular). The batch function ImportProfiles (sandbox.go:508) performs delete+reimport without flock protection.

With parallelism=4 in functional tests, all 4 processes start ImportProfiles simultaneously, see a hash cache miss (no process has written the cache yet), and each deletes and reimports the same profiles. Another process's EnsureProvider hits the gateway during a delete window and gets NotFound.

The local internal/scaffold/fullsend-repo/profiles/ directory contains fullsend-github-ro.yaml and fullsend-vertex-ai.yaml — the same profiles that ImportProfile (singular) imports from the URL-resolved agents repo with proper flock protection. The unfenced batch import in step 2 clobbers step 1's safely-imported profiles.

Latest main (9c4ca5c6): Functional Tests run 32477527362 — all 4 triage cases fail with provider creation errors.

What should happen

ImportProfiles should have the same flock serialization as ImportProfile to prevent parallel processes from racing on profile delete+reimport.

How to reproduce

  1. Check out main at 9c4ca5c6 or later (includes both fix(#6420): make ImportProfile concurrency-safe with hash-based caching #6421 and fix(#6435): serialize ImportProfile with flock and retry EnsureProvider #6437).
  2. Run make functional-tests or push to a PR — the triage suite runs 4 cases in parallel.
  3. All 4 cases fail with unsupported provider type or profile.

Context

Blocks CI on all open PRs that run functional tests. Follow-up to #6420 (closed by #6421) and #6435 (closed by #6437) — same class of race, different code path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcomponent/sandboxOpenShell sandbox environmentpriority/highSignificant impact, address soonready-to-codeTriaged and ready for the code agenttype/bugConfirmed defect in existing behavior

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions