Skip to content

Commit 4ec58ec

Browse files
authored
Fix initial connpool delay when a new node is added (#79)
When a new node was added it was waiting for the first delay of the reconnection policy before connecting. This resolves that by not having a pending timeout as the initial state.
1 parent e3e3ed9 commit 4ec58ec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

proxycore/connpool.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func (p *connPool) stayConnected(idx int) {
176176

177177
connectTimer := time.NewTimer(0)
178178
reconnectPolicy := p.config.ReconnectPolicy.Clone()
179-
pendingConnect := false
179+
pendingConnect := true
180180

181181
done := false
182182
for !done {
@@ -212,6 +212,7 @@ func (p *connPool) stayConnected(idx int) {
212212
p.connsMu.Lock()
213213
conn, p.conns[idx] = nil, nil
214214
p.connsMu.Unlock()
215+
pendingConnect = false
215216
}
216217
}
217218
}

0 commit comments

Comments
 (0)