Skip to content

Commit 5560254

Browse files
committed
Documented expected retry behaviour when RR balancer proxy targets change
1 parent 7c2cd96 commit 5560254

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

middleware/proxy.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,12 @@ func (b *randomBalancer) Next(c echo.Context) *ProxyTarget {
228228
return b.targets[b.random.Intn(len(b.targets))]
229229
}
230230

231-
// Next returns an upstream target using round-robin technique.
231+
// Next returns an upstream target using round-robin technique. In the case
232+
// where a previously failed request is being retried, the round-robin
233+
// balancer will attempt to use the next target relative to the original
234+
// request. If the list of targets held by the balancer is modified while a
235+
// failed request is being retried, it is possible that the balancer will
236+
// return the original failed target.
232237
//
233238
// Note: `nil` is returned in case upstream target list is empty.
234239
func (b *roundRobinBalancer) Next(c echo.Context) *ProxyTarget {

0 commit comments

Comments
 (0)