Skip to content

Pull reading of last storage subsystem out of lock (part2)#73295

Merged
CyrusNajmabadi merged 19 commits intodotnet:mainfrom
CyrusNajmabadi:noDispose
May 2, 2024
Merged

Pull reading of last storage subsystem out of lock (part2)#73295
CyrusNajmabadi merged 19 commits intodotnet:mainfrom
CyrusNajmabadi:noDispose

Conversation

@CyrusNajmabadi
Copy link
Contributor

@CyrusNajmabadi CyrusNajmabadi commented May 1, 2024

Updates storage system to no longer be disposable.

@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels May 1, 2024
@CyrusNajmabadi CyrusNajmabadi changed the title Pull reading of last storage subsystem out of lock Pull reading of last storage subsystem out of lock (part2) May 1, 2024

private readonly string _solutionDirectory;

private readonly SQLiteConnectionPoolService _connectionPoolService;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

inlined this type. it really wasn't needed as a separate singleton type.

await PerformWriteAsync(_flushInMemoryDataToDisk, cancellationToken).ConfigureAwait(false);
}

private Task FlushWritesOnCloseAsync()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this intentionally went away. There is an ABWQ that is already flushign writes to disk. That will still continue working up until the point that the disposal token fires (which means VS is shutting down). We've always had the semantics that if we are shutting down, we strictly shut down, potentially losing some writes to disk (note: at worse we only ever lose writes in the las 0.5 seconds before shutdown).

Tthis is always safe to then skip. If we have any final writes, they'll either get flushed or not. If they do, great. If they don't, that's fine as well. That's because the persistent cache is only ever considered 'best effort'. 100% of featues taht use it can only use it as a place they try to store data into, but work 100% fine if those writes didn't happen. This will be detected the next tmie VS runs when a feature tries to erad the data, and simply goes "the data isn't htere, so i'll compute it".

ownershipLock.Dispose();
}

throw;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

so much complex disposable logic that goes away.

@CyrusNajmabadi CyrusNajmabadi marked this pull request as ready for review May 2, 2024 01:49
@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner May 2, 2024 01:49
@CyrusNajmabadi CyrusNajmabadi requested a review from ToddGrun May 2, 2024 01:58
@CyrusNajmabadi
Copy link
Contributor Author

@ToddGrun this is ready for review.

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 2, 2024 02:12
@CyrusNajmabadi CyrusNajmabadi merged commit d8f3b0b into dotnet:main May 2, 2024
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone May 2, 2024
@CyrusNajmabadi CyrusNajmabadi deleted the noDispose branch May 2, 2024 14:29
@CyrusNajmabadi
Copy link
Contributor Author

@jasonmalinowski For review when you get back.

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