Support persistent transaction options for custom retry loops
#4,091 opened on 2020年11月19日
説明
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.