Skip to content

[release/13.4] Fix TypeScript AppHost async callback deadlock#17689

Merged
joperezr merged 1 commit into
release/13.4from
backport/pr-17575-to-release/13.4
May 29, 2026
Merged

[release/13.4] Fix TypeScript AppHost async callback deadlock#17689
joperezr merged 1 commit into
release/13.4from
backport/pr-17575-to-release/13.4

Conversation

@aspire-repo-bot
Copy link
Copy Markdown
Contributor

Backport of #17575 to release/13.4

/cc @sebastienros @IEvangelist

Customer Impact

Testing

Risk

Regression?

Run the exported DistributedApplication.RunAsync capability on a background thread so startup callbacks invoked before the first await do not block StreamJsonRpc's non-concurrent synchronization context.

Add an end-to-end TypeScript AppHost regression that recreates the lazy IOptions.Configure async callback pattern from #17487.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 29, 2026 21:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@github-actions
Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 17689

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17689"

@sebastienros sebastienros added this to the 13.4 milestone May 29, 2026
@sebastienros sebastienros added the Servicing-consider Issue for next servicing release review label May 29, 2026
@joperezr joperezr merged commit 6c9c5e8 into release/13.4 May 29, 2026
31 of 36 checks passed
@joperezr joperezr deleted the backport/pr-17575-to-release/13.4 branch May 29, 2026 22:09
@microsoft-github-policy-service microsoft-github-policy-service Bot modified the milestone: 13.4 May 29, 2026
@aspire-repo-bot
Copy link
Copy Markdown
Contributor Author

✅ No documentation update needed.

docs_optional → bug_fix_restores_documented_behavior

No gating signals fired (signal_count = 0, recommendation = docs_optional).

The only source change is a single-line fix in src/Aspire.Hosting/DistributedApplication.cs adding RunSyncOnBackgroundThread = true to the [AspireExport("run")] attribute, which resolves a deadlock when TypeScript AppHosts use async callbacks via lazy IOptions.Configure during BeforeStartEvent. The documented/expected behavior — that await builder.build().run() completes successfully — is restored by this fix. The second changed file is a regression test under tests/. No new public API, CLI flags, configuration keys, or user-facing options were introduced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Servicing-consider Issue for next servicing release review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants