Repository navigation
Work around license scan timeout by scanning source-build-assets serially - #7626
Conversation
…ally The license scan pipeline has been failing frequently with a timeout. scancode-toolkit 32.5.0 deadlocks its multiprocessing pool at the end of a scan on the large, text-heavy source-build-assets content, causing the job to hang past its timeout. Scan the affected content serially to avoid the deadlock: - Make the scancode --processes count pipeline-driven per matrix leg. An independent serialScanRepos list (source-build-assets) flows a process count of 0 through the matrix to the test, disabling scancode multiprocessing for those legs; all other repos use the test's default of 4. - Remove the '--memory=12g' container cap in eng/pipelines/vmr-license-scan.yml so the scan is no longer throttled to 12 GB of host memory. Co-authored-by: Copilot App <[email protected]>
There was a problem hiding this comment.
Pull request overview
Adjusts the VMR license-scan pipeline and corresponding test harness to avoid scancode hangs/timeouts when scanning source-build-assets, by making scancode parallelism configurable per matrix leg and removing container memory throttling.
Changes:
- Plumbs a pipeline-controlled
LicenseScanProcessCountintoMicrosoft.DotNet.SourceBuild.Testsvia runtime host configuration. - Updates
LicenseScanTeststo use a configurable scancode--processesvalue (defaulting to the prior behavior). - Removes the
--memory=12gcap from the license-scan container and extends the matrix generation to carry per-repo process counts.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/Microsoft.DotNet.SourceBuild.Tests/Microsoft.DotNet.SourceBuild.Tests.csproj | Adds a runtime config switch to pass the process count into tests. |
| test/Microsoft.DotNet.SourceBuild.Tests/LicenseScanTests.cs | Uses the configured scancode process count when invoking scancode. |
| test/Microsoft.DotNet.SourceBuild.Tests/Config.cs | Adds parsing for LicenseScanProcessCount from runtime config. |
| eng/pipelines/vmr-license-scan.yml | Removes container memory limit option. |
| eng/pipelines/templates/stages/vmr-license-scan.yml | Extends matrix to include per-repo process count and forwards it into dotnet test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ellahathaway
left a comment
There was a problem hiding this comment.
Do you have a test pipeline run for these changes? I'm curious about how long scanning takes with this fix.
https://dev.azure.com/dnceng/internal/_build/results?buildId=3017812&view=results |
The license scan pipeline has been failing frequently with a timeout. scancode deadlocks its multiprocessing pool at the end of a scan on the large, text-heavy source-build-assets content, causing the job to hang past its timeout.
Scan the affected content serially to avoid the deadlock:
--processescount pipeline-driven per matrix leg. An independentserialScanReposlist (source-build-assets) flows a process count of 0 through the matrix to the test, disabling scancode multiprocessing for those legs; all other repos use the test's default of 4.--memorycontainer cap invmr-license-scan.ymlso the scan is no longer memory-throttled.Fixes dotnet/source-build#5470