fix(concurrency): clamp learned limit below the ceiling

An overload seen with many requests in flight set the learned limit above the ceiling. The learner now clamps the value to one below the ceiling.
This commit is contained in:
2026-11-02 23:57:07 +00:00
parent 36ad65c96e
commit cbffcb4061
2 changed files with 39 additions and 0 deletions
+3
View File
@@ -95,6 +95,9 @@ func (c *concurrencyLearner) observe(provider string, resp *http.Response, err e
if next < 1 {
next = 1
}
if next > learnedCeiling-1 {
next = learnedCeiling - 1
}
if s.learned == 0 || next < s.learned {
s.learned = next
}