Skip to content

Coalesce concurrent async source file requests - #65650

Open
emerardd wants to merge 1 commit into
microsoft:mainfrom
emerardd:fix/65503-source-file-requests
Open

emerardd wants to merge 1 commit into
microsoft:mainfrom
emerardd:fix/65503-source-file-requests

Conversation

@emerardd

Copy link
Copy Markdown

Fixes #65503.

Concurrent Program.getSourceFile() calls for the same uncached file each request and decode the entire file. The async API now shares one in-flight request per canonical path within a program. It clears the pending entry when the request settles so failed reads can be retried.

The regression test checks the underlying request count for equivalent paths, retry after a shared failure, and the cache hit after a successful fetch.

Validation: the regression fails before the fix and passes after it. The 13 related async and sync API tests passed with the November 23 native nightly, along with the JavaScript API build and formatting checks.

AI assistance: Codex helped implement the change and write and run the regression test.

Full repository validation (hereby validate --api) has not completed.

Copilot AI balanced review requested due to automatic review settings November 24, 2026 03:09
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Nov 24, 2026
@typescript-automation typescript-automation Bot added the For Backlog Bug PRs that fix a backlog bug label Nov 24, 2026

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@emerardd

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Copilot AI 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.

🟢 Approval recommended

No active review issues are recorded, though full repository validation remains incomplete.

No open issues 🎉

Review effort: Balanced

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Nov 25, 2026

This branch has not been deployed

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

Labels

For Backlog Bug PRs that fix a backlog bug

Projects

Status: Needs merge

Development

Successfully merging this pull request may close these issues.

API client: concurrent Program.getSourceFile calls for one file stampede the cache, each fetching the file whole

3 participants