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

Dev | Improved connection timeout #2098

Merged
merged 6 commits into from Aug 22, 2023

Conversation

DavoudEshtehari
Copy link
Member

@DavoudEshtehari DavoudEshtehari commented Jul 21, 2023

  • Improved the connection timeout accuracy, by involving the IP address resolution and socket connection retry process on Managed SNI.
  • Expanded using the timeout timer on managed code.
  • Improved connection timeout tests.

@DavoudEshtehari DavoudEshtehari added the ✔️ Tests Identifier for test related changes label Jul 21, 2023
@DavoudEshtehari DavoudEshtehari added this to the 5.2.0-preview4 milestone Jul 21, 2023
@codecov
Copy link

codecov bot commented Jul 22, 2023

Codecov Report

Patch coverage: 66.66% and project coverage change: -0.07% ⚠️

Comparison is base (610a2c2) 70.98% compared to head (4b1e43e) 70.92%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2098      +/-   ##
==========================================
- Coverage   70.98%   70.92%   -0.07%     
==========================================
  Files         305      305              
  Lines       61818    61844      +26     
==========================================
- Hits        43884    43864      -20     
- Misses      17934    17980      +46     
Flag Coverage Δ
addons 92.88% <ø> (ø)
netcore 73.39% <62.10%> (-0.13%) ⬇️
netfx 69.72% <91.30%> (+<0.01%) ⬆️

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

Files Changed Coverage Δ
...oft/Data/SqlClient/TdsParserStateObject.netcore.cs 80.47% <ø> (-0.11%) ⬇️
...re/src/Microsoft/Data/SqlClient/SNI/SNINpHandle.cs 7.81% <6.66%> (-0.39%) ⬇️
...e/src/Microsoft/Data/SqlClient/SNI/SNITcpHandle.cs 63.01% <55.26%> (-0.40%) ⬇️
.../netcore/src/Microsoft/Data/SqlClient/TdsParser.cs 68.28% <66.66%> (-0.39%) ⬇️
...nt/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs 71.06% <66.66%> (+0.03%) ⬆️
...t/netcore/src/Microsoft/Data/SqlClient/SNI/SSRP.cs 50.92% <80.00%> (-0.60%) ⬇️
...nt/src/Microsoft/Data/ProviderBase/TimeoutTimer.cs 83.78% <88.88%> (+1.64%) ⬆️
...core/src/Microsoft/Data/SqlClient/SNI/SNICommon.cs 56.66% <100.00%> (+1.53%) ⬆️
...tcore/src/Microsoft/Data/SqlClient/SNI/SNIProxy.cs 49.46% <100.00%> (ø)
...crosoft/Data/SqlClient/SqlInternalConnectionTds.cs 73.42% <100.00%> (+0.09%) ⬆️
... and 5 more

... and 6 files with indirect coverage changes

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

@DavoudEshtehari DavoudEshtehari added Ⓜ️ Managed SNI Use this label if the issue/PR relates to issues in Managed SNI and removed ✔️ Tests Identifier for test related changes labels Jul 28, 2023
@DavoudEshtehari DavoudEshtehari changed the title Test | Improved the connection timeout tests Fix | Improved the connection timeout on Managed SNI Jul 28, 2023
@David-Engel
Copy link
Contributor

David-Engel commented Aug 1, 2023

Similar to the suggestion I made on the localdb PR, the managed SNI code would benefit from being passed the TimeoutTimer object. The long timerExpire in SNITcpHandle now came from one from a parent caller. You can use the MillisecondsRemaining method on the TimeoutTimer object to easily create the appropriate TimeSpan that you want to pass in as a timeout to .NET methods. And the IsExpired property can be used in the logic when you want to decide to throw instead of retry.

@DavoudEshtehari DavoudEshtehari changed the title Fix | Improved the connection timeout on Managed SNI Fix | Improved the connection timeout Aug 2, 2023
@DavoudEshtehari DavoudEshtehari added 💡 Enhancement New feature request and removed Ⓜ️ Managed SNI Use this label if the issue/PR relates to issues in Managed SNI labels Aug 2, 2023
@DavoudEshtehari DavoudEshtehari changed the title Fix | Improved the connection timeout Dev | Improved connection timeout Aug 2, 2023
Co-authored-by: David Engel <dengel1012@gmail.com>
@JRahnama JRahnama merged commit 591d929 into dotnet:main Aug 22, 2023
132 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 Enhancement New feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants