-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Conversation
✅ Successfully linked to Azure Boards work item(s): |
src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticService.cs
Show resolved
Hide resolved
{ | ||
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⏱️ Switching to an enum
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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:
Line 24 in 3ab3ca7
source.DiagnosticsCleared += OnCleared; |
src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticService.cs
Outdated
Show resolved
Hide resolved
@CyrusNajmabadi thoughts on a for/against here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
cc798a4
to
a66eace
Compare
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.