Skip to content

Keep accepted sockets alive in TlsSession tests - #131857

Merged
wfurt merged 1 commit into
dotnet:mainfrom
wfurt:fix-tls-session-socket-lifetime
Aug 5, 2026
Merged

wfurt merged 1 commit into
dotnet:mainfrom
wfurt:fix-tls-session-socket-lifetime

Conversation

@wfurt

@wfurt wfurt commented Aug 5, 2026

Copy link
Copy Markdown
Member

Addresses #131798

Keep each accepted server Socket alive and deterministically disposed for the full lifetime of the corresponding socket-bound TlsSocketSession. The declaration order ensures the session releases its ownership first, followed by the original socket wrapper.

This applies the ownership pattern consistently to all eight socket-bound test cases. The intermittent macOS reset was not reproduced locally, so this change hardens the suspected lifetime issue without claiming a locally confirmed reproduction.

Validation:

Note

This pull request description was generated with GitHub Copilot.

Copilot AI review requested due to automatic review settings August 5, 2026 08:03
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@wfurt
wfurt requested a review from a team August 5, 2026 08:04
@wfurt wfurt added this to the 11.0.0 milestone Aug 5, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/ncl, @bartonjs, @vcsjones
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates TlsSessionTests to ensure accepted server sockets are kept alive and deterministically disposed for the lifetime of the corresponding socket-bound TlsSocketSession, by making the accepted serverSocket a using declaration in each affected test.

Changes:

  • Convert the accepted server Socket in socket-bound TlsSession test cases to using Socket serverSocket = await listener.AcceptAsync();.
  • Apply the same lifetime/cleanup pattern consistently across the eight socket-bound test cases in this file.

@wfurt

wfurt commented Aug 5, 2026

Copy link
Copy Markdown
Member Author

/ba-g test failures unrelated.

@wfurt
wfurt merged commit dfe2ba4 into dotnet:main Aug 5, 2026
85 of 87 checks passed
@wfurt
wfurt deleted the fix-tls-session-socket-lifetime branch August 5, 2026 11:47
@dotnet-milestone-bot dotnet-milestone-bot Bot modified the milestones: 11.0.0, 11.0-rc1 Aug 6, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants