Align SubscribeConfig chan size contract#1272
Open
peter941221 wants to merge 4 commits into
Open
Conversation
brandur
reviewed
Jun 3, 2026
Contributor
Author
|
Reverted both wording changes and kept the zero-default behavior test coverage. |
brandur
reviewed
Jun 3, 2026
Contributor
|
Ah doh, looks like this conflicted with your other change. Want to rebase? |
35ccbed to
aec2483
Compare
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.
SubscribeConfig.ChanSizealready treats0as "use the default buffer size", but the surrounding contract drifted away from that behavior. The public comment did not say that zero selects the default, it still had a wording typo, and the panic string still claimed the value had to be greater or equal to1.This aligns the public comment, panic string, and tests with the existing zero-as-default behavior.
It also fixes the comment typo from
overalltooverflow.The runtime behavior was already right. This patch only makes the boundary conditions easier to understand and harder to misread in tests or review.
Testing
Added
Test_SubscriptionManager/PanicOnNegativeChanSize.Added
Test_SubscriptionManager/UsesDefaultChanSizeWhenZero.Ran
go test . -run "Test_SubscriptionManager/(PanicOnNegativeChanSize|UsesDefaultChanSizeWhenZero)" -count=1.Ran
go test . -run TestDoesNotExist -count=1as a compile/load smoke check.