Repository navigation
Conversation
Root cause: mudler#5889 changed the comparison to `!= "true"` while the result still feeds ResourceLimit.Enable directly, so the libp2p resource manager was enabled when the variable was unset and disabled when it was set to "true" -- the opposite of the docs, and of the debug example that the same PR added. Extract newNodeConfig from newNodeOpts so the environment parsing can be covered by a test. Fixes mudler#13031 Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Vivek1898 <viveksingh27795@gmail.com>
2 tasks done
Collaborator
|
Thank you for this fix. It is now on master, bundled with a few related fixes in #13044, with your commits and authorship kept (the P2P resource limits fix). Some small follow-up changes were needed while rebasing on current master; they are in the same series. Closing this PR as it is now redundant. |
Contributor
Author
|
Thanks for carrying it through #13044 and keeping the authorship. |
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.
Description
This PR fixes #13031
newNodeOptsreadsLOCALAI_P2P_ENABLE_LIMITSwith!= "true"and passes the result straight intoResourceLimit.Enable, so the libp2p resource manager is enabled when the variable is unset and disabled when it is set to"true". That is the opposite of the docs table (distributed_inferencing.md: "Set to "true" to enable connection limits and resources management") and of the troubleshooting page, both of which set it totrueto turn limits on.The comparison was
== "true"from #3125 through v3.0.0. #5889 flipped it to!=without changing how the value is used; the debug example that the same PR added to the docs setsLOCALAI_P2P_ENABLE_LIMITS=true, so the flip looks unintended rather than a change of default. In edgevpn v0.34.0,Limit.Enable == falseinstallsnetwork.NullResourceManager, so unset now means "limits on, 100 max conns" andtruemeans "no limits".Changes:
core/p2p/p2p.go: compare with== "true"and name the resultenableLimits. Theconfig.Configliteral moves into a newnewNodeConfig(token)so the environment parsing is reachable from a test;newNodeOptsis otherwise unchanged.core/p2p/node_config_internal_test.go+p2p_suite_test.go: ginkgo suite for the package (there was none) with specs for unset,"true", and other values. On the previous code the first three specs fail; on this branch all pass.Notes for Reviewers
LOCALAI_P2P_ENABLE_LIMITS=trueturns it on. If the intent in fix(p2p): adapt to backend changes, general improvements #5889 was to make limits the default, the docs table and troubleshooting page would need the opposite change instead; happy to do that if so.go test ./core/p2p/andgo vet ./core/p2p/pass locally (macOS arm64, Go 1.26). Note that on darwin edgevpn disables the resource manager regardless, so the effect is only observable on Linux.Signed commits