-
Notifications
You must be signed in to change notification settings - Fork 312
Add try-catch and ensure task exception is set in SqlCommand #3202
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
Conversation
rework retry to avoid lambda capture
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See question about exception loss.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3202 +/- ##
==========================================
- Coverage 72.83% 66.03% -6.80%
==========================================
Files 288 282 -6
Lines 59263 59240 -23
==========================================
- Hits 43162 39121 -4041
- Misses 16101 20119 +4018
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fixes #3067
Adds a try-catch block around getting a connection which can fail. This change ensures that the task completion source that tasks are waiting on is signalled.
Also found a trivial continue that was capturing the tcs so I changed it to static and passed the tcs as state avoiding the lambda capture.