-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
Priority:2Work that is important, but not critical for the releaseWork that is important, but not critical for the releasetriaged
Description
Context
Inspired by: https://stackoverflow.microsoft.com/questions/394371
Experience of having a task experiencing OOM:
Build FAILED.
0 Warning(s)
0 Error(s)
Time Elapsed 00:19:29.61
MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Text.StringBuilder.ToString()
at System.IO.StringWriter.ToString()
at Newtonsoft.Json.Linq.JToken.ToString(Formatting formatting, JsonConverter[] converters)
at Microsoft.Portal.Framework.ContentPackageGenerator.ContentPackageWriter.WriteDocument[T](PackageEntryPath documentPath, T newDocument, T existingDocument)
at Microsoft.Portal.Framework.ContentPackageGenerator.ContentPackageWriter.WriteProjectsDocument(EffectiveContentPackageProject projects)
at Microsoft.Portal.Framework.ContentPackageGenerator.PopulatePackage(ContentPackageWriter contentPackage)
at Microsoft.Portal.Framework.ContentPackageGenerator.GeneratePackage(IContentStore contentStore, Action`2 logger)
at Microsoft.Portal.Framework.GenerateContentPackageCore.Generate(ContentPackageGeneratorParameters parameters, Action`2 logger)
at Microsoft.Portal.Pdc.Core.DxBuild.GenerateContentPackage(DxBuildArgs args, ITaskLoggingHelper loggingHelper, String ContentPackageProjectFileWriterResult)
at Microsoft.Portal.Pdc.Core.DxBuild.Compile(DxBuildArgs args, ITaskLoggingHelper loggingHelper)
at Microsoft.Portal.Pdc.Core.DxBuildTask.ExecuteCore()
at Microsoft.Portal.Framework.PortalTaskBase.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
Experience of a task experiencing 'traditional exception':
error MSB4018: The "TaskThatReturnsDictionaryTaskItem" task failed unexpectedly.
This is an unhandled exception from a task -- PLEASE OPEN A BUG AGAINST THE TASK OWNER.
System.Exception: Hello there!
at Microsoft.Build.Engine.UnitTests.TaskThatReturnsDictionaryTaskItem.Execute() in C:\src\msbuild\src\Build.UnitTests\BackEnd\TaskThatReturnsDictionaryTaskItem.cs:line 24
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() in C:\src\msbuild\src\Build\BackEnd\TaskExecutionHost\TaskExecutionHost.cs:line 561
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() in C:\src\msbuild\src\Build\BackEnd\Components\RequestBuilder\TaskBuilder.cs:line 813
Done executing task "TaskThatReturnsDictionaryTaskItem" -- FAILED.
Done building target "Build" in project "Temporary45a7acefae06435d83657c9bcf06a0df.csproj" -- FAILED.
Done building project "Temporary45a7acefae06435d83657c9bcf06a0df.csproj" -- FAILED.
Build FAILED.
The case 2 is much more informative and actionable
Repro steps
- Edit
TaskThatReturnsDictionaryTaskItem - Add
throw new Exception("Hello there!");into the Execute() method - Execute/Debug one of the unit tests in
TaskExecutionHost_Tests(e.g.TestTaskDictionaryOutputItems) - Change the exception in Execution method to
OutOfMemoryException - Execute the test again and compare log outputs
Details
We handle OOM with special care (see
| if (ExceptionHandling.IsCriticalException(ex)) |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Priority:2Work that is important, but not critical for the releaseWork that is important, but not critical for the releasetriaged