mirror of
https://github.com/puppetlabs/beaker-vmpooler.git
synced 2026-01-26 11:08:40 -05:00
(maint) random backoff strategy
The retry logic for VMPooler has two issues. 1) Waiting longer than VMPooler takes to refill the pool to retry introduces excessive delays, and 2) waiting for a deterministic amount of time means that processes started at the same time stay in sync causing peak loads. This change caps the wait time at 15 seconds plus a random wait time, addressing both issues.
This commit is contained in:
parent
02684546cb
commit
5317f2c1db
1 changed files with 1 additions and 1 deletions
|
|
@ -169,7 +169,7 @@ module Beaker
|
|||
@logger.debug("Retrying provision for vmpooler host after waiting #{wait} second(s)")
|
||||
sleep wait
|
||||
waited += wait
|
||||
last_wait, wait = wait, last_wait + wait
|
||||
last_wait, wait = wait, [last_wait + wait, 15].min + rand(5)
|
||||
retry
|
||||
end
|
||||
report_and_raise(@logger, e, 'Vmpooler.provision')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue