runRYWTransaction:Add comment to remind func should be idempodent

This commit is contained in:
Meng Xu 2020-06-22 23:04:09 -07:00
parent c4ac68ef1e
commit 9cff90fb5f
1 changed files with 1 additions and 0 deletions

View File

@ -37,6 +37,7 @@ runRYWTransaction(Database cx, Function func) {
state Reference<ReadYourWritesTransaction> tr(new ReadYourWritesTransaction(cx));
loop{
try {
// func should be idempodent; otherwise, retry will get undefined result
state decltype( fake<Function>()( Reference<ReadYourWritesTransaction>() ).getValue()) result = wait(func(tr));
wait(tr->commit());
return result;