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

Rewrite the quit debouncer to drop quits early #1091

Merged
merged 5 commits into from
Aug 15, 2020

Conversation

Half-Shot
Copy link
Contributor

@Half-Shot Half-Shot commented Jul 25, 2020

For the uninitiated: Debouncing quits is something we do when a IRC server netsplits, to avoid the matrix server being flooded with /leave requests and/or killing the bridge.

Currently the quit debouncer code operates at the IrcHandler level, which means it's already gone through some hot paths of the code such as identifying which rooms to talk into. Furthermore, the debouncer operates by storing a deferred promise to work on later when bridging delayed QUITs.

In the field, we've noticed that the bridge will crash and burn long before it gets to this queue, so this code attempts to drop QUITs very early on, and store the work in a simple data structure to try and limit the amount of work involved when debouncing.

Please review this PR with a mindset of trying to achieve the above with the smallest per-request footprint on CPU/memory.

@Half-Shot Half-Shot changed the title WIP: Rewrite the quit debouncer to drop quits early. Rewrite the quit debouncer to drop quits early. Aug 13, 2020
@Half-Shot Half-Shot changed the title Rewrite the quit debouncer to drop quits early. Rewrite the quit debouncer to drop quits early Aug 13, 2020
@Half-Shot Half-Shot merged commit 985ccd1 into develop Aug 15, 2020
@jaller94 jaller94 deleted the hs/quit-debouncer-performance branch August 17, 2020 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant