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

Properly dispose the SymbolSearchEngine #73464

Merged
merged 2 commits into from
May 14, 2024

Conversation

CyrusNajmabadi
Copy link
Member

Noticed while investigating post-VS shutdown issues with Dave.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner May 14, 2024 03:50
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels May 14, 2024
@CyrusNajmabadi CyrusNajmabadi requested a review from ToddGrun May 14, 2024 03:50
public void Dispose()
{
// Nothing to do for the no-op version.
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: the actual Dispose we care about already exists, but is currently not called through any codepaths. It is here:

What thsi PR does is hook things up to ensure that it is called. To ensure that we actually dispose the RemoteServiceConnection instance we're holding onto.

@CyrusNajmabadi
Copy link
Member Author

@ToddGrun ptal

_lazyUpdateEngine = SymbolSearchUpdateNoOpEngine.Instance;
}

updateEngine?.Dispose();
Copy link
Member Author

Choose a reason for hiding this comment

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

needed so this searc-service release the underlying ISymbolSearchUpdateEngine, which will release the connection we have with the oop server.

public void Dispose()
{
ISymbolSearchUpdateEngine? updateEngine;
using (_gate.DisposableWait())
Copy link
Contributor

Choose a reason for hiding this comment

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

using (_gate.DisposableWait())

This could block during MEF disposal right? That doesn't seem great.

Copy link
Member Author

Choose a reason for hiding this comment

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

indeed.

Copy link
Contributor

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

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

:shipit:

@CyrusNajmabadi CyrusNajmabadi enabled auto-merge May 14, 2024 18:15
@CyrusNajmabadi CyrusNajmabadi merged commit cd8d28f into dotnet:main May 14, 2024
25 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone May 14, 2024
@CyrusNajmabadi CyrusNajmabadi deleted the properDispose branch May 14, 2024 22:14
@Cosifne Cosifne modified the milestones: Next, 17.11 P2 May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE 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