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

connmgr: remove WithEmergencyTrim #3217

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sukunrt
Copy link
Member

@sukunrt sukunrt commented Feb 28, 2025

This option WithEmergencyTrim intended to trim connections where there was a memory emergency. The API was very confusing. To use it correctly you had to use the WithEmergencyTrim option and then do

watchdog.HeapDriven(...) to run the goroutine that would trigger this in time of a memory emergency.

As there's no correct usage of this
API(https://github.com/search?q=WithEmergencyTrim&type=code&p=1), I'm removing this and exporting a ForceTrim method that users can call using any watchdog style memory tracking implementation.

closes #3216

This option `WithEmergencyTrim` intended to trim connections where there
was a memory emergency. The API was very confusing. To use it correctly 
you had to use the `WithEmergencyTrim` option and then do

`watchdog.HeapDriven(...)` to run the goroutine that would trigger this 
in time of a memory emergency. 

As there's no correct usage of this
API(https://github.com/search?q=WithEmergencyTrim&type=code&p=1), 
I'm removing this and exporting a ForceTrim method that users can call 
using any watchdog style memory tracking implementation.
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.

connmgr.WithEmergencyTrim is broken
1 participant