Tags: rotki/rotki
Tags
Retry premium backup upload. Help slow/unstable connections. While working on 1.29.1 and the new encrypted DB backup upload mechanism we noticed that for some unstable connections and big DB backup sizes a timeout can happen and the DB upload fails. After a lot of debugging it was noticed that a read timeout of a socket happens here: https://github.com/urllib3/urllib3/blob/f96a1cfc568beddf1e17ce7609609eca40780be5/src/urllib3/connectionpool.py#L785 A bit further down the HTTP request has a retry check: https://github.com/urllib3/urllib3/blob/f96a1cfc568beddf1e17ce7609609eca40780be5/src/urllib3/connectionpool.py#L865 This is what this commit takes advantage of. Sets the requests session for rotki.com in a way that we have at least 3 retries for all failed requests. The way the arguments are setup is also required as the retry increment function checks against each different error type and method: https://github.com/urllib3/urllib3/blob/f96a1cfc568beddf1e17ce7609609eca40780be5/src/urllib3/util/retry.py#L540