Skip to content

Fix CTRL-C stall issue. #10962

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

Merged
merged 3 commits into from
Aug 15, 2025
Merged

Fix CTRL-C stall issue. #10962

merged 3 commits into from
Aug 15, 2025

Conversation

mitchdenny
Copy link
Member

Fixes #10955

I need to do a bit more investigtation to figure out why task cancellation isn't unwinding the dotnet package search process faster but this fixes it on the calling side.

Putting this up so I can validate PR bits in a few different scenarios.

@Copilot Copilot AI review requested due to automatic review settings August 14, 2025 05:50
@mitchdenny mitchdenny self-assigned this Aug 14, 2025
Copy link
Contributor

@Copilot 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.

Pull Request Overview

This PR fixes a CTRL-C stall issue (#10955) where the CLI update notifier was preventing graceful cancellation when users attempted to interrupt the application. The changes implement a timeout-based cancellation strategy to avoid hanging on package search operations.

Key changes:

  • Implements early cancellation detection in the update notifier using TaskCompletionSource
  • Significantly reduces the update check timeout from 10 seconds to 100 milliseconds
  • Removes default parameter values from cancellation token parameters to ensure explicit cancellation handling

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Aspire.Cli/Utils/CliUpdateNotifier.cs Adds cancellation-aware logic using TaskCompletionSource and removes default cancellation token parameter
src/Aspire.Cli/Commands/BaseCommand.cs Reduces update notification timeout from 10 seconds to 100ms and removes default cancellation token parameter
Comments suppressed due to low confidence (1)

@mitchdenny mitchdenny added this to the 9.5 milestone Aug 14, 2025
@mitchdenny mitchdenny force-pushed the mitchdenny/fix-ctrl-c-stall branch from 8ad54c8 to 2864568 Compare August 15, 2025 13:37
@mitchdenny mitchdenny requested a review from davidfowl August 15, 2025 13:37
@davidfowl
Copy link
Member

Running aspire add then ctrl + c never shows me the update. Not a huge deal as run pretty much always works.

@davidfowl davidfowl merged commit 941237e into main Aug 15, 2025
576 of 578 checks passed
@davidfowl davidfowl deleted the mitchdenny/fix-ctrl-c-stall branch August 15, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aspire new stalls on CTRL-C
2 participants