The `for attempt` loop does not terminate properly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
transaction |
New
|
Undecided
|
Unassigned |
Bug Description
When a convenience `for attempt` loop is used with transaction manager, the loop does not terminate properly after the successful transaction. The tests are checking only for ``ntry % 3``. Since the default number of retries are 3 it seems that the tests work correctly for successful transaction. However, when the condition is changed it shows that the loop continues to the end (e.g., five iterations), despite the successful transaction which should have stopped the iteration.
The attached patch adds the tests that:
- confirm the problem
- show the workaround
- suggest the possible fix in the code
The patch does not attempt to fix the code of the `attempts` method because there is, perhaps, a better way to deal with this issue.