Skip to content

go1.23 timers cause issues with libp2p connmgr and more #10501

Closed
@lidel

Description

@lidel

Version

0.30.0-rc2

Config

default `ipfs init` + custom ports to run A/B test

Description

Bug

0.30.0-rc2 switched to go1.23, and we experience an increased number of connections when running go-libp2p + go-libp2p-kad-dht server, confirmed both by me, and anecdotal evidence from discussion forums.

The problem seem to go away if running with forced go1.22 timer behavior GODEBUG=asynctimerchan=1 (Ref. https://go.dev/wiki/Go123Timer)

How to reproduce

  1. Run two instances of 0.30.0-rc2 with a public IP or UPnP, so they act as DHT servers and get a lot of connections from random peers. Run them with different env variables:
  • GODEBUG=asynctimerchan=0 to force Go 1.23 timers
  • GODEBUG=asynctimerchan=1 to force Go 1.22 timers
  1. After a few hours, the one that runs with GODEBUG=asynctimerchan=0 will have significantly more connections (e.g. 6k vs 200)
  2. Stopping with ctl-C does not work reliably with GODEBUG=asynctimerchan=0, it sometimes takes a second time to correctly stop the daemon.

Next steps

Short term, I will revert #10486 and switch back to 1.22 for 0.30.0 release and keep it until go-libp2p and go-libp2p-kad-dht are compatible with 1.23.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugA bug in existing code (including security flaws)need/triageNeeds initial labeling and prioritization

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions