-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rcmgr: Support specific network prefix in conn limiter #2807
Conversation
On second thought, we shouldn't make a breaking change in a patch release. I'm going to add back the old name of |
}, | ||
} | ||
|
||
func WithLimitPeersPerCIDR(ipv4 []ConnLimitPerCIDR, ipv6 []ConnLimitPerCIDR) Option { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't change this name for the patch release. I'm fine with just making a new release. v0.35.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the same topic can we introduce a new Option in a patch release(WithNetworkPrefixLimit
)? It's backwards compatible but definitely not a bug fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, let's make a new release to v0.35.
On the same topic can we introduce a new Option in a patch release(WithNetworkPrefixLimit)? It's backwards compatible but definitely not a bug fix.
Technically you're right. It's not a patch release per semver. We don't have a great way of distinguishing between major and minor releases right now though and I'd argue a minor release is closer to a patch release in spirit than a minor release is to a major relase.
Plan is to merge this and release it in v0.35 with just this change. |
Despite the field being called "ConnLimitPerCIDR" you weren't able to define limits for a specific CIDR address block. I've renamed this to ConnLimitPerSubnet to make it clearer that this connection limit applies to each subnet with the same N bit prefix.
I've also added an option to allow defining limits on specific address prefix blocks. If an IP address matches one of these blocks then that limit is used instead of the more generic
ConnLimitPerSubnet
. By default you are allowed unlimited connections from localhost. This should prevent test breakages we've seen.This does break the existing API. I think that's okay because: