Fix health race (#645)
* Revert "middleware/proxy: Make Unhealthy a pointer (#615)"
This reverts commit acbf522ceb
.
* middleware/proxy: add proper locking
This add the proper locking around `Unhealthy`.
This commit is contained in:
parent
bfa18470e5
commit
003b1bf678
6 changed files with 26 additions and 28 deletions
|
@ -218,11 +218,11 @@ func newUpstream(hosts []string, old *staticUpstream) Upstream {
|
|||
Conns: 0,
|
||||
Fails: 0,
|
||||
FailTimeout: upstream.FailTimeout,
|
||||
Unhealthy: newBool(),
|
||||
Unhealthy: false,
|
||||
|
||||
CheckDown: func(upstream *staticUpstream) UpstreamHostDownFunc {
|
||||
return func(uh *UpstreamHost) bool {
|
||||
if *uh.Unhealthy {
|
||||
if uh.Unhealthy {
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue