mit-dci / opencbdc-tx

A transaction processor for a hypothetical, general-purpose, central bank digital currency
Other
895 stars 200 forks source link

fix: Retry sentinel startup on failure #200

Closed HalosGhost closed 1 year ago

HalosGhost commented 1 year ago

In particular, infinitely retry starting the sentinel if its coordinator client fails to initialize.

Note: this probably isn't ideal; exponential back-off delay with a retry threshold (after which we should fatally error out) is probably better in the long-run. This, however, will suffice for now.

Edit: As infinite-retry causes the tests to fail, I've gone ahead and implemented a really basic threshold and increasing-delay. Currently, the threshold is 4 retries, and the delay is exponential (increasing by a factor of two). I will be double-checking that the README walkthrough runs correctly (on a reasonably low-powered machine of mine) after the tests pass before I request review from someone else to try to make sure this will fix the issue (at least for most people).

Fixes #186

HalosGhost commented 1 year ago

CC: @karlovskiy, @mszulcz-mitre, @AlexRamRam, @metalicjames

Would any of you mind pulling this change and testing locally. It seems to work quite reliably on my two test machines (one of which is woefully under-powered), but I'd love to get a second tACK before I merge it.

karlovskiy commented 1 year ago

@HalosGhost I've had chance to check your commit and it just works!

HalosGhost commented 1 year ago

@karlovskiy want to request your own review and add an approval? PR authors cannot approve their own PRs. :)

karlovskiy commented 1 year ago

@HalosGhost Ok. I'll be glad to ;)