Skip to content

Commit bde09d5

Browse files
committed
Increase timeout to 80s. Backoff poll frequency.
Timeout was 60s, increase to 80s. This may help on heavily loaded storage environments. We see ~60 debug messages for each timed out wait. This is more than needed and puts a bit more load on the control plane than needed. So change the approach: Start with 0.5s polling freq but increase wait time by 0.1s each time, slowly backing off. So we produce only 35 debug lines and API calls before running into the timeout. Sidenote: Exponential backoff is a well-known approach to deal with congestion. We kept it simple (linear back-off), as our timeout is not huge. Signed-off-by: Kurt Garloff <[email protected]>
1 parent 87a7803 commit bde09d5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Tests/iaas/volume-backup/volume-backup-tester.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
# timeout in seconds for resource availability checks
3131
# (e.g. a volume becoming available)
32-
WAIT_TIMEOUT = 60
32+
WAIT_TIMEOUT = 80
3333

3434

3535
def wait_for_resource(
@@ -39,10 +39,12 @@ def wait_for_resource(
3939
timeout=WAIT_TIMEOUT,
4040
) -> None:
4141
seconds_waited = 0
42+
wait_delay = 0.5
4243
resource = get_func(resource_id)
4344
while resource is None or resource.status not in expected_status:
44-
time.sleep(1.0)
45-
seconds_waited += 1
45+
time.sleep(wait_delay)
46+
seconds_waited += wait_delay
47+
wait_delay += 0.1
4648
if seconds_waited >= timeout:
4749
raise RuntimeError(
4850
f"Timed out after {seconds_waited} s: waiting for resource {resource_id} "

0 commit comments

Comments
 (0)