File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
tests/opentelemetry-docker-tests/tests Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 42
42
MSSQL_PORT = int (os .getenv ("MSSQL_PORT" , "1433" ))
43
43
MSSQL_USER = os .getenv ("MSSQL_USER" , "sa" )
44
44
MSSQL_PASSWORD = os .getenv ("MSSQL_PASSWORD" , "yourStrong(!)Password" )
45
- RETRY_COUNT = 8
46
- RETRY_INTERVAL = 5 # Seconds
45
+ RETRY_COUNT = 5
46
+ RETRY_INITIAL_INTERVAL = 2 # Seconds
47
47
48
48
logger = logging .getLogger (__name__ )
49
49
@@ -56,14 +56,16 @@ def wrapper():
56
56
func ()
57
57
return
58
58
except Exception as ex : # pylint: disable=broad-except
59
+ # Exponential backoff
60
+ backoff_interval = RETRY_INITIAL_INTERVAL * (2 ** i )
59
61
logger .error (
60
62
"waiting for %s, retry %d/%d [%s]" ,
61
63
func .__name__ ,
62
64
i + 1 ,
63
65
RETRY_COUNT ,
64
66
ex ,
65
67
)
66
- time .sleep (RETRY_INTERVAL )
68
+ time .sleep (backoff_interval )
67
69
raise Exception (f"waiting for { func .__name__ } failed" )
68
70
69
71
return wrapper
You can’t perform that action at this time.
0 commit comments