Skip to content

Explicitly handle the start of a solution open to update state#27159

Merged
jinujoseph merged 1 commit intodotnet:masterfrom
jasonmalinowski:batching-after-fake-solution-load
May 31, 2018
Merged

Explicitly handle the start of a solution open to update state#27159
jinujoseph merged 1 commit intodotnet:masterfrom
jasonmalinowski:batching-after-fake-solution-load

Conversation

@jasonmalinowski
Copy link
Copy Markdown
Member

We update _solutionLoadComplete in various places as a way to approximate a "should we batch this load" flag. We never explicitly listened to a begin solution load event -- we just assumed VS starts this way, and reset it during solution close. Sometimes solutions can be re-opened before a close, and our flag would then be off and cause extra processing when unintended.

Ask Mode template

Customer scenario

Opens a file for diffing (say from team explorer), and then opens a solution. The solution load will be slower than it should be.

Bugs this fixes

https://devdiv.visualstudio.com/0bdbc590-a062-4c3f-b0f6-9383f67865ee/_workitems/edit/520280

Workarounds, if any

Open a different solution before you open the big solution, or restart Visual Studio.

Risk

Moderate: the change is simple, but this area is subtle.

Performance impact

Improved.

Is this a regression from a previous update?

Nope, seems to have always been there.

Root cause analysis

When files are opened for diff, Roslyn set a flag tracking that as meaning the solution was open, and further projects should be loaded interactively. This happens because the Roslyn's expectations for the events being raised didn't match reality. It's a combination of Roslyn having strange code, and the events being raised aren't quite right anyways. The shell looked into fixing their issues but saw further regressions in other areas.

How was the bug found?

Customer report.

We update _solutionLoadComplete in various places as a way to
approximate a "should we batch this load" flag. We never explicitly
listened to a begin solution load event -- we just assumed VS starts
this way, and reset it during solution close. Sometimes solutions can
be re-opened before a close, and our flag would then be off and cause
extra processing when unintended.
@jasonmalinowski jasonmalinowski added this to the 15.8 milestone May 25, 2018
@jasonmalinowski jasonmalinowski self-assigned this May 25, 2018
@jasonmalinowski jasonmalinowski requested a review from Pilchie May 25, 2018 17:59
@jasonmalinowski jasonmalinowski requested a review from a team as a code owner May 25, 2018 17:59
{
int IVsSolutionLoadEvents.OnBeforeOpenSolution(string pszSolutionFilename)
{
GetProjectTrackerAndInitializeIfNecessary(ServiceProvider.GlobalProvider).OnBeforeOpenSolution();
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.

Do we want to force create it here, or leave it null if it's the first solution being opened?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@Pilchie Well, if it's the very first solution being opened, it's possible we haven't even subscribed to that -- we won't have loaded until the first project is being pushed.

@jasonmalinowski
Copy link
Copy Markdown
Member Author

@dotnet-bot retest this please.

@jasonmalinowski jasonmalinowski requested a review from a team May 29, 2018 20:11
@jasonmalinowski
Copy link
Copy Markdown
Member Author

@jinujoseph, this needs a delegated M2 approval.

@jinujoseph
Copy link
Copy Markdown
Contributor

Approved to merge for 15.8.Preview3

@jinujoseph jinujoseph merged commit 4db93f3 into dotnet:master May 31, 2018
@jasonmalinowski jasonmalinowski deleted the batching-after-fake-solution-load branch July 9, 2018 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants