Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Background trimming #43

Merged
merged 11 commits into from
May 18, 2019
Merged

Background trimming #43

merged 11 commits into from
May 18, 2019

Conversation

vyzo
Copy link
Contributor

@vyzo vyzo commented May 13, 2019

On top of #40
Closes #42
Closes #44

Note that this adds a Close method to stop the background goroutine; that should be part of the connection manager interface and invoked by the host on close.

vyzo and others added 7 commits May 10, 2019 13:53
- fix potential concurrent modification of connection map
  from concurrent connects/disconnects by locking the segment
- don't spawn goroutines on every connect during trims
otherwise the target can be 0, which makes it negative on decrement, and it will end up
dropping all connections.
@vyzo vyzo requested a review from raulk May 13, 2019 17:00
@ghost ghost assigned vyzo May 13, 2019
@ghost ghost added the status/in-progress In progress label May 13, 2019
@vyzo vyzo force-pushed the feat/background-trimming branch from 1e96efe to dc99664 Compare May 17, 2019 20:47
@vyzo vyzo requested a review from Stebalien May 17, 2019 20:52
@vyzo
Copy link
Contributor Author

vyzo commented May 18, 2019

I am waiting for libp2p/go-libp2p-interface-connmgr#18 before merge, so that we can absorb the interface change as well.

@vyzo
Copy link
Contributor Author

vyzo commented May 18, 2019

Merging this, as the Close method for the interface will go straight to go-libp2p-core.

@vyzo vyzo merged commit ad11ad1 into master May 18, 2019
@vyzo vyzo deleted the feat/background-trimming branch May 18, 2019 18:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
3 participants