Skip to content

[8.0.0 Cherry-pick] Don't wait in SniTcpHandle.CheckConnection - #5099

Merged
mdaigle merged 1 commit into
release/8.0from
dev/automation/pr-5071-to-8.0.0
Nov 17, 2026
Merged

mdaigle merged 1 commit into
release/8.0from
dev/automation/pr-5071-to-8.0.0

Conversation

@github-actions

Copy link
Copy Markdown

Cherry-pick of #5071 (c58251e) into release/8.0.

* Don't wait in SniTcpHandle.CheckConnection

The liveness check polled the socket with a 100 µs timeout. On a healthy,
idle connection the poll waits the whole timeout, and Windows rounds it up
to the system timer tick (15.6 ms by default), so every open from the pool
over TCP with the managed network layer cost about 15 ms once the
connection had been idle longer than CheckConnectionWindow.

A connection closed by the peer is already readable, so a zero timeout
detects it just the same; SelectRead and the Available check stay as they
were for Linux.

* Measure an idle pooled checkout as a benchmark instead of a unit test

The liveness probe runs only on a connection that has been idle for more
than 5 ms, and a successful probe restarts that window, so the churn
runner probes at most one checkout in every 5 ms and averages its cost
away. ConnectionPoolIdleCheckoutRunner leaves a one-connection pool idle
for 10 ms outside the measurement, then times a single open, sync and
async, so every measured checkout pays for the probe. With managed SNI on
Windows it reads about 13.5 ms per checkout with Poll(100) and about
0.2 ms with Poll(0).

The timing assertion leaves the unit tests, which keep the peer-closed case.

* Explain the zero poll timeout as a best-effort health snapshot

---------

Co-authored-by: Rocco Panunzio <222559735+RoccoPanunzio@users.noreply.github.com>
@github-actions github-actions Bot added this to the 8.0.0 milestone Nov 17, 2026
@github-actions
github-actions Bot requested a review from a team as a code owner November 17, 2026 19:42
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Nov 17, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@mdaigle

mdaigle commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

/azp run

@mdaigle
mdaigle enabled auto-merge (squash) November 17, 2026 20:22
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
2 pipeline(s) were filtered out due to trigger conditions.

@mdaigle
mdaigle merged commit 3538773 into release/8.0 Nov 17, 2026
38 checks passed
@mdaigle
mdaigle deleted the dev/automation/pr-5071-to-8.0.0 branch November 17, 2026 21:16
@github-project-automation github-project-automation Bot moved this from To triage to Done in SqlClient Board Nov 17, 2026
@codecov

codecov Bot commented Nov 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.96%. Comparing base (463a45c) to head (d73bc0f).
⚠️ Report is 12 commits behind head on release/8.0.

Additional details and impacted files
@@               Coverage Diff               @@
##           release/8.0    #5099      +/-   ##
===============================================
+ Coverage        68.97%   69.96%   +0.99%     
===============================================
  Files              314      313       -1     
  Lines            45857    69736   +23879     
===============================================
+ Hits             31629    48790   +17161     
- Misses           14228    20946    +6718     
Flag Coverage Δ
CI-SqlClient ?
sqlclient-pr 69.96% <100.00%> (?)

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

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mdaigle mdaigle mentioned this pull request Nov 18, 2026
3 of 4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants