Skip to content

Fix platform-specific TCP keep-alive issues#3090

Merged
mgravell merged 11 commits into
mainfrom
marc/keep-alive-fix
May 27, 2026
Merged

Fix platform-specific TCP keep-alive issues#3090
mgravell merged 11 commits into
mainfrom
marc/keep-alive-fix

Conversation

@mgravell
Copy link
Copy Markdown
Collaborator

@mgravell mgravell commented May 26, 2026

Fix #3086

before .NET 10, there are problems with TCP keep-alive on DNS endpoint on non-Windows; here we compensate:

  1. make TCP keep-alive an explicit option (defaults to enabled, usual setup i.e. defaults-provider etc)
  2. restrict TCP keep-alives to IP and DNS endpoints
  3. if not .NET10+, disable for DNS endpoints if not on Windows

(also updates CI image to Redis 8.8)

Copy link
Copy Markdown

@ndyakov ndyakov left a comment

Choose a reason for hiding this comment

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

Other than the question I added this looks good to me.

Comment thread src/StackExchange.Redis/SocketManager.cs
Copy link
Copy Markdown

@uglide uglide left a comment

Choose a reason for hiding this comment

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

I believe I found 2 small issues, worth double-checking.

Comment thread tests/StackExchange.Redis.Tests/TcpKeepAliveTests.cs Outdated
Comment thread src/StackExchange.Redis/ConfigurationOptions.cs
@mgravell mgravell merged commit 6e0df97 into main May 27, 2026
12 of 18 checks passed
@mgravell mgravell deleted the marc/keep-alive-fix branch May 27, 2026 12:31
@liukonen
Copy link
Copy Markdown

Thank you again for the vast turnaround on this! You rock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TCP keep-alive failing on DNS endpoints pre .NET 10

4 participants