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

Add support for SqlConnectionOverrides for OpenAsync() API #2433

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

cheenamalhotra
Copy link
Member

@cheenamalhotra cheenamalhotra commented Mar 27, 2024

As the name suggests, introduces new API:

public Task SqlConnection.OpenAsync(SqlConnectionOverrides overrides, CancellationToken cancellationToken);

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 for OpenAsync() too.

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

Additional context:
dotnet/efcore#33399
#29

Copy link
Contributor

@mdaigle mdaigle 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 to not 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
@cheenamalhotra cheenamalhotra requested review from samsharma2700 and removed request for JRahnama October 5, 2024 08:11
@cheenamalhotra
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🆕 Public API Issues/PRs that introduce new APIs to the driver.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants