Skip to content

Commit 1df4b29

Browse files
authored
fix: scope host double decrement (#334)
1 parent 5872a42 commit 1df4b29

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

proxy.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,8 @@ func executeWithRetry(
232232
if rw.StatusCode() == http.StatusBadGateway {
233233
log.Debugf("the invalid host is: %s", s.host.addr)
234234
s.host.penalize()
235-
s.host.dec()
235+
// comment s.host.dec() line to avoid double increment; issue #322
236+
// s.host.dec()
236237
atomic.StoreUint32(&s.host.active, uint32(0))
237238
newHost := s.host.replica.cluster.getHost()
238239
// The query could be retried if it has no stickiness to a certain server

0 commit comments

Comments
 (0)