Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mitigation in 17.7 for cases where local and remote host disagree on source generated files. #69965

Closed
wants to merge 4 commits into from

Conversation

CyrusNajmabadi
Copy link
Member

@CyrusNajmabadi CyrusNajmabadi commented Sep 15, 2023

We're seeing a lot of crashes in the wild where the local VS workspace and the Remote OOP workspace disagree on what trees are present within each other (for example, in #69234).

When looking at these crashes, we commonly see stuff like:

image

indicating that this is an issue primarily with SG docs. Our theory (which we are still collecting data/dumps on) is that there is either a bug in our workspace in terms of how we generate SG docs, or there is a buggy SG out there which doesn't operate deterministically. In either event, the two hosts could then see a different set of documents, which would then cause these crashes.

To address this, we've made a larger/riskier change in main here #69917 to make it so that the local VS workspace always defers to the remote workspace for SG contents. This should ensure that there is no way for these systems to be out of sync.

However, we do not want to port a large/risky change like that back to 17.7. So, instead we're considering mitigating the issue in 17.7 such that the features that are currently affected make themselves resilient to this scenario. This is not something we want to be in 17.8, so if this is accepted, we will undo this change there and only take the full fix.

When this flows into main, we will want to keep the first commit, which corresponds to #69952.

We will not want to keep the second commit.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner September 15, 2023 17:05
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Sep 15, 2023
@CyrusNajmabadi CyrusNajmabadi changed the base branch from release/dev17.8 to release/dev17.7 September 15, 2023 17:09
@@ -137,6 +137,9 @@ public void AugmentPeekSession(IPeekSession session, IList<IPeekableItem> peekab
workspace, document.Id, item.SourceSpan.Start, cancellationToken).ConfigureAwait(false))
{
var text = await document.GetTextAsync(project.Solution, cancellationToken).ConfigureAwait(false);
if (text is null)
continue;
Copy link
Member

Choose a reason for hiding this comment

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

❓ Can we put this in CanNavigateToPositionAsync instead?

Comment on lines 56 to 57
bool throwForMissingSourceGenerated = true,
CancellationToken cancellationToken = default)
Copy link
Member

Choose a reason for hiding this comment

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

💡 Overloads are preferred in order to make cancellationToken required on all paths

Copy link
Member Author

Choose a reason for hiding this comment

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

will do.

@CyrusNajmabadi
Copy link
Member Author

Closing out. Did not get QB approval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE OnDeckForServicing untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants