You are browsing as a guest. Sign up (or log in) to start making projects!

1h 58m logged

Add exponential backoff retry logic to PwrClient connection

Implement connect_with_retry in PwrClient that wraps the existing connection
logic with up to 3 retry attempts using exponential backoff starting at 1
second and doubling to 2 and 4 seconds. The existing connect method is
renamed to connect_once and made private, with the public connect method
now calling it in a retry loop. Transient network failures such as TCP
connection refused or TLS handshake timeouts are retried, while
authentication failures are not (they propagate immediately since retrying
with the same credentials would produce the same result). Each retry
attempt is logged at WARN level with the error and delay, and a successful
retry is logged at INFO level. The connect_timeout_secs from the client
config is applied to each individual TCP connection attempt within the
retry loop.

0
2

Comments 0

No comments yet. Be the first!