Repository navigation
[Fix] Validate ArgusPipeHostOptions values when they are set (#67) - #87
Merged
Merged
Conversation
Every option validates in its setter, so an invalid value fails at startup with an exception that names the option instead of failing later inside the host. Limits must be greater than zero, MaxRequestBodySize zero or greater, PipeName not null or empty, the request timeouts at least 1 ms and ShutdownDrainTimeout zero or greater, each at most the timers' maximum or Timeout.InfiniteTimeSpan.
…d changes Releases are reconstructed from the PackageReleaseNotes at each tag, the unreleased section from the commits merged since 1.2.1.
|
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.



Fixes #67
Problem
ArgusPipeHostOptionsaccepted any value. An invalid one failed later, deep inside the host: a zero limit stopped the hosted service when it started listening, and a negative timeout made every request fail with only "Pipe request handling failed." in the log.Change
Every option validates in its setter, like
ArgusRetryPolicy,ArgusCompressionOptionsandArgusClient.MaxResponseBodySizealready do. That covers a host built throughAddArgusPipeHostas well as one constructed directly, without anIValidateOptionsand without re-checking in the host.PipeNamenull, empty or white spaceMaxConcurrentRequests,MaxConcurrentConnections,MaxRequestHeaderSizeMaxRequestBodySizeRequestReadTimeout,RequestTimeout,ResponseWriteTimeoutTimeout.InfiniteTimeSpanShutdownDrainTimeoutTimeout.InfiniteTimeSpanCancelAfterandTask.Delayaccept;TimeSpan.MaxValuewould throw there.AddArgusPipeHost(o => ...)the exception surfaces when the host creates its hosted services. Options bound from configuration are set by the binder through reflection, so there the host fails with aTargetInvocationExceptionwhose inner exception names the option. Both paths have a test.Behavior change
A host configured with an invalid value used to start and now fails at startup. A negative
MaxRequestBodySizesilently meant "no limit"; use0for that.Changelog
This PR also starts
CHANGELOG.md(Keep a Changelog format):PackageReleaseNotesat each tag, which match the GitHub release notes.Unreleasedlists the 32 commits merged since 1.2.1, written from their titles, plus this change.CLAUDE.mdgets the rule that a pull request with a user-visible change adds a line underUnreleased.Issue check
MaxConcurrentConnections/MaxConcurrentRequestsof 0 or lessRequestReadTimeout/RequestTimeoutnegativeMaxRequestHeaderSizeof 0 or lessMaxRequestBodySizenegative0accepts a 2 MB bodyShutdownDrainTimeoutnegativeRequestReadTimeoutof -30 s from a config filePipeNameArgusPipeHostOptionsTestFixtureResponseWriteTimeoutTimeSpan.Zerofor the timeoutsShutdownDrainTimeout(cancels immediately)PipeNamenull or emptyCHANGELOG.mdand the wikiVerification
dotnet build ArgusTransfer.sln: 0 warningsdotnet test ArgusTransfer.sln: 716 passeddotnet format ArgusTransfer.sln --verify-no-changes: cleandotnet build ArgusTransfer.sln -warnaserror: 0 warningsNot done: host tests for
ShutdownDrainTimeoutzero and infinite (the drain is covered at ordinary values through the same code path), andPackageReleaseNotes, which is written at release time.The wiki page "Server Configuration" has a new "Option Validation" section.
🤖 Generated with Claude Code