Skip to content

Conversation

@adamsitnik
Copy link
Member

@adamsitnik adamsitnik commented Aug 28, 2025

Customer Impact

The preview 7 and later releases of System.CommandLine included an API change that resulted in default cancellation behaviors for System.CommandLine-based applications changing. in preview6 and earlier, the library was configured so that Ctrl+C would cause a System.OperationCanceledException to be thrown, giving user code a simple hook to catch and react to that. Preview 7 and later dropped this behavior unintentionally, causing some users to report that their cleanup/cancellation code was no longer being triggered.

How was it found

An external user, @mpatkisson, discovered the issue, did detailed investigation and analysis in #2671, and then contributed a fix in #2672.

Risk

Low. The existing cancellation mechanisms in use are under test, but we did not have a test that covers the documented 2s cancellation default behavior, to ensure we didn't regress it. This has been manually tested, and we will shortly add a test to the repo to prevent regressions.

Co-authored-by: Michael Atkisson <mpatkisson@triptacular.com>
@adamsitnik adamsitnik requested a review from ViktorHofer August 28, 2025 10:01
@ViktorHofer ViktorHofer changed the title Backport bug fix to the 10.0-rc1 branch Backport bug fix to the 10.0 branch Aug 28, 2025
@jeffhandley jeffhandley requested a review from artl93 August 28, 2025 14:41
@adamsitnik
Copy link
Member Author

@artl93 I would like to backport this simple bug fix to 10 RC2. To tell the long story short we have removed the default timeout in Preview 7 and this PR is adding it back.

@baronfel baronfel added the servicing-consider Requested review by .NET Tactics label Aug 28, 2025
@jeffhandley jeffhandley changed the title Backport bug fix to the 10.0 branch [release/10.0] Re-add default value on ProcessTerminationTimeout Aug 29, 2025
@jeffhandley jeffhandley added servicing-approved .NET Tactics has approved of this change and removed servicing-consider Requested review by .NET Tactics labels Aug 29, 2025
@jeffhandley jeffhandley merged commit 8348c0d into dotnet:release/10.0 Aug 29, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

servicing-approved .NET Tactics has approved of this change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants