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

Do not post fault telemetry for cancellation exceptions #6139

Merged
merged 3 commits into from
Dec 2, 2024

Conversation

jeffkl
Copy link
Contributor

@jeffkl jeffkl commented Nov 7, 2024

Bug

Fixes: https://github.com/NuGet/Client.Engineering/issues/3013

Description

Our code is posting fault telemetry for cancellations and it should not be. The PackageItemViewModel was assuming that HTTP timeouts were throwing a TaskCanceledException but that is not the case. In TimeoutUtility we detect a timeout and throw a TimeoutException instead:

throw new TimeoutException(timeoutMessage);

This change updates the view model based on my findings and blocks any OperationCancelledException from posting telemetry. Any code in the future where we want to post fault telemetry but its not really a cancellation should wrap the exception as something else like a TimeoutException.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@jeffkl jeffkl self-assigned this Nov 7, 2024
@jeffkl jeffkl requested a review from a team as a code owner November 7, 2024 17:07
dtivel
dtivel previously approved these changes Nov 7, 2024
@jeffkl jeffkl force-pushed the dev-jeffkl-do-not-post-fault-on-cancellation branch from 176ebae to 614d7ce Compare November 13, 2024 22:57
@jeffkl jeffkl changed the title Detect more conditions of cancellation in PackageItemViewModel to not post fault telemetry Do not post fault telemetry for cancellation exceptions Nov 13, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Status:No recent activity PRs that have not had any recent activity and will be closed if the label is not removed label Nov 25, 2024
@jeffkl jeffkl force-pushed the dev-jeffkl-do-not-post-fault-on-cancellation branch from 614d7ce to 1f39805 Compare December 2, 2024 18:20
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Status:No recent activity PRs that have not had any recent activity and will be closed if the label is not removed label Dec 2, 2024
@jeffkl
Copy link
Contributor Author

jeffkl commented Dec 2, 2024

I had to rebase, re-requesting reviews...

@jeffkl jeffkl requested a review from Nigusu-Allehu December 2, 2024 18:21
@jeffkl jeffkl merged commit 0dc2f25 into dev Dec 2, 2024
23 checks passed
@jeffkl jeffkl deleted the dev-jeffkl-do-not-post-fault-on-cancellation branch December 2, 2024 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants