Skip to content

Commit

Permalink
Documented expected retry behaviour when RR balancer proxy targets ch…
Browse files Browse the repository at this point in the history
…ange
  • Loading branch information
mikemherron committed Apr 4, 2023
1 parent 7c2cd96 commit 5560254
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion middleware/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,12 @@ func (b *randomBalancer) Next(c echo.Context) *ProxyTarget {
return b.targets[b.random.Intn(len(b.targets))]
}

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

0 comments on commit 5560254

Please sign in to comment.