Skip to content
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(libp2p): streams config validation in resource manager #10435

Merged
merged 3 commits into from
Jun 3, 2024

Conversation

EnchanterIO
Copy link
Contributor

@EnchanterIO EnchanterIO commented May 27, 2024

Description

It seems like when configuring custom resource manager limits, the node fails to start with an error:

Unable to initialize libp2p due to conflicting resource manager limit configuration.\nresource manager System.Streams (5000) must be bigger than ConnMgr.HighWater (2000)

With this fix the node starts - same if condition exists a few lines above for rcm.System.ConnsInbound and rcm.System.Conns.

How to reproduce

Configure ConnectionManager:

    "ConnMgr": {
      "GracePeriod": "20s",
      "HighWater": 2000,
      "LowWater": 1500,
      "Type": "basic"
    },

and enable ResourceManager:

    "ResourceMgr": {
      "Enabled": true,
    },

and configure some resource limits, especially streams:

> cat libp2p-resource-limit-overrides.json
{
  "System": {
    "Streams": 5000,
    "StreamsInbound": 3500,
    "StreamsOutbound": 1500,
    "Conns": 5000,
    "ConnsInbound": 3500,
    "ConnsOutbound": 1500,
    "Memory": "2147483648"
  },
  "Transient": {
    "Streams": 300,
    "StreamsInbound": 100,
    "StreamsOutbound": 200,
    "Conns": 300,
    "ConnsInbound": 100,
    "ConnsOutbound": 200
  }
}

Current behavior

Launching the ipfs daemon fails:

Unable to initialize libp2p due to conflicting resource manager limit configuration.\nresource manager System.Streams (5000) must be bigger than ConnMgr.HighWater (2000)

Expected behavior

ipfs daemon launches with configured limits without an error.

@EnchanterIO EnchanterIO marked this pull request as ready for review May 27, 2024 13:14
@EnchanterIO EnchanterIO requested a review from a team as a code owner May 27, 2024 13:14
@EnchanterIO EnchanterIO changed the title fix(libp2p): libp2p streams config validation in resource manager fix(libp2p): streams config validation in resource manager May 27, 2024
This was referenced May 28, 2024
these are generated during release, and we are releasing 0.29 now
@lidel lidel added the skip/changelog This change does NOT require a changelog entry label Jun 3, 2024
@lidel lidel self-assigned this Jun 3, 2024
Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, will include this in 0.29.0-rc2 later today.

@lidel lidel merged commit 40cf630 into ipfs:master Jun 3, 2024
16 checks passed
lidel pushed a commit that referenced this pull request Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip/changelog This change does NOT require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants