Skip to content

fix(file-search): isolate and queue concurrent searches - #7952

Merged
icecrasher321 merged 3 commits into
stagingfrom
codex/relax-file-search-concurrency
Sep 18, 2026
Merged

icecrasher321 merged 3 commits into
stagingfrom
codex/relax-file-search-concurrency

Conversation

@icecrasher321

@icecrasher321 icecrasher321 commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Raise workspace file-search admission ceilings to 20 per workspace and 5,000 per database.
  • Isolate searches in a dedicated five-connection client pool per process, with a bounded queue that rotates workspaces and reserves waiting capacity across tenants.
  • Reuse application request cancellation and the shared deadline helper to bound queueing, connection acquisition, and execution. Keep capacity reserved until underlying database work settles.
  • Preserve exact/regex results and line numbers; document fleet capacity and connection-cleanup boundaries.

Type of Change

  • Bug fix

Testing

  • 185 focused unit tests passed, covering cancellation propagation, queue fairness/overflow, deadlines, stalled acquisition, late completion, and slot release.
  • 53 PostgreSQL 17 integration tests passed; one optional benchmark skipped. Covers pool isolation, a 20-search burst, admission saturation/recovery, complete-line regex, revision changes, and cleanup.
  • Application/database type checks, lint, repository audits, block registry, and docs checks.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Sep 18, 2026 5:49pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the prior shared-pool contention finding is resolved by the dedicated search pool, and no new actionable failures remain.

Summary

The PR raises database-level file-search admission ceilings while isolating searches in a dedicated five-connection pool and placing a bounded, workspace-rotating queue ahead of connection acquisition.

  • Propagates HTTP and tool cancellation into search execution.
  • Holds local admission capacity until underlying database work settles, including after caller timeout.
  • Adds per-workspace queue reservations, execution deadlines, pool-isolation tests, and operational documentation.
  • Moves database pool profiles into a separately exported module so admission and driver limits share one source of truth.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Search request] --> B[Authorization and folder scope]
  B --> C{Local admission}
  C -->|Capacity available| D[Active search slot]
  C -->|Busy| E[Bounded per-workspace queue]
  E -->|Fair rotation| D
  E -->|Cancelled or expired| F[Retryable unavailable error]
  D --> G[Dedicated search connection pool]
  G --> H[Database advisory admission]
  H --> I[Repeatable-read search transaction]
  I --> J[Results and index coverage]
  I -->|Settles after success or failure| K[Release active slot]
  G -->|Caller deadline first| F
  G -->|Underlying work later settles| K
Loading

Reviews (3) · Last reviewed commit: "fix(file-search): bound admission waits ..."

Comment thread apps/sim/lib/workspace-files/search/constants.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/workspace-files/search/constants.ts
@icecrasher321
icecrasher321 force-pushed the codex/relax-file-search-concurrency branch from d0e215d to 6b8f7bc Compare September 18, 2026 00:57
@icecrasher321
icecrasher321 requested a review from a team as a code owner September 18, 2026 00:57
@icecrasher321 icecrasher321 changed the title fix(file-search): allow larger concurrent search bursts fix(file-search): isolate and queue concurrent searches Sep 18, 2026
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@icecrasher321 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 13 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@icecrasher321
icecrasher321 force-pushed the codex/relax-file-search-concurrency branch from 6b8f7bc to 6a07fbe Compare September 18, 2026 17:47
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@icecrasher321 I have started the AI code review. It will take a few minutes to complete.

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@icecrasher321 I have started the AI code review. It will take a few minutes to complete.

@icecrasher321
icecrasher321 merged commit 5d520ba into staging Sep 18, 2026
34 of 35 checks passed
@icecrasher321
icecrasher321 deleted the codex/relax-file-search-concurrency branch September 18, 2026 18:08

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 14 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 14 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant