Monorepo for Tangled — https://tangled.org forked from tangled.org/core

eventconsumer: rework retry mechanism master

the previous retry mechanism had a slight flaw: successful connections did not reset the exponent on the retry interval. this results in constantly growing retry intervals: attempt #1 - wait 5s attempt #2 - wait 10s attempt #3 - success! . . . disconnect attempt #4 - wait 20s what we want to see however, is a pattern like so: attempt #1 - wait 5s attempt #2 - wait 10s attempt #3 - success! . . . disconnect attempt #1 - wait 5s this is solved by slapping the retry logic around DialConnection, which is a more atomic point of connection attempt. retry logic is also offloaded to the github.com/avast-go/retry package Signed-off-by: oppiliappan <me@oppi.li>


+35 -25
4 changed files