Skip to content

Handle overlapped restore when build is triggered#7470

Open
Erarndt wants to merge 2 commits into
devfrom
dev-erarndt-restoreDuringBuild
Open

Handle overlapped restore when build is triggered#7470
Erarndt wants to merge 2 commits into
devfrom
dev-erarndt-restoreDuringBuild

Conversation

@Erarndt

@Erarndt Erarndt commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Bug

Fixes:

Description

On solution open, an implicit restore is triggered. If the user then immediately triggers a build, a second restore is queued after the implicit restore, and since there are no outward signals that a restore is in progress, the build appears to be stuck. This change adds a message to the output window indicating that a restore is in progress and avoids scheduling a second restore if the results of the first are valid.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@Erarndt Erarndt requested a review from a team as a code owner June 10, 2026 22:10
@Erarndt Erarndt requested review from martinrrm and zivkan June 10, 2026 22:10
@nkolev92

Copy link
Copy Markdown
Member

since there are no outward signals that a restore is in progr

Restore logs to the PackageManager output console and status bar both.

The confirmed issue on the other side is more about restore winning before build. #7431 will fix that.

I think this would theoretically make things better by putting restore logs in the build output isntead of just the package manager console, but it's a different problem.

@Erarndt

Erarndt commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

since there are no outward signals that a restore is in progr

Restore logs to the PackageManager output console and status bar both.

The confirmed issue on the other side is more about restore winning before build. #7431 will fix that.

I think this would theoretically make things better by putting restore logs in the build output isntead of just the package manager console, but it's a different problem.

Could you clarify what you mean? I think we might be seeing two separate issues. The delay I'm referring to is where build appears to be stalled with no progress indication:

image

The Package Manager output isn't even available as an option yet:

image

The build is awaiting for PromoteTaskToActiveAsync() which is waiting on the implicit restore to finish. Once that finishes, I do see updates in both the Package Manager output and status bar, but that's for the restore that got queued behind the implicit one.

@nkolev92

Copy link
Copy Markdown
Member

I am referring to https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2901003.

When talking about the bug you're seeing you mentioned a linked issue, so that's why I said the linked issue is different.

@Erarndt

Erarndt commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

I am referring to https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2901003.

When talking about the bug you're seeing you mentioned a linked issue, so that's why I said the linked issue is different.

Ah, I understand what you meant now. I did some additional digging and found out that there are a few things going on. It's technically true that build is waiting on a restore to finish, but the implicit restore is also blocked on the project system. The restore is waiting for all the projects to be nominated inside the loop in StartBackgroundJobRunnerAsync(). I'm going to spend some time looking into this, but I suspect just adding some status messages will go a long way here.

@dotnet-policy-service dotnet-policy-service Bot added the Status:No recent activity PRs that have not had any recent activity and will be closed if the label is not removed label Jun 24, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has no activity for 7 days. It will be closed if no further activity occurs within another 7 days of this comment. If it is closed, you may reopen it anytime when you're ready again, as long as you don't delete the branch.

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

Labels

Status:No recent activity PRs that have not had any recent activity and will be closed if the label is not removed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants