apple/foundationdb

Support persistent transaction options for custom retry loops

Open

#4.091 aberto em 19 de nov. de 2020

Ver no GitHub
 (2 comments) (0 reactions) (0 assignees)C++ (1.266 forks)batch import
good first issue

Métricas do repositório

Stars
 (13.912 stars)
Métricas de merge de PR
 (Mesclagem média 4d 12h) (126 fundiu PRs em 30d)

Description

We have some transaction options (e.g. transaction timeouts, retry limits) that are persistent across transaction retries. This behavior can be useful if you want to enforce a timeout that starts from the beginning of your first try regardless of how many tries you take.

The persistent aspect of these options only applies if you use onError to implement your retry loop. If you instead reset your transaction or create a new one, it will lose all prior state about your number of tries and time spent, and you will need to set those options again.

It's possible for a writer of custom retry loops to implement these features themselves (e.g. by counting retries and/or tracking the current running time of a transaction to adjust the timeout value), but it might be nice to provide a soft reset capability that allows users to utilize the built-in functionality.

Guia do colaborador