apple/foundationdb

Support persistent transaction options for custom retry loops

Open

#4,091 建立於 2020年11月19日

在 GitHub 查看
 (2 留言) (0 反應) (0 負責人)C++ (13,912 star) (1,266 fork)batch import
good first issue

描述

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.

貢獻者指南

Support persistent transaction options for custom retry loops · apple/foundationdb#4091 | Good First Issue