microsoft / microsoft/json-document-transforms
Concurrent transforms with the same source and/or transform file can fail
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 115
- Forks
- 39
- PR merge metrics
- No merged PRs in 30d
Description
When using slow cheetah to transform json files we discovered that the transforms would fail intermittently. This was particularly frequent when building a project targeting multiple frameworks (net461 and netcore2.1 in this instance). The parallel build behaviour of msbuild meant it would regularly attempt to perform the same transforms at the same time (once for each target framework).
This would result in msbuild output similar to:
[17:52:50] [Step 6/12] 2>UpdateLocalAppSettings:
[17:52:50] [Step 6/12] Beginning transformation.
[17:52:50] [Step 6/12] 15>UpdateLocalAppSettings:
[17:52:50] [Step 6/12] Beginning transformation.
[17:52:50] [Step 6/12] Transformation failed.
This seems to be caused by the source file being opened with exclusive access for the duration of the transform. The files need to be opened with a FileShare mode of Read to allow concurrent transformations.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the code that opens the source and transform files during JSON transformation, then inspect how parallel MSBuild executions share those handles. Reproduce the issue with a multi-target parallel build and verify that concurrent transformations complete without intermittent failures when files permit shared reads.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100