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

Use AsyncBatchingWorkQueue instead of TaskQueue #72425

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

sharwell
Copy link
Member

@sharwell sharwell commented Mar 6, 2024

This change was made during a review of AB#1949588. During the review, I failed to recognize a red herring in the automated analysis pipeline, which suggested that a high-hitting bug in 17.8 was still present in 17.9 and newer. In reality, the issue was already fixed for 17.9 Preview 1 by #70039, and internal analysis data confirms that there are no remaining known cases where DiagnosticService._eventQueue is consuming significant amounts of memory.

@sharwell sharwell requested a review from a team as a code owner March 6, 2024 20:59
@Pilchie
Copy link
Member

Pilchie commented Mar 6, 2024

✅ Successfully linked to Azure Boards work item(s):

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Mar 6, 2024
{
using var argsBuilder = TemporaryArray<DiagnosticsUpdatedArgs>.Empty;
// No work to do. Avoid adding an empty args collection to _eventQueue because that is used to represent
// an operation from RaiseDiagnosticsCleared.
Copy link
Member

Choose a reason for hiding this comment

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

is this the same logic we had preivously? trying to find it.

Copy link
Member

Choose a reason for hiding this comment

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

ok. i think i've wrapped my head around this. but i def find it confusing. could we instead enqueue this information as a boolean into the ABWQ instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

⏱️ Switching to an enum

Copy link
Member Author

Choose a reason for hiding this comment

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

➡️ Updated

// listener should have already created since all events are done in the serialized queue
ev.RaiseEvent(static (handler, arg) => handler(arg.source, arg.args), (source, args: argsBuilder.ToImmutableAndClear()));
}, CancellationToken.None);
private void RaiseDiagnosticsCleared(IDiagnosticUpdateSource source)
Copy link
Member

Choose a reason for hiding this comment

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

i'm not really understanding who is calling this.

Copy link
Member Author

@sharwell sharwell Mar 7, 2024

Choose a reason for hiding this comment

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

➡️ The caller is abstracted a few layers. There is an event hookup here:

@sharwell
Copy link
Member Author

sharwell commented Mar 11, 2024

@CyrusNajmabadi thoughts on a for/against here?

Copy link
Member

@CyrusNajmabadi CyrusNajmabadi left a comment

Choose a reason for hiding this comment

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

Lgtm

@sharwell sharwell enabled auto-merge March 11, 2024 15:09
@sharwell sharwell merged commit 0ed61bd into dotnet:main Mar 11, 2024
27 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Mar 11, 2024
@RikkiGibson RikkiGibson modified the milestones: Next, 17.10 P3 Mar 25, 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.

4 participants