Skip to content

Comments

connmgr: remove WithEmergencyTrim#3217

Merged
sukunrt merged 1 commit intomasterfrom
push-qxnzwvvqxloz
Mar 21, 2025
Merged

connmgr: remove WithEmergencyTrim#3217
sukunrt merged 1 commit intomasterfrom
push-qxnzwvvqxloz

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.
@sukunrt sukunrt merged commit 9a2a542 into master Mar 21, 2025
9 checks passed
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

2 participants