Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add support for SqlConnectionOverrides for OpenAsync() API#2433

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

cheenamalhotra
Copy link
Member

@cheenamalhotracheenamalhotra commentedMar 27, 2024
edited
Loading

As the name suggests, introduces new API:

publicTaskSqlConnection.OpenAsync(SqlConnectionOverridesoverrides,CancellationTokencancellationToken);

Previously, we skipped addiing overrides to OpenAsync in PR#463 due to no transient fault handling, but with recent PR#1983 we now enable transient fault handling by default forOpenAsync() too.

To support fail fast behavior in OpenAsync(), we need to allow passingSqlConnectionOverrides inOpenAsync() too.

Additional context:
dotnet/efcore#33399
#29

roji reacted with thumbs up emojiErikEJ reacted with heart emoji
Copy link
Contributor

@mdaiglemdaigle left a comment

Choose a reason for hiding this comment

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

Based on my current understanding, the existing default is tonot apply transient fault handling for OpenAsync. This changes the default to applying transient fault handling.

It seems like there are two options if we want to make a change now:

  1. modify this change to retain the current default behavior
  2. do this change, but only apply it on a new (major?) version

However, given what we've learned about the slow, serial nature of OpenAsync, part of me feels like we should wait to do this change until general async performance is improved.

I would advocate for waiting.

@DavoudEshtehari
Copy link
Contributor

@cheenamalhotra Could you wrap this up for the preview 1 with the outstanding comments? Generally, this looks good to me and I'd rather not pushing it to the next preview.

# Conflicts:#doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml
@cheenamalhotracheenamalhotra requested review fromsamsharma2700 and removed request forJRahnamaOctober 5, 2024 08:11
@cheenamalhotra
Copy link
MemberAuthor

/azp run

@azure-pipelinesAzure Pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -99,6 +99,9 @@ override protected DbConnectionInternal CreateConnection(DbConnectionOptions opt
// NOTE: Retrieve <UserInstanceName> here. This user instance name will be used below to connect to the Sql Express User Instance.
instanceName = sseConnection.InstanceName;

// Set future transient fault handling based on connection options
sqlOwningConnection._applyTransientFaultHandling = opt != null && opt.ConnectRetryCount > 0;
Copy link
MemberAuthor

@cheenamalhotracheenamalhotraNov 15, 2024
edited
Loading

Choose a reason for hiding this comment

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

This had to be moved here as in async flow, connection attempt happens on another thread and the value gets reset very quickly to be captured again when retry is attempted. So fail fast wasn't really working. This change makes sure the value gets reset after the login flow is complete.

cc@David-Engel for second set of eyes

David-Engel reacted with thumbs up emoji
@codecovCodecov
Copy link

codecovbot commentedNov 15, 2024
edited
Loading

Codecov Report

Attention: Patch coverage is90.00000% with2 lines in your changes missing coverage. Please review.

Project coverage is 72.44%. Comparing base(7ec6310) to head(906fa0f).
Report is 3 commits behind head on main.

Files with missing linesPatch %Lines
...c/Microsoft/Data/SqlClient/SqlConnectionFactory.cs0.00%1 Missing⚠️
...c/Microsoft/Data/SqlClient/SqlConnectionFactory.cs0.00%1 Missing⚠️
Additional details and impacted files
@@            Coverage Diff             @@##             main    #2433      +/-   ##==========================================- Coverage   72.48%   72.44%   -0.04%==========================================  Files         288      288                Lines       59493    59497       +4     ==========================================- Hits        43122    43104      -18- Misses      16371    16393      +22
FlagCoverage Δ
addons92.58% <ø> (ø)
netcore75.37% <90.00%> (-0.04%)⬇️
netfx70.92% <90.00%> (+<0.01%)⬆️

Flags with carried forward coverage won't be shown.Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

@cheenamalhotracheenamalhotra merged commit59dcb78 intodotnet:mainNov 15, 2024
76 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@DavoudEshtehariDavoudEshtehariDavoudEshtehari left review comments

@mdaiglemdaiglemdaigle approved these changes

@David-EngelDavid-EngelDavid-Engel approved these changes

@benrr101benrr101Awaiting requested review from benrr101

@samsharma2700samsharma2700Awaiting requested review from samsharma2700

Assignees
No one assigned
Labels
Public API 🆕Issues/PRs that introduce new APIs to the driver.
Projects
None yet
Milestone
6.0-preview3
Development

Successfully merging this pull request may close these issues.

4 participants
@cheenamalhotra@DavoudEshtehari@mdaigle@David-Engel

[8]ページ先頭

©2009-2025 Movatter.jp