Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing constraint from templates to avoid SDK multithreading issue #4176

Merged
merged 1 commit into from
May 15, 2024

Conversation

joperezr
Copy link
Member

@joperezr joperezr commented May 14, 2024

Works around #4145.

@dsplaisted has done a full diagnosis of the issue here, but the TL;DR is that there seems to be a multi-threading issue inside the SDK, particularly in their logic that tries to check for installed workloads. Aspire templates today have a constraint to show these templates only when the aspire workload is installed, which is technically unrequired as the templates get installed via the workload anyway. By adding this constraint, we are forcing the piece of code in the SDK with the race condition, which will make it so that around 50% of the time, aspire template creation will fail. The SDK team will fix this bug in servicing, but in the meantime we are working around the bug by removing the unnecessary constraint from our templates.

We expect a lot of people will hit this issue (essentially anyone creating aspire projects from the command line), so we'll want to service this to 8.0.1 release. (FYI: @danmoseley )

cc: @DamianEdwards @phenning

Microsoft Reviewers: Open in CodeFlow

Copy link
Contributor

@phenning phenning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. As long as we aren't expecting customers to install templates directly from dotnet new, which I don't believe is the case. Worse case there is that the created template may not function as intended.

@joperezr joperezr merged commit 756dfe6 into dotnet:main May 15, 2024
8 checks passed
@joperezr
Copy link
Member Author

/backport to release/8.0

Copy link
Contributor

Started backporting to release/8.0: https://github.com/dotnet/aspire/actions/runs/9089407386

Copy link
Contributor

@joperezr backporting to release/8.0 failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: Removing constraint from templates to avoid SDK multithreading issue
Using index info to reconstruct a base tree...
A	src/Aspire.ProjectTemplates/templates/aspire-mstest/.template.config/template.json
A	src/Aspire.ProjectTemplates/templates/aspire-nunit/.template.config/template.json
M	src/Aspire.ProjectTemplates/templates/aspire-starter/.template.config/template.json
M	src/Aspire.ProjectTemplates/templates/aspire-xunit/.template.config/template.json
Falling back to patching base and 3-way merge...
Auto-merging src/Aspire.ProjectTemplates/templates/aspire-xunit/.template.config/template.json
CONFLICT (content): Merge conflict in src/Aspire.ProjectTemplates/templates/aspire-xunit/.template.config/template.json
Auto-merging src/Aspire.ProjectTemplates/templates/aspire-starter/.template.config/template.json
CONFLICT (modify/delete): src/Aspire.ProjectTemplates/templates/aspire-nunit/.template.config/template.json deleted in HEAD and modified in Removing constraint from templates to avoid SDK multithreading issue. Version Removing constraint from templates to avoid SDK multithreading issue of src/Aspire.ProjectTemplates/templates/aspire-nunit/.template.config/template.json left in tree.
CONFLICT (modify/delete): src/Aspire.ProjectTemplates/templates/aspire-mstest/.template.config/template.json deleted in HEAD and modified in Removing constraint from templates to avoid SDK multithreading issue. Version Removing constraint from templates to avoid SDK multithreading issue of src/Aspire.ProjectTemplates/templates/aspire-mstest/.template.config/template.json left in tree.
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Removing constraint from templates to avoid SDK multithreading issue
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

Copy link
Contributor

@joperezr an error occurred while backporting to release/8.0, please check the run log for details!

Error: git am failed, most likely due to a merge conflict.

@joperezr joperezr deleted the RemoveTemplateConstraint branch May 16, 2024 20:59
@github-actions github-actions bot locked and limited conversation to collaborators Jun 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants