-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix: clarity: no user supplied rcmgr limits of 0 #9563
fix: clarity: no user supplied rcmgr limits of 0 #9563
Conversation
The goal of this commit is to make clear that we don't support user-supplied limits of 0 currently. Apply (https://github.com/libp2p/go-libp2p/blob/master/p2p/host/resource-manager/limit.go#L102 ) overrides any 0 value. With the current code, a zero-limit in userSuppliedOverrideLimitConfig will be overridden by the computed default limits. I want to be able to do: ``` defaultComputedLimitConfig.Apply(userSuppliedOverrideLimitConfig) ``` but that won't override any of the computed defaults. I'd like to see this fixed, but this at least make clear the situation.
Co-authored-by: Antonio Navarro Perez <antnavper@gmail.com>
I think we're good to merge now @lidel , but will let you check. |
@BigLep You need to format the code to make Go checks pass. |
Doh - thanks @ajnavarro . I guess that's what I get for making Go code changes in the Github UI. It looks like I'm good now... |
…th-zero-values-not-supported
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.
I took this PR for a spin and agree we are better with it in 0.18. Merging. 👍
Some thoughts:
- Without this PR we would have very bad time migrating and cleaning up user configs in 0.19 when go-libp2p has explicit
0
support. Good call @BigLep - UX of doing anything with ResourceMgr via CLI + config is pure torture, but since we have autoscaling I hope not many people will have to touch it too much.
- I've found two bugs and filled ipfs swarm limit all --reset does not remove user overrides from Swarm.ResourceMgr.Limits #9576 and ipfs swarm limit all: returns empty "" Service and Protocol name #9577 but none of them should block 0.18, fine to fix them later.
Co-authored-by: Antonio Navarro Perez <antnavper@gmail.com> Co-authored-by: Marcin Rataj <lidel@lidel.org>
The goal of this commit is to make clear that we don't support user-supplied limits of 0 currently. Apply (https://github.com/libp2p/go-libp2p/blob/master/p2p/host/resource-manager/limit.go#L102 ) overrides any 0 value. With the current code, a zero-limit in userSuppliedOverrideLimitConfig will be overridden by the computed default limits.
I want to be able to do:
but that won't override any of the computed defaults.
I'd like to see this fixed, but this at least make clear the situation.