Repository navigation
Enable TCP keepalive for upstream and listener sockets - #236
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #191.
Enable TCP keepalive on outbound upstream NNTP connections and accepted CacheListener client sockets so dead network paths can be detected without relying exclusively on application-level NNTP
DATEprobes or waiting for application I/O timeouts.Changes
TcpKeepAliveSettingsand integrate it withTcpSocketOptionsfor consistent configuration across both socket paths.TcpClient, including connections created for subsequent reconnects.DATE: TCP keepalive remains enabled when providerKeepAliveSecondsis zero. Existing application-levelDATEbehaviour is preserved.BackFiller:TcpKeepAlivesettings with validated defaults:TimeSeconds: 10 — idle time before the first probe.IntervalSeconds: 5 — interval between probes.RetryCount: 3 — unanswered probes before the connection is considered dead.SO_KEEPALIVEis mandatory. Unsupported per-socket probe-timing options are handled best-effort, retaining the operating system's defaults where necessary.docs/configuration.md.The configured probe timings target a nominal detection window of approximately 25 seconds, subject to operating-system behaviour and scheduling. This is not a hard disconnect-time guarantee.
Validation
VectorNNTPD.BackFillerService.Tests(Release x64): 1,333 passedVectorNNTPD.Common.Tests(Release x64): 1,136 passeddotnet format VectorNNTP.slnx --verify-no-changes: passedtools/Invoke-CodeQlAnalysis.ps1: completed successfully; six pre-existingNntpSessionPoolfindings remain, with no new findings reported for this change.Behavioural guarantees
DATEprobes being enabled.SO_KEEPALIVE.