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

ConnManager should trim using a background worker #42

Closed
vyzo opened this issue May 13, 2019 · 0 comments · Fixed by #43
Closed

ConnManager should trim using a background worker #42

vyzo opened this issue May 13, 2019 · 0 comments · Fixed by #43
Assignees
Labels

Comments

@vyzo
Copy link
Contributor

vyzo commented May 13, 2019

Currently we trigger a trim on every incoming connection.
This has two effects:

  • contention to trim, which could lead to overtrimming if connections are slow to close and we have a fresh connection notification right after the silence period; this effect has been observed in a relay.
  • failure to trim, if the connections that push us over the high water mark all happen within the grace periood or the silence period, whichever is greater, then they will not get trimmed.

I suggest we add a background worker that periodically trims instead of the current algorithm that relies on connection notifications.
The downside is that we will need a Close method to stop the background goroutine.

@ghost ghost assigned vyzo May 13, 2019
@ghost ghost added the status/in-progress In progress label May 13, 2019
@vyzo vyzo changed the title ConnectManager should trim using a background worker ConnManager should trim using a background worker May 13, 2019
@vyzo vyzo closed this as completed in #43 May 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant