Fix forwarding logger regression: RegisterDistributedLoggerCore skips forwarding logger when central logger is a ReusableLogger (#14237) - #14282
#14282Fix forwarding logger regression: RegisterDistributedLoggerCore skips forwarding logger when central logger is a ReusableLogger (#14237)#14282AlesProkop merged 6 commits intocopilot/fix-forwarding-logger-issuedotnet/msbuild:copilot/fix-forwarding-logger-issuefrom copilot/investigate-forwarding-logger-regression-14237dotnet/msbuild:copilot/investigate-forwarding-logger-regression-14237Copy head branch name to clipboard
Conversation
|
Hello @copilot, I noticed that you’re changing an .swr file or any file under src/Package/MSBuild.VSSetup.. Please make sure to validate this change by an experimental VS insertion. This is accomplished by pushing to an exp/* branch, which requires write permissions to this repo. |
…ready wrapped in ReusableLogger Co-authored-by: AlesProkop <276576870+AlesProkop@users.noreply.github.com>
Review — PR #14282 · 2 files, +55/−8Methodology: portable core + dotnet/msbuild expert-reviewer · 24/24 dimensions evaluated Verdict: 🟡 COMMENT — address findings — 0 blocking, 0 major, 2 moderate, 2 nit · 20 of 24 evaluated dimensions clean I verified the central claim by tracing the code at the PR head:
|
|
@AlesProkop the logger routing issue brought up by the expert review is definitely a thing that we need to actually fix/address |
Expert review — PR #14282 current head
|
Expert review - PR #14282 current head
|
|
@baronfel Could you re-review please? |
|
@AlesProkop Thanks for the fix, interesting to see the AI integration on a non-trivial issue and repository. Is there a schedule in which release the changes would be shipped? We're working around the issue by just using a central logger and doing the filtering there, but that has a non-negligible overhead for our large parallel builds. |
JanProvaznik
left a comment
There was a problem hiding this comment.
I trust that this fixes the reported bug, it's not the cleanest abstraction, but I haven't found a better one.
the comments in the PR are unhelpfully verbose. pls make them to the point and move the details to the issue
@danstur This should be shipped in the September VS feature update. |
1f7ebd8
into
copilot/fix-forwarding-logger-issue
Fixes #14237
Context
Commit
b6f853defcbegan registering distributed central loggers for evaluation. Those loggers later reachLoggingService.RegisterDistributedLoggerCorebehindReusableLoggerwrappers, causing the duplicate check to skip the entire distributed registration before its forwarding logger was initialized. The regression first shipped in MSBuild 18.0.2 and is not present in 17.x.Changes Made
LoggingService.RegisterDistributedLoggerCoreto reuse a pre-registeredReusableLoggerwithout reinitializing its wrapped logger.ReusableLogger.RerouteActiveEventSourceto move the wrapped logger's subscriptions to the forwarding logger's dedicated sink, preserving forwarding filters and preventing duplicate delivery.Testing
RegisterDistributedLogger_WhenCentralLoggerAlreadyWrappedInReusableLogger_ForwardingLoggerIsRegisteredto verify that the forwarding logger is initialized and registered.RegisterDistributedLogger_WhenCentralLoggerAlreadyWrapped_HonorsForwardingLoggerFilteringto verify that only forwarded events are delivered, exactly once.RegisterDistributedLogger_DuplicateCentralViaReusableWrapper_SecondRegistrationRejectedto verify that duplicate registration is rejected without disconnecting the first sink.