Skip to content

Conversation

@SandyXSD
Copy link
Contributor

@SandyXSD SandyXSD commented Mar 21, 2022

#1593

try = 0: sleep = 0
	if kill -9 (connection refused): write wait = 0
	if down host (i/o timeout): write wait = opt.WriteTimeout = 5s
min, max = opt.MinRetryBackoff, opt.MaxRetryBackoff = 20ms, 10s
try = 1; sleep ~= min << 1 / 2 + min = 40ms
try = 2; sleep ~= min << 2 / 2 + min = 60ms
...
try = 9; sleep ~= min << 9 / 2 + min = 5s
try = 10; sleep ~= min << 10 / 2 + min = 10s

Once = (10 + 5 + 2.5 + 1.25 + ...) + 11 * (write wait)
	= 20s or 75s
Total = Once * 3
	= 60s or 225s

@SandyXSD SandyXSD requested a review from davies March 21, 2022 09:21
@davies davies merged commit e306c2a into main Mar 21, 2022
@davies davies deleted the sentinel-smaller-backoff branch March 21, 2022 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants