Repository navigation
Fix evaluation logging for multi-proc builds - #2748
Conversation
|
Great find! This explain this issue my users have been reporting: |
| int submissionId = reader.ReadInt32(); | ||
| int projectInstanceId = reader.ReadInt32(); | ||
| buildEventContext = new BuildEventContext(submissionId, nodeId, projectInstanceId, projectContextId, targetId, taskId); | ||
| int evaluationId = reader.ReadInt32(); |
There was a problem hiding this comment.
For back compat, you should bump up the format version number, and read the new value only when the format version is greater than or equal the new version value.
There was a problem hiding this comment.
This is binary serialization which looks like the version number is derived from the CLR version. It looks like I shouldn't mess with that?
There was a problem hiding this comment.
You're right. I had confused this with the binary logging serialization, but that one's not affected by this PR.
|
ProjectInstance.Initialize has some postconditions that an evaluation ID should have been assigned. Can you please add the equivalent for Project.Reevaluate as well? |
|
Can you please add a test for the out of proc case? You can use this test as an example. |
|
@cdmihai I pushed changes, can you take a look? |
| var result = submission.Execute(); | ||
|
|
||
| Assert.Equal(BuildResultCode.Success, result.OverallResult); | ||
| Assert.True(_logger.AllBuildEvents.OfType<ProjectEvaluationStartedEventArgs>().GroupBy(args => args.BuildEventContext.EvaluationId).All(g => g.Count() == 1)); |
There was a problem hiding this comment.
You should also assert that there are exactly two groups, right? There should have been two evaluations, each with a different evaluations ID
There was a problem hiding this comment.
Looks like this is failing on .net core. Can you please take a look? Ping me if you need another set of eyes on it.
There was a problem hiding this comment.
@cdmihai What is the best way to debug a CoreCLR test? I see how to build it but not sure the easiest way to get it under the debugger.
There was a problem hiding this comment.
Nevermind, looked at the docs and figured it out. I think I've fixed the bug.
|
@dotnet-bot test Windows_NT Build for CoreCLR please |
|
@cdmihai Looks like everything is green, what do you think? |
| var result = submission.Execute(); | ||
|
|
||
| Assert.Equal(BuildResultCode.Success, result.OverallResult); | ||
| Assert.True(_logger.AllBuildEvents.OfType<ProjectEvaluationStartedEventArgs>().GroupBy(args => args.BuildEventContext.EvaluationId).All(g => g.Count() == 1)); |
There was a problem hiding this comment.
Can you also assert there's two groups (to make sure that two IDs got produced)? Or better yet, instead of grouping, assert that there are exactly two evaluation ids, and they're different values.
cdmihai
left a comment
There was a problem hiding this comment.
LGTM, with a testing nit suggestion.
|
@dotnet-bot test Windows_NT Build for CoreCLR please |
|
@panopticoncentral Added a merge commit, hopefully it's correct? |
|
👍 |
|
Thanks! |
CPS expects Project.LastEvaluationId to reflect the id of the ongoing, not yet finished evaluation. This invariant regressed in dotnet#2748 LoggingService now creates an evaluation build event context separate from sending project started events. This allows the Evaluator to set the evaluation Id on Project before the first evaluation event gets fired.
CPS expects Project.LastEvaluationId to reflect the id of the ongoing, not yet finished evaluation. This invariant regressed in #2748 LoggingService now creates an evaluation build event context separate from sending project started events. This allows the Evaluator to set the evaluation Id on Project before the first evaluation event gets fired.
CPS expects Project.LastEvaluationId to reflect the id of the ongoing, not yet finished evaluation. This invariant regressed in dotnet#2748 LoggingService now creates an evaluation build event context separate from sending project started events. This allows the Evaluator to set the evaluation Id on Project before the first evaluation event gets fired.
When working on a build log viewer, I noticed that there are two issues with evaluation log events in multi-proc builds:
I know there are a lot of considerations around this, so let me know if something looks wrong about what I've done.
cc: @KirillOsenkov