You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[processor/memorylimiter] Fix degenerate GC loop when exporter has problems (#15053)
#### Description
Fixes the degenerate force-GC loop when memory is held by live
references (e.g., exporter queues during a downstream outage). Forced GC
backs off exponentially when ineffective and resets on recovery; the cap
is exposed as `max_gc_interval_when_{soft,hard}_limited` (default `30s`,
`0` disables).
#### Link to tracking issue
Fixes#4981
#### Testing
Added regression test for #4981; existing memorylimiter tests pass.
#### Documentation
README updated; chloggen entry under `.chloggen/`.
---------
Signed-off-by: Kc Balusu <kcbalusu@meta.com>
Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Copy file name to clipboardExpand all lines: internal/memorylimiter/config.go
+43Lines changed: 43 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,11 @@ import (
13
13
var (
14
14
errCheckIntervalOutOfRange=errors.New("'check_interval' must be greater than zero")
15
15
errInconsistentGCMinInterval=errors.New("'min_gc_interval_when_soft_limited' should be larger than 'min_gc_interval_when_hard_limited'")
16
+
errInconsistentGCMaxInterval=errors.New("'max_gc_interval_when_soft_limited' should be larger than or equal to 'max_gc_interval_when_hard_limited' (when both are set)")
17
+
errInconsistentGCMaxSoftInterval=errors.New("'max_gc_interval_when_soft_limited' must be greater than or equal to 'min_gc_interval_when_soft_limited' (or 0 to disable)")
18
+
errInconsistentGCMaxHardInterval=errors.New("'max_gc_interval_when_hard_limited' must be greater than or equal to 'min_gc_interval_when_hard_limited' (or 0 to disable)")
19
+
errNegativeGCMaxSoftInterval=errors.New("'max_gc_interval_when_soft_limited' must be non-negative")
20
+
errNegativeGCMaxHardInterval=errors.New("'max_gc_interval_when_hard_limited' must be non-negative")
16
21
errLimitOutOfRange=errors.New("'limit_mib' or 'limit_percentage' must be greater than zero")
17
22
errSpikeLimitOutOfRange=errors.New("'spike_limit_mib' must be smaller than 'limit_mib'")
18
23
errSpikeLimitPercentageOutOfRange=errors.New("'spike_limit_percentage' must be smaller than 'limit_percentage'")
@@ -37,6 +42,22 @@ type Config struct {
37
42
// GCs is a CPU-heavy operation and executing it too frequently may affect the recovery capabilities of the collector.
0 commit comments