DescriptionStandardize storage-consistency polling strategy.
All providers have a "shortAttempt" polling strategy, which they use both to
wait for eventual storage consistency and for generally retrying things that
may take a while to become possible. These package-global variables were
getting in the way of the factoring-out of common code.
And so, as discussed in https://codereview.appspot.com/11633043/ this branch
makes the how-to-wait-for-storage-consistency part available on the
StorageReader interface. VerifyBootstrapInit no longer needs to take the
strategy as an argument, because it's available on the environment's storage
object. Some shortAttempt variables are replaced entirely; in other cases we
now have to different polling strategies that probably deserve to be tuned for
their specific purposes.
I also found a new way to specify non-delaying policies. There was always the
problem that even in testing, we needed a little bit of delay because
otherwise an attempt strategy might decide immediately that it was done, and
loops might not be executed at all. The "little bit of delay" made behaviour
nondeterministic, leading to the risk of spurious failures on slow or busy
systems if it was too small, and slowing down the test suite if it was too
large. But there's also a Min field, which sets a minimum number of times the
loop must be attempted. For a non-delaying attempt strategy, the right
approach seems to be to specify zero delays but a Min of 1.
Where providers need storage polling that actually sleeps, I made sure they
override these with non-delaying strategies. For the providers with
immediately-consistent storage there is no delay at all, and so no need to
override the strategy either.
This branch will conflict with the one whose review prompted this work.
Unfortunate, but better than a big conflated giga-branch.
https://code.launchpad.net/~jtv/juju-core/storage-consistency-strategy/+merge/177163
(do not edit description out of merge proposal)
Patch Set 1 #Patch Set 2 : Standardize storage-consistency polling strategy. #
Total comments: 7
Patch Set 3 : Standardize storage-consistency polling strategy. #
MessagesTotal messages: 6
|