Closed voidspace closed 7 years ago
Adding options to tweak timing strategy seems like it should be out of the scope of this package. We already have packages focused exactly on retries. Given that no lock implementions block, why not make this a "fail immediately" API with no configuration and leave the retrying for some place external such as juju/utils?
+1 to what @rogpeppe said. Let's figure out how to reuse our existing retry approaches here.
This is irrelevant now, since the mutexes are now blocking. There's still a delay for compatibility with old implementations, but working in backoff is overkill.
It should be possible to have exponential back-off (could be a bool on Spec) up to a maximum delay (MaxDelay on Spec - if 0 then no max in the backoff). If Exponential is True then "Delay" is the initial delay, with the delay doubling on each acquire poll.